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

2633 Commits

Author SHA1 Message Date
Jaanus Sellin
280710f22a
feat: delta rework (#9133)
We are changing how the Delta API works, as discussed:

1. We have removed the `updated` and `removed` arrays and now keep
everything in the `events` array.
2. We decided to keep the hydration cache separate from the events array
internally. Since the hydration cache has a special structure and may
contain not just one feature but potentially 1,000 features, it behaved
differently, requiring a lot of special logic to handle it.
3. Implemented `nameprefix` filtering, which we were missing before.


Things still to implement:

1.  Segment hydration and updates to it.
2025-01-22 13:57:42 +02:00
Thomas Heartman
4bbff0c554
feat(1-3260): store support for data traffic from a range (#9127)
Add support for querying the traffic data usage store for the aggregated data for an arbitrary number of months back.

Adds a new `getTrafficDataForMonthRange(monthsBack: number)` method to the store that aggregates data on a monthly basis by status code and traffic group. Returns a new type with month data instead of day data.
2025-01-22 09:48:51 +01:00
David Leek
09872ae760
chore: create the releasePlanChangeRequests feature flag (#9126) 2025-01-21 14:26:22 +01:00
Thomas Heartman
857c91b803
feat(1-3262): initial impl of new month/range picker (#9122)
This PR implements a first version of the new month/range picker for the
data usage graphs. It's minimally hooked up to the existing
functionality to not take anything away.

This primary purpose of this PR is to get the design and interaction out
on sandbox so that UX can have a look and we can make adjustments.

As such, there are a few things in the code that we'll want to clean up
before removing the flag later:
- for faster iteration, I've used a lot of CSS nesting and element
selectors. this isn't usually how we do it here, so we'll probably want
to extract into styled components later
- there is a temporary override of the value in the period selector so
that you can select ranges. It won't affect the chart state, but it
affects the selector state. Again, this lets you see how it acts and
works.
- I've added a `NewHeader` component because the existing setup smushed
the selector (it's a MUI grid setup, which isn't very flexible). I don't
know what we want to do with this in the end, but the existing chart
*does* have some problems when you resize your window, at least
(although this is likely due to the chart, and can be solved in the same
way that we did for the personal dashboards).


![image](https://github.com/user-attachments/assets/f3ce3ff9-bab3-4d00-afbe-56f5624fbe16)
2025-01-21 12:15:43 +01:00
Tymoteusz Czech
08a28c99d6
fix: align project roles checkboxes (#9123)
Fix checkbox alignment and grouping
2025-01-21 10:34:20 +00:00
Mateusz Kwasniewski
e9db8ab8f0
feat: max parallel sessions config (#9109) 2025-01-20 11:51:50 +01:00
Mateusz Kwasniewski
54aebe7b5c
feat: connection id counting fallback (#9115) 2025-01-20 09:18:31 +01:00
Fredrik Strand Oseberg
25c09c3627
feat: transparent header (#9108)
This PR adds header redesign behind a feature flag
2025-01-17 09:45:45 +01:00
Jaanus Sellin
013ddd348d
fix: remove deleted event from being update event (#9106)
The feature was getting into updated array due to feature-deleted event.
2025-01-16 11:52:07 +02:00
Jaanus Sellin
3a50750a33
fix: feature-dependencies-removed event should not be created always (#9100)
Currently, every time you archived feature, it created
feature-dependencies-removed event.

This PR adds a check to only create events for those features that have
dependency.
2025-01-15 11:55:01 +02:00
Jaanus Sellin
d6ec0f1776
fix: add removed back after deleting from updated (#9099) 2025-01-15 10:40:28 +02:00
Tymoteusz Czech
a2b78df0ad
feat: new lifecycle icons (#9098)
- Feature flag added
- New assets
2025-01-15 08:53:07 +01:00
Nuno Góis
4a000b3a40
chore: prioritize milestone strategies in sorting (#9081)
https://linear.app/unleash/issue/2-3100/sorting-issues-with-milestone-strategies-and-regular-strategies

This PR ensures that milestone strategies are always prioritized and
evaluated before regular strategies. It ensures that the order displayed
in the UI matches the internal evaluation order.
2025-01-14 15:25:33 +00:00
Tymoteusz Czech
b5f0d3e86a
refactor: project permissions list (#9082)
Re-organized project permissions.
2025-01-14 14:24:25 +01:00
Thomas Heartman
6a7dcb9c46
fix(1-3247): remove explicit "in project" text from change request event text (#9091)
We got an event for a scheduled application success today that looked a
little something like this:

> Successfully applied the scheduled change request #1168 in the
production environment in project eg by gaston in project eg.

Notice that we're stating the project twice (once with a link (removed
here) and once without).

This PR removes the redundancy in CR events:


The project is already included in the `changeRequest` variable, which
is populated in `src/lib/addons/feature-event-formatter-md.ts` by
the `generateChangeRequestLink` function.

The (current) definition is:

```typescript
    generateChangeRequestLink(event: IEvent): string | undefined {
        const { preData, data, project, environment } = event;
        const changeRequestId =
            data?.changeRequestId || preData?.changeRequestId;
        if (project && changeRequestId) {
            const url = `${this.unleashUrl}/projects/${project}/change-requests/${changeRequestId}`;
            const text = `#${changeRequestId}`;
            const featureLink = this.generateFeatureLink(event);
            const featureText = featureLink
                ? ` for feature flag ${this.bold(featureLink)}`
                : '';
            const environmentText = environment
                ? ` in the ${this.bold(environment)} environment`
                : '';
            const projectLink = this.generateProjectLink(event);
            const projectText = project
                ? ` in project ${this.bold(projectLink)}`
                : '';
            if (this.linkStyle === LinkStyle.SLACK) {
                return `${this.bold(`<${url}|${text}>`)}${featureText}${environmentText}${projectText}`;
            } else {
                return `${this.bold(`[${text}](${url})`)}${featureText}${environmentText}${projectText}`;
            }
        }
    }
```

Which includes links, env, and project info already.
2025-01-14 09:54:19 +01:00
Mateusz Kwasniewski
1b4d1df84f
fix: force updated_at date to change (#9092) 2025-01-13 15:51:29 +01:00
Gastón Fournier
fea3d89fca
feat: Remove create admin token from API (#9090)
Admin tokens have been [deprecated in previous
versions](https://docs.getunleash.io/reference/api-tokens-and-client-keys#admin-tokens)
encouraging the usage of personal access tokens for better traceability
of changes within Unleash.

This removes the ability of creating them from the API
2025-01-13 14:49:56 +01:00
Mateusz Kwasniewski
ce73190241
feat: unique connection gauge metric (#9089) 2025-01-13 14:06:09 +01:00
Jaanus Sellin
86bbe62abe
fix: remove archived features from delta (#9088)
Weird thing is that I could not reproduce it locally, but I have a
theory to fix our delta mismatch.

Revisions are added to the delta every second.

This means that in a single revision, you can disable an event, remove a
dependency, and archive it simultaneously. These actions are usually
performed together since archiving an event will inherently disable it,
remove its dependencies, and so on.

Currently, we observe these events happening within the same revision.
However, since we were checking `.updated` last, the event was always
removed from the `removedMap`.

Now, by checking `.removed` last, the archive action will properly
propagate to the revision.
2025-01-13 14:36:34 +02:00
Nuno Góis
b0b2836c67
test: fix timezone-related inconsistencies in tests (#9083)
https://linear.app/unleash/issue/2-3132/fix-tests-to-make-them-timezone-agnostic

Noticed our tests failed for me locally since I'm on a different
timezone (Lisbon time, GMT).
This fixes these timezone-related inconsistencies.

### Before


![image](https://github.com/user-attachments/assets/253bf76b-f269-4f1f-93bf-104bc9cec3d4)

![image](https://github.com/user-attachments/assets/abadacc2-f0a3-462b-b0d8-afb059e51697)

### After


![image](https://github.com/user-attachments/assets/8bdfcee2-8e08-4489-8723-189f1448e4a6)
2025-01-13 11:35:30 +00:00
Mateusz Kwasniewski
e559718581
feat: unique connection counting (#9074) 2025-01-13 11:56:57 +01:00
Tymoteusz Czech
af1b6c8c37
migration: cors root role permission (#9080)
after https://github.com/Unleash/unleash/pull/8996
2025-01-13 09:19:27 +01:00
Jaanus Sellin
fda2252957
fix: etag support RFC 9110 standard (#9077)
ETag must be in double quotes based on standard. Fixing it.

```
If-None-Match: "<etag_value>"
2025-01-10 15:39:00 +02:00
Mateusz Kwasniewski
67068afb13
chore: fix migration file (#9079) 2025-01-10 13:41:07 +01:00
Mateusz Kwasniewski
f47de55d67
chore: fix migration file (#9078) 2025-01-10 13:36:34 +01:00
Mateusz Kwasniewski
5a1f1a00ba
feat: migration for unique connections (#9076) 2025-01-10 13:25:09 +01:00
David Leek
0dbecd78a0
chore: featureToggleService use optionallyDisableFeature instead of duplicating logic (#9073) 2025-01-09 11:29:00 +01:00
Nuno Góis
b0434c9a84
chore: remove unused newHostedAuthHandler flag (#9070)
https://linear.app/unleash/issue/2-3106/clean-up-post-unified-auth-handler

Cleans up this flag that we never ended up using anyways.
2025-01-09 09:13:18 +00:00
Mateusz Kwasniewski
161fa131c7
chore: remove connection id from tracking (#9072) 2025-01-09 09:46:04 +01:00
Mateusz Kwasniewski
135c1bd917
chore: remove oidcRedirect flag (#9069) 2025-01-08 14:24:56 +01:00
Mateusz Kwasniewski
cef10eee02
feat: Unique connection tracking (#9067) 2025-01-08 13:36:40 +01:00
Jaanus Sellin
73515d78ce
chore: remove simplifyProjectOverview flag (#9068)
Remove the flag and delete unused components.
2025-01-08 14:10:40 +02:00
Nuno Góis
e7269473f3
chore: new hosted auth handler (#9045)
https://linear.app/unleash/issue/2-3074/add-sign-in-with-google-to-our-hosted-instances-when-only-password-is

https://linear.app/unleash/issue/2-3078/allow-viewer-access-from-auth-app-for-payg

Adds support for a new unified hosted auth handler.

This new auth handler provides a Google sign in option in case you don't
have an SSO provider configured. It also provides a way for auth-app to
sign in with Unleash's read-only user for Pro and Enterprise PAYG
instances.

Check the PR comments for more details.
2025-01-08 10:02:35 +00:00
Tymoteusz Czech
608a3986af
migration: read logs permission (#9049)
continuation of https://github.com/Unleash/unleash/pull/8996
2025-01-08 10:52:41 +01:00
Tymoteusz Czech
dc4a760172
feat: read logs and update cors maintenance root-role permissions (#8996)
Additional granular permissions related to instance-level access.

- CORS settings
- Reading logs (both instance logs and login history)

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2025-01-08 10:03:40 +01:00
Fredrik Strand Oseberg
2363d99fe7
feat: add migration (#8891) 2025-01-06 14:38:56 +01:00
Jaanus Sellin
8bf1b783e9
fix: delta do not return archived as changed (#9062)
Our delta API was returning archived feature as updated. Now making sure
we do not put `archived-feature `event into `updated` event array.
Also stop returning removed as complex object.
2025-01-06 14:48:30 +02:00
Mateusz Kwasniewski
13fb7c4a63
feat: making context service transactional (#9063) 2025-01-06 13:38:09 +01:00
gitar-bot[bot]
1c0431365e
[Gitar] Cleaning up stale flag: licensedUsers with value true (#9061)
[![Gitar](https://raw.githubusercontent.com/gitarcode/.github/main/assets/gitar-banner.svg)](https://gitar.ai)
This automated PR permanently enables the `licensedUsers` feature flag.
  
  ---
This automated PR was generated by [Gitar](https://gitar.ai). View
[docs](https://gitar.ai/docs).

---------

Co-authored-by: Gitar <noreply@gitar.ai>
2025-01-06 10:44:13 +02:00
Mateusz Kwasniewski
c56200e030
feat: ability to delete single legal values (#9058)
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-01-03 15:38:10 +01:00
Mateusz Kwasniewski
20fda186b5
feat: ability to upsert single legal values (#9056) 2025-01-03 14:18:36 +01:00
Mateusz Kwasniewski
4a52247bd9
chore: export context service factory (#9053) 2025-01-03 10:41:34 +01:00
Mateusz Kwasniewski
eb0b7d5e4f
refactor: Context service feature oriented (#9052) 2025-01-03 10:23:47 +01:00
Jaanus Sellin
9003a7eb91
fix: remove archived from delta (#9051) 2025-01-03 09:44:25 +02:00
Jaanus Sellin
54d6bd5b86
feat: log warning if there is diff between client/features and delta api (#9047)
Log out the diff and warn if there is gap between old logic and new
delta.
2025-01-02 12:59:33 +02:00
Fredrik Strand Oseberg
71eb6b1511
feat: delta api e2e test (#9003)
WIP PR for delta-api tests.

---------

Co-authored-by: sjaanus <sellinjaanus@gmail.com>
2024-12-30 14:16:41 +02:00
Nuno Góis
adaf91a791
chore: remove Unleash AI (#9010)
https://linear.app/unleash/issue/2-3071/finish-experiment

Removes Unleash AI.

Also removes other related changes made during the experiment
development.
2024-12-20 11:02:49 +00:00
weekwith.me
df9292ff53
fix: Change Open API validation middleware to specify and use path parameters (#8913)
## About the changes
Moved Open API validation handler to the controller layer to reuse on
all services such as project and segments, and also removed unnecessary
middleware at the top level, `app.ts`, and method, `useErrorHandler` in
`openapi-service.ts`.

### Important files

#### Before

<img width="1510" alt="1 Before"
src="https://github.com/user-attachments/assets/96ac245d-92ac-469e-a097-c6c0b78d0def">

Express cant' parse the path parameter because it doesn't be specified
on the `use` method. Therefore, it returns `undefined` as an error
message.

#### After

<img width="1510" alt="2 After"
src="https://github.com/user-attachments/assets/501dae6c-fef5-4e77-94c3-128a9f7210da">

Express can parse the path parameter because I change to specify it on
the controller layer. Accordingly, it returns `test`.
2024-12-20 10:53:33 +01:00
Christopher Kolstad
66907bfd8e
feat: only display oss included projects/environments when install is oss (#8896)
Trying again, now with a tested function for resolvingIsOss.

Still want to test this on a pro instance in sandbox before we deploy
this to our customers to avoid what happened Friday.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2024-12-19 14:33:54 +01:00
Jaanus Sellin
b701fec75d
feat: store memory footprints to grafana (#9001)
When there is new revision, we will start storing memory footprint for
old client-api and the new delta-api.
We will be sending it as prometheus metrics.

The memory size will only be recalculated if revision changes, which
does not happen very often.
2024-12-19 13:15:30 +02:00