1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00
Commit Graph

14132 Commits

Author SHA1 Message Date
Gastón Fournier
ad605e42c7
chore(security): upgrade on-headers transitive dep (#10410) 2025-07-24 12:45:54 +02:00
Mateusz Kwasniewski
9a768f7bdc
chore: orval update creation trends (#10409)
Co-authored-by: sjaanus <sellinjaanus@gmail.com>
2025-07-24 13:38:11 +03:00
dependabot[bot]
f9ede12535
chore(deps): bump form-data from 4.0.0 to 4.0.4 (#10408) 2025-07-24 12:11:02 +02:00
Mateusz Kwasniewski
049e1ba271
feat: new flags in production explanation (#10407) 2025-07-24 11:53:25 +02:00
Nuno Góis
45e5b217aa
fix: add strategy release templates visibility for non Enterprise (#10401)
https://linear.app/unleash/issue/2-3711/add-strategy-modal-shows-release-templates-section-for-non-enterprise

Fixes a bug for non-Enterprise where release templates were mentioned
(and even linked to) even though they were not available for these
plans. When following the link the result was a page that did not
render.

Also slightly refactors and improves this component.

<img width="870" height="496" alt="image"
src="https://github.com/user-attachments/assets/47499e21-73fc-4ddf-8eed-6146be31b074"
/>
2025-07-23 20:17:22 +01:00
Gastón Fournier
0e015d6686
chore(security): remove coveralls dependency (#10405)
## About the changes
We've been using vitest for coverage and we use a github action to push
results to coveralls, so this should work just fine

Unlocks form-data to be able to fix
https://github.com/Unleash/unleash/security/dependabot/267

Also, removing coverage from PRs to avoid running tests twice
2025-07-23 20:40:00 +02:00
Gastón Fournier
4854b35cb1
chore(security): upgrade to newer node version (#10404)
## About the changes
Upgrade node to latest version to solve
[CVE-2025-27210](https://nodejs.org/en/blog/vulnerability/july-2025-security-releases)

Closes #10380
2025-07-23 18:49:06 +02:00
dependabot[bot]
e89fa7ec6e
chore(deps): bump form-data from 4.0.0 to 4.0.4 in /frontend (#10403) 2025-07-23 18:37:42 +02:00
dependabot[bot]
86b4bea838
chore(deps): bump form-data from 4.0.1 to 4.0.4 in /website (#10392) 2025-07-23 18:12:12 +02:00
Thomas Heartman
64050121db
Add timestampsInChangeRequestTimeline flag (#10399)
Adds flag to OSS for the new timestamps in CR timeline capability.

We might not need them in the UI, but might as well add it in case.
2025-07-23 15:33:40 +02:00
Mateusz Kwasniewski
299ed65ef7
feat: New production flags chart (#10400) 2025-07-23 15:29:47 +02:00
Mateusz Kwasniewski
0457f5e035
chore: orval generation (#10398) 2025-07-23 13:11:26 +02:00
Nuno Góis
e87c51948f
fix: banner form state (#10397)
https://linear.app/unleash/issue/2-3710/fix-banner-form-state-inconsistencies

Noticed a few inconsistencies with the way the banner form handles
state. This should fix that by ensuring the form's state correctly
reflects prop changes.
2025-07-23 08:36:48 +01:00
Nuno Góis
65ea41d601
chore: AI flag cleanup better support advanced flag names (#10396)
https://linear.app/unleash/issue/2-3709/improve-support-for-advanced-flag-names-in-ai-flag-cleanup

Improves support for advanced flag names in AI flag cleanup.

This is something I noticed when it tried to run against
https://github.com/Unleash/unleash/issues/10395 — The dot (.) broke the
previous logic.
2025-07-22 17:39:16 +01:00
Melinda Fekete
f363a1eba7
Add search priority for auto-generated pages (#10386) 2025-07-22 18:16:24 +02:00
Nuno Góis
b663696bd4
chore: AI flag cleanup reports errors back to issue (#10381)
https://linear.app/unleash/issue/2-3706/ai-flag-cleanup-reports-errors-back-to-issue

Reports AI flag cleanup errors back to the issue.
2025-07-22 16:21:56 +01:00
Gastón Fournier
57ec5ce876
chore: remove unkonwn flags (#10389)
We're iterating over the keys of experimental and checking if they're
enabled:
e140ab63e1/src/lib/util/flag-resolver.ts (L26)
which leads to this big list of unknown flags

This comes from our report:
<img width="1461" height="1042" alt="image"
src="https://github.com/user-attachments/assets/9579f351-e5e9-42ad-a141-b5cde83a41b8"
/>
2025-07-22 16:49:42 +02:00
Thomas Heartman
bfd82015d1
Fix each child in a list should have a key error. (#10393)
The console was complaining. I suspect it was because of the wrapping
fragment. So instead of doing everything within react, I switched to
using a standard case statement.

Also: because name is optional and not guaranteed to be unique, let's
use id for the key instead.
2025-07-22 13:03:33 +00:00
Mateusz Kwasniewski
d7f98945a3
chore: Lifecycle graphs flag (#10390) 2025-07-22 14:34:27 +02:00
Gastón Fournier
020e9a49ef
chore: don't fail if array is not ordered properly (#10391)
Spotted it here:
https://github.com/Unleash/unleash/actions/runs/16443263365/job/46468801248
<img width="928" height="584" alt="image"
src="https://github.com/user-attachments/assets/5e430b91-2664-4a79-9f13-cf6da4640046"
/>

where the sort order is different.
2025-07-22 14:30:56 +02:00
Gastón Fournier
e140ab63e1
fix: flaky delete stale session (#10387)
When deleting stale sessions, we sort them by createdAt. If both
sessions are created with the same createdAt, there's a chance we get a
different sort order and we end up with the wrong order:
https://github.com/Unleash/unleash/actions/runs/16438565746/job/46453700977

I think adding 10ms between inserts should be enough (1ms should do,
but this gives me more confidence and doesn't hurt that much)

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-07-22 11:42:14 +00:00
Melinda Fekete
dc81f81b54
docs: guide for managing feature flags in code (#10344) 2025-07-22 11:47:09 +02:00
Tymoteusz Czech
f54305c8b7
refactor: impact metrics modal - label filtering and UX (#10377)
Modal for editing a chart now follows design of other parts of the app
more closely.
2025-07-22 10:08:29 +02:00
Nuno Góis
51f8244a5d
chore: emit CLIENT_METRICS event after sifting (#10376)
https://linear.app/unleash/issue/2-3705/only-emit-client-metrics-after-sifting-metrics

Only emits the `CLIENT_METRICS` event after metric sifting.

This ensures the event is emitted only for valid metrics tied to known
flags, instead of all flags included in the metrics payload.

See:
https://github.com/Unleash/unleash/pull/10375#discussion_r2218974109
2025-07-21 15:40:02 +01:00
Nuno Góis
8f0c0ccef3
chore: sift metrics on both endpoints (#10375)
https://linear.app/unleash/issue/2-3696/report-unknown-flags-when-sent-to-the-bulk-metrics-endpoint

Unifies metrics sifting logic across both metrics endpoints:
- `/metrics`
- `/metrics/bulk`

This PR improves consistency between the `/metrics` and `/metrics/bulk`
endpoints by introducing a shared `siftMetrics` method, now used within
`registerBulkMetrics`. Both endpoints already call this method at the
end of their respective logic flows, ensuring that metrics are sifted in
the same way regardless of the path taken.

While the primary goal was to enable reporting of unknown flags via the
`/metrics/bulk` endpoint, this change also improves bulk processing by
consistently dropping invalid or unknown flags before insertion, just
like in the regular `/metrics` endpoint.
2025-07-21 12:40:41 +01:00
Tymoteusz Czech
c1df04548d
feat: add impact metrics wildcard label (#10373) 2025-07-21 10:50:14 +02:00
Melinda Fekete
253c2d71b3
docs: prioritize search results (#10369) 2025-07-18 17:09:35 +02:00
Tymoteusz Czech
2ff1aa78a0
refactor: color assignment in useChartData (#10372) 2025-07-18 14:28:56 +02:00
Tymoteusz Czech
b581b2393d
fix: improve impact metrics preview chart (#10368) 2025-07-18 09:46:32 +02:00
Mateusz Kwasniewski
89f5f79836
feat: aggregation mode selection (#10367) 2025-07-17 18:36:25 +02:00
Tymoteusz Czech
2d96becb28
fix: update legend display logic (#10365)
When grouping by multiple labels, chart label should always be visible.
Even if returned data only has 1 series
2025-07-17 16:26:24 +02:00
Melinda Fekete
5d23a9c5e1
Add metadata to quickstart (#10366) 2025-07-17 16:25:32 +02:00
Mateusz Kwasniewski
f04dd454d9
feat: sanitize impact metrics (#10364) 2025-07-17 12:59:50 +02:00
Kitsios Konstantinos
84748aaff0
[CI]: Cancel CI runs that become obsolete (#10339)
## About the changes
Currently, if a PR is open and a push happens, the **e2e:frontend**
workflow will start running. If, shortly after a subsequent push on the
*same* PR happens, the workflow will start running again without
cancelling the previous (now obsolete) run. With these changes, the
first run would be cancelled, thus **saving compute resources** (see
below for quantity) that can be used to **speed up your overall CI/CD**,
without sacrificing functionality, since the second run will contain the
changes from the first push as well. 🌱

### Example
Here is an example of the behaviour described above: the commit
`b1b2e61` triggered
[this](https://github.com/Unleash/unleash/actions/runs/14493085673/)
workflow run, and shortly after the commit `9997fe1`, that happened on
top of the first commit, triggered
[this](https://github.com/Unleash/unleash/actions/runs/14493089012/)
workflow. Both workflows ran till the end, spending approximately 8 CPU
minutes each. With the proposed changes, the first run would be
cancelled, hence saving ~8 CPU minutes and clearing the queue for other
workflows. Note that this is an example of a single concurrent run; the
accumulated gain for all PRs would be higher, with a lower estimate at
**2 CPU hours** over the last few months.

The same holds for these workflow(s) as well: Dependency review, PR ->
Build Docs.

### Context
Hi,

We are a team of [researchers](https://www.ifi.uzh.ch/en/zest.html) from
University of Zurich and we are currently working on energy
optimizations in GitHub Actions workflows.

Kindly let us know (here or in the email below) if you would like more
details, if you want to reject the proposed changes for other reasons,
or if you have any question whatsoever.

Best regards,  
[Konstantinos
Kitsios](https://www.ifi.uzh.ch/en/zest/team/konstantinos_kitsios.html)
konstantinos.kitsios@uzh.ch
2025-07-17 11:22:44 +01:00
Tymoteusz Czech
3fb71bca75
fix: update text wrapping style in ImpactMetricsChart (#10363) 2025-07-17 10:52:53 +02:00
Mateusz Kwasniewski
1ab8275996
feat: default origin for impact metrics (#10362) 2025-07-16 14:45:44 +02:00
Thomas Heartman
e125c0f072
fix(1-3928): prevent overwriting existing values in instance store (#10360)
Fixes a bug in the instance store where insert and bulkUpsert would
overwrite existing properties if there was a row there already. Now
it'll ignore any properties that are undefined.

The implementation is lifted directly from
`src/lib/db/client-applications-store.ts` (line 107 atm).

Additionally, I've renamed the `insert` method to `upsert` to make it
clearer what it does (and because we already have `bulkUpsert`). The
method seems to only be used in tests, anyway. I do not anticipate any
changes to be required in enterprise (I've checked).

## Discussion points:

This implementation uses `delete` to remove properties from the object.
Why didn't I do it some other way? Two main reasons:
1. We've had this implementation for 4 years in the client applications
store. If there were serious issues with it, we'd probably know by know.
(Probably.)
2. The only way I can think of without deleting, would be to use
`Object.fromEntries` and `Object.toEntries` and either map or reduce.
That'll double the amount of property iterations we'll need to do.

So naively, this strikes me as being more efficient. If you know better
solutions, I will of course be happy to take them. If not, I'd like to
leave this as is and then change it if we see that it's causing issues.
2025-07-16 12:10:15 +00:00
Thomas Heartman
642b209b9d
fix: don't overwrite seenClients in instance-service; merge if same client appears again (#10357)
Fixes a bug where `registerInstance` and
`register{Frontend|Backend}Client` would overwrite each other's data in
the instance service, leading to the bulk update being made with partial
data, often missing SDK version. There's a different issue in the actual
store that causes sdk version and type to be overwritten when it's
updated (because we don't use `setLastSeen` anymore), but I'll handle
that in a different PR.

This PR adds tests for the changes I've made. Additionally, I've made
these semi-related bonus changes:
- In registerInstance, don't expect a partial `IClientApp`. We used to
validate that it was actual a metrics object instead. Instead, update
the signature to expect the actual properties we need from the cilent
metrics schema and set a default for instanceId the way Joi did.
- In `metrics.ts`, use the `ClientMetricsSchema` type in the function
signature, so that the request body is correctly typed in the function
(instead of being `any`).
- Delete two unused properties from the`createApplicationSchema`. They
would get ignored and were never used as far as I can tell. (`appName`
is taken from the URL, and applications don't store `sdkVersion`
information).
- Add `sdkVersion` to `IClientApp` because it's used in instance
service.

I've been very confused about all the weird type shenanigans we do in
the instance service (expecting `IClientApp`, then validating with a
different Joi schema etc). I think this makes it a little bit better and
updates the bits I'm touching, but I'm happy to take input if you
disagree.
2025-07-16 14:02:25 +02:00
Mateusz Kwasniewski
8455134688
feat: show rps only for counters (#10361) 2025-07-16 13:43:29 +02:00
Mateusz Kwasniewski
c3f1454df7
feat: use metric display name in impact charts (#10359) 2025-07-16 11:58:42 +02:00
Nuno Góis
7910aa9130
chore: add flag paygInstanceStatsEvents (#10356)
https://linear.app/unleash/issue/2-3697/add-flag-payginstancestatsevents

Adds a new flag: `paygInstanceStatsEvents`

This controls sending the daily PAYG instance stats events.
2025-07-15 09:35:55 +01:00
Nuno Góis
3d78fbea7f
chore: prevent unknown flag deadlocks by sorting and batching inserts (#10348)
https://linear.app/unleash/issue/2-3692/prevent-deadlocks-by-sorting-and-batching-inserts

Tries to prevent deadlocks by sorting and batching unknown flag inserts
when flushing.
2025-07-15 08:58:42 +01:00
Mateusz Kwasniewski
998834245c
feat: Using impact metrics with flags (#10355) 2025-07-15 08:42:38 +02:00
Thomas Heartman
34feef990e
chore: Export IClientInstance from server-impl. (#10354)
This type wasn't available in enterprise, so I'm adding it to serer-impl
to make it available.

I was a little unsure whether this would be an implementation detail
that we shouldn't expose in server-impl, but comparing it with the other
things we export (`applyGenericQueryParams`, `flattenPayload`,
`basePaginationParameters`), that seems to be fine. I'm guessing this
isn't the main public export? Or it is, and we just don't care 🤷
2025-07-14 15:36:18 +02:00
Nuno Góis
e51b3bb6c2
chore: allow bulk metrics with empty flag names (#10353)
https://linear.app/unleash/issue/2-3695/allow-empty-flag-names-to-be-reported-in-bulk-metrics

Accepts metrics with empty flag names in the `/api/client/metrics/bulk`
endpoint.

When testing unknown flags through Edge, which uses the `/bulk`
endpoint, we noticed that there's a slight difference in validation
behavior compared to the regular metrics endpoint. While the regular
endpoint allows empty flag names, this one does not.

We can argue that we don't care about empty flag names in the first
place, which is true, but this inconsistency between the metric
endpoints can be confusing, and it also means that a single empty flag
name evaluation would break metrics being reported for that entire Edge
instance, for example.

This way we still accept it, just like we currently do if we point to
Unleash directly instead of going through Edge.

**Note**: We noticed that, due to the slightly different logic branch,
the bulk metrics endpoint does not report unknown flags. We'll take a
look at this at a later point.
2025-07-14 14:30:06 +01:00
Mateusz Kwasniewski
187d24db1f
chore: impact metrics resolver signature update (#10352) 2025-07-14 13:16:25 +02:00
Thomas Heartman
ed9eccd743
chore: add application_created event type (#10351)
This is primarily to facilitate reading and processing these events in
the payg cloud section of Unleash. We only emit these in one place, so I
added the types in there.
2025-07-14 11:02:29 +00:00
Mateusz Kwasniewski
ca485959b0
feat: prefix unleash impact metrics labels (#10350) 2025-07-14 11:47:45 +02:00
Mateusz Kwasniewski
fe471419b4
chore: bump node sdk with impact metrics flags (#10349) 2025-07-14 09:50:41 +02:00
Melinda Fekete
46f7031854
Fix linting in docs sidebar (#10347)
Fix linting in docs
2025-07-11 15:03:12 +02:00