1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
Commit Graph

2248 Commits

Author SHA1 Message Date
Tymoteusz Czech
413da2aa27
fix: don't show link stubs in slack notifications (#7810)
Slack is trying to add not useful link previews
2024-08-08 15:29:42 +02:00
Mateusz Kwasniewski
b65e593c23
chore: remove featureLifecycle and featureLifecycleMetrics flags (#7808) 2024-08-08 13:45:23 +02:00
Mateusz Kwasniewski
fffed5d8dc
feat: filter out archived projects from the main project list (#7803) 2024-08-08 13:22:44 +02:00
Mateusz Kwasniewski
3fe385e127
chore: remove flagCreator flag (#7807) 2024-08-08 12:19:32 +02:00
Mateusz Kwasniewski
8caa1e242c
feat: transactional project service support (#7799) 2024-08-07 16:34:55 +02:00
Mateusz Kwasniewski
0450bfe6f9
feat: archive project service (#7794) 2024-08-07 12:09:00 +02:00
Mateusz Kwasniewski
74de3ea72e
feat: archived at column in projects (#7782) 2024-08-07 10:00:37 +02:00
Simon Hornby
a507ca91a5
chore: remove scim api flag (#7780) 2024-08-07 09:19:42 +02:00
Thomas Heartman
440d6b48db
feat: make to date inclusive (#7775)
Changes the handling of the `to` query parameter in
the API to be inclusive.
2024-08-06 13:40:07 +00:00
Thomas Heartman
76bc7bf250
refactor: rename createdAtFrom/To to from/to (#7773)
Update the query parameter of the new event search API to match the
query parameters of the insights API
2024-08-06 15:02:44 +02:00
Mateusz Kwasniewski
f9665233cc
chore: archive projects flag (#7772) 2024-08-06 14:59:49 +02:00
Jaanus Sellin
0118f88964
fix: feature type is now validated (#7769)
Previously people were able to send random data to feature type. Now it
is validated.

Fixes https://github.com/Unleash/unleash/issues/7751

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2024-08-06 12:27:20 +03:00
Jaanus Sellin
1a97515adf
feat: event search e2e tests (#7755)
This covers the e2e cases for event search.
2024-08-05 15:02:35 +03:00
Mateusz Kwasniewski
afa34867c1
fix: playground parent disabled with strategy (#7744) 2024-08-05 10:39:21 +02:00
Jaanus Sellin
57a8b9da79
feat: event search on new endpoint, first test (#7739)
Changed the url of event search to search/events to align with
search/features. With that created a search controller to keep all
searches under there.
Added first test.
2024-08-02 15:07:21 +03:00
Jaanus Sellin
bcb7a803d0
feat: new event search (#7708)
This introduces the new event search API, with paging.
2024-08-02 10:56:42 +03:00
Mateusz Kwasniewski
bbefff5d5a
refactor: rename rollback to more explicit rollbackTransaction (#7723) 2024-08-01 13:49:49 +02:00
Tymoteusz Czech
d1e70eefbe
feat: Remove orphaned tokens flags (#7714)
Cleanup of `allowOrphanedWildcardTokens` and `cleanApiTokenWhenOrphaned`
2024-08-01 13:31:52 +02:00
Thomas Heartman
0c53f7d21b
feat: create gauges for all resource limits (#7718)
This PR adds Grafana gauges for all the existing resource limits. The
primary purpose is to be able to use this in alerting. Secondarily, we
can also use it to get better insights into how many customers have
increased their limits, as well as how many people are approaching their
limit, regdardless of whether it's been increased or not.

## Discussion points

### Implementation

The first approach I took (in
87528b4c67),
was to add a new gauge for each resource limit. However, there's a lot
of boilerplate for it.

I thought doing it like this (the current implementation) would make it
easier. We should still be able to use the labelName to collate this in
Grafana, as far as I understand? As a bonus, we'd automatically get new
resource limits when we add them to the schema.

``` tsx
        const resourceLimit = createGauge({
            name: 'resource_limit',
            help: 'The maximum number of resources allowed.',
            labelNames: ['resource'],
        });

        // ...

        for (const [resource, limit] of Object.entries(config.resourceLimits)) {
            resourceLimit.labels({ resource }).set(limit);
        }
```

That way, when checking the stats, we should be able to do something
like this:

``` promql
resource_limit{resource="constraintValues"}
```

### Do we need to reset gauges?

I noticed that we reset gauges before setting values in them all over
the place. I don't know if that's necessary. I'd like to get that double
clarified before merging this.
2024-08-01 09:59:25 +02:00
Mateusz Kwasniewski
a4c49e7d7f
fix: rollback should await a result (#7712) 2024-07-31 16:46:15 +02:00
Nuno Góis
49fecb2005
chore: request origin prom metrics (#7709)
https://linear.app/unleash/issue/2-2501/adapt-origin-middleware-to-stop-logging-ui-requests-and-start

This adapts the new origin middleware to stop logging UI requests (too
noisy) and adds new Prometheus metrics.

<img width="745" alt="image"
src="https://github.com/user-attachments/assets/d0c7f51d-feb6-4ff5-b856-77661be3b5a9">

This should allow us to better analyze this data. If we see a lot of API
requests, we can dive into the logs for that instance and check the
logged data, like the user agent.

This PR adds some helper methods to make listening and emitting metric
events more strict in terms of types. I think it's a positive change
aligned with our scouting principle, but if you think it's complex and
does not belong here I'm happy with dropping it.
2024-07-31 13:52:39 +01:00
Mateusz Kwasniewski
987ba5ea0a
chore: composition root playground service (#7710) 2024-07-31 14:44:57 +02:00
Mateusz Kwasniewski
126dff2344
chore: change request playground flag (#7707) 2024-07-31 11:38:55 +02:00
Mateusz Kwasniewski
6170d10e62
feat: rollback transaction wrapper (#7706) 2024-07-31 10:22:05 +02:00
Nuno Góis
9fff29a080
chore: change log level to info in origin middleware (#7705)
https://linear.app/unleash/issue/2-2492/change-origin-middleware-log-level-to-info

Changes origin middleware log level to `info` instead of `debug`.
2024-07-31 09:01:48 +01:00
Jaanus Sellin
24e2c4030b
feat: new event search flag (#7699)
Add `newEventSearch` flag
2024-07-31 08:59:42 +02:00
Mateusz Kwasniewski
c828d01135
refactor: encapsulate playground limit in service (#7700) 2024-07-30 12:40:27 +02:00
Nuno Góis
50167d4f9e
chore: origin middleware (#7695)
https://linear.app/unleash/issue/2-2489/create-a-first-iteration-of-an-origin-middleware-that-logs-ui-and-api

Small spike around what the first iteration of an "origin middleware"
would look like.

No strong feelings all around, so feel free to tell me this is all wrong
and we should go a different route. However diving a little bit into it
personally helps me wrap my head around it, so it may help you too.
2024-07-30 10:42:50 +01:00
Tymoteusz Czech
1f2d47bd91
fix: on project delete with tokens put token deleted in audit log (#7675)
Use service with audit tracking instead of store directly.
2024-07-26 14:06:15 +02:00
Jaanus Sellin
1e3c690185
feat: tag feature on creation (#7664)
Now it is possible to tag feature on creation.
2024-07-25 13:36:28 +03:00
Tymoteusz Czech
369518cd7d
Feat: webhook markdown (#7658)
Add ability to format format event as Markdown in generic webhooks,
similar to Datadog integration.
Closes https://github.com/Unleash/unleash/issues/7646

Co-authored-by: Nuno Góis <github@nunogois.com>
2024-07-25 09:45:20 +00:00
Thomas Heartman
245c3e119d
chore: add flag configuration for the new flag creation flow (#7662)
Add a new flag and default it to true for local development.
2024-07-25 11:12:58 +02:00
Jaanus Sellin
0148481623
feat: update openapi schema for feature creation for tags (#7657)
Added tags support for schema.
2024-07-25 10:36:04 +03:00
Nuno Góis
8a20ae999f
chore: keep latest integration events for each integration configuration (#7652)
https://linear.app/unleash/issue/2-2469/keep-the-latest-event-for-each-integration-configuration

This makes it so we keep the latest event for each integration
configuration, along with the previous logic of keeping the latest 100
events of the last 2 hours.

This should be a cheap nice-to-have, since now we can always know what
the latest integration event looked like for each integration
configuration. This will tie-in nicely with the next task of making the
latest integration event state visible in the integration card.

Also improved the clarity of the auto-deletion explanation in the modal.
2024-07-24 13:52:57 +01:00
Thomas Heartman
e2b90ae91d
fix: add workaround for tooltip (#7649)
This PR adds the UI part of feature flag collaborators. Collaborators are hidden on windows smaller than size XL because we're not sure how to deal with them in those cases yet.
2024-07-24 09:33:29 +00:00
Nuno Góis
1d6dc9b195
chore: integration events API (#7639)
https://linear.app/unleash/issue/2-2439/create-new-integration-events-endpoint

https://linear.app/unleash/issue/2-2436/create-new-integration-event-openapi-schemas

This adds a new `/events` endpoint to the Addons API, allowing us to
fetch integration events for a specific integration configuration id.


![image](https://github.com/user-attachments/assets/e95b669e-e498-40c0-9d66-55be30a24c13)

Also includes:
- `IntegrationEventsSchema`: New schema to represent the response object
of the list of integration events;
- `yarn schema:update`: New `package.json` script to update the OpenAPI
spec file;
- `BasePaginationParameters`: This is copied from Enterprise. After
merging this we should be able to refactor Enterprise to use this one
instead of the one it has, so we don't repeat ourselves;

We're also now correctly representing the BIGSERIAL as BigInt (string +
pattern) in our OpenAPI schema. Otherwise our validation would complain,
since we're saying it's a number in the schema but in fact returning a
string.
2024-07-23 10:09:19 +01:00
Nuno Góis
9ff393b3d7
chore: register integration events in New Relic integration (#7636)
https://linear.app/unleash/issue/2-2462/register-integration-events-new-relic

Registers integration events in the **New Relic** integration.

Similar to:
- #7635
- #7634
- #7631
- #7626
- #7621
2024-07-23 10:07:31 +01:00
Nuno Góis
47ff73afb2
chore: register integration events in Datadog integration (#7635)
https://linear.app/unleash/issue/2-2461/register-integration-events-datadog

Registers integration events in the **Datadog** integration.

Similar to:
 - #7634 
 - #7631
 - #7626
 - #7621
2024-07-22 12:14:32 +01:00
Nuno Góis
e07ded9455
chore: register integration events in Teams integration (#7634)
https://linear.app/unleash/issue/2-2460/register-integration-events-teams

Registers integration events in the **Teams** integration.

Also includes slight improvements to the **Webhooks** integration.

Similar to:
 - #7631
 - #7626
 - #7621
2024-07-22 12:13:10 +01:00
Nuno Góis
1033276e97
chore: register integration events in Slack App integration (#7631)
https://linear.app/unleash/issue/2-2459/register-integration-events-slack-app

Registers integration events in the **Slack App** integration.

Similar to:
 - #7626
 - #7621
2024-07-22 11:54:19 +01:00
Thomas Heartman
a5223af702
fix: change "features flags" -> "feature flags" (#7632)
This typo has been around since the tag was introduced. About time we
fixed it.
2024-07-22 10:48:54 +02:00
Christopher Kolstad
71b2035dfb
chore: extend uiConfig schema with new SSO variables (#7628)
As the title says. Adds two new nullable variables to uiConfig. Used in
frontend to decide if SSO config is editable through the GUI
2024-07-19 12:39:34 +00:00
Mateusz Kwasniewski
71b3a2ae0a
feat: feature collaborators added to API behind a flag (#7627) 2024-07-19 14:34:22 +02:00
Nuno Góis
203b700e27
chore: register integration events in Slack integration (#7626)
https://linear.app/unleash/issue/2-2458/register-integration-events-slack

Registers integration events in the **Slack** integration.

Similar to: https://github.com/Unleash/unleash/pull/7621

Also slightly improves the previous work on webhooks.
2024-07-19 12:56:55 +01:00
Thomas Heartman
87fa5a2414
chore: allow you to lower constraint values even when they're above limit (#7624)
This PR allows you to gradually lower constraint values, even if they're
above the limits.

It does, however, come with a few caveats because of how Unleash deals
with constraints:
Constraints are just json blobs. They have no IDs or other
distinguishing features. Because of this, we can't compare the current
and previous state of a specific constraint.

What we can do instead, is to allow you to lower the amount of
constraint values if and only if the number of constraints hasn't
changed. In this case, we assume that you also haven't reordered the
constraints (not possible from the UI today). That way, we can compare
constraint values between updated and existing constraints based on
their index in the constraint list.

It's not foolproof, but it's a workaround that you can use. There's a
few edge cases that pop up, but that I don't think it's worth trying to
cover:

Case: If you **both** have too many constraints **and** too many
constraint values
Result: You won't be allowed to lower the amount of constraints as long
as the amount of strategy values is still above the limit.
Workaround: First, lower the amount of constraint values until you're
under the limit and then lower constraints. OR, set the constraint you
want to delete to a constraint that is trivially true (e.g. `currentTime
> yesterday` ). That will essentially take that constraint out of the
equation, achieving the same end result.

Case: You re-order constraints and at least one of them has too many
values
Result: You won't be allowed to (except for in the edge case where the
one with too many values doesn't move or switches places with another
one with the exact same amount of values).
Workaround: We don't need one. The order of constraints has no effect on
the evaluation.
2024-07-19 10:14:42 +00:00
Mateusz Kwasniewski
c3a00c07e1
feat: feature collaborators read model (#7625) 2024-07-19 12:10:21 +02:00
Nuno Góis
0869e39603
chore: register integration events in webhooks (#7621)
https://linear.app/unleash/issue/2-2450/register-integration-events-webhook

Registers integration events in the **Webhook** integration.

Even though this touches a lot of files, most of it is preparation for
the next steps. The only actual implementation of registering
integration events is in the **Webhook** integration. The rest will
follow on separate PRs.

Here's an example of how this looks like in the database table:

```json
{
  "id": 7,
  "integration_id": 2,
  "created_at": "2024-07-18T18:11:11.376348+01:00",
  "state": "failed",
  "state_details": "Webhook request failed with status code: ECONNREFUSED",
  "event": {
    "id": 130,
    "data": null,
    "tags": [],
    "type": "feature-environment-enabled",
    "preData": null,
    "project": "default",
    "createdAt": "2024-07-18T17:11:10.821Z",
    "createdBy": "admin",
    "environment": "development",
    "featureName": "test",
    "createdByUserId": 1
  },
  "details": {
    "url": "http://localhost:1337",
    "body": "{ \"id\": 130, \"type\": \"feature-environment-enabled\", \"createdBy\": \"admin\", \"createdAt\": \"2024-07-18T17: 11: 10.821Z\", \"createdByUserId\": 1, \"data\": null, \"preData\": null, \"tags\": [], \"featureName\": \"test\", \"project\": \"default\", \"environment\": \"development\" }"
  }
}
```
2024-07-19 10:07:52 +01:00
Thomas Heartman
3db1159304
feat: allow you to gradually scale back constraint usage (#7622)
This PR updates the limit validation for constraint numbers on a single
strategy. In cases where you're already above the limit, it allows you
to still update the strategy as long as you don't add any **new**
constraints (that is: the number of constraints doesn't increase).

A discussion point: I've only tested this with unit tests of the method
directly. I haven't tested that the right parameters are passed in from
calling functions. The main reason being that that would involve
updating the fake strategy and feature stores to sync their flag lists
(or just checking that the thrown error isn't a limit exceeded error),
because right now the fake strategy store throws an error when it
doesn't find the flag I want to update.
2024-07-19 08:40:45 +00:00
Mateusz Kwasniewski
a0ba44d9f4
chore: feature collaborators flag (#7623) 2024-07-19 10:11:39 +02:00
Nuno Góis
5a2b48687e
chore: integration events service (#7614)
https://linear.app/unleash/issue/2-2438/create-new-integration-event-service

https://linear.app/unleash/issue/2-2442/automatically-clean-up-old-integration-events

Adds a new `IntegrationEventsService`.
2024-07-18 16:54:31 +01:00