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

716 Commits

Author SHA1 Message Date
Jaanus Sellin
8e38ebf1a7
fix: also export context fields used for stickiness (#3106) 2023-02-15 08:44:59 +01:00
Mateusz Kwasniewski
b1728c5fe2
feat: Export segments limited info (#3109) 2023-02-14 15:35:10 +01:00
Nuno Góis
8729f082d2
refactor: remove variants per environment feature flag (#3102)
https://linear.app/unleash/issue/2-428/clean-up-feature-flag-once-were-done-with-the-migration

Cleans up the variants per environment feature flag due to GA.
2023-02-14 14:02:02 +00:00
Jaanus Sellin
c094472cfe
fix: export failing because stream closed (#3104) 2023-02-14 14:20:30 +02:00
Mateusz Kwasniewski
5f7c1d8525
fix: export empty list (#3103) 2023-02-14 13:13:58 +01:00
Mateusz Kwasniewski
c14621a09a
fix: enabling more tests with strict schema validation (#3081) 2023-02-14 11:25:13 +01:00
Fredrik Strand Oseberg
9cc7b8fdeb
fix: replace assert with error (#3074)
This PR changes the behavior of checking the incoming token on the
`/api/frontend` path. Instead of using assert resulting in a 500 error
we are throwing an error that is caught by the default controller and
emitted back to the user as JSON.

This should be the correct behaviour, since the endpoint can not give
you any meaningful data without the environment that the API token
holds.
2023-02-13 08:40:04 +01:00
Jaanus Sellin
df3ce70c0d
feat: Gradual schema improvements (#3075) 2023-02-10 15:05:57 +01:00
renovate[bot]
6e44a65c58
fix(deps): update dependency unleash-client to v3.18.0 (#2956)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [unleash-client](https://togithub.com/Unleash/unleash-client-node) |
[`3.16.1` ->
`3.18.0`](https://renovatebot.com/diffs/npm/unleash-client/3.16.1/3.18.0)
|
[![age](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/compatibility-slim/3.16.1)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/confidence-slim/3.16.1)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>Unleash/unleash-client-node</summary>

###
[`v3.18.0`](https://togithub.com/Unleash/unleash-client-node/blob/HEAD/CHANGELOG.md#&#8203;3180)

[Compare
Source](https://togithub.com/Unleash/unleash-client-node/compare/v3.17.0...v3.18.0)

feat: gracefully handle unsuccessful metrics post
([#&#8203;414](https://togithub.com/Unleash/unleash-client-node/issues/414))
feat/flush metrics
([#&#8203;415](https://togithub.com/Unleash/unleash-client-node/issues/415))
feat: add metrics jitter support
([#&#8203;412](https://togithub.com/Unleash/unleash-client-node/issues/412))
fix: Allow SDK to startup when backup data is corrupt
([#&#8203;418](https://togithub.com/Unleash/unleash-client-node/issues/418))
fix: flexible-rollout random stickiness is not random enough
([#&#8203;417](https://togithub.com/Unleash/unleash-client-node/issues/417))
fix: build correct version on npm version
chore(deps): update dependency eslint-plugin-import to v2.27.5
([#&#8203;416](https://togithub.com/Unleash/unleash-client-node/issues/416))
chore(deps): update dependency
[@&#8203;typescript-eslint/eslint-plugin](https://togithub.com/typescript-eslint/eslint-plugin)
to v5.48.2
([#&#8203;413](https://togithub.com/Unleash/unleash-client-node/issues/413))
chore(deps): update dependency eslint to v8.32.0
([#&#8203;410](https://togithub.com/Unleash/unleash-client-node/issues/410))
chore(deps): update dependency prettier to v2.8.3
([#&#8203;406](https://togithub.com/Unleash/unleash-client-node/issues/406))
chore(deps): update dependency eslint-plugin-import to v2.27.4
([#&#8203;404](https://togithub.com/Unleash/unleash-client-node/issues/404))

###
[`v3.17.0`](https://togithub.com/Unleash/unleash-client-node/blob/HEAD/CHANGELOG.md#&#8203;3170)

[Compare
Source](https://togithub.com/Unleash/unleash-client-node/compare/v3.16.1...v3.17.0)

- feat: Only initialize the SDK once.
([#&#8203;368](https://togithub.com/Unleash/unleash-client-node/issues/368))
-   fix: upgrade semver to 7.3.8
-   fix: add resolution for debug
-   fix: add resolution for minimatch
-   fix: add resolution for qs
-   fix: add resolution for json5
-   fix: update yarn.lock
- docs: Update the readme with info from docs.getunleash
([#&#8203;399](https://togithub.com/Unleash/unleash-client-node/issues/399))
-   docs: minor fix in README
- chore(deps): update dependency debug to v4
([#&#8203;402](https://togithub.com/Unleash/unleash-client-node/issues/402))
- chore(deps): update dependency json5 to v2
([#&#8203;401](https://togithub.com/Unleash/unleash-client-node/issues/401))
- chore(deps): update dependency eslint to v8.31.0
([#&#8203;394](https://togithub.com/Unleash/unleash-client-node/issues/394))
- chore(deps): update dependency nock to v13.3.0
([#&#8203;400](https://togithub.com/Unleash/unleash-client-node/issues/400))
- chore(deps): update dependency
[@&#8203;typescript-eslint/eslint-plugin](https://togithub.com/typescript-eslint/eslint-plugin)
to v5.48.1
([#&#8203;395](https://togithub.com/Unleash/unleash-client-node/issues/395))
- chore(deps): update dependency eslint-config-prettier to v8.6.0
([#&#8203;396](https://togithub.com/Unleash/unleash-client-node/issues/396))
- chore(deps): update dependency prettier to v2.8.2
([#&#8203;398](https://togithub.com/Unleash/unleash-client-node/issues/398))
- chore(deps): update dependency
[@&#8203;typescript-eslint/eslint-plugin](https://togithub.com/typescript-eslint/eslint-plugin)
to v5.47.1
([#&#8203;346](https://togithub.com/Unleash/unleash-client-node/issues/346))
- chore(deps): update dependency typescript to v4.9.4
([#&#8203;386](https://togithub.com/Unleash/unleash-client-node/issues/386))
- chore(deps): update dependency sinon to v15
([#&#8203;391](https://togithub.com/Unleash/unleash-client-node/issues/391))
- chore(deps): update dependency
[@&#8203;types/node](https://togithub.com/types/node) to v18
([#&#8203;380](https://togithub.com/Unleash/unleash-client-node/issues/380))
- chore(deps): update dependency
[@&#8203;types/node](https://togithub.com/types/node) to v14.18.36
([#&#8203;382](https://togithub.com/Unleash/unleash-client-node/issues/382))
- chore(deps): update dependency eslint to v8.30.0
([#&#8203;367](https://togithub.com/Unleash/unleash-client-node/issues/367))
- chore(deps): update dependency prettier to v2.8.1
([#&#8203;387](https://togithub.com/Unleash/unleash-client-node/issues/387))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

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

---

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

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/Unleash/unleash).

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

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.ai>
2023-02-10 10:51:53 +01:00
Jaanus Sellin
8ee9b75e48
Add option to run unleash in strict schema validation (#3073)
feat: strict schema validation
2023-02-09 15:21:03 +02:00
Gastón Fournier
b76e66fc1d
fix: make sure we have a user in event store (#3072)
## About the changes
Spotted some issues in logs:
```json
{
  "level":"warn",
  "message":"Failed to store \"feature-environment-variants-updated\" event: error: insert into \"events\" (\"created_by\", \"data\", \"environment\", \"feature_name\", \"pre_data\", \"project\", \"tags\", \"type\") values (DEFAULT, $1, $2, $3, $4, $5, $6, $7) returning \"id\", \"type\", \"created_by\", \"created_at\", \"data\", \"pre_data\", \"tags\", \"feature_name\", \"project\", \"environment\" - null value in column \"created_by\" violates not-null constraint",
  "name":"lib/db/event-store.ts"
}
```

In all other events we're doing the following:
b7fdcd36c0/src/lib/services/segment-service.ts (L80)

So this is just mimicking that to quickly release a patch, but I'll look
into a safer (type-checked) solution so this problem does not happen
again
2023-02-09 11:01:39 +01:00
Ivar Conradi Østhus
07e8a351bb
Fix/show tag events (#3064)
This PR fixes two issues with events today:

1. Feature toggles "Event log" must include all events, regardless of
the project. This is important as feature toggles may move between
2. Add/remove tags on a feature toggle events should include project id
in order to show up in the project specific event log.
2023-02-08 19:57:21 +01:00
Gastón Fournier
354b5b2976
chore: service accounts GA (#3059)
## About the changes
This PR prepares the GA of service accounts: OpenAPI tags, documentation
and flag removal

Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#2942

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2023-02-08 11:59:24 +01:00
andreas-unleash
d14072ff74
show api access screen in projet settings (#3056)
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! ❤️ -->

## 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-612](https://linear.app/unleash/issue/1-612/first-iteration-of-project-token-management)

<!-- (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-02-07 13:01:45 +02:00
Thu Vo
3387e6fc39
JSON stringify errors to view more info of params (#3033) 2023-02-07 09:21:09 +01:00
Gastón Fournier
ad57ee84e6
chore: Move rps endpoint to pro (#3054)
## About the changes
Network view is part of our cloud offering.
2023-02-07 09:14:12 +01:00
Tymoteusz Czech
0656fddbc4
Refactor: Project Overview fetching (#3035) 2023-02-07 08:57:28 +01:00
Mateusz Kwasniewski
09ab4e42db
export queries use order by feature name (#3051) 2023-02-06 15:46:25 +01:00
Tymoteusz Czech
ab9712812a
Project health tests (#3028) 2023-02-02 12:01:16 +01:00
Ivar Conradi Østhus
627958d30f
feat/enable_batch_metrics_for_all (#3027)
Batch Metrics as a capability developed to support the frontend API to
handle more metrics from SDKs without overloading the DB to much. It has
been running in Unleash Cloud for months and has proven to work quite
nice.

This PR simply removes the flag to make the capability GA, also for
self-hosted users.
2023-02-01 20:50:17 +01:00
Gastón Fournier
896994d42f
fix: when app count is zero because it just started (#3029)
## About the changes
This fixes response time metrics with app names when the app just starts
and has zero which is falsy. We want to compare against undefined (which
means the snapshot is not yet ready)
2023-02-01 17:30:35 +01:00
sjaanus
daa4041d03
Export tag types (#3026)
Adds a simple functionality to export also tag types.
2023-02-01 13:14:49 +02:00
Mateusz Kwasniewski
dc8c95702f
Schedule health report (#3025) 2023-01-31 13:35:16 +01:00
Tymoteusz Czech
59e8e2b1ed
refactor: project health domain (#3024) 2023-01-31 13:08:20 +01:00
Nuno Góis
054c590813
fix: limit creation of other users PATs (adapting) (#3019)
https://linear.app/unleash/issue/2-656/limit-the-ability-of-creating-a-token-on-behalf-of-another-user

Adapts to the refactor that reverts the initial experimental idea of
Service Accounts before they existed in the current implementation:
Managing other user's PATs.
2023-01-31 08:40:23 +00:00
Gastón Fournier
9c214858c7
chore: backport changes from 4.20 (#3021)
## About the changes
Changes included in 4.20 release, mainly improving OpenAPI tags
2023-01-30 16:02:42 +01:00
Gastón Fournier
812604902b
fix: list projects with all archived toggles (#3020)
## About the changes
While trying to count only features that are not archived to display the
amount of features of a project, accidentally we filtered out projects
with all features archived (they should show up in the list but with
count of features zero)
2023-01-30 13:32:43 +00:00
sjaanus
ab5da2116a
Remove timeout from store (#3018) 2023-01-30 12:01:44 +01:00
Mateusz Kwasniewski
d9110b6ce5
refactor: separate scheduling from DI (#3017) 2023-01-30 11:13:17 +01:00
Mateusz Kwasniewski
96b21f08b0
feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
Fredrik Strand Oseberg
1c4ba4cc97
Feat/project stats types (#3012)
Update type for project stats
2023-01-27 17:19:27 +01:00
Fredrik Strand Oseberg
897e97330a
Feat/project stats members (#3009)
This PR adds project members to the project stats and connects the stats
to the UI.
2023-01-27 13:13:41 +01:00
sjaanus
e226e31ad5
Export variants env (#3008)
Export variants env
2023-01-27 13:20:32 +02:00
Mateusz Kwasniewski
f8473a243f
exclude tags for other features (#3007) 2023-01-27 11:34:20 +01:00
Fredrik Strand Oseberg
d8a250dc9c
Feat/project status monthly (#2986)
This PR takes the project status API a step further by adding the
capability of providing a date to control the selection. We are
currently making calculations based on a gliding 30 day window, updated
once a day. The initial database structure and method for updating the
UI is outlined in this PR.
2023-01-26 16:13:15 +01:00
Mateusz Kwasniewski
6b9a242be5
upload limit and import ui tweaks (#2998) 2023-01-26 12:36:45 +01:00
Mateusz Kwasniewski
527ed5feaf
filter out unused fields as they fail import validation (#2997) 2023-01-26 09:48:10 +01:00
Mateusz Kwasniewski
decb7f320d
feat: import stage (#2985) 2023-01-25 12:34:28 +01:00
Mateusz Kwasniewski
80c444aa99
cleanup in export and import (#2973) 2023-01-24 14:29:59 +01:00
Christopher Kolstad
c961374b24
task: changing variants blocked by cr (#2966)
## About the changes
This PR adds two new functions that is protected by CR. When used
instead of the current setVariantOnEnv and setVariantsOnEnv if the flag
UNLEASH_EXPERIMENTAL_CR_ON_VARIANTS is set, the call is blocked. This
leaves the old functions, which is used from the CR flow in place, and
adds new methods protected by CR.

Also adds e2e tests verifying that the methods will block requests if CR
is enabled for project:environment pair, as well as not block if CR is
not enabled. Tests already in place should confirm that the default
flow, without the flag enabled just works.
2023-01-24 10:43:10 +01:00
Nuno Góis
ccfc046937
feat: adds the PAT_DELETE event (#2965)
<img width="973" alt="image"
src="https://user-images.githubusercontent.com/14320932/214047789-830adae4-daf1-4761-9b77-a49c9b92d0d8.png">

Adds the `PAT_DELETE` event so we can log the relevant information when
a PAT is deleted.

Should cover the following scenarios:

- User deletes their own PAT;
- Admin deletes another user's PAT;
- Admin deletes a Service Account token;
2023-01-23 15:11:16 +02:00
Gastón Fournier
70d8f9e58a
feat: add warning hints on potential misconfiguration (#2948)
## About the changes
Add warnings when we detect something might be wrong with the customer
configuration, in particular with regard to variants configuration

## Rationale
Moving from variants per feature to variants per environment will allow
users to have fine-grained permissions and more control over variants on
different environments: #2254

But because this requires an additional step of copying variants to
other environments, we identified the potential risk of users forgetting
to follow this step. To keep them informed about this, we're introducing
a warning sign after a toggle is enabled when we detect that:
1. The environment is enabled without variants
2. Other enabled environments have variants

This situation would be a problem if you rely on `getVariant` method
from the SDK, because without variants you'll receive the default
variant. Probably, not what you'd expect after enabling the toggle, but
there are situations where this might be correct. Because of the latter,
we thought that adding a warning and letting the user handle the
situation was the best solution.

## UI sketches
![image
(6)](https://user-images.githubusercontent.com/455064/213676353-112639f0-7781-42c0-8c9d-8c7eba316bae.png)
![Screenshot from 2023-01-19
08-55-10](https://user-images.githubusercontent.com/455064/213664639-7b11ff4b-048a-4a36-aa71-7df2f889adff.png)

Co-authored-by: Nuno Góis <github@nunogois.com>
2023-01-20 18:09:01 +01:00
Gastón Fournier
96c65fc10d
feat: Add ability to push variants to multiple environments (#2914)
## About the changes
This PR adds the ability to push variants to multiple environments
overriding the existing variants.

Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#2254

**Note:** This won't fail if there are variants in other environments, because the operation wouldn't be idempotent. It should have that property because setting variants to 1 or more environments once or twice should not make a difference
2023-01-20 10:30:20 +01:00
Gastón Fournier
30ed92cbbb
fix: Add missing sortOrder property (#2940)
Add sortOrder property to some OpenAPI schemas
2023-01-20 08:46:01 +01:00
sjaanus
53c11b8585
Add feature name to strategy schema (#2936) 2023-01-19 15:17:36 +02:00
Fredrik Strand Oseberg
f4d857285b
feat: status API (#2931)
Initial status API
2023-01-19 13:27:50 +01:00
Nuno Góis
7d73d772df
feat: add the account abstraction logic (#2918)
https://linear.app/unleash/issue/2-579/improve-user-like-behaviour-for-service-accounts-accounts-concept

Builds on top of https://github.com/Unleash/unleash/pull/2917 by moving
the responsibility of handling both account types from `users` to
`accounts`.

Ideally:
 - `users` - Should only handle users;
 - `service-accounts` - Should only handle service accounts;
 - `accounts` - Should handle any type of account;

This should hopefully also provide a good building block in case we
later decide to refactor this further down the `accounts` path.
2023-01-18 16:08:07 +00:00
Ivar Conradi Østhus
bb20c6d102
fix: project feature_count should not include archived (#2919)
fixes: #2923
2023-01-18 15:58:27 +01:00
andreas-unleash
5ceab6f989
Add flag to control CASE_INSENSITIVE_IN_OPERATORS until SDKs catch up (#2927)
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! ❤️ -->

## 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-01-18 15:53:14 +02:00
andreas-unleash
91e20cc09a
Add support for case for IN and NOT_IN operators (#2924)
Signed-off-by: andreas-unleash <andreas@getunleash.ai>

Adds support for case for IN and NOT_IN operators
<!-- 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? -->

<img width="1547" alt="Screenshot 2023-01-18 at 11 35 10"
src="https://user-images.githubusercontent.com/104830839/213136158-25c525c8-de82-423b-93d1-5ae6eb8469fa.png">

## 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-01-18 14:42:26 +02:00