1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-27 01:19:00 +02:00
Commit Graph

13975 Commits

Author SHA1 Message Date
Thomas Heartman
e4ead3bd67
Refactor: get rid of editable constraint wrapper (#9921)
This (admittedly pretty big) PR removes a component layer, moves all
logic for updating constraint values into a single module, and dumbs
down other components.

The main changes are:
- EditableConstraintWrapper is gone. All the logic in there has been
moved into the new `useEditableConstraint` hook. Previously it was split
between the wrapper, editableConstraint itself, the legalValues
component.
- the `useEditableConstraint` hook accepts a constraint and a save
function and returns an editable version of that constraint, the
validator for input values, a function that accepts update commands,
and, when relevant, existing and deleted legal values.
- All the logic for updating a constraint now exists in the
`constraint-reducer` file. As a pure function, it'll be easy to unit
test pretty thoroughly to make sure all commands work as they should
(tests will come later)
- The legal values selector has been dumbed down consiberably as it no
longer needs to create its own internal weak map. The internal
representation of selected values is now a set, so any kind of lookup is
now constant time, which should remove the need for the extra layer of
abstraction.

## Discussion points

I know the reducer pattern isn't one we use a *lot* in Unleash, but I
found a couple examples of it in the front end and it's also quite
similar to how we handle state updates to change request states. I'd be
happy to find a different way to represent it if we can keep it in a
single, testable interface.

Semi-relatedly: I've exposed the actions to submit for the updates at
the moment, but we could map these to functions instead. It'd make
invocations a little easier (you wouldn't need to specify the action
yourself; only use the payload as a function arg if there is one), but
we'd end up doing more mapping to create them. I'm not sure it's worth
it, but I also don't mind if we do 💁🏼
2025-05-09 11:47:22 +02:00
Nuno Góis
bfc583b5b7
chore: prevent duplicate key errors in unknown flags (#9940)
https://linear.app/unleash/issue/2-3561/fix-duplicate-key-errors-in-unknown-flags

This should prevent `duplicate_key` errors in unknown flags.

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-09 10:02:38 +01:00
Jaanus Sellin
8b115122fc
chore: fix strategy tests (#9922)
This is still in progress.
2025-05-09 11:10:45 +03:00
Mateusz Kwasniewski
43efaf7c47
feat: report feature links by domain (#9936) 2025-05-09 09:39:15 +02:00
Mateusz Kwasniewski
857ee7da5c
feat: prevent more than 10 links in the UI and backend (#9937) 2025-05-08 21:21:28 +02:00
Thomas Heartman
c72f39bb4f
chore: make operator checking more ergonomic and type-ful (#9932)
This is a helper PR for a refactor I'm working on for the new constraint
inputs. In the refactoring, it's useful to have individual subtypes for
the various subgroups of operators and to be able to easily assert
whether something is X operator or not.

The only change required in the code base is a single check for
operators, which is now handled by using the new `isXOperator` functions
instead.

Yes, the operator file in constants now includes functions, but it
seemed useful to put the identification functions there instead of
somewhere unrelated. The tests are primarily to ensure that the
identifier function works, and I'd be happy to remove them if we think
it's necessary. That said, they're pretty simple unit tests, so I think
it's fine to leave them.

The main bulk of the change is: removing the explicit `: Operator[]`
typing to the various sub-sets of operators and instead adding explicit
types. Additionally, there's the new identifier functions.
2025-05-08 14:10:57 +02:00
Mateusz Kwasniewski
a3ac624deb
feat: report top used domains (#9934) 2025-05-08 14:06:10 +02:00
Tymoteusz Czech
499ee1e099
migration: project settings - external link templates (#9933) 2025-05-08 13:51:21 +02:00
Mateusz Kwasniewski
28e5f39548
feat: store domain for links (#9931) 2025-05-08 13:33:41 +02:00
Mateusz Kwasniewski
9ca44e6188
feat: add domain to links (#9930) 2025-05-08 13:20:47 +02:00
Mateusz Kwasniewski
3865fb41ae
fix: project environments have info about required approvals (#9929) 2025-05-08 11:37:15 +02:00
Mateusz Kwasniewski
c8ebaa49fc
feat: order links by insertion order (#9928) 2025-05-08 10:46:26 +02:00
Mateusz Kwasniewski
dea785fb96
feat: edit link UI (#9926) 2025-05-08 10:25:47 +02:00
Gastón Fournier
919db76629
chore: ignore sample cdn url (#9925)
This url is used as an example in a page
2025-05-08 08:42:33 +01:00
David Leek
d15456a76a
chore: use tokenname instead of username in frontend for api-token creation (#9891) 2025-05-08 09:20:19 +02:00
Mateusz Kwasniewski
dac5a5e596
feat: delete link UI (#9923) 2025-05-07 15:58:51 +02:00
sjaanus
471cef1f29
chore: fix strategy tests 2025-05-07 16:12:53 +03:00
Mateusz Kwasniewski
206d5ed121
feat: shared add link dialogue for 2 paths (#9920) 2025-05-07 14:07:58 +02:00
Mateusz Kwasniewski
193c6274fc
chore: generate orval types (#9919) 2025-05-07 13:37:58 +02:00
Mateusz Kwasniewski
36c8efceae
feat: add link ui (#9918) 2025-05-07 13:24:59 +02:00
Nuno Góis
eb238f502a
chore: unknown flags (#9837)
https://linear.app/unleash/issue/2-3406/hold-unknown-flags-in-memory-and-show-them-in-the-ui-somehow

This PR introduces a suggestion for a “unknown flags” feature.

When clients report metrics for flags that don’t exist in Unleash (e.g.
due to typos), we now track a limited set of these unknown flag names
along with the appnames that reported them. The goal is to help users
identify and clean up incorrect flag usage across their apps.

We store up to 10 unknown flag + appName combinations, keeping only the
most recent reports. Data is collected in-memory and flushed
periodically to the DB, with deduplication and merging to ensure we
don’t exceed the cap even across pods.

We were especially careful to make this implementation defensive, as
unknown flags could be reported in very high volumes. Writes are
batched, deduplicated, and hard-capped to avoid DB pressure.

No UI has been added yet — this is backend-only for now and intended as
a step toward better visibility into client misconfigurations.

I would suggest starting with a simple banner that opens a dialog
showing the list of unknown flags and which apps reported them.

<img width="497" alt="image"
src="https://github.com/user-attachments/assets/b7348e0d-0163-4be4-a7f8-c072e8464331"
/>
2025-05-07 11:48:36 +01:00
Mateusz Kwasniewski
2b73b17579
feat: feature links section (#9915) 2025-05-07 11:35:41 +02:00
Github Actions Bot
b322afb097 6.10.0 2025-05-07 07:51:51 +00:00
Github Actions Bot
0784ce4f1f docs: Update CHANGELOG.md 2025-05-07 07:51:39 +00:00
Jaanus Sellin
d3cb8759c9
fix: make setConstraints work in editable constraints list (#9913)
Was missing implementation for addConstraint through ref.

Added it together with test.
2025-05-07 09:49:22 +03:00
Mateusz Kwasniewski
20a80142d3
feat: normalize urls in feature links (#9911) 2025-05-06 19:08:04 +02:00
Ivar Conradi Østhus
28373f5e37
fix: namespace flag-repo for unleash sdk (#9910)
Did two things:

1. Use basePath to prefix the Unleash repo used with the Unleash
Frontend SDK.
2. Use JSON.stringify as key for useEffect to avoid potential render
loop
2025-05-06 19:05:06 +02:00
Thomas Heartman
a7118e0c18
chore(1-3639): constraint validation (#9909)
Implements client-side validation of constraint values before you can
add them to a constraint.

I've removed the extra server-side validation that used to happen for
each specific constraint, because the surrounding form itself uses
server side validation to check every constraint every time there's a
change. This is what controls disabling the submit button etc.

I wanna make the next PR a bit of a followup cleanup now that it's
clearer what properties we do and don't need.
<img width="371" alt="image"
src="https://github.com/user-attachments/assets/7c98708f-fcbe-40ca-8590-bb0f5b2ad167"
/>
<img width="361" alt="image"
src="https://github.com/user-attachments/assets/503d4841-d910-4e8e-b0ef-a3d725739534"
/>
2025-05-06 15:21:33 +02:00
David Leek
681079bd08
chore: clean up adminNavUI flag (#9907) 2025-05-06 14:59:07 +02:00
Mateusz Kwasniewski
b9f1d8414c
feat: add links to feature read model (#9905) 2025-05-06 14:57:52 +02:00
Jaanus Sellin
8e05c92440
chore: align recently used constraints to designs (#9904)
Now both of the recents have aligned styling.
Now ConstraintAccordionView accepts dashed and solid borders.


![image](https://github.com/user-attachments/assets/89fefaf5-4acc-41b0-aa7b-efb1d5e1eb63)
2025-05-06 15:42:38 +03:00
Jaanus Sellin
8d377f76b7
chore: remove dead code (#9906) 2025-05-06 15:42:27 +03:00
Jaanus Sellin
dcb58de728
chore: clean dead code (#9903)
When looking at the big removal PR, I knew we missed something.

https://github.com/Unleash/unleash/pull/9888
2025-05-06 14:29:53 +03:00
Fredrik Strand Oseberg
db90ad9c6c
feat: enterprise consumption billing (#9862)
Initial PR that adds logic for displaying a link to stripe to view
consumption based pricing in the billing overview

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2025-05-06 13:15:31 +02:00
Mateusz Kwasniewski
c6ab2a1cf7
feat: sql feature link persistence (#9901) 2025-05-06 11:46:15 +02:00
Mateusz Kwasniewski
bb82b6920b
feat: feature link migration (#9900) 2025-05-06 11:21:20 +02:00
Jaanus Sellin
79abbc832f
feat: recently used segment chip (#9895) 2025-05-06 11:56:46 +03:00
Tymoteusz Czech
af93f93836
refactor: remove flagOverviewRedesign flag (#9888)
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-05-06 10:25:57 +02:00
renovate[bot]
6a2953f768
chore(deps): update dependency vite to v5.4.19 [security] (#9899)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [vite](https://vite.dev)
([source](https://redirect.github.com/vitejs/vite/tree/HEAD/packages/vite))
| [`5.4.18` ->
`5.4.19`](https://renovatebot.com/diffs/npm/vite/5.4.18/5.4.19) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/vite/5.4.19?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vite/5.4.19?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vite/5.4.18/5.4.19?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vite/5.4.18/5.4.19?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

### GitHub Vulnerability Alerts

####
[CVE-2025-46565](https://redirect.github.com/vitejs/vite/security/advisories/GHSA-859w-5945-r5v3)

### Summary
The contents of files in [the project
`root`](https://vite.dev/config/shared-options.html#root) that are
denied by a file matching pattern can be returned to the browser.

### Impact

Only apps explicitly exposing the Vite dev server to the network (using
--host or [server.host config
option](https://vitejs.dev/config/server-options.html#server-host)) are
affected.
Only files that are under [project
`root`](https://vite.dev/config/shared-options.html#root) and are denied
by a file matching pattern can be bypassed.

- Examples of file matching patterns: `.env`, `.env.*`, `*.{crt,pem}`,
`**/.env`
- Examples of other patterns: `**/.git/**`, `.git/**`, `.git/**/*`

### Details

[`server.fs.deny`](https://vite.dev/config/server-options.html#server-fs-deny)
can contain patterns matching against files (by default it includes
`.env`, `.env.*`, `*.{crt,pem}` as such patterns).
These patterns were able to bypass for files under `root` by using a
combination of slash and dot (`/.`).

### PoC
```
npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173
```


![image](https://redirect.github.com/user-attachments/assets/822f4416-aa42-461f-8c95-a88d155e674b)

![image](https://redirect.github.com/user-attachments/assets/42902144-863a-4afb-ac5b-fc16effa37cc)

---

### Release Notes

<details>
<summary>vitejs/vite (vite)</summary>

###
[`v5.4.19`](https://redirect.github.com/vitejs/vite/releases/tag/v5.4.19)

[Compare
Source](https://redirect.github.com/vitejs/vite/compare/v5.4.18...v5.4.19)

Please refer to
[CHANGELOG.md](https://redirect.github.com/vitejs/vite/blob/v5.4.19/packages/vite/CHANGELOG.md)
for details.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "" in timezone Europe/Madrid,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjQuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI2NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-06 08:15:37 +00:00
hypermod-io[bot]
9d6c18b94a
Welcome to Hypermod (#9897)
Welcome to Hypermod! 🚀

This PR introduces the Hypermod Workflow File which connects the
repository to Hypermod.
The workflow will be triggered by Hypermod when a deployment is
requested, which then uses Hypermod CLI to apply automated code
transformations to your source files.
After the transformations is complete, diffs are collected and a pull
request is created.

Please review the changes and merge this PR to connect.

For more information, visit
[Hypermod](https://hypermod.io/docs/installation).

Co-authored-by: Christopher Kolstad <chriswk@fastmail.com>
2025-05-06 08:09:07 +00:00
Mateusz Kwasniewski
4860d73bf7
chore: feature links flag (#9896) 2025-05-06 09:46:18 +02:00
Mateusz Kwasniewski
002233e7f6
feat: feature link backend stub (#9893) 2025-05-06 09:31:45 +02:00
David Leek
1166d00e6d
chore: flag cleanup simplifyDisableFeature (#9892) 2025-05-06 08:41:03 +02:00
Melinda Fekete
7ca79c1b84
docs: update self-hosting guide (#9855) 2025-05-05 15:57:17 +02:00
Melinda Fekete
c0e30deafb
docs: remove roadmap from footer (#9890)
Remove Product Roadmap from footer and add Product Vision
2025-05-05 15:02:05 +02:00
Thomas Heartman
bc342c5b13
chore(1-3679): use numeric input mode for numbers. (#9875)
Adds inputmode='decimal' to input fields with number input. As discussed
on the [GOV.UK
blog](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/),
this finds a balance between giving numeric input options to mobile
devices and improving validation / user experience.

They mention this bit in their [design system
guideline](https://design-system.service.gov.uk/components/text-input/#numbers)

> Do not use `<input type="number">` unless your user research shows
that there’s a need for it. With `<input type="number">` there’s a risk
of users accidentally incrementing a number when they’re trying to do
something else - for example, scroll up or down the page. And if the
user tries to enter something that’s not a number, there’s no explicit
feedback about what they’re doing wrong.

I've purposefully not included the `pattern="[0-9]*"` attribute here,
because the browser error messages conflict with our own and have
several drawbacks in terms of accessibility according to Adrian
Roselli's ["Avoid default field
validation"](https://adrianroselli.com/2019/02/avoid-default-field-validation.html).

Instead, the validation here will be part of the validation handling
later.

Also, I've opted for using `decimal` instead of `numeric`, because we
allow you to store decimal values and that inputmode also adds the
decimal separator to the keyboard. As always, however, there's
complications: several languages (including Norwegian) use a comma as a
decimal separator instead of a period, so the keyboard will likely
contain numbers and a comma instead of a period. This is a problem
because JS doesn't recognize "45,6" as a valid number. I've added a
follow-up task to look into this. I thought at first it would just be
expanding the validation, but because it's stored as a string on the
back end and the SDKs presumably parse it, we can't just suddenly allow
commas as decimal separators.
2025-05-05 11:30:52 +02:00
Jaanus Sellin
33f23cc0c1
feat: recently used segments (#9881) 2025-05-05 10:15:43 +03:00
Thomas Heartman
832e3f2e79
Add input help text (#9883)
Adds help text to the popover input for free text values, single numeric
and semver values. The help text is in addition to the error text (so
you can get both).

Also makes the add button a little narrower to better match sketches.

## Rendered

Multiple values (free text):
<img width="953" alt="image"
src="https://github.com/user-attachments/assets/1d9bf7da-af8c-46b6-8eae-ae4f8a687363"
/>

With error
<img width="936" alt="image"
src="https://github.com/user-attachments/assets/aa9dc2da-ad9f-43da-9e44-c36fd8344df1"
/>

Numeric operators:
<img width="927" alt="image"
src="https://github.com/user-attachments/assets/f1e8afd8-7051-4691-bdd2-810929ccd4fa"
/>



SemVer operators:

<img width="944" alt="image"
src="https://github.com/user-attachments/assets/655a7a7b-a4a4-468c-8a5d-23e5d38375b8"
/>
2025-05-02 15:47:29 +02:00
Thomas Heartman
3d84001273
1-3687/input mode separation (#9882) 2025-05-02 12:30:38 +02:00
Mateusz Kwasniewski
1b9c0e5000
feat: bulk apps should respect multi projects and multi envs (#9879) 2025-05-02 10:12:41 +02:00