1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
Commit Graph

450 Commits

Author SHA1 Message Date
Tymoteusz Czech
169b2bd0c5
Strategy title frontend (#3556)
Ability to add a title to a strategy
2023-04-19 17:27:23 +00:00
Christopher Kolstad
4f7fd46623
fix: return 404 when gettings tags for a non existing feature (#3560)
From the discussion here
https://github.com/Unleash/unleash/pull/3496#discussion_r1163745860

This PR checks the existence of the feature before trying to get tags
for the feature. Doing so by stealing the exists method from the feature
store, since that's what we need to know exists, and avoiding having the
feature store as a dependency to the featureTagStore seemed reasonable.
2023-04-19 14:10:13 +02:00
Gastón Fournier
0e80484068
docs: update documentation and dev server use of passord (#3564)
## About the changes
Update `passord` documentation with `password`. Note this was not a typo
but just Norwegian:
https://dictionary.cambridge.org/dictionary/english-norwegian/password
```shell
grep passord * -R -l | grep -v .git | grep -v dist | grep -v v3 | xargs sed -i 's/passord/password/g'
```
The script above avoids updating v3 because of legacy reasons

Related to #1265
2023-04-19 13:29:18 +02:00
Gastón Fournier
008d9b8bb6
feat: deprecate state api (#3551)
## About the changes
This deprecates state API in favor of the new batch import/export
2023-04-18 18:34:12 +02:00
Thomas Heartman
e11fae56e9
OpenAPI: addon operations (#3421)
This PR updates the OpenAPI schemas for all the operations tagged with
"addons". In doing so, I also uncovered a few bugs and inconsistencies.
These have also been fixed.

## Changes

I've added inline comments to the changed files to call out anything
that I think is worth clarifying specifically. As an overall
description, this PR does the following:

Splits `addon-schema` into `addon-schema` and
`addon-create-update-schema`. The former is used when describing addons
that exist within Unleash and contain IDs and `created_at` timestamps.
The latter is used when creating or updating addons.

Adds examples and descriptions to all relevant schemas (and their
dependencies).

Updates addons operations descriptions and response codes (including the
recently introduced 413 and 415).

Fixes a bug where the server would crash if it didn't recognize the
addon provider (test added).

Fixes a bug where updating an addon wouldn't return anything, even if
the API said that it would. (test added)

Resolves some inconsistencies in handling of addon description. (tests
added)

### Addon descriptions

when creating addons, descriptions are optional. The original
`addonSchema` said they could be `null | string | undefined`. This
caused some inconsistencies in return values. Sometimes they were
returned, other times not. I've made it so that `descriptions` are now
always returned from the API. If it's not defined or if it's set to
`null`, the API will return `description: null`.

### `IAddonDto`

`IAddonDto`, the type we used internally to model the incoming addons
(for create and update) says that `description` is required. This hasn't
been true at least since we introduced OpenAPI schemas. As such, the
update and insert methods that the service uses were incompatible with
the **actual** data that we require.

I've changed the type to reflect reality for now. Assuming the tests
pass, this **should** all be good, but I'd like the reviewer(s) to give
this a think too.

---------

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2023-04-18 10:50:34 +00:00
Gastón Fournier
c97294aee4
Fix openapi tests (#3549)
## About the changes
Update tests due to fixes introduced in
2da279b7fb

This PR removes the fixes from the exceptions' list
2023-04-18 08:17:23 +00:00
andreas-unleash
2da279b7fb
feat: add title to strategy (#3510)
<!-- 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! ❤️ -->
Adds title column to strategies, feature_strategies and features_view in
the db
Updates model/schemas
## 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 #
[1-855](https://linear.app/unleash/issue/1-855/allow-for-title-on-strategy-backend)

<!-- (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>
2023-04-18 08:59:02 +02:00
Gastón Fournier
5940a81158
docs: improve open api (#3535)
## About the changes
Amends based on https://github.com/Unleash/unleash/pull/3519
2023-04-18 08:50:36 +02:00
Gastón Fournier
4f78db3be9
fix: segments schemas (#3525)
## About the changes
Remove segment schemas from exceptions

---------

Co-authored-by: GitHub Actions Bot <>
2023-04-17 10:51:48 +02:00
Gastón Fournier
ea9bf7f447
chore: add linter rules for regexp (#3500)
## About the changes
Add linter rules for regexp security vulnerabilities

Commit 1c5d54c76e [fails due to
regexp/no-super-linear-backtracking](https://github.com/Unleash/unleash/actions/runs/4668430535/jobs/8265506170#step:5:37)
as reported here:
https://github.com/Unleash/unleash/security/code-scanning/1


[0127d1a](0127d1a746)
fixes the issues and warnings by running `yarn lint --fix`
2023-04-17 07:11:22 +00:00
Christopher Kolstad
6cc51b7ba0
docs: Added docs for edge endpoints (#3501)
Adding documentation for the edge endpoints. Also separating request and
response schema for our validate endpoint to make clear that we expect a
list of strings as input, but yield tokens as output.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-04-14 15:39:39 +02:00
Gastón Fournier
d4c24c9520
chore: amend open api tags descriptions and examples (#3519)
## About the changes
Adds descriptions and examples to tag schemas
2023-04-14 12:26:19 +02:00
andreas-unleash
60a2c1a996
chore: Backport 4.22.3 (#3508)
<!-- 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! ❤️ -->
Backports stickiness fixes 
## 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>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Mateusz Kwasniewski <kwasniewski.mateusz@gmail.com>
2023-04-12 16:22:13 +03:00
Gastón Fournier
37beaa611f
chore: Improve openapi documentation for tags (#3496)
## About the changes
1. Create tag should not throw a 500 when bad data is provided
2. Added summary, description and examples to open API endpoints

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2023-04-12 09:34:32 +00:00
Gastón Fournier
c1a1a0fdeb
docs: open api examples for segment schemas (#3503)
## About the changes
Add additional documentation for segments

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2023-04-12 09:29:51 +00:00
Mateusz Kwasniewski
d9f22f4349
feat: Maintenance openapi (#3478) 2023-04-10 09:55:29 +02:00
Mateusz Kwasniewski
f1133556bd
refactor: switching to new stats calculations (#3477) 2023-04-10 09:50:39 +02:00
Tymoteusz Czech
8f278cb726
Fix: feature schema (#3456) 2023-04-07 09:16:00 +00:00
Jaanus Sellin
33487d11b9
feat: authorization middleware (#3464) 2023-04-06 11:46:54 +02:00
Jaanus Sellin
80bea14d42
feat: changing password will expire reset password tokens (#3451) 2023-04-05 12:39:52 +03:00
Christopher Kolstad
512efe0809
docs: Flesh out openapi for tag: Environments (#3440)
### What
This fleshes out the documentation for actions tagged with Environments.

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-04-04 15:45:34 +02:00
Gastón Fournier
2bfbe3cd79
fix: concurrency issue when running multiple requests (#3442)
## About the changes

Fix issue when running multiple calls to the /frontend endpoint concurrently, which ends up creating many instances of unleash SDK client.
2023-04-04 09:32:35 +02:00
andreas-unleash
9b6f5cd198
fix: make api tokens ui consistent and remove check for deprecated envs. (#3410)
<!-- 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 removes the check for deprecated environments when validating
api token environment.

Unifies global and project level tokens allow selection of deprecated
environments when creating an api token

Adds 'deprecated' to the EnvironmentSelector when appropriate

## 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>
2023-03-29 10:33:14 +03:00
andreas-unleash
0d68febdf7
Fix: make stickiness accept any string (#3408)
<!-- 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! ❤️ -->
Changes the schema and api to accept any string for defaultStickiness
## 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>
2023-03-28 16:42:16 +03:00
Mateusz Kwasniewski
3b311f74c0
feat: stop change project on change request enabled (#3391) 2023-03-28 11:28:22 +02:00
Mateusz Kwasniewski
2caab45801
feat: disallow clone toggle on change request enabled (#3383) 2023-03-27 13:21:50 +02:00
Fredrik Strand Oseberg
354e54a356
fix: count events instead of loading them in memory (#3382)
Refactor project events to use count instead of loading the events in
memory
2023-03-27 11:24:01 +02:00
Christopher Kolstad
49fbf4a635
task: enclose ETag in double quotes. (#3385)
According to the
[RFC](https://www.rfc-editor.org/rfc/rfc7232#section-2.3) Etags should
be enclosed in double quotes. This PR makes sure we do actually wrap it
in double quotes
2023-03-24 16:11:42 +01:00
Mateusz Kwasniewski
ab913228ca
refactor: read model for change request access checking (#3380) 2023-03-24 14:31:43 +01:00
Gastón Fournier
a79a76f497
refactor: test composition and other error codes (#3348)
## About the changes
Small refactor to showcase how to use [composition to validate different
aspects of the
response](https://github.com/Unleash/unleash/pull/3348/files#diff-ee4c1bd501b1195162b7a85ed6be348a665288f871abc8e74f64d94361213f9eR361-R367)
and checking [different status
codes](https://github.com/Unleash/unleash/pull/3348/files#diff-4044a5da3280ef76960bbffd5f36eccb395ac319fe58c4d59ef68a878cbb1a5dR95)
2023-03-23 16:31:05 +01:00
Mateusz Kwasniewski
57f42b5629
feat: collaboration mode API cleanup (#3357) 2023-03-23 14:13:34 +01:00
Nuno Góis
27d48b3437
Feat segments project safeguards (#3359)
https://linear.app/unleash/issue/2-811/ability-to-move-project-specific-segments


![image](https://user-images.githubusercontent.com/14320932/226572047-19ed225c-13d5-4f2e-b10f-e17a7f7e6ae7.png)

Provides some safeguards to project-specific segments when managing them
on a global level (segments page):
- You can always promote a segment to global;
- You can't specify a project if the segment is currently in use in
multiple projects;
- You can't specify a different project if the segment is currently
already in use in a project;
2023-03-21 20:28:43 +00:00
Mateusz Kwasniewski
902ebefe7e
feat: support updating existing projects without existing settings (#3358) 2023-03-21 10:32:09 +01:00
Gastón Fournier
af42347a7b
chore: PoC test API helper (DRY) (#3342)
## About the changes
New way of centralizing API calls while doing E2E tests to avoid repeating ourselves.
2023-03-20 10:27:19 +01:00
Jaanus Sellin
d28e65b94c
feat: revive features (#3344) 2023-03-17 18:21:13 +00:00
Ivar Conradi Østhus
dc5b53fa4d
Poc: calculate etag based on query and latest revison id (#3062)
This is very much POC and WIP
2023-03-17 14:10:21 +01:00
andreas-unleash
32e1ad44ed
Feat/add cypress tests for project scoped stickiness (#3340)
<!-- 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! ❤️ -->


## 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>
2023-03-17 14:41:59 +02:00
Gastón Fournier
7a9ea22eed
feat: project-specific segments tests and fixes (#3339)
## About the changes
- Refactored some E2E tests to use our APIs
- Added test cases for project-specific segments
- Added validation to check a project can access a specific segment
- Fixed an OpenAPI schema that was missing segments

## Discussion points
https://github.com/Unleash/unleash/pull/3339/files#r1140008992
2023-03-17 12:43:34 +01:00
Fredrik Strand Oseberg
e2ad0cae45
fix: refactor calculate time to prod (#3333)
This PR changes how we calculate average time to production. Instead of
calculating fleeting 30 day windows and calculating the past and current
window, we now calculate a flat average across the entire project life.
This is less error prone as each feature will be tied to the earliest
time it was turned on in a production environment.
2023-03-16 15:45:24 +01:00
Mateusz Kwasniewski
1064dfa40c
feat: project mode (#3334) 2023-03-16 15:29:52 +01:00
andreas-unleash
edd12709ef
fix: remove proxy return all toggles functionality (#3331)
<!-- 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 removes the return all toggles functionality. Removes the flag
as well
## 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 #
[1-778](https://linear.app/unleash/issue/1-778/remove-proxyalltoggles-functionality)

<!-- (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>
2023-03-16 14:00:18 +02:00
Jaanus Sellin
d94dd31677
feat: refactor archive (#3330) 2023-03-16 10:26:02 +02:00
Jaanus Sellin
138ac98094
feat: bulk revive features (#3321) 2023-03-16 09:51:18 +02:00
andreas-unleash
933455e308
feat: use api instead of localStorage (#3305)
<!-- 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 replaces localStorage with api calls for getting/setting project
scoped stickiness
## 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>
2023-03-15 16:06:25 +02:00
Gastón Fournier
1d0bc833b3
chore: refactor segments to stop depending on the implementation (#3315)
## About the changes
- Introducing ISegmentService interface to decouple from the actual
implementation
- Moving UpsertSegmentSchema to OSS to be able to use types
- Added comments where our code is coupled with segments just to
highlight and have a conversation about some use cases if needed, but
they can be removed before merging
- Removed segment service from some project features as it was not used
2023-03-15 14:58:19 +01:00
Mateusz Kwasniewski
d9e3ff9cd4
refactor: move project membership check from access to project (#3322) 2023-03-15 14:44:08 +01:00
Jaanus Sellin
a5f1b89b4a
feat: bulk delete features (#3314) 2023-03-15 15:08:08 +02:00
Mateusz Kwasniewski
9fd84abaa5
feat: Default project mode open (#3316) 2023-03-15 12:28:06 +01:00
Jaanus Sellin
6c813ab066
feat: bulk stale features (#3311) 2023-03-15 08:37:06 +02:00
Mateusz Kwasniewski
7753082660
feat: expose project members (#3310) 2023-03-14 16:27:57 +01:00