1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-09 00:18:26 +01:00
Commit Graph

2691 Commits

Author SHA1 Message Date
Mateusz Kwasniewski
e29eb51f3c
chore: consumption model flag (#9379) 2025-02-27 09:45:07 +01:00
Jaanus Sellin
9ae9221960
feat: now instances are only shown for last 24 hours (#9372) 2025-02-27 09:19:48 +02:00
Jaanus Sellin
e0f0108c19
feat: SQL performance optimization to count instances (#9369) 2025-02-27 09:11:00 +02:00
Tymoteusz Czech
4e7ce65567
chore: remove uiGlobalFontSize flag (#9331)
1-3383
2025-02-26 12:39:53 +01:00
Gastón Fournier
3f373665ed
feat: ignore events in log when nothing has changed (#9364)
## About the changes
Some automation may keep some data up-to-date (e.g. segments). These
updates sometimes don't generate changes but we're still storing these
events in the event log and triggering reactions to those events.


Arguably, this could be done in each service domain logic, but it seems
to be a pretty straightforward solution: if preData and data are
provided, it means some change happened. Other events that don't have
preData or don't have data are treated as before.

Tests were added to validate we don't break other events.
2025-02-26 09:15:01 +01:00
Jaanus Sellin
c14cc3346e
chore: remove deltaApiStreaming flag (#9362) 2025-02-25 16:46:34 +02:00
Nuno Góis
a91876790e
chore: deprecate and undeprecate protected environments (#9360)
https://linear.app/unleash/issue/2-3320/allow-users-to-deprecate-and-undeprecate-protected-environments

Allows users to deprecate and undeprecate protected environments.


![image](https://github.com/user-attachments/assets/621684d3-21e3-4f58-b6b5-2d2731c9fd9e)
2025-02-25 13:41:41 +00:00
Nuno Góis
add4191381
chore: months old version banner (#9352)
https://linear.app/unleash/issue/2-3309/warn-users-of-lagging-versions-3-months-old

Adds a banner warning users in case they are running an outdated Unleash
version (>=3 months old) in case the build date data is present.

When clicking "Changelog" the users are redirected to
https://github.com/Unleash/unleash/releases.


![image](https://github.com/user-attachments/assets/f6b9b361-e780-4558-8b6c-5987b12efe68)
2025-02-25 12:48:55 +00:00
Jaanus Sellin
55eb73cf08
feat: now project moving is split into two events (#9358)
When project is moved, then Unleash creates only one event, which is for
target project.
We also need one for source project, to know that project was moved out
of it.

Test will be in enterprise repo.
2025-02-25 12:45:24 +02:00
Jaanus Sellin
4630068b0a
feat: add tests for filterEventsByQuery (#9338) 2025-02-20 14:52:01 +02:00
Nuno Góis
7340c74b1b
refactor: rename networkViewEnabled to prometheusAPIAvailable (#9330)
https://linear.app/unleash/issue/2-3290/rename-networkviewenabled-to-prometheusapiavailable

Follow-up to: https://github.com/Unleash/unleash/pull/9325

See: https://github.com/Unleash/unleash/pull/9325#discussion_r1960085303

Renames `networkViewEnabled` to `prometheusAPIAvailable`. This new name
better reflects what it stands for.
2025-02-19 14:38:59 +00:00
Nuno Góis
b4bfadd95e
chore: visualize connected edges (#9325)
https://linear.app/unleash/issue/2-3233/visualize-connected-edge-instances

Adds a new tab in the Network page to visualize connected Edges.

This is behind a `edgeObservability` flag.

Also opens up the Network page even if you don't have a Prometheus API
configured. When accessing the tabs that require it to set, and it
isn't, we show some extra information about this and redirect you to the
respective section in our docs.


![image](https://github.com/user-attachments/assets/1689f785-7544-450b-8c33-159609fc0f7d)


![image](https://github.com/user-attachments/assets/a7a14805-0488-41d2-885f-5e11a8495127)


![image](https://github.com/user-attachments/assets/918cba87-5538-4600-a71f-1143b2e33e2a)
2025-02-19 12:23:52 +00:00
Ivar Conradi Østhus
7811e4e264
fix: use bucket stop as timestamp for metrics bucket (#9327)
This fixes a problem where the yggdrasil-engine does not send the
correct value for bucket.start. In practice clients sends metrics every
60s and it does not matter if we use start or the stop timestamp to
resolve the nearest full hour.
2025-02-19 10:38:11 +02:00
Jaanus Sellin
ca562c548d
feat: project field to feature removed event (#9322)
Start sending out project for feature deleted, as we need it for edge to
keep exact copy.
2025-02-19 09:37:10 +02:00
Ivar Conradi Østhus
3f730bb7f3
fix: add a metric to track client registrations (#9314)
Adding a counter to track every time a client registers with Unleash.
2025-02-17 09:01:19 +01:00
Christopher Kolstad
edd03d02dd
task: add status_code to edge traffic table to store 304s as well (#9312) 2025-02-14 14:52:45 +01:00
Thomas Heartman
aafacc68cf
feat: new flag header (#9302)
Initial spike to add the new design for the flag page header
2025-02-14 14:33:35 +01:00
Jaanus Sellin
4a72580b24
fix: return undefined from delta if no events (#9311)
Nameprefix can remove events from result, so we should send 304 in that
case.
2025-02-14 12:28:43 +02:00
Nuno Góis
0e208fd8eb
chore: add change request events to teams integration (#9309)
https://linear.app/unleash/issue/2-3265/investigate-teams-integration-for-change-request-notifications

Adds change request events to the Teams integration.
2025-02-14 09:43:56 +00:00
Christopher Kolstad
1dad28fdb5
task: add edge observability tables (#9307)
Adds two stat tables to store edge observability data.
2025-02-14 08:48:13 +00:00
Fredrik Strand Oseberg
fa43420ab9
fix: mutating delta events (#9303)
Fix a bug where delta events would be mutated due to Object.assign.
2025-02-14 10:30:14 +02:00
Jaanus Sellin
aa15fbee9a
fix: hydration event should update with every event (#9310)
We were not updating hydration event id. This fixes it.
2025-02-14 09:35:08 +02:00
Christopher Kolstad
8de801025f
task: make setting service handle conflict on insert (#9160)
Currently, in enterprise we're struggling with setting service and
transactionality; all our verfications says that the setting key is not
present, so setting-store happily tries to insert a new row with a new
PK. However, somehow at the same time, the key already exists. This
commit adds conflict handling to the insertNewRow.
2025-02-13 15:54:43 +01:00
Thomas Heartman
243088fdca
fix: Add strategy and more strategies button are different heights (#9300)
Fixes the height discrepancy between add strategy and more strategies
buttons, both with and without the flag enabled.

The essence of the fix is to make the "more strategies" button's height
dynamic and grow to match the height of the other button.



Before (flag enabled):

![image](https://github.com/user-attachments/assets/4dda44b3-3add-40cd-93ed-48150e73ac35)

After (flag enabled):

![image](https://github.com/user-attachments/assets/2788f141-fe64-4733-9202-f9f115396001)


Before (flag disabled):

![image](https://github.com/user-attachments/assets/c3a9d396-cb30-4a61-9400-45458189d3f2)

After (flag disabled):

![image](https://github.com/user-attachments/assets/0570ff85-401a-4e6f-93e7-d1619a4cd848)

As a bonus: also enables the ui font redesign flag for server-dev.

If you're very sharp-eyed, you might notice a few things:

1. There's more padding on the new button. This was done in concert with
UX when we noticed there was more padding on other buttons. So as a
result, we set the button type to the default instead of "small".

1. The kebab button isn't perfectly square with the flag on. There's a
few issues here, but essentially: to use `aspect-ratio: 1`, you need
either a height or a width set. Because we want everything here to be
auto-generated (use the button's intrinsic height), I couldn't make it
work. In the end, I think this is close enough. If you have other ideas,
you're very welcome to try and fix it.
2025-02-12 13:54:06 +01:00
Nuno Góis
151db95c2d
feat: frontend API POST endpoint (#9291)
https://linear.app/unleash/issue/2-3260/implement-post-request-support-in-unleashs-frontend-api

Implements the POST endpoint in Unleash's frontend API.
2025-02-12 11:56:51 +00:00
David Leek
5921f0ea09
chore: add migration that backfills scim user email hashes (#9295) 2025-02-12 09:05:36 +01:00
Mateusz Kwasniewski
54766fd4a0
feat: connection count usage (#9294) 2025-02-11 16:15:45 +01:00
Tymoteusz Czech
cac38b0cee
fix: font size flag change to boolean (#9290)
## About the changes
Fix for `uiGlobalFontSize` flag being returned as an object, which is truthy.
2025-02-11 13:24:18 +01:00
Gastón Fournier
5e9698fe63
chore: Create test db from template (#9265)
## About the changes
Based on the first hypothesis from
https://github.com/Unleash/unleash/pull/9264, I decided to find an
alternative way of initializing the DB, mainly trying to run migrations
only once and removing that from the actual test run.

I found in [Postgres template
databases](https://www.postgresql.org/docs/current/manage-ag-templatedbs.html)
an interesting option in combination with jest global initializer.

### Changes on how we use DBs for testing

Previously, we were relying on a single DB with multiple schemas to
isolate tests, but each schema was empty and required migrations or
custom DB initialization scripts.

With this method, we don't need to use different schema names
(apparently there's no templating for schemas), and we can use new
databases. We can also eliminate custom initialization code.

### Legacy tests

This method also highlighted some wrong assumptions in existing tests.
One example is the existence of `default` environment, that because of
being deprecated is no longer available, but because tests are creating
the expected db state manually, they were not updated to match the
existing db state.

To keep tests running green, I've added a configuration to use the
`legacy` test setup (24 tests). By migrating these, we'll speed up
tests, but the code of these tests has to be modified, so I leave this
for another PR.

## Downsides
1. The template db initialization happens at the beginning of any test,
so local development may suffer from slower unit tests. As a workaround
we could define an environment variable to disable the db migration
2. Proliferation of test dbs. In ephemeral environments, this is not a
problem, but for local development we should clean up from time to time.
There's the possibility of cleaning up test dbs using the db name as a
pattern:
2ed2e1c274/scripts/jest-setup.ts (L13-L18)
but I didn't want to add this code yet. Opinions?

## Benefits
1. It allows us migrate only once and still get the benefits of having a
well known state for tests.
3. It removes some of the custom setup for tests (which in some cases
ends up testing something not realistic)
4. It removes the need of testing migrations:
https://github.com/Unleash/unleash/blob/main/src/test/e2e/migrator.e2e.test.ts
as migrations are run at the start
5. Forces us to keep old tests up to date when we modify our database
2025-02-11 13:01:43 +01:00
Simon Hornby
bf9fdd4f8d
feat: allow SCIM user deletion (#9190)
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2025-02-10 14:17:46 +02:00
Jaanus Sellin
fb68692247
feat: add delta api streaming flag (#9269)
Lets add separate flag for delta streaming.
2025-02-10 11:22:16 +02:00
Ivar Conradi Østhus
ac1d8b9b70
fix: change log-level to info for filterExistingFlagNames 2025-02-09 22:50:04 +01:00
Ivar Conradi Østhus
d1b9ca00a0
fix: Killwitch to block usage-metrics from non-exiting flag-names (#9266)
Adds a killswitch called "filterExistingFlagNames". When enabled it will
filter out reported SDK metrics and remove all reported metrics for
names that does not match an exiting feature flag in Unleash.

This have proven critical in the rare case of an SDK that start sending
random flag-names back to unleash, and thus filling up the database. At
some point the database will start slowing down due to the noisy data.

In order to not resolve the flagNames all the time we have added a small
cache (10s) for feature flag names. This gives a small delay (10s) from
flag is created until we start allow metrics for the flag when
kill-switch is enabled. We should probably listen to the event-stream
and use that invalidate the cache when a flag is created.
2025-02-09 22:45:44 +01:00
Fredrik Strand Oseberg
af516537bd
fix: return if empty array (#9254)
Fixes an issue where segment-updated event would be added to cache even
though there were no correlated events. Tests needs to be added in
Enterprise.
2025-02-07 14:39:43 +01:00
Tymoteusz Czech
aa5c70f70e
fix: project roles - include change request config in project update (#9256)
Change request settings as a subset of "update project" role.
2025-02-07 13:42:48 +01:00
Jaanus Sellin
43e418e40a
feat: emit delta updated event (#9250)
Start emitting delta updated event and make delta cache service
singleton.
2025-02-07 10:52:11 +02:00
Tymoteusz Czech
4e36d2285e
chore: remove sortProjectRoles flag (#9226) 2025-02-06 19:40:10 +01:00
Tymoteusz Czech
54e4fd2190
chore: remove lifecycle v2 flag (#9224) 2025-02-06 14:54:45 +01:00
David Leek
9a8607b07e
chore: clear scim fields when deleting user + migration for existing cases (#9217) 2025-02-05 15:45:51 +01:00
Jaanus Sellin
a15d63672f
feat: client spec to support deltaApi (#9222)
Add client spec version for delta API.
2025-02-05 15:02:44 +02:00
Mateusz Kwasniewski
a11c965bec
feat: productivity report unsubscribed users (#9220) 2025-02-05 11:28:01 +01:00
Mateusz Kwasniewski
ebcbd7b637
feat: productivity report only for seen users (#9204) 2025-02-05 10:05:35 +01:00
Jaanus Sellin
640db0c057
chore: pull delta controller out of OSS (#9206)
We are moving delta controller to enterprise. This sets it up.
2025-02-04 14:37:39 +02:00
Jaanus Sellin
d8a47ce39d
fix: now hydration event is being returned if revision does not exist in cache (#9203)
Now when customer is coming with revision ID that does not exist in
cache, we return hydration.
2025-02-04 13:21:17 +02:00
Melinda Fekete
ef8191c68d
Update API tokens and client keys pages (#9143) 2025-02-04 09:32:32 +01:00
Nuno Góis
138410eafd
chore: drop release plan template view permissions (#9195)
https://linear.app/unleash/issue/2-3225/drop-the-release-template-view-permissions

Drops the release plan template view permissions in favor of an "open by
default" approach.

Should merge the Enterprise PR first.
2025-02-03 16:24:25 +00:00
Gastón Fournier
6f19ce090d
feat: move create user validations to the input (#9189)
## About the changes
Validations in the constructor were executed on the way out (i.e. when
reading users). Instead we should validate when we insert the users.

We're also relaxing the email validation to support top domain emails
(e.g. `...@jp`)
2025-02-03 15:18:20 +01:00
Mateusz Kwasniewski
3b76c31838
fix: relax email checking (#9183) 2025-01-31 15:10:18 +01:00
Mateusz Kwasniewski
9f568b79b2
fix: relax email checking (#9182) 2025-01-31 14:50:24 +01:00
Mateusz Kwasniewski
77cb30a82f
feat: drop x- header prefix (#9175) 2025-01-30 16:09:26 +01:00