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

2970 Commits

Author SHA1 Message Date
unleash-bot[bot]
f7fcd1c4df
chore(AI): registerFrontendClient flag cleanup (#10297) 2025-07-03 10:52:48 +02:00
Jaanus Sellin
48efcefba7
fix: remove console log from tests (#10292)
One thing that can make tests fail is console.out, as it produces IO.
2025-07-03 10:07:53 +03:00
Jaanus Sellin
778fb2ee17
feat: now also sorting by id if in same transaction/date (#10290)
Also sort events by id, so they will be in correct order if done inside
transaction.
2025-07-03 09:26:38 +03:00
Jaanus Sellin
7e85de8f65
feat: now it is possible to search events by group id (#10275)
Now when you put group ID as query param, it will filter based on
transaction id.

I am not sure if its best naming, whether it should be groupId or
transactionId, I will leave as group for now, but its simple change
later.


![image](https://github.com/user-attachments/assets/e0caaf57-f93f-40ee-a332-d3aed249c4ca)
2025-07-02 10:16:13 +03:00
Nuno Góis
a251a9808a
fix: private projects visibility for users in editor and admin groups (#10265)
https://linear.app/unleash/issue/2-3665/viewer-role-in-admin-group-cannot-access-private-projects

Fixes a bug where private projects were not visible for viewers that
belonged to Editor or Admin groups.
2025-07-01 17:16:52 +01:00
David Leek
a748502f7d
chore(email): improve the approve request email message (#10264) 2025-07-01 15:23:39 +02:00
Jaanus Sellin
0e5080fac5
feat: start showing CR id in UI and make it clickable (#10259)
![image](https://github.com/user-attachments/assets/72c631aa-0b60-42c1-b546-870962a3e885)
2025-07-01 12:50:49 +03:00
Mateusz Kwasniewski
661fd6febf
feat: bulk impact metrics (#10251) 2025-07-01 09:50:44 +02:00
Jaanus Sellin
681ce3bfd9
feat: start storing every transaction id in events table (#10236)
Every time an event gets inserted, we check if there is transaction
data, that we can include.
2025-06-30 16:00:57 +03:00
Christopher Kolstad
873d64e84b
task: Added name and email of requester to track down spammers (#10235)
As the title says. This adds name and email of requester to CR approval
mails. This will hopefully have users complain to their coworkers rather
than Unleash if they get too many mails.
2025-06-30 09:54:55 +00:00
Jaanus Sellin
2d2ba4ae25
feat: start storing event group type and id (#10233)
Simple 2 columns for event type and event id.

I thought about adding check for type, but decided to handle checking in
backend code.

Currently the types will be

1. transaction
2. change-request

And ID is ulid
2025-06-30 12:50:51 +03:00
Thomas Heartman
4eedf88627
add crDiffView to Unleash (#10228)
This change adds the `crDiffView` flag to Unleash, potentially enabling
the new JSON diff tab in change request changes instead of the "view
json diff" hover functionality.
2025-06-27 11:24:44 +02:00
Jaanus Sellin
c5b6ee75f3
feat: transaction grouping, use ulids and strings (#10230)
Replace generating random number id based on timestamp and now use
ulids.
2025-06-27 11:45:17 +03:00
Jaanus Sellin
8c1c9076b3
feat: add transaction context store (#10211)
Create transaction context, that generates a random ID for each
transaction, but also allows you to define your own id, for example
change-request.
2025-06-27 11:04:52 +03:00
Nuno Góis
e624413e19
chore: update Slack App to App for Slack (#10218)
https://linear.app/unleash/issue/2-3640/update-unleashs-integration-and-docs-accordingly

Updates "Slack App" to "App for Slack" to satisfy Slack Marketplace
requirements.

This is a follow up to:
- https://github.com/Unleash/unleash-slack-app/pull/7
- https://github.com/Unleash/unleash-slack-app/pull/9
- https://github.com/Unleash/unleash-slack-app/pull/10
2025-06-26 15:33:49 +01:00
Gastón Fournier
0f9774800e
feat: ability to search events by type with pagination (#10217)
This helps us to use this feature to implement partial user sync by
observing the changes in the audit log
2025-06-26 14:42:29 +02:00
Christopher Kolstad
67f81d5d0b
task: added new event for updated requested approvers list (#10216) 2025-06-26 11:46:32 +02:00
Mateusz Kwasniewski
550262d3b0
chore: bring back impact metrics (#10212) 2025-06-25 17:03:09 +02:00
Mateusz Kwasniewski
45efcf8078
fix: impact metrics undefined (#10210) 2025-06-25 14:48:07 +02:00
Mateusz Kwasniewski
abcc9248e2
feat: impact metrics resolver (#10209) 2025-06-25 13:52:35 +02:00
Mateusz Kwasniewski
7c31ec71a1
feat: Count errors and gauge for heap memory (#10203) 2025-06-25 08:03:15 +02:00
Mateusz Kwasniewski
3f9db9195c
feat: count created feature links with impact metrics (#10201) 2025-06-24 13:18:06 +02:00
Mateusz Kwasniewski
b33765bc2b
feat: expand resolver interface with impact metrics (#10199) 2025-06-23 13:37:33 +02:00
Tymoteusz Czech
daa6461d9b
chore: bulk metrics - remove a flag (#10190) 2025-06-23 13:25:25 +02:00
Christopher Kolstad
6aecc3f93e
task: added notified at to change request requested approvals (#10196)
Adding this should allow us to only notify users that haven't been
notified before.

Necessary because the change_added event does not include a preData that
allowed us to diff requestedApprovers based on the event alone.

Also added a index on this column, since we're going to be using it to
filter.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-23 10:51:47 +00:00
Ivar Conradi Østhus
2ecb4b0a4f
Chore/remove flag disable bulk toggle (#10183)
Prompt used:

![image](https://github.com/user-attachments/assets/17d35ab4-cc2c-4f90-9bee-7fdc3550e1ec)

LLM: Gemini 2.5 Pro (preview)

@kwasniew do we still need this kill-switch?
2025-06-20 13:18:50 +02:00
Mateusz Kwasniewski
632f3a04cb
feat: validate impact metrics (#10181) 2025-06-19 14:46:36 +02:00
Jaanus Sellin
40840c98cf
feat: support event id in search (#10176)
We added `id` as one of the query parameters for searching events.
2025-06-19 14:46:14 +03:00
Mateusz Kwasniewski
63a354ab6f
test: impact metrics e2e (#10178) 2025-06-19 12:34:22 +02:00
Simon Hornby
40c7c25db9
feat: ingest new impact metrics (#10169)
Accepts the new impact metrics into the singleton registry and then does
nothing with them. If the relevant flag is off, the metrics are stripped
from the existing metrics data format and dropped on the floor
2025-06-19 11:31:51 +02:00
Tymoteusz Czech
b356e23191
feat: add prometheusImpactMetricsApi option to configuration (#10168)
API url, similar to `config.prometheusApi`, for impact metrics
2025-06-18 17:53:08 +02:00
Gastón Fournier
967df825cb
feat: do not lock until migrations are needed (#10170) 2025-06-18 17:40:21 +02:00
Mateusz Kwasniewski
2444bd7ccd
test: impact metrics collection e2e (#10162) 2025-06-18 13:44:55 +02:00
Christopher Kolstad
4c13bd63ee
task: added requested cr approval email template and emailService method (#10161)
Initial template and emailService method in place here.
2025-06-18 13:26:48 +02:00
Christopher Kolstad
ce8d49be10
task: added table for requested approvers for CRs (#10159)
As part of the task to make it possible to send notifications to
approvers for a CR, this PR adds a table that can link users to CRs
they've been requested to make an approval for.
2025-06-18 11:52:29 +02:00
Mateusz Kwasniewski
6f7f48a361
Revert "chore: use logger instead of console.error" (#10153)
Reverts Unleash/unleash#10150
2025-06-17 17:20:39 +02:00
Gastón Fournier
0bad9101fc
chore: use logger instead of console.error (#10150) 2025-06-17 15:37:57 +02:00
Mateusz Kwasniewski
02876a1c08
feat: expose impact metrics (#10151) 2025-06-17 14:17:46 +02:00
Thomas Heartman
c619cb9ec5
chore(1-3835): improve json diff view (#10146)
Replaces the existing JSON diff implementation we use with
`json-diff-react` (35kb unpacked, according to npm), a react-fork of the
popular `json-diff` library. The change is behind a new flag.

The new library has several advantages:
- nicer formatting (including nested objects)
- we don't need to calculate the diff manually anymore
- option to hide/reveal unchanged properties

There's still a few more things to put in place (such as handling of no
changes) and overflow handling when you have very long properties.

Here's a few comparison screenies:

Old (below) vs new (above):

![image](https://github.com/user-attachments/assets/466472cc-9499-4d22-8f62-e3f9096496d1)

Fold and unfold:

![image](https://github.com/user-attachments/assets/3d213aee-a3a6-42e2-8fbb-0133276aa790)

![image](https://github.com/user-attachments/assets/3f7d7aeb-5835-4f32-9d6e-97cf09df1c0e)

In change requests:

![image](https://github.com/user-attachments/assets/c529ff8c-05c8-4ec7-a49d-ac58a1eeea98)

Strategy re-ordering:
Folded:

![image](https://github.com/user-attachments/assets/26ef905d-c766-4982-be9a-83ff15260e23)

Unfolded:

![image](https://github.com/user-attachments/assets/d2e212c3-351c-42fe-a645-ec8e9c71146e)

Old:

![image](https://github.com/user-attachments/assets/041310b0-149b-417a-a724-8d37f1ad44f7)
2025-06-17 12:01:17 +02:00
Mateusz Kwasniewski
d2b9751e01
feat: translate impact metrics to prom format (#10147) 2025-06-17 11:52:41 +02:00
Christopher Kolstad
c165e87d74
chore: now expose IFeatureUsageInfo to override telemetry checking (#10149)
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2025-06-17 11:27:47 +02:00
Christopher Kolstad
f0a2c335fb
task: added flag for CR approver emails (#10144) 2025-06-16 14:08:54 +02:00
Gastón Fournier
6afb9f8796
refactor: migrate from make-fetch-happen to ky and use ky natively (#10134)
Migrate from make-fetch-happen to ky

## Summary:

- Replaced all usages of make-fetch-happen with
[ky](https://github.com/sindresorhus/ky) for HTTP requests.
- Upgraded nock to v14 so it's capable of mocking native fetch
implementation
- Removed the make-fetch-happen dependency
- Ensured all fetch logic is compatible with ky API.

## Why:

- ky provides a modern, lightweight, and promise-based HTTP client with
a simpler API.
- Reduces dependencies and simplifies codebase.

## Testing:

We'll do testing in sandbox environment of the modified functionality
(which is not much) and we also rely on automated testing.

---------

Co-authored-by: Simon Hornby <simon@getunleash.io>
2025-06-13 15:30:47 +02:00
Christopher Kolstad
c13ab85b1c
feat: report hostedBy and licenseType (#10141)
Added two new fields to FeatureInfo (what gets reported as telemetry)
reporting license type and hostedBy. Will be overriden in Enterprise.
2025-06-13 12:44:21 +00:00
Nuno Góis
dbc34a10bd
chore: remove flag enterprise-payg (#10139)
https://linear.app/unleash/issue/2-3602/clean-up-flag-enterprise-payg

Removes
[enterprise-payg](https://app.unleash-hosted.com/hosted/projects/eg/features/enterprise-payg)

Doesn't seem like this is being used anywhere.
2025-06-13 12:05:48 +01:00
Nuno Góis
3467dfbdb8
chore: remove flag newGettingStartedEmail (#10136)
https://linear.app/unleash/issue/2-3601/clean-up-flag-newgettingstartedemail

Removes
[newGettingStartedEmail](https://app.unleash-hosted.com/hosted/projects/eg/features/newGettingStartedEmail)

Related: 
 - https://github.com/Unleash/unleash/pull/9980
 - https://github.com/Unleash/unleash/pull/9997
 - https://github.com/Unleash/unleash/pull/9998
 - https://github.com/Unleash/unleash/pull/10029
2025-06-13 10:24:13 +01:00
Christopher Kolstad
b70f862f93
fix: md5 is deprecated and fails FEDRAMP. Replace with sha256 (#10125)
#10121 points out that we're using md5 functions still. This PR updates
our migrations to no longer use md5 at all (so if you haven't run the
migrations, you won't get email hashes until you get to the included
migration with this PR). If you've already run the migrations, we'll
drop the existing `email_hash varchar(32)` column and replace it with a
`email_hash TEXT` column.

We're also replacing the md5 function with `encode(sha256(email),
'hex')`. encode has been supported since PG10, sha256 came with PG11.

Do we want an index on the email_hash? I wasn't sure, but if we want to
do lookup we probably should have an index on it (though not a unique
one)
2025-06-13 09:41:40 +02:00
Gastón Fournier
37a125f0b5
feat: ability to query users with pagination (#10130)
Made a few QoL improvements:
- Don't use default export for class
- Move users store to a feature package (didn't move the interface as it
might be referenced elsewhere)
- Add types for query builders (and ts-expect-error when needed)
2025-06-12 17:43:22 +02:00
Tymoteusz Czech
4e48d90ed8
fix: use technicalDebt property from backend (#10111)
Frontend should load `technicaDebt` from backend instead of
re-calculating it.
2025-06-12 16:50:29 +02:00
Nuno Góis
75a8b49609
chore: update Slack App URL (#10129)
https://linear.app/unleash/issue/2-3600/update-slack-app-url-to-slack-appgetunleashio

Updates the Slack App URL to: https://slack-app.getunleash.io
2025-06-12 12:04:08 +01:00
Thomas Heartman
7e61e0dd09
Chore(1-3807)/remove flag add edit strategy take2 (#10108)
Removes all usages of flag addEditStrategy and refactors code where
necessary.

This is only the first step of the cleanup. After this, there's still
lots of code to be removed. I've got a different PR that removes ~5k
lines of code (https://github.com/Unleash/unleash/pull/10105) that I
want to reach in pieces to make sure that everythnig works on the way
there.
2025-06-11 06:03:34 +00:00
Tymoteusz Czech
1e7d022b5a
chore: remove flag sideMenuCleanup (#10093)
- remove flag
- remove unused components
- adjust e2e test snapshots
2025-06-10 12:23:47 +02:00
David Leek
ffe40cab59
chore: hide/disallow new instances of deprecated integrations (#10104) 2025-06-10 12:19:37 +02:00
Christopher Kolstad
7f14cc2c3d
task: bump minimum postgres version (#10096)
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2025-06-09 11:04:47 +02:00
Tymoteusz Czech
a5e5ea0436
feat: update backend to include technicalDebt field (#10088)
Deprecate `health` for a more descriptive `technicalDebt` in project-related services and schemas.
2025-06-06 16:27:41 +02:00
Thomas Heartman
c739ea71cf
Fix(1-3804)/store flag creation form state (#10089)
Adds caching via localstorage to the flag creation form, so that if you
(accidentally) close the form before submitting it, you'll retain (most)
of the same data when you reopen it.

Specifically, we'll store:
- name
- description
- type
- tags
- impression data

We can't store the project as it is now, because it gets overridden by
whatever is in the URL. However, this is probably a good thing. It means
that if you navigate to a different project and open the feature
creation form there, it'll retain everything from the last one, but
it'll use the current project.

The stored data is cleared when you successfully create a feature, so
that you don't get dangling data.

The data is also stored in a shared cache for all projects, so that you
don't have different caches per project.

The behavior of seeding the form is hidden behind a flag (that doesn't
exist yet). We'll still read and write to the cache if the flag is off,
but we won't use it to populate the feature form, so it has no
discernible impact on the user.

## Bug detected 🐛  ... and squashed

Working on this, I came to realize that there was a bug in how the
config button and use feature form hooks interacted. We (in this case
probably me) have assumed that it's fine to use a set for any option
checking in the config buttons. Also, we're using a set to store tags in
the feature form. But objects aren't compared by value in JS, so the set
will happily accept multiple instances of the same tag. Likewise, these
tags won't show up as selected in the dropdown because when the dropdown
checks if the set `has` the value, it's using reference equality.

To get around this, I have normalized the values of the Tags set to
strings (`<type>:<value>`), which are easily comparable.

We can iterate on this later if we need to.

## `useLocalStorageState`

In doing this, I have also made a change to the useLocalStorageState
hook:
the exposed "setState" function now writes to the localstorage
immediately. This is because the useEffect method might not have time to
save the data if the component unmounts (this was the case with the flag
dialog).

However, I have kept the useEffect because it gets run on component
mount and then only when it changes. This means that we will get double
saves to localstorage, but it'll be with the same data, so it's benign.


I've tried out two other uses of the hook (event timeline props and
environment columns in the project flags table) and see no discernible
difference in behavior.

## `useFeatureForm`

I have also made a change to the useFeatureForm hook and removed a
`useEffect` that would reset the name to whatever you passed in as the
initial name if you cleared it out. This essentially meant that you
couldn't clear the name completely, because it would just refill with
the initial name.

As far as I can tell, there is no need to have this sticking around
anymore. The hook is only used in two places: the flag creation dialog
and the flag edit page. The flag edit page doesn't allow you to change
the name anyway and it was causing issues in the dialog. It's likely a
holdover from the way something worked 3 years ago. Both the dialog and
the edit screen seem to work just fine with this change.

I have also changed the function parameters from ordered parameters to
an object. There's so many of them that even you don't think it's a good
idea to use objects when you have multiple params with the same type,
it's just nigh-impossible to remember the order by now.

## Minor changes

Additionally, I came across three issues that were causing react errors,
and have fixed them.
1. we'd forgotten to interpolate a variable and just used the variable
name in a string instead
2. an html attribute that doesn't exist (`aria-role` instead of `role`)
3. Providing a disabled button inside a tooltip. I've seen this one
around for ages and it prevented tooltips from working on disabled
buttons. The solution was wrapping it in a span.
2025-06-06 13:01:16 +02:00
Gastón Fournier
bdb763c9d5
chore!: remove deprecated default env from new installs (#10080)
**BREAKING CHANGE**: DEFAULT_ENV changed from `default` (should not be
used anymore) to `development`

## About the changes
- Only delete default env if the install is fresh new.
- Consider development the new default. The main consequence of this
change is that the default is no longer considered `type=production`
environment but also for frontend tokens due to this assumption:
724c4b78a2/src/lib/schema/api-token-schema.test.ts (L54-L59)
(I believe this is mostly due to the [support for admin
tokens](https://github.com/Unleash/unleash/pull/10080#discussion_r2126871567))
- `feature_toggle_update_total` metric reports `n/a` in environment and
environment type as it's not environment specific
2025-06-06 12:02:21 +02:00
Gastón Fournier
f1c2706db7
chore: prepare to remove default env (#10087)
Use DEFAULT_ENV instead of just 'default'
2025-06-06 09:20:16 +02:00
David Leek
ae47771290
chore: remove deprecation of instance stats endpoint (#10083) 2025-06-04 14:48:20 +02:00
David Leek
1aadbb3641
chore(apitoken)!: remove ILegacyApiTokenCreate (#10072) 2025-06-04 11:41:37 +02:00
Christopher Kolstad
8d7a0fdd7f
chore(adminapi)!: Remove deprecated project overview (#10069)
BREAKING CHANGE: As part of the preparation for a new major (7.0) this
removes /api/admin/projects/{projectId} endpoint. It has been deprecated
since 5.8, and we don't use it anymore in our frontend.
2025-06-04 09:59:36 +02:00
Jaanus Sellin
cf87f8cfe1
feat: make lifecycle trends more detailed (#10079)
##  PR Summary: Update `lifecycle_trends` Table Schema

###  What Changed

- **Updated `stage` column constraint**
- **Old values:** `'initial', 'develop', 'production', 'cleanup',
'archived'`
- **New values:** `'initial', 'pre-live', 'live', 'completed',
'archived'`

- **Replaced `flag_type` CHECK constraint with a foreign key**
  - Removed hardcoded values: `'experimental', 'release', 'permanent'`
  - Added foreign key:
    ```sql
FOREIGN KEY (flag_type) REFERENCES feature_types(id) ON DELETE CASCADE
    ```

- **Added down migration** to:
  - Restore original `stage` constraint
- Drop the foreign key on `flag_type` and re-add the original CHECK
constraint

### 💡 Why

- Align `stage` values with lifecycle model
- Use the `feature_types` table to ensure referential integrity
2025-06-04 10:32:32 +03:00
Gastón Fournier
5019f4fcbc
chore!: removing userId strategy for new installations of Unleash (#9800)
This removes a strategy that was already deprecated, but only for new
installations.

I tested starting with an installation with this strategy being used and
then updating, and I was still able to edit the strategy, so this should
not impact current users.

On a fresh install the strategy is no longer available.

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2025-06-04 09:30:13 +02:00
Christopher Kolstad
8050f25add
chore(adminapi)!: Remove feature variant endpoints (#10071)
BREAKING CHANGE: This removes the
GET /api/admin/projects/{project}/features/{featureName}/variants 
PATCH /api/admin/projects/{project}/features/{featureName}/variants 
PUT /api/admin/projects/{project}/features/{featureName}/variants
endpoints

Users should move to environment or strategy specific variant methods
rather than feature level variant methods.
2025-06-04 09:09:52 +02:00
Mateusz Kwasniewski
0819b2cf32
chore: remove link flags (#10076) 2025-06-03 13:47:24 +02:00
Mateusz Kwasniewski
68660e1e1f
chore: remove flag removeInactiveApplications (#10075) 2025-06-03 13:22:11 +02:00
Mateusz Kwasniewski
280c9c3f64
chore: remove flag cleanup reminder (#10074) 2025-06-03 13:13:51 +02:00
Nuno Góis
6d70265edd
chore: clean up project related tech debt (#10065)
https://linear.app/unleash/issue/2-3581/remove-project-related-legacy-code

Identified some clean up opportunities during deprecated endpoint
removal, mostly related to project insights.
2025-06-03 09:21:55 +01:00
Jaanus Sellin
e474abb946
feat: lifecycle trends migration (#10066)
Adding a single table to capture all lifecycle trends data.

One field presents a challenge: `median_time_in_stage_days`. This value
is calculated per `stage`, not per `flag_type`. As a result, we would
need to duplicate the total median time across each flag type. This
isn’t a major issue.

An alternative would be to create a separate table solely for the median
values, but that seems like overkill.
2025-06-03 08:55:28 +03:00
Tymoteusz Czech
5be0b37cb1
fix: add event listeners for release plan updates in metrics (#10070)
Milestone changes should be visible in metrics, in the same way as
strategy changes are.
2025-06-02 12:40:10 +02:00
Gastón Fournier
63bf01d211
chore: print out 10 unknown flag names (#10062)
- Move logs, and replace a debug log with just the info log while adding
appName to it
- Print out at most 10 invalid flag names
2025-05-30 12:24:41 +02:00
Gastón Fournier
898073878b
chore!: remove isAPI from userSchema response (#10060)
isAPI is not needed for responses, removing it from the system is much
more complex, so I had to cut it with a scalpel...
2025-05-30 11:37:50 +02:00
Jaanus Sellin
d8c83fb824
fix: do not allow creating cr for same environment (#10010)
If there are two concurrent requests to create or edit change requests,
two separate ones may be created in parallel. The UI does not currently
handle this scenario, and if additional changes are made, they might be
added to a random existing change request—resulting in a messy and
unpredictable state.

This PR adds a unique index to the `change_requests` table 
```
on (created_by, project, environment)
WHERE state NOT IN ('Applied', 'Cancelled', 'Rejected', 'Scheduled').
```

In the extremely rare case where such conflicting data already exists in
a database, the migration will automatically cancel one of the
conflicting change requests.
2025-05-30 08:20:11 +03:00
Nuno Góis
eef32b7cf5
chore!: remove deprecated put project groups roles endpoint (#10059)
https://linear.app/unleash/issue/2-3361/remove-put-apiadminprojectsprojectidgroupsgroupidrolesroleid

Removes PUT
`/api/admin/projects/{projectId}/groups/{groupId}/roles/{roleId}` which
was deprecated in v5.5.
Also cleans up related code.
2025-05-29 14:03:59 +01:00
Gastón Fournier
600ee7ee80
feat: fail in dev when usign deprecated endpoints (#10058) 2025-05-29 12:44:00 +02:00
Gastón Fournier
241b7e8165
chore: simplify serving of static openapi assets (#10046)
Use existing public folder from frontend to serve opeanapi static
assets. We also benefit from frontend image optimizations
2025-05-28 19:14:55 +02:00
Gastón Fournier
ff83f934d5
feat: clean up old OAS and ability to add badges to descriptions (#10038)
## About the changes
This removes some old and unused files from an initial test of setting
up openapi that's currently not working:

![image](https://github.com/user-attachments/assets/5ed9b1bf-a3b1-48ec-9232-6e534e6ceb96)


Also, adds the ability of marking endpoints as (note, the endpoints are
made up just for illustration purposes):
- Enterprise only 

![image](https://github.com/user-attachments/assets/0f8768b3-051f-4dc5-89d9-f09b38d5ca4c)

- Beta: 

![image](https://github.com/user-attachments/assets/45a29b16-6063-4718-bda6-e6ac28061be5)

- Both: 

![image](https://github.com/user-attachments/assets/2ed8bc95-868b-4577-8f84-67b74e739a51)

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-05-28 13:14:00 +02:00
Nuno Góis
1f4aa0ed34
chore!: remove deprecated delete project groups roles endpoint (#10036)
https://linear.app/unleash/issue/2-3362/remove-delete-apiadminprojectsprojectidgroupsgroupidrolesroleid

Removes DELETE
`/api/admin/projects/{projectId}/groups/{groupId}/roles/{roleId}` which
was deprecated in v5.5.
Also cleans up related code.
2025-05-28 12:11:17 +01:00
Tymoteusz Czech
b111abc96f
feat: update sidebar navigation - refactors (#10037)
- added `sideMenuCleanup` flag
- extracted `SecondaryNavigation`, `SecondaryNavigationList` and
`MobileNavigationSidebar` into separate files
- hidden recent projects and flags
- renamed 'Insights' to 'Analytics'
2025-05-28 12:00:28 +02:00
Gastón Fournier
a302055bea
feat: add required cdn events (#10040)
## About the changes
Exposes configuration revision service UPDATE_EVENT constant so it can
be used, and we also add a new event for cdn token created
2025-05-28 09:39:59 +02:00
Nuno Góis
a419b8e098
chore: prefer searchEvents over deprecated methods (#10031)
https://linear.app/unleash/issue/2-3577/prefer-the-new-searchevents-method-over-deprecated-methods

We should favor our new `searchEvents` method over the other deprecated
methods. This PR removes these deprecated methods, replaces them with
the new `searchEvents` and `searchEventsCount` methods, and marks the
old endpoints as deprecated.

Follow-up to: https://github.com/Unleash/unleash/pull/10030
2025-05-27 16:19:10 +01:00
Jaanus Sellin
2879ce9dd6
fix: make revision id not be so reactive (#10032)
Unleash is being too reactive to events inside Unleash. We should not
update etag if feature is created or tag is added to feature.

This PR adds this condition and adds test for it.
2025-05-27 16:16:26 +03:00
Thomas Heartman
092c525531
chore: add lifecycleMetrics flag definition (#10033)
Adds the new lifecycleMetrics flag.
2025-05-27 11:53:22 +00:00
Nuno Góis
290ef6ca40
chore!: remove deprecated POST events search endpoint (#10030)
https://linear.app/unleash/issue/2-3368/remove-post-apiadmineventssearch-deprecated-in-610

Removes POST `/api/admin/events/search` which was deprecated in v6.1.
Also cleans up related code.
2025-05-27 09:12:36 +01:00
Nuno Góis
45434109a9
chore: don't include passwordLink if it's unleashUrl (#10029)
https://linear.app/unleash/issue/2-3572/fix-dont-include-passwordlink-if-its-the-same-as-unleashurl

In case we don't have password auth enabled (`passwordLink ===
unleashUrl`), we should see the alternative branch in our getting
started email:


e52fcd11e0/src/mailtemplates/getting-started-new/getting-started-new.html.mustache (L40-L45)

This change helps us validate this behavior within the
`newGettingStartedEmail`. If it works correctly for both cases (password
auth enabled/disabled) we can probably clean this up as part of our flag
removal.
2025-05-26 14:57:06 +01:00
Nuno Góis
e52fcd11e0
chore!: remove deprecated POST ui-config endpoint (#10027)
https://linear.app/unleash/issue/2-3472/remove-post-apiadminui-config-deprecated-in-690

Removes POST `/api/admin/ui-config` which was deprecated in v6.9.
Also cleans up related code.
2025-05-26 10:22:16 +01:00
Gastón Fournier
27781fea47
chore: remove console.log and reuse package scripts (#10025)
Make `start:dev` re-use `dev:backend`, the only difference is start:dev
runs a clean before running
2025-05-23 12:24:03 +02:00
Gastón Fournier
76b201e40e
feat: add migration for cdn_tokens (#10021) 2025-05-21 14:20:04 +00:00
Jaanus Sellin
5fb718efcd
feat: custom metrics poc (#10018)
Now we can receive custom metrics, return those for UI and have extra
prometheus endpoint for it.

---------

Co-authored-by: Christopher Kolstad <chriswk@getunleash.io>
2025-05-21 16:55:30 +03:00
Thomas Heartman
e118321bfb
chore: fix typo (#10016)
Fixes a typo error that snuck in
2025-05-19 11:10:16 +00:00
Thomas Heartman
9955267d39
Chore(1-3753)!: block deletion of context fields in use (#10005)
Blocks deletion of context fields that are in use and updates the
"active usage" count to exclude use in archived flags.

- Before allowing you to delete a context field, checks if it is in use
by any strategies. If so, returns a 409 error.
- Updates what we count as "in use" to exclude flags that have been
archived.

BREAKING CHANGE: Context fields can no longer be deleted if they are in
use by active (non-archived) flags.
2025-05-19 13:02:01 +02:00
Nuno Góis
8fae8fb8b3
chore: remove teams integration CR events flag (#10015)
https://linear.app/unleash/issue/2-3265/investigate-teams-integration-for-change-request-notifications

Removes the `teamsIntegrationChangeRequests` feature flag.

Follow-up to: https://github.com/Unleash/unleash/pull/9309
2025-05-16 15:06:53 +01:00
Tymoteusz Czech
b0954f213c
chore: remove flagsReleaseManagementUI and flagsOverviewSearch flags (#10011)
Removing the `flagsReleaseManagementUI` and `flagsOverviewSearch`
feature flags - we're keeping these enabled.
2025-05-16 15:13:32 +02:00
Gastón Fournier
e754212a39
docs: explain health API properly (#10009)
## About the changes
Our health implementation always returns GOOD if the server is up:
beb29f5b5b/src/lib/routes/health-check.ts (L46-L51)

Currently our documentation of the endpoint is misleading saying that it
will return BAD if unable to connect to PostgreSQL

Closes #9965
2025-05-16 12:38:27 +02:00
Gastón Fournier
beb29f5b5b
chore: stop using deprecated properties and lean on resourceLimits cfg (#9994)
This removes segmentValuesLimit and strategySegmentsLimit from
ui-config-schema, deprecated in 5.11.0
2025-05-16 09:41:04 +00:00
Christopher Kolstad
b681702b77
task: migrate tests to vitest
Vitest Pros:
* Automated failing test comments on github PRs
* A nice local UI with incremental testing when changing files (`yarn
test:ui`)
* Also nicely supported in all major IDEs, click to run test works (so
we won't miss what we had with jest).
* Works well with ESM

Vitest Cons:
* The ESBuild transformer vitest uses takes a little longer to transform
than our current SWC/jest setup, however, it is possible to setup SWC as
the transformer for vitest as well (though it only does one transform,
so we're paying ~7-10 seconds instead of ~ 2-3 seconds in transform
phase).
* Exposes how slow our tests are (tongue in cheek here)
2025-05-16 11:19:10 +02:00
Nuno Góis
4d1b44818f
chore: remove filterExistingFlagNames feature flag (#9957)
https://linear.app/unleash/issue/2-3564/remove-filterexistingflagnames-feature-flag

We're removing the `filterExistingFlagNames` feature flag since we've
decided we want this to be the default behavior.

We don't need to rush to merge it, just in case we need to disable this
for any reason. However it should also be pretty easy to just revert if
needed.

Changes in tests are a bit tricky since they assumed the previous
behavior where we always registered metrics, even for non existing flag
names. `cachedFeatureNames` is also memoized with a TTL of 10s, so the
easiest way to overcome this was to override `cachedFeatureNames` to
return what we expected. As long as they return the same flag names that
we expect, we're able to register their metrics.

Let me know if you can think of a better approach.
2025-05-16 08:52:27 +01:00
Thomas Heartman
082a03afd7
Fix(1-3485)/handle deleted constraints (#9999)
Improves handling of constraints in use that have been deleted.

This change implments a few small changes on both the front and the back
end on how we deal with constraints that have been deleted.

The most important change is on the back end, in the
`/constraints/validate` endpoint. We used to throw here if the
constraint couldn't be found, but the only reason we wanted to look for
the constraint in the db was to check for legal values. Now, instead,
we'll allow you to pass a constraint field that doesn't exist in the
database. We'll still check the values against the operator for
validity, we just don't control legal values anymore (because there
aren't any).

On the front end, we improve the handling by showing the deleted context
filed in the dropdown, both when the selector dropdown is closed and
when it is open. However, if you change the context field, we remove the
deleted field from the list. This seems like a sensible tradeoff. Means
you can't select it if you've deselected it.
2025-05-15 13:08:54 +02:00
Tymoteusz Czech
4d92d54f9a
feat: track last seen clients using bulk update (#9981)
Let's not update `lastSeen` in the db on each client call
2025-05-15 13:06:54 +02:00
Nuno Góis
45c2a0b939
chore: small visual improvements to the new invite mail template (#9998)
https://linear.app/unleash/issue/2-3567/improve-the-look-of-the-unleash-instance-getting-started-email

Some small visual improvements to the email template after the latest
changes.

Follow-up to: https://github.com/Unleash/unleash/pull/9997
2025-05-15 08:52:01 +01:00