1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
Commit Graph

719 Commits

Author SHA1 Message Date
sjaanus
6c621bf65b
Fix crashing search bars (#2765) 2022-12-28 12:35:27 +02:00
Nuno Góis
aaa96f71cb
feat: message banner (#2726)
Related to:
https://linear.app/unleash/issue/2-511/exploration-build-data-for-the-possibility-of-showing-an-alert-to-the
Namely:
https://unleash-internal.slack.com/archives/C046LV85N3C/p1671443897386729

The idea is to have a general message banner that can be controlled
through a feature flag in Unleash to display announcements, warnings,
informations, etc.

Currently using mock feature flags, but the idea is to bind this to a
feature flag we can manage in our Unleash instance, and use its payload
to provide information to end users whenever we want.

Co-authored-by: Gastón Fournier <gaston@getunleash.ai>
2022-12-22 15:16:51 +00:00
Christopher Kolstad
5b66346e56
fixes 2-456: Preserve all data from strategy import (#2720)
## What
Previously when importing strategies we've used the same data type we've
used for creating strategies (the minimal, a name, an optional
description, optional parameters and an optional editable column). This
meant that exporting strategies and then importing them would reactivate
deprecated strategies. This PR changes to allow the import to preserve
all the data coming in the export file.

## Tests
Added four new tests, two new unit tests using our fake stores and two
new e2e tests. Interestingly the ones in the fake store ran green before
this change as well, probably because we just insert the parsed json
object in the fake store, whereas the real store actually converts the
object from camelCasing to the postgresql snake_casing standard.

## Discussion points:
### Mismatch between fake and real stores
This is inevitable since storing things in javascript arrays vs saving
in a real database will have some differences, but this again shows the
value of our e2e tests.

### Invariants
Should we see if we can add some invariants to our import/export so that
we can write some proptests for it? One candidate is commutativity of
import/export. On a fresh database importing and then exporting should
yield the same file that was imported provided all flags are turned on.
Candidate for Q1 improvement of import/export.
2022-12-21 13:33:41 +01:00
sjaanus
be045dc13a
Remove favorites feature flag (#2722) 2022-12-21 12:03:06 +00:00
sjaanus
a0619e963d
Maintenance mode for users (#2716) 2022-12-21 13:23:44 +02:00
Nuno Góis
7ce5b3de64
refactor: flag resolver should use stricter types (#2571)
Adding stricter types to `FlagResolver` can possibly help improve our DX
- Help us prevent errors like typos, guide us to correctly add a flag
when needed, and warn us of stray checks whenever we do a clean up at a
later stage.
2022-12-20 15:10:06 +00:00
Gastón Fournier
4b519ead4f
perf: Simplify queries to prometheus (#2706)
## About the changes
This PR improves our queries to Prometheus (instead of making multiple queries do only one) and improves the UI and the code. 

The reports aggregate all HTTP methods (GET, POST, PUT, DELETE, OPTIONS, HEAD and PATCH) without distinction under the same "endpoint" (a relative path inside unleash up to a certain depth)

Co-authored-by: Nuno Góis <nuno@getunleash.ai>
2022-12-19 17:06:59 +01:00
sjaanus
2d5455d203
Maintenance mode middleware (#2707) 2022-12-19 09:01:04 +02:00
Nuno Góis
a3ac96f763
Feat network overview (#2708)
https://linear.app/unleash/issue/2-512/exploration-network-overview-represented-as-a-flow-chart

<img width="1307" alt="image"
src="https://user-images.githubusercontent.com/14320932/208110067-294a0b91-d52e-49d1-9024-fa5e8530e2d8.png">
2022-12-16 14:12:36 +00:00
Gastón Fournier
2979f21631
feat: expose number of registered applications metric (#2692)
## About the changes
This metric will expose an aggregated view of how many client
applications are registered in Unleash. Since applications are ephemeral
we are exposing this metric in different time windows based on when the
application was last seen.

The caveat is that we issue a database query for each new range we want
to add. Hopefully, this should not be a problem because:
a) the amount of ranges we'd expose is small and unlikely to grow
b) this is currently updated at startup time and even if we update it on
a scheduled basis the refresh rate will be rather sparse

## Sample data
This is how metrics will look like
```
# HELP client_apps_total Number of registered client apps aggregated by range by last seen
# TYPE client_apps_total gauge
client_apps_total{range="allTime"} 3
client_apps_total{range="30d"} 3
client_apps_total{range="7d"} 2
```
2022-12-16 11:16:51 +00:00
Christopher Kolstad
eafba10cac
feature: add query support to features endpoint (#2693)
## About the changes
The deprecated /api/admin/features endpoint supported querying with tag
and namePrefix parameters.

This PR adds this functionality to
/api/admin/projects/<project>/features as well, allowing to replicate
queries that used to work.

Closes #2306

### Important files
src/lib/db/feature-strategy-store.ts
src/test/e2e/stores/feature-strategies-store.e2e.test.ts

## Discussion points
I'm extending our query parameters support for
/api/admin/projects/<projectId>/features endpoint. This will be
reflected in our open-api spec, so I also made an
adminFeaturesQuerySchema for this.

Also, very open for something similar to what we did for the modifyQuery
for the archived parameter, but couldn't come up with a good way to
support subselects using the query builder, it just ended up blowing the
stack. If anyone has a suggestion, I'm all ears.

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2022-12-16 12:05:18 +01:00
sjaanus
d42e90544f
Maintenance mode UI (#2704) 2022-12-15 16:07:22 +02:00
Nuno Góis
90f0d665f9
fix: disable networkView for dev, fail more gracefully (#2701)
Disables networkView for dev for now. Attempts to fail more gracefully
both on the service and front-end.
2022-12-15 10:12:02 +00:00
Christopher Kolstad
23094b016e
feat: first draft of chart for instance traffic in frontend (#2670)
## What
We've already added the backend for this. This is the initial work for
drawing a chart for instance traffic in the frontend. It requires the environment variable `PROMETHEUS_API` set to a valid prometheus-query-language (promql) supported backend, such as Prometheus itself or Victoria Metrics. Besides, at the moment we're hiding this functionality behind the flag `UNLEASH_EXPERIMENTAL_NETWORK_VIEW` which has to be set to true

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
Co-authored-by: Gastón Fournier <gaston@getunleash.ai>
2022-12-15 08:47:07 +00:00
Ivar Conradi Østhus
34c12c8234
fix: adjust db-pool for test to use max=4 2022-12-14 20:25:14 +01:00
Ivar Conradi Østhus
e01167676c
fix: background frontend settings should not crash tests 2022-12-14 20:24:47 +01:00
Ivar Conradi Østhus
e4035d37d4
fix: adjust db-pool for test to use max=3 2022-12-14 19:53:26 +01:00
Ivar Conradi Østhus
2223cace41
fix: adjust db-pool a bit 2022-12-14 19:42:01 +01:00
Ivar Conradi Østhus
09c87c755f
Fix/remove settings cache (#2694)
In this PR we remove the general SettingService cache, as it will not
work across multiple horizontal unleash instances, events are not
published across.

We also fix the CORS origin to: 
- Access-Control-Allow-Origin set to "*" if no Origin is configured
- Access-Control-Allow-Origin set to "*" if any Origin is configured to
"*"
- - Access-Control-Allow-Origin set to array and have the "cors"
middleware to return an exact match on the user provided Origin.

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
2022-12-14 17:35:22 +01:00
Ivar Conradi Østhus
10aa79eb56
fix: move docker-compose to this repo (#2666)
Use latest official image for Unleash for simplicity. 
Also takes away the proxy as it is not needed anymore.
2022-12-12 20:40:18 +01:00
Nuno Góis
5086ec7921
remove feature flag: tokens last seen (#2673)
https://linear.app/unleash/issue/2-470/clean-up-flag
2022-12-12 14:32:35 +00:00
Nuno Góis
e8d0fdba1f
remove feature flag: toggle tag filtering (#2668)
https://linear.app/unleash/issue/2-482/clean-up-feature-flag-after-this-goes-ga

Relevant discussion:
https://unleash-internal.slack.com/archives/C046LV6HH6W/p1670837328201169
2022-12-12 13:21:12 +00:00
Gastón Fournier
5fe238c896
task: Expose prometheus metrics (#2586)
## About the changes
This connects our backend with Prometheus (or compatible) metrics
service, and exposes raw data (i.e. acting as a proxy)

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2022-12-12 14:05:56 +01:00
Ivar Conradi Østhus
d9d9f01b37
feat: add capability to write heap snapshot. (#2611)
Is protected behind a config option called `enableHeapSnapshotEnpoint`.
When API endpoint is triggered it will write a heapSnapshot to disk.

Steps to create heap snapshot:

1. Add env variable `ENABLE_HEAP_SNAPSHOT_ENPOINT=true`. 
2. Call this endpoint: `/internal-backstage/heapSnapshot`
3. Download the created heapdump from the server. 

The snapshot can be loaded in the chrome dev-tool to analysis.
2022-12-08 11:25:39 +01:00
andreas-unleash
d69ca0a508
ui flags replaced in index.html (#2617)
Signed-off-by: andreas-unleash <andreas@getunleash.ai>

<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->
This PR puts the ui flags in the index.html in a meta tag. This makes
them accessible without logging in and allows us to track user signups
with invite links
## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2022-12-07 14:31:27 +02:00
sjaanus
6b74b7c255
Fix error in migration when updating feature_environments (#2607)
Fixes a issue, where `variants` was null in features table, but column is not nullable.


Co-authored-by: sighphyre <liquidwicked64@gmail.com>
2022-12-06 14:57:54 +02:00
Gastón Fournier
aa20d2d418
Fix PATCH variants (old endpoint) when variants per environment are enabled (#2591)
## About the changes
This PR addresses some issues when working with variants after migrating
to variants per environment.

**Problem:** since PATCH
`/api/admin/projects/default/features/${featureName}/variants` does not
take into account `featureEnvironments`, when variantsPerEnvironment
gets enabled, this method will override the variants in other
environments (i.e. not doing a patch). This method has to be maintained
because of backward compatibility but it has to be adapted to deal with
variants per environment


https://linear.app/unleash/issue/2-476/when-using-patch-for-variants-without-environments-it-wipes-out

Co-authored-by: Nuno Góis <github@nunogois.com>
2022-12-06 09:47:54 +00:00
Thomas Heartman
8c42fbf34b
Docs(fix): add more (missing) redirects, fix links (#2592)
## What

This PR fixes some broken links we had in the application. It also adds
redirects for those links so that they should work in the future.

## Why

Because it's important to have links that work 💁
2022-12-06 09:32:42 +01:00
Mateusz Kwasniewski
e059b755c9
skip change request (#2598) 2022-12-05 15:38:17 +01:00
Mateusz Kwasniewski
b9290dd5ed
CR applier should be able to create strategy (#2597) 2022-12-05 12:39:13 +01:00
Simon Hornby
447bd44c99
Remove clone env and sync sso group flags (#2596)
Removes feature flags for syncing sso groups and clone environment.
These features are being made generally available for all who have
access to environments and sso groups
2022-12-05 12:07:15 +02:00
Ivar Conradi Østhus
4a3d26065f
Fix/cors expose ETag (#2594)
This commit fixes two issues with the frontend API

1. fix: update cors max age to match chromium defaults
https://source.chromium.org/chromium/chromium/src/+/main:services/network/public/cpp/cors/preflight_result.cc;drc=49e7c0b4886cac1f3d09dc046bd528c9c811a0fa;l=31
2: fix: expose ETage for cross-origin requests
2022-12-05 10:04:35 +01:00
Fredrik Strand Oseberg
bc3744d565
fix: remove stray only (#2589)
This removes stray onlys in our tests and adds a linter rule that will
error if only is present. Also updates the test result of one of our
tests as a result of [this pull
request](https://github.com/Unleash/unleash/pull/2344)
2022-12-02 13:10:39 +01:00
Tymoteusz Czech
79e96fdb98
feat: favorite feature and project (#2582)
## About the changes
Add an ability to star a toggle from it's overiew.

Co-authored-by: sjaanus <sellinjaanus@gmail.com>
2022-12-02 09:16:03 +02:00
sjaanus
e728ecba69
Remove signup conditional flag (#2581)
Remove signup flag
2022-12-01 14:12:54 +02:00
Gastón Fournier
bf0171518c
task: continue to return export v3 when variants per env disabled (#2529)
## About the changes
With the latest changes of variants per environment, we switched to
export schema v4 without having the feature toggle enabled. This moves
the variants to `featureEnvironments` when they were previously in
`features`. The main problem is that it can create confusion as the
exported file has the same variants for each one of the environments but
after importing the file the UI will only show one set of variants
attached to the feature.

With this change, we're maintaining the previous schema until the
feature toggle is enabled.
2022-12-01 11:13:49 +00:00
sjaanus
24fee65f7e
Make single project endpoint also return all features favorites (#2578)
Small update, that single project endpoint would also return features
with favorites.
2022-12-01 09:49:49 +02:00
Tymoteusz Czech
5f88269744
feat: favorite feature table icons (#2525) 2022-11-30 12:44:38 +00:00
Fredrik Strand Oseberg
dacaaa51b7
feat: default the frontend api flags to on (#2573)
* This PR turns on the flag for the frontendApi to be on by default. We
should still be able to override them from the unleash-cloud
distribution.
2022-11-30 13:33:07 +01:00
sjaanus
65851ba51c
Add favorite events (#2572)
This PR adds 4 new events

1. FAVORITE_FEATURE_ADDED
2.  FAVORITE_FEATURE_REMOVED
3. FAVORITE_PROJECT_ADDED
4. FAVORITE_PROJECT_REMOVED
2022-11-30 14:26:17 +02:00
sjaanus
a22d5f5a43
Favorite project (#2569)
Adds ability to favorite projects.

1. Can favorite project
2. Can unfavorite project
3. Favorite field is returned on `/api/admin/projects/default`
4. Favorite field is returned on` /api/admin/projects`
2022-11-30 13:41:53 +02:00
sjaanus
0d58371f11
Some tweaks to favorites (#2563)
This is follow up PR to https://github.com/Unleash/unleash/pull/2550,
which addresses the issues that came up from reviews.
2022-11-30 09:47:57 +02:00
sjaanus
9ac6b945be
Fix super small text issue (#2473)
Fix super small text issue

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2022-11-30 09:18:49 +02:00
Nuno Góis
7ce38ffe89
feat: update seen_at pat column (#2516)
https://linear.app/unleash/issue/2-451/update-last-seen-column-for-pats
2022-11-30 08:10:31 +02:00
Nuno Góis
4d8817698a
feat: add last seen column to token table (#2520)
https://linear.app/unleash/issue/2-449/add-table-column-to-api-tokens-table-ui
2022-11-30 08:07:13 +02:00
Nuno Góis
564c287025
Feat update token seen at (#2514)
https://linear.app/unleash/issue/2-448/update-last-seen-column-for-api-tokens

Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.ai>
2022-11-29 19:46:40 +00:00
sjaanus
b32d3d0fee
Favorite features (#2550) 2022-11-29 16:06:08 +01:00
Mateusz Kwasniewski
e97922d065
store min approvals as part of change request creation (#2548) 2022-11-29 09:40:40 +01:00
Gastón Fournier
0943ff8f49
Fix OOM with eslint in migrations (#2545)
## About the changes
When adding a new migration, we might run out of memory. Migrations have
only JS files and we're running these through TS parser. Removing TS
config reference from `.eslintrc` proved to solve the issue while
running local manual tests

This still lints migration files but using JS syntax
2022-11-28 15:16:19 +01:00
Nuno Góis
1fec43947d
add feature flag: network view (#2543)
https://linear.app/unleash/issue/2-453/add-feature-flag
2022-11-28 13:48:02 +00:00