1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-12-09 20:04:11 +01:00
Commit Graph

3144 Commits

Author SHA1 Message Date
melindafekete
49e19f22d6
Merge branch 'main' into docs/audit-urls 2025-11-24 10:33:22 +01:00
Thomas Heartman
c29983d810
fix: handle invalid permissions in role creation (#11003)
The `create` and `update` role methods used to blindly accept any
incoming permissions, but if the permissions don't exist in the
database, then the database would throw, yielding a 500 error to the
user.

To fix this, we can validate that all the permissions exist before we
try to add the incoming permissions.

The http error only manifests in enterprise, but the fix requires
modifying the access service. Therefore, I've added the tests to the
access service too, such that if you break something, then you don't
need to wait for it to propagate to enterprise.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2025-11-20 12:32:49 +00:00
David Leek
93ea192f8c
feat: frontend for pkce (#11005) 2025-11-20 10:59:48 +01:00
melindafekete
9a99e2e445
Move how-to guides to guides 2025-11-19 16:09:53 +01:00
Nuno Góis
416bd27859
chore: show hosting in connected edges (#10995)
https://linear.app/unleash/issue/2-4037/show-hosting-in-connected-edges-edge-observability

Show "hosting" in Connected Edges.

This can be one of:
 - Cloud
 - Self-hosted
 - Unknown

<img width="326" height="691" alt="image"
src="https://github.com/user-attachments/assets/baba1fbb-6f22-46f5-8271-4f4a0c3fcc8a"
/>
2025-11-19 10:41:46 +00:00
Jaanus Sellin
ccbf375a13
feat: add safeguard events (#10994) 2025-11-19 10:10:44 +02:00
melindafekete
67b4508cb1
Merge main 2025-11-18 14:30:38 +01:00
Nuno Góis
f06eabf7e6
chore: export default metrics register (#10989)
https://linear.app/unleash/issue/2-4035/avoid-prom-client-dependency-in-enterprise-cloud

This exports the default metrics register so consumers can tap into it
if needed.
2025-11-17 13:40:13 +00:00
Jaanus Sellin
8c6efeb48d
chore: fix safeguards schema (#10982) 2025-11-14 13:30:35 +02:00
Jaanus Sellin
ba25d7ada9
chore: fix transitionCondition (#10981) 2025-11-14 13:01:13 +02:00
Jaanus Sellin
25c4f6fa3b
chore: update schema to match reality (#10979) 2025-11-14 09:11:22 +00:00
Jaanus Sellin
9de82e87f2
chore: start validating getFeature endpoint (#10975) 2025-11-14 08:47:31 +02:00
Jaanus Sellin
06b9d1939b
fix: add missing nested types (#10976) 2025-11-13 13:41:23 +02:00
Jaanus Sellin
684a0ff48c
feat: add safeguards schema to oss (#10972)
TypeScript throws `TS7056` because the schema object becomes too large
for the compiler to fully serialize when using deep literal inference.
Splitting the components object and explicitly reconstructing the type
prevents the error while preserving correct type inference.
2025-11-13 09:30:15 +00:00
Thomas Heartman
1795e68a67
test: add extra test to ensure we don't return a disabled variant (#10968)
Adds a test to ensure that the `getAll` method of the flag resolver
doesn't return the disabled variant if a flag is defined as a boolean in
the settings.

We have some places in the UI where we check `if
(uiConfig.flags.<flagname>) {...}`. If one of these flags were suddenly
returned as the disabled variant instead of `false`, then it'd be
impossible to turn it off.

As such, to maintain backwards compatibility and adhere to the principle
of least surprise, I'd like to add this test to ensure this doesn't
change going forward.
2025-11-13 10:18:36 +01:00
Thomas Heartman
89a3578826
fix: allow external flag resolver to override false experiments with variants in getAll (#10966)
Fixes a bug / uncovered edge case in the flag resolver in Unleash:
If a local experiment was defined as false (the typical default value),
then that flag could only ever be returned as a boolean from the
`ui-config` endpoint. In other words, even if the external resolver has
a variant for that flag, the UI would never get the variant.

The fix is to not just check `isEnabled` for false flags, but instead:
- use `getVariant`
- then check `variant.enabled` (in which case we have a variant and can
return it)
- else check `variant.feature_enabled`, falling back to `isEnabled` only
if `feature_enabled` is null/undefined.
2025-11-12 12:00:27 +01:00
Thomas Heartman
b33abf036b
chore: configure the 'maintenanceMode' flag to accept variants (#10956)
Configure the `maintenanceMode` flag type to be `boolean | Variant` and
update the env parsing to allow passing strings from the env.

The [first
impl](3bbfc9e681)
required you to set a full, variant -- stringified as json -- in the
env, but this is both error-prone and not very user friendly.
Additionally, the name of the variant isn't really important, and if
you're passing a string, you probably want it to be true.

As such, the [second
impl](c38357baa4)
updates the env parsing to read the full string value into a
pre-formatted variant if it's not parseable as a boolean.

As such, to set a custom message, you can now do:

```sh
UNLEASH_EXPERIMENTAL_MAINTENANCE_MODE='Custom message from plain env var string' yarn dev
```

With the [updates to the
UI](https://github.com/Unleash/unleash/pull/10961), it'll look a little
something like this:

<img width="388" height="64" alt="image"
src="https://github.com/user-attachments/assets/6b8a174b-d75f-4748-8f1a-1ad4ebce2073"
/>

## Rationale

This allows locking down Unleash instances with a custom message.
Previously, you'd have to use both maintenance mode and a custom banner
for this, but that requires more work to set properly and it shows two
banners, when you really only want the one.
2025-11-11 12:52:49 +01:00
Jaanus Sellin
6f02edce2d
chore: move delta diffing to a different feature flag (#10962)
Move delta diffing to a different feature flag
2025-11-11 10:55:37 +00:00
Jaanus Sellin
96118836d5
chore: remove release plans from getFeature endpoint (#10955) 2025-11-10 15:06:21 +02:00
Gastón Fournier
142b5a5d95
chore: decrease log level of acquire job lock (#10952)
This was done in order to debug the functionality, now it serves no
purpose
2025-11-10 10:38:15 +00:00
Thomas Heartman
1cab7eaa78
chore: replace deprecated getDefaultVariant with defaultVariant (#10944)
Updates the flag resolver and other references to the unleash client's
deprecated `getDefaultVariant` to instead point to the `defaultVariant`
property instead, as described by the deprecation notice:


46bf068d26/src/variant.ts (L55-L60)
2025-11-10 11:11:00 +01:00
unleash-bot[bot]
8c56c375c7
chore(AI): trafficBillingDisplay flag cleanup (#10949) 2025-11-10 10:35:33 +02:00
unleash-bot[bot]
547c8ffd58
chore(AI): lifecycleGraphs flag cleanup (#10942)
This PR cleans up the lifecycleGraphs flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10941

## 🧹 AI Flag Cleanup Summary
This change removes the `lifecycleGraphs` feature flag and makes the
associated
feature permanently available. The lifecycle graphs on the insights page
are now
enabled for all Enterprise users.
### 🚮 Removed
- **Configuration**
- `lifecycleGraphs` flag definition from `IFlagKey` and `flags` object
in
`src/lib/types/experimental.ts`.
- `lifecycleGraphs` flag from `UiFlags` in
`frontend/src/interfaces/uiConfig.ts`.
- `lifecycleGraphs: true` from `src/server-dev.ts` development config.
- **UI**
- The `useUiFlag('lifecycleGraphs')` hook call and associated
conditional
rendering logic in `PerformanceInsights.tsx`.
### 🛠 Kept
- **UI**
- The "New flags in production" and "Flags archived vs flags created"
widgets
are now always shown for Enterprise instances on the Performance
Insights page.
### 📝 Why
The `lifecycleGraphs` feature flag has been fully rolled out and is now
considered a permanent part of the application. This cleanup removes the
obsolete flag and its related conditional logic to simplify the
codebase.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-11-07 10:36:49 +00:00
Melinda Fekete
28fa4240b7
docs: updates for 7.3 (#10913) 2025-11-06 10:56:15 +01:00
Jaanus Sellin
fe2d63ad9b
feat: add safeguards migration (#10928)
Safeguards migration
2025-11-06 11:03:40 +02:00
unleash-bot[bot]
1030feee38
chore(AI): envAddStrategySuggestion flag cleanup (#10916) 2025-11-05 11:02:42 +01:00
unleash-bot[bot]
11a2860700
chore(AI): newStrategyModal flag cleanup (#10912)
This PR cleans up the newStrategyModal flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10911



🧹 AI Flag Cleanup Summary

This change removes the newStrategyModal feature flag, making the new
"Add
strategy" modal the default and only experience for adding strategies to
a
feature.

I've removed the flag checks and the legacy code paths for the old
strategy
menu. The FeatureStrategyMenu component is now simplified to only render
the new
modal experience. I have also removed the flag from backend
configurations and
frontend interfaces.

🚮 Removed

• Feature Flag: newStrategyModal flag definition and configuration from
experimental.ts, server-dev.ts, and uiConfig.ts.
• Conditional Logic: All checks for the newStrategyModal flag in
FeatureStrategyMenu.tsx.
• Legacy Components: The old strategy menu
(LegacyFeatureStrategyMenuCards) and
related dialogs (LegacyReleasePlanReviewDialog) have been removed from
FeatureStrategyMenu.tsx.
• Unused Code: Unused state variables, functions
(openDefaultStrategyCreationModal, openReleasePlans), and imports
related to
the legacy strategy menu have been cleaned up.

🛠 Kept

• New "Add strategy" modal: The new modal for adding strategies is now
the only
implementation. Its user experience is preserved and made default.

📝 Why

The newStrategyModal feature has been completed, and the decision was to
keep
the new user experience. This cleanup removes the complexity of
maintaining two
different UI paths for adding strategies, making the code cleaner and
easier to
maintain.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
2025-11-05 08:59:18 +00:00
unleash-bot[bot]
8d00eea66a
chore(AI): newUiConfigService flag cleanup (#10910)
This PR cleans up the newUiConfigService flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10909

## 🧹 AI Flag Cleanup Summary
This PR removes the `newUiConfigService` feature flag and makes its
functionality permanent. The `UiConfigController` now exclusively uses
the
`UiConfigService` to generate the UI configuration, removing the old,
now-dead
code path.
As a result of this change, several services that were only used in the
old
implementation have been removed from `UiConfigController`, along with
their
associated types and imports, simplifying the controller significantly.
### 🚮 Removed
- **Flag Definitions**
- `newUiConfigService` flag definition from
`src/lib/types/experimental.ts`.
- Development override for `newUiConfigService` in `src/server-dev.ts`.
- **Conditional Logic**
- The `if` block checking for `newUiConfigService` in
`UiConfigController.getUiConfig`.
- **Dead Code**
- The legacy implementation of building the UI config object inside
`UiConfigController`.
- Several unused service dependencies (`VersionService`,
`SettingService`,
`EmailService`, `SessionService`, `MaintenanceService`) and
`IFlagResolver` from
`UiConfigController`.
### 🛠 Kept
- **New `getUiConfig` implementation**
- The `UiConfigController.getUiConfig` method now solely relies on
`UiConfigService` to fetch the UI configuration.
### 📝 Why
The `newUiConfigService` feature flag was fully rolled out and marked as
completed. This cleanup removes the flag and the legacy code path,
simplifying
the `UiConfigController` and making the new UI config service the
standard way
of providing UI configuration.

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
2025-11-04 15:49:44 +00:00
Nuno Góis
699f9e6ce2
fix: enterprise edge stats should take into account full month (#10898)
https://linear.app/unleash/issue/2-3993/fix-enterprise-edge-stats

Fixes Enterprise Edge stats to correctly reflect the average across the
whole month.

Now returns a rounded average with 3 decimal places.

Also includes the average of the last 12 months.
2025-11-03 13:45:38 +00:00
Mateusz Kwasniewski
bbff52eb7b
feat: milestone progression paused at (#10907) 2025-11-03 14:08:37 +01:00
Simon Hornby
0afcba27bf
chore: add a flag to deny streaming for non edge connections (#10905) 2025-11-03 14:45:23 +02:00
Mateusz Kwasniewski
d452e45f37
chore: safeguards flag (#10906) 2025-11-03 12:05:26 +01:00
Gastón Fournier
bf19b62079
feat: ability to disable custom strategies (#10885)
## About the changes
This adds the ability to disable custom strategy creation and editing by
using two env variables: `UNLEASH_DISABLE_CUSTOM_STRATEGY_CREATION` and
`UNLEASH_DISABLE_CUSTOM_STRATEGY_EDITING`.

Fixes: #9593

This could be useful if you want to remove the ability to create new
custom strategies and rely on the built-in ones
2025-11-03 09:27:15 +01:00
renovate[bot]
f74c1dc482
fix(deps): update dependency normalize-url to v8 (#10193) 2025-10-29 14:30:51 +01:00
Gastón Fournier
bcfad0a250
feat: include readiness check option (#10850)
## About the changes
This introduces a new endpoint to allow users to check for readiness of
Unleash to serve traffic, in particular validating that the DB is up.
It's an opt-in feature that has to be enabled with the environment
variable `CHECK_DB_ON_READY=true` or via the configuration option
`checkDbOnReady`.

Closes #10742
2025-10-29 13:11:23 +01:00
Mateusz Kwasniewski
9a23bc36f8
chore: remove unused events (#10883) 2025-10-29 10:29:04 +01:00
unleash-bot[bot]
25abe054a4
chore(AI): originMiddlewareRequestLogging flag cleanup (#10864)
This PR cleans up the originMiddlewareRequestLogging flag. These changes
were automatically generated by AI and should be reviewed carefully.

Fixes #10863

## 🧹 AI Flag Cleanup Summary
This change removes the `originMiddlewareRequestLogging` feature flag
and its
associated code. The flag's outcome was to be discarded, so the logging
it
controlled has been removed from `originMiddleware`.
### 🚮 Removed
- **Flag Definition**
- Removed `originMiddlewareRequestLogging` from the `IFlagKey` type in
`src/lib/types/experimental.ts`.
- Removed the flag from the development server configuration in
`src/server-dev.ts`.
- **Logic**
- Removed the conditional logging of API requests from
`originMiddleware`.
- **Tests**
- Removed the test case for API request logging in
`origin-middleware.test.ts`.
- Removed the flag setup from the test configuration.
### 🛠 Kept
- **Core functionality**
- The core logic of the `originMiddleware` for emitting `REQUEST_ORIGIN`
metric events for UI and API requests remains unchanged.
### 📝 Why
The `originMiddlewareRequestLogging` feature flag was completed and its
outcome
was 'discarded'. This cleanup removes the flag and the now-dead code
related to
it, simplifying the middleware and tests.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2025-10-28 18:42:10 +01:00
Mateusz Kwasniewski
2f315545a3
fix: missing await in user splash update (#10878) 2025-10-28 09:43:17 +01:00
Mateusz Kwasniewski
8b95cb5386
fix: update splash nonexistent user (#10873) 2025-10-27 16:49:58 +01:00
Mateusz Kwasniewski
31e78d7536
refactor: milestone progression natural key (#10869) 2025-10-27 15:14:52 +01:00
Jaanus Sellin
0e1de4c511
chore: increase performance of application upsert (#10870)
This is our most longest running database query. Takes most time to
execute overall.

<img width="2233" height="381" alt="Screenshot from 2025-10-27 15-29-33"
src="https://github.com/user-attachments/assets/241abb84-1606-40b4-9a1c-bc706a1f7e20"
/>
2025-10-27 16:11:18 +02:00
Jaanus Sellin
a0c296ee3b
chore: bulk add instances once every 10 seconds (#10871)
This is most executed method by far and almost always hits db layer. We
should make it less frequent.
2025-10-27 16:11:00 +02:00
Mateusz Kwasniewski
bbee498b3e
feat: fake impact metrics improvements (#10866) 2025-10-27 10:43:53 +01:00
Melinda Fekete
b6694cd925
docs: update import export page (#10854) 2025-10-24 14:53:32 +02:00
Mateusz Kwasniewski
fd4fa815a9
chore: expose fake impact metrics resolver (#10861) 2025-10-24 13:53:06 +02:00
Jaanus Sellin
dc745cfac8
feat: add timers to all SQL queries in client applications store (#10855)
I know that creating new applications is one of the hot paths. We were
missing timers on this store. Adding them.
2025-10-24 09:11:50 +03:00
Jaanus Sellin
b0f3252632
feat: add plausibleMetrics feature flag (#10847) 2025-10-23 10:42:12 +03:00
Nuno Góis
8ba35507cd
chore: add edge instances to instance stats (#10839)
https://linear.app/unleash/issue/2-3979/add-edge-instances-to-self-reported-instance-stats

Adds edge instances to instance stats.
2025-10-22 16:40:43 +01:00
melindafekete
84631f51e5
Update get started and core concepts 2025-10-22 10:46:51 +02:00
Mateusz Kwasniewski
859e3bbdde
feat: unified milestone progression changed event (#10836) 2025-10-21 13:21:57 +02:00