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

1567 Commits

Author SHA1 Message Date
Christopher Kolstad
b06613d1b0
feat: Adds rate limiting to metric POST endpoints (#5075)
### What
The heaviest requests we serve are the register and metrics POSTs from
our SDKs/clients.
This PR adds ratelimiting to /api/client/register, /api/client/metrics,
/api/frontend/register and /api/frontend/metrics with a default set to
6000 requests per minute (or 100 rps) for each of the endpoints.

It will be overrideable by the environment variables documented.

### Points of discussion
@kwasniew already suggested using featuretoggles with variants to
control the rate per clientId. I struggled to see if we could
dynamically update the middleware after initialisation, so this attempt
will need a restart of the pod to update the request limit.
2023-10-18 13:00:44 +02:00
Fredrik Strand Oseberg
3ac8ab898a
fix: log diff (#5072)
Add a deep diff function to investigate diff in logs
2023-10-18 09:25:25 +02:00
Mateusz Kwasniewski
75b131162e
feat: dependent features use new transaction mechanism (#5073) 2023-10-18 08:59:26 +02:00
Gastón Fournier
db04a1eaa8
chore: introduce type to prevent potential issues (#5066)
## About the changes
This small improvement aims to help developers when instantiating
services. They need to be constructed without injecting services or
stores created elsewhere so they can be bound to the same transactional
scope.

This suggests that you need to create the services and stores on your
own
2023-10-17 12:30:44 +02:00
andreas-unleash
cf42a829f4
feat: add option to return disabled strategies (#5059)
Adds the option to include disabled strategies (behind the
playgroundImprovements flag

Closes #
[1-1505](https://linear.app/unleash/issue/1-1505/return-disabled-strategies-in-the-playground-features-request)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-10-17 12:35:07 +03:00
Gastón Fournier
08116d008a
chore: GA transactional decorator (#5020)
## About the changes
After testing with the flag enabled and fixing a bug, this is ready to
be GA
2023-10-17 10:47:18 +02:00
Nuno Góis
fd580c9539
fix: extract username from user should not return undefined (#5061)
This fixes a return type error by changing the logic of
`extractUsernameFromUser` to never return undefined.

In the previous code, `user` could be truthy, but that doesn't mean
`email` or `username` were defined. This assumes we always fallback to
"unknown" in those scenarios.
2023-10-17 09:18:44 +01:00
Jaanus Sellin
5619db33ed
feat: import dependencies (#5044) 2023-10-17 08:22:54 +03:00
Mateusz Kwasniewski
e9e110f702
feat: show dependencies only when using pro/enterprise or at least on… (#5052) 2023-10-16 20:56:06 +02:00
Fredrik Strand Oseberg
0064c9e1be
refactor: add tests for /api/client/features (#5057)
add more robust tests for /api/client/features
2023-10-16 16:18:41 +02:00
Gastón Fournier
675ec2e836
chore: add enterprise event (#5056)
This just adds a new event type
2023-10-16 15:37:11 +02:00
Nuno Góis
364e315a3c
feat: add new message banner events (#5055)
https://linear.app/unleash/issue/2-1516/add-new-message-banner-events

Adds new message banner events to help us keep track of changes related
to the new feature.
2023-10-16 14:30:40 +01:00
Fredrik Strand Oseberg
9e493f56a0
refactor: create builder class for converting rows to avoid duplication (#5050)
Create a builder for creating the data structures for feature toggle
list and playground api
2023-10-16 14:19:46 +02:00
Fredrik Strand Oseberg
1a46ab7b12
refactor: add test coverage (#5046)
Adds test coverage for different feature flag paths temporarily
2023-10-16 13:17:26 +02:00
andreas-unleash
8561ba8df7
feat: add playground imrpovements flag (#5045)
Adds the playgroundImprovements flag

Close #
[1-1508](https://linear.app/unleash/issue/1-1508/add-playgroundimprovements-feature-flag)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-10-16 14:08:21 +03:00
Fredrik Strand Oseberg
b58d900c2d
fix: feature flag playground features in new store (#5013)
Have playground use the method in the feature-toggle-service instead of
asking the client-feature-toggle-store
2023-10-16 12:29:31 +02:00
Nuno Góis
6c21ed5f74
feat: make maintenance-related 503s more intuitive (#5018)
This makes maintenance-related 503s more intuitive on our UI by
mentioning that maintenance banner is currently enabled.


![image](https://github.com/Unleash/unleash/assets/14320932/43142c58-6b87-4b2d-9239-50f2bb1409e6)
2023-10-16 09:27:29 +01:00
Mateusz Kwasniewski
c41f23ae54
feat: remove dependency on archive (#5040) 2023-10-16 08:59:34 +02:00
Jaanus Sellin
2263a1f062
feat: dependencies import validation (#5023) 2023-10-13 14:17:54 +03:00
Fredrik Strand Oseberg
b6d945befc
refactor: feature toggle list query (#5022)
Cean up huge query method in feature-toggle-store
2023-10-13 12:29:14 +02:00
Mateusz Kwasniewski
3eeafba5f9
feat: validate archive dependent features (#5019) 2023-10-13 12:09:46 +02:00
andreas-unleash
a9a75d5e82
fix: disable all environments when reviving a feature (#4999)
Disable all environments when reviving a feature

Closes #
[SR-93](https://linear.app/unleash/issue/SR-93/disable-all-environments-when-reviving-a-feature)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-10-13 10:38:18 +03:00
Jaanus Sellin
a7dd0d6c1a
fix: import segment test and fix (#5017) 2023-10-13 09:40:34 +03:00
Fredrik Strand Oseberg
f34d187cd9
Refactor/separate client and admin store (#5006)
This PR is the first step in separating the client and admin stores.
Currently our feature toggle services uses the client store to serve
multiple purposes. 

Admin API uses the feature toggle service to serve both the feature
toggle list and playground features, while the client API uses the
feature toggle service to serve client features. The admin API can
change often and have very different requirements than the client API,
which changes infrequently and generally keeps the same stable structure
for long periods of time. This architecture is error prone, because when
you need to make changes to the admin API, you can very easily affect
the client API.

I aim to put up a stone wall between the two APIs. Complete separation
between the two APIs, at the cost of some duplication.

In this PR I have created a feature oriented architecture for client
features and disconnected the client API from the feature toggle
service. It now goes through it's own service to it's own store. For
feature toggle service I have duplicated and replaced the functionality
that serves /api/admin/features, I have kept a lot of the ugliness in
the code and haven't removed anything in order to avoid breaking
changes.

Next steps: 
* Move playground to admin API
* Remove client-feature-toggle-store from feature-toggle-service
2023-10-12 13:58:23 +02:00
Jaanus Sellin
7b7a2a706c
fix: enable segment importing for oss (#5010) 2023-10-12 13:43:43 +03:00
Nuno Góis
66304cf8e7
feat: message banners table migration (#5009)
https://linear.app/unleash/issue/2-1485/db-create-migration-for-a-new-internal-message-banners-table

Adds a DB migration for a new `message_banners` table.
2023-10-12 11:27:00 +01:00
Jaanus Sellin
2059706e77
feat: export dependent feature toggles (#5007) 2023-10-12 12:56:10 +03:00
Gastón Fournier
7343183f2d
chore: split interfaces for import and export (#5004)
## About the changes
This splits the interfaces for import and export, especially because the
import functionality has to be replaced in enterprise repo.

This is a breaking change because of the service renames, but I'll have
the PR for the other repository ready so we reduce the time to fix. I
intentionally avoided doing it backward compatible because of time.
2023-10-12 11:34:09 +02:00
Mateusz Kwasniewski
cfcf9de65a
feat: Protect archive feature (#5003) 2023-10-12 08:38:03 +02:00
Mateusz Kwasniewski
30e9fb87e9
feat: prevent adding dependency to archived or removed parent (#4987) 2023-10-11 16:21:57 +02:00
andreas-unleash
4e8c0478bf
fix: export NotFoundError and ISegmentService in internals.ts (#4997)
export NotFoundError and ISegmentService in internals.ts

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-10-11 14:31:45 +03:00
Jaanus Sellin
69286339fc
feat: make invite link more visible (#4984) 2023-10-11 14:31:32 +03:00
Nuno Góis
65f424156c
feat: re-order message banners (#4995)
https://linear.app/unleash/issue/2-1494/re-order-message-banners

- Re-orders message banners to fit into this logic:

>1. Maintenance banner
>2. External message banner(s) - Most likely coming from Unleash
>3. Internal message banner(s)

- Renames the feature flag to better reflect the feature behavior;
- Lays a basic skeleton structure for this new feature;
2023-10-11 11:55:54 +01:00
Fredrik Strand Oseberg
bc96216daa
Refactor/move features to feature oriented architecture (#4994)
This PR gathers feature related files in the same folder.
2023-10-11 09:38:57 +02:00
Nuno Góis
2222c47d10
feat: add internalMessageBanner feature flag (#4990)
https://linear.app/unleash/issue/2-1487/feature-flag-add-a-new-internalmessagebanner-feature-flag-for-this

Adds a new `internalMessageBanner` feature flag.
2023-10-10 20:03:59 +01:00
Fredrik Strand Oseberg
a2ca7b0d35
Refactor/last seen at read feature overview (#4986)
Refactor feature overview to use the last seen store
2023-10-10 14:40:36 +02:00
Christopher Kolstad
0c069b1385
fix: added await to getActiveUsers tests 2023-10-10 13:23:20 +02:00
Christopher Kolstad
1edd73db45
feat: feature changes counted in new table (#4958)
As part of more telemetry on the usage of Unleash. 

This PR adds a new `stat_` prefixed table as well as a trigger on the
events table trigger on each insert to increment a counter per
environment per day.

The trigger will trigger on every insert into the events base, but will
filter and only increment the counter for events that actually have the
environment set. (there are events, like user-created, that does not
relate to a specific environment).

Bit wary on this, but since we truncate down to row per (day,
environment) combo, finding conflict and incrementing shouldn't take too
long here.

@ivarconr was it something like this you were considering?
2023-10-10 12:32:23 +02:00
Fredrik Strand Oseberg
c97bcc65e6
Refactor/project overview last seen at test (#4979)
Increase test coverage of last seen in project overview
2023-10-10 10:43:45 +02:00
Mateusz Kwasniewski
b4c8f92a26
feat: do not allow to manage dependencies directly with cr enabled (#4971) 2023-10-10 09:25:03 +02:00
Fredrik Strand Oseberg
30d8444c80
fix: refactor getProjectOverview store method (#4972)
This PR cleans up and refactors the feature-strategy-store method
getFeatureOverview to join on the new table and attempts to make the
function more readable by extracting some of the logic into separate
functions. Keeping the LastSeenMapper for now in case there is a reason
to use it for the other endpoints.
2023-10-10 07:34:21 +02:00
Fredrik Strand Oseberg
d896dbd0c7
Fix/last seen at by environment (#4939)
Initial architecture for last seen at by environment.
2023-10-09 10:54:00 +02:00
Gastón Fournier
34fc17146e
chore: improve type on import service (#4962)
## About the changes
Limit import type to what matters
2023-10-09 10:45:19 +02:00
David Leek
e065e2a455
feat: render segments changes in feature strategy update event messages (#4950)
## About the changes

Segment changes in predata and data columns were both showing the new
segments list

Adds formatting of what's changed with segments to feature strategy
update events, so when a user changes the strategy from using
constraints, to using segments instead, it's communicated in event
updates

results in: 

admin updated
[sample-toggle](http://localhost/projects/default/features/sample-toggle)
in project [default](http://localhost/projects/default) by updating
strategy Sample Strategy in development constraints from [userId is one
of (1,2,3)] to empty set of constraints; segments from empty set of
segments to (1)


Closes #
#4912 

### Important files

- `src/lib/services/feature-toggle-service.ts` - Segment changes in
preData and data
- `src/lib/addons/feature-event-formatter-md.ts` - Formatting segments

## Discussion points

This is an SR least effort PR - we should plan a task where we look at
how to render this list of segments in a more comprehensible way (it's
just rendering ids now)
2023-10-09 09:11:39 +02:00
Nuno Góis
e0faa3e842
fix: typo in enabled event (#4960)
Fixes a typo where we would send `disabled` for `enabled` events.


https://unleash-community.slack.com/archives/C03GWTN7XMG/p1696631381409369
2023-10-08 19:22:12 +02:00
Gastón Fournier
c3e8d743bc
chore: Improve UI Config type (#4959)
Fix link types
2023-10-06 16:31:39 +02:00
Mateusz Kwasniewski
8b0cf8b11d
feat: allow to delete dependencies when no orphans (#4952) 2023-10-06 13:39:16 +02:00
Gastón Fournier
52fa872fe6
chore: handle transactions already started at the controller layer (#4953)
## About the changes
This PR adds a method to safeguard us from opening a new transaction
while inside another transaction, resulting in two isolated transactions
that will not be atomic (if one fails, the other might still complete
successfully).


bbbe4d4637/lib/knex-builder/make-knex.js (L143C5-L144C88)

We're currently opening transactions at the controller layer 

2746bd1517/src/lib/features/export-import-toggles/export-import-controller.ts (L206-L208)

but in some other places, we do it at the store level:

2746bd1517/src/lib/db/access-store.ts (L577)


## Alternative
We can remove store-level transactions and move them to the controller
following this approach:


cb034976b9/src/lib/services/index.ts (L282-L284)


cb034976b9/src/lib/features/export-import-toggles/export-import-controller.ts (L206-L208)

This option is more expensive because we have to:
1. Write the factory methods that propagate the transaction to the
stores (therefore creating the store factory methods as well)
2. Identify the methods for creating the transactions at the store level
and backtrack the calls until the controller layer
2023-10-06 13:38:32 +02:00
Jonas Strømsodd
80c4a8277c
feat: allow defining initial admin user as env variable (#4927)
Closes #4560
2023-10-06 09:07:06 +02:00
David Leek
40ebb7ef95
fix: only delete SSO-synced group membership where membership was added by SSO sync (#4929)
Fixes an issue where SSO group sync would delete a syncable group that a
user was manually added to

## Discussion points

Is this the longterm fix for this? Or would we want another column in
the mapping table for future-proofing this?
2023-10-05 13:22:46 +02:00
Mateusz Kwasniewski
2c7587ba4b
feat: dependent features in playground (#4930) 2023-10-05 13:05:20 +02:00
Gastón Fournier
0da48cc0d1
chore: revamp transactional impl (#4916)
## About the changes
This transactional implementation decorates a service with a
transactional method that removes the need to start transactions in the
method using the service.

This is a gradual rollout with a feature toggle, just because
transactions are not easy.
2023-10-04 15:16:37 +02:00
Mateusz Kwasniewski
bc650ffe3f
feat: flag for clone dependencies (#4922) 2023-10-04 13:29:36 +02:00
Mateusz Kwasniewski
257414424d
feat: copy feature with parent (#4918) 2023-10-04 12:20:27 +02:00
Mateusz Kwasniewski
5141d9db67
feat: change project with feature dependencies (#4915) 2023-10-04 12:16:52 +02:00
andreas-unleash
b07c032d56
fix: update potentially-stale status dynamically (#4905)
Fixes 2 bugs:

- project-health-service keeping the feature types as an instance
variable and only updating it once was preventing real calculation to
happen if the lifetime value changed for a feature toggle type
- the ui was reading from a predefined map for the lifetime values so
they would never reflect the BE change

Closes #
[SR-66](https://linear.app/unleash/issue/SR-66/slack-question-around-potentially-stale-and-its-uses)

<img width="1680" alt="Screenshot 2023-10-02 at 14 37 17"
src="https://github.com/Unleash/unleash/assets/104830839/7bee8d4a-9054-4214-a1a2-11ad8169c3d5">
<img width="1660" alt="Screenshot 2023-10-02 at 14 37 06"
src="https://github.com/Unleash/unleash/assets/104830839/23bf55c7-a380-4423-a732-205ad81d5c3c">

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-10-04 12:47:16 +03:00
Mateusz Kwasniewski
88305a6388
feat: prevent delete and archive on parent feature (#4913) 2023-10-04 09:27:53 +02:00
Mateusz Kwasniewski
296cc9a9f2
feat: update dependency permission (#4910) 2023-10-04 09:27:14 +02:00
Nuno Góis
4167a60588
feat: biome lint frontend (#4903)
Follows up on https://github.com/Unleash/unleash/pull/4853 to add Biome
to the frontend as well.


![image](https://github.com/Unleash/unleash/assets/14320932/1906faf1-fc29-4172-a4d4-b2716d72cd65)

Added a few `biome-ignore` to speed up the process but we may want to
check and fix them in the future.
2023-10-02 13:25:46 +01:00
Mateusz Kwasniewski
751bc465d6
feat: generate orval types with dependent features (#4902) 2023-10-02 12:35:20 +02:00
Nuno Góis
521cc24a22
feat: add more events in integrations (#4815)
https://linear.app/unleash/issue/2-1253/add-support-for-more-events-in-the-slack-app-integration

Adds support for a lot more events in our integrations. Here is how the
full list looks like:

- ADDON_CONFIG_CREATED
- ADDON_CONFIG_DELETED
- ADDON_CONFIG_UPDATED
- API_TOKEN_CREATED
- API_TOKEN_DELETED
- CHANGE_ADDED
- CHANGE_DISCARDED
- CHANGE_EDITED
- CHANGE_REQUEST_APPLIED
- CHANGE_REQUEST_APPROVAL_ADDED
- CHANGE_REQUEST_APPROVED
- CHANGE_REQUEST_CANCELLED
- CHANGE_REQUEST_CREATED
- CHANGE_REQUEST_DISCARDED
- CHANGE_REQUEST_REJECTED
- CHANGE_REQUEST_SENT_TO_REVIEW
- CONTEXT_FIELD_CREATED
- CONTEXT_FIELD_DELETED
- CONTEXT_FIELD_UPDATED
- FEATURE_ARCHIVED
- FEATURE_CREATED
- FEATURE_DELETED
- FEATURE_ENVIRONMENT_DISABLED
- FEATURE_ENVIRONMENT_ENABLED
- FEATURE_ENVIRONMENT_VARIANTS_UPDATED
- FEATURE_METADATA_UPDATED
- FEATURE_POTENTIALLY_STALE_ON
- FEATURE_PROJECT_CHANGE
- FEATURE_REVIVED
- FEATURE_STALE_OFF
- FEATURE_STALE_ON
- FEATURE_STRATEGY_ADD
- FEATURE_STRATEGY_REMOVE
- FEATURE_STRATEGY_UPDATE
- FEATURE_TAGGED
- FEATURE_UNTAGGED
- GROUP_CREATED
- GROUP_DELETED
- GROUP_UPDATED
- PROJECT_CREATED
- PROJECT_DELETED
- SEGMENT_CREATED
- SEGMENT_DELETED
- SEGMENT_UPDATED
- SERVICE_ACCOUNT_CREATED
- SERVICE_ACCOUNT_DELETED
- SERVICE_ACCOUNT_UPDATED
- USER_CREATED
- USER_DELETED
- USER_UPDATED

I added the events that I thought were relevant based on my own
discretion. Know of any event we should add? Let me know and I'll add it
🙂

For now I only added these events to the new Slack App integration, but
we can add them to the other integrations as well since they are now
supported.

The event formatter was refactored and changed quite a bit in order to
make it easier to maintain and add new events in the future. As a
result, events are now posted with different text. Do we consider this a
breaking change? If so, I can keep the old event formatter around,
create a new one and only use it for the new Slack App integration.

I noticed we don't have good 404 behaviors in the UI for things that are
deleted in the meantime, that's why I avoided some links to specific
resources (like feature strategies, integration configurations, etc),
but we could add them later if we improve this.

This PR also tries to add some consistency to the the way we log events.
2023-09-29 16:11:59 +01:00
Kamil Zegier
486c174004
fix: Add condition for getting max revision id from store (#4549)
## About the changes
In our staging setup, we create ad-hoc environments and import Unleash
state from production. After unleash is deployed on such environment,
the import job kicks in and feeds Unleash instance with feature flags
from production.

Between Unleash being up and running and the import job running, some
applications start polling Unleash. They get an empty feature toggle
list with `meta.revisionId=0`. Then apps use this as part of `eTag`
header in subsequent requests. Even though after import Unleash server
finally has toggles to serve, it doesn't because it calculates _max
revision id_ based on toggle updates (not null `feature_name` column in
query) or `SEGMENT_UPDATED`.

This change adds an extra condition to query so feature toggles import
is considered something that should invalidate the cache.
2023-09-29 12:59:28 +00:00
Christopher Kolstad
6673d131fe
feat: biome lint (#4853)
This commit changes our linter/formatter to biome (https://biomejs.dev/)
Causing our prehook to run almost instantly, and our "yarn lint" task to
run in sub 100ms.

Some trade-offs:
* Biome isn't quite as well established as ESLint
* Are we ready to install a different vscode plugin (the biome plugin)
instead of the prettier plugin


The configuration set for biome also has a set of recommended rules,
this is turned on by default, in order to get to something that was
mergeable I have turned off a couple the rules we seemed to violate the
most, that we also explicitly told eslint to ignore.
2023-09-29 14:18:21 +02:00
Mateusz Kwasniewski
fbc571dffc
feat: events for dependencies (#4864) 2023-09-29 14:02:15 +02:00
Mateusz Kwasniewski
72cca4f450
feat: display dependencies and parents in project details (#4859) 2023-09-28 13:37:52 +02:00
Gastón Fournier
93da4a1217
Fix open handles in tests (#4858)
## About the changes
This fixes a bunch of openHandles from our tests

I've used this script to find out the ones that leave them:
`find src -name "*.test.ts" -printf "%f\n" | xargs -i sh -c "echo =====
{} && yarn test {}"`

If there's an issue, the script will halt and the last filename will be
the one that has to be fixed.

Each commit fixes one problem so it's easy to review
2023-09-28 12:13:51 +02:00
Gastón Fournier
f9c3259083
fix: partial index on events announced (#4856)
## About the changes
Add partial index on events by announced. This should help avoid `Seq
Scan on events` when the majority of events are announced=true

---
Co-authored-by: Ivar Østhus <ivar@getunleash.io>
Co-authored-by: Gard Rimestad <gard@getunleash.io>
2023-09-28 10:21:16 +02:00
Gastón Fournier
e2ffbee468
chore: limit the amount of unannounced events we announce (#4845)
## About the changes
When the events table is large we might be doing a full table scan
searching for unannounced events. We spotted it due to a performance
alert and confirmed in AWS performance insights

![image](https://github.com/Unleash/unleash/assets/455064/8e815fa3-7a1b-4453-881a-98a148eae119)

The proposal is to limit this operation to 500 events (rule of thumb)
per round
f82ae354eb/src/lib/services/index.ts (L141-L147)
and also ignore the events older than a day (because it seems
reasonable)


## Discussion points
**Idea**: split the `events` table into `recent_events` and
`historical_events`. Recent can be anything from a day/week/month. This
would help with recurrent queries that rely on recent data from the
event's table such as optimal 304 calculation or event this scheduled
task that sends unannounced events.
2023-09-27 15:38:00 +02:00
Nuno Góis
87d9497be9
refactor: prefer eventService.storeEvent methods (#4830)
https://linear.app/unleash/issue/2-1403/consider-refactoring-the-way-tags-are-fetched-for-the-events

This adds 2 methods to `EventService`:
 - `storeEvent`;
 - `storeEvents`;

This allows us to run event-specific logic inside these methods. In the
case of this PR, this means fetching the feature tags in case the event
contains a `featureName` and there are no tags specified in the event.

This prevents us from having to remember to fetch the tags in order to
store feature-related events except for very specific cases, like the
deletion of a feature - You can't fetch tags for a feature that no
longer exists, so in that case we need to pre-fetch the tags before
deleting the feature.

This also allows us to do any event-specific post-processing to the
event before reaching the DB layer.
In general I think it's also nicer that we reference the event service
instead of the event store directly.

There's a lot of changes and a lot of files touched, but most of it is
boilerplate to inject the `eventService` where needed instead of using
the `eventStore` directly.

Hopefully this will be a better approach than
https://github.com/Unleash/unleash/pull/4729

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2023-09-27 14:23:05 +01:00
Mateusz Kwasniewski
a06037625d
refactor: expicit names in queries (#4850) 2023-09-27 15:17:04 +02:00
Mateusz Kwasniewski
87a81120d2
feat: feature admin API returns dependencies and children (#4848) 2023-09-27 15:07:20 +02:00
Mateusz Kwasniewski
fd8775f13d
feat: read model for dependent features (#4846) 2023-09-27 14:33:51 +02:00
Jaanus Sellin
960bc110ce
feat: enterprise project settings (#4844) 2023-09-27 13:10:10 +03:00
Fredrik Strand Oseberg
ebb76a5354
Feat/reset pnps (#4841)
This PR resets pnps prompts by removing entries in the user_feedback
table
2023-09-27 12:03:02 +02:00
Mateusz Kwasniewski
76a2ec53f1
feat: Enforce one dependency (#4835) 2023-09-26 14:31:13 +02:00
Mateusz Kwasniewski
e030b67a19
feat: Api to list available parent options (#4833) 2023-09-26 14:03:24 +02:00
David Leek
0938b2e545
docs: improve datadog integration docs (#4802)
## About the changes

Improvement to the description of the datadog integration. Adds 2
missing event types, removes an event type that is deprecated and about
to be completely removed, adds missing description of extra json headers
and source type name, and adds description for the new configuration
option for JSON body support

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-26 11:15:22 +01:00
Mateusz Kwasniewski
d49ff03464
feat: delete all feature dependencies (#4832) 2023-09-26 09:38:34 +02:00
Fredrik Strand Oseberg
b919c445b4
feat: add kill switch for client metrics (#4829)
This PR adds a killswitch for client metrics that we can use to disable
metrics in our cloud offering.
2023-09-26 09:37:42 +02:00
Mateusz Kwasniewski
a9805b312b
feat: Delete dependency api (#4824) 2023-09-25 15:50:05 +02:00
Jaanus Sellin
2bf995e731
feat: context/segment usage private (#4826) 2023-09-25 15:50:44 +03:00
Jaanus Sellin
c84f39ad7c
fix: project mode count even if no settings exist (#4825) 2023-09-25 12:44:02 +03:00
Jaanus Sellin
f7d87a2339
feat: add project collaboration mode to prometheus (#4819) 2023-09-25 12:07:59 +03:00
Mateusz Kwasniewski
06ea70ef00
feat: enforce no transitive parents (#4818) 2023-09-25 10:12:32 +02:00
Nuno Góis
b9946ee35c
docs: Unleash Slack App integration (#4801)
https://linear.app/unleash/issue/2-1235/docs-slack-app-integration-documentation

This adds a new reference doc for the new Unleash Slack App integration
and marks the previous Slack integration as deprecated.

As a side-effect this PR also fixes an issue where we wouldn't be able
to delete tags with special characters.

---------

Co-authored-by: David Leek <david@getunleash.io>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-22 23:19:17 +01:00
Nuno Góis
91edae3ccf
refactor: contract event group deleted after #4816 (#4817)
As mentioned in
https://github.com/Unleash/unleash/pull/4816#discussion_r1334162284
2023-09-22 12:57:09 +01:00
Nuno Góis
b6b0f83e3d
feat: add group-deleted event (#4816)
Adds a missing `group-deleted` event.
2023-09-22 11:04:46 +01:00
Mateusz Kwasniewski
b4742df8be
feat: UI stub for adding dependent features (#4814) 2023-09-22 11:26:45 +02:00
Jaanus Sellin
ac018447f9
feat: optimize private projects for enterprise (#4812) 2023-09-22 11:54:33 +03:00
Nuno Góis
7eae1f8382
fix: datadog addon needs flagResolver (#4806)
Fixes what this breaks: https://github.com/Unleash/unleash/pull/4765 -
The Datadog integration needs a `flagResolver`.
2023-09-21 15:07:24 +02:00
Nuno Góis
ea9901c968
chore: GA (remove flag) for Slack App integration (#4765)
https://linear.app/unleash/issue/2-1405/remove-slackappaddon-feature-flag-and-make-this-ga

GA's the new Slack App integration by removing the feature flag 🚀
2023-09-21 13:55:58 +01:00
Jaanus Sellin
5e6ed0baac
feat: private projects handle in playground (#4791) 2023-09-21 11:22:29 +03:00
Tymoteusz Czech
18f7d0f9e1
Remove integrationsRework flag (#4770)
https://linear.app/unleash/issue/1-1359/remove-integrationsrework-flag
2023-09-20 16:27:40 +02:00
Mateusz Kwasniewski
85c7f84f8d
feat: Client api dependent features (#4778) 2023-09-20 11:53:43 +02:00
Nuno Góis
39b0c089d1
feat: simpler integration filters (#4766)
https://linear.app/unleash/issue/2-1407/remove-the-all-checkboxes-from-project-and-environment-filters

Simplifies integration event filters by removing the "ALL" checkboxes
from these components. Whether you opted to check the "ALL" checkbox, or
not to filter at all, the result is the same - The selected options
would act as a filter.

Includes some refactoring and clean up.


![image](https://github.com/Unleash/unleash/assets/14320932/2e30c5c5-12e1-4bc6-bd4a-8be4226d625d)
2023-09-20 09:21:30 +01:00
Jaanus Sellin
e4f8e1692a
feat: make application usage private through project (#4786) 2023-09-20 10:35:30 +03:00
Jaanus Sellin
e4577362bc
feat: move middleware to enterprise (#4767) 2023-09-20 08:37:52 +03:00
Gastón Fournier
bed0a2962f
chore: Improve access service iter 2 (#4779)
## About the changes
In https://github.com/Unleash/unleash/pull/4689 I forgot to add backward
compatibility for a public method that was being used in Enterprise.
2023-09-19 16:15:27 +02:00
Ivar Conradi Østhus
013efac46b
feat: open-source segments 🚀 (#4690)
We love all open-source Unleash users. in 2022 we built the [segment
capability](https://docs.getunleash.io/reference/segments) (v4.13) as an
enterprise feature, simplify life for our customers.

Now it is time to contribute it to the world 🌏

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2023-09-19 11:24:26 +00:00
David Leek
bff1bd1026
feat: implement optional json payload and template (#4752)
## About the changes

Adds optional support for specifying JSON templates for datadog message
payload


![image](https://github.com/Unleash/unleash/assets/707867/eb7c838a-7abf-441e-972e-ddd7ada07efa)


### 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? -->

`frontend/src/component/integrations/IntegrationForm/IntegrationParameters/IntegrationParameter/IntegrationParameterEnableWithDropdown.tsx`
- a new component comprising of a text field and a dropdown menu
`src/lib/addons/datadog.ts` - Where the integration is taking place

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

- Should I have implemented the new component type as a specifiable
addon parameter type in definitions? Felt a bit YAGNI/Premature
- Would like input on naming and the new component etc
2023-09-19 13:08:10 +02:00
Mateusz Kwasniewski
be7f0d8b4e
feat: Persist dependent features (#4772) 2023-09-19 13:01:38 +02:00
Gastón Fournier
12d9297f68
Revert "chore: improve access service" (#4773)
Reverts Unleash/unleash#4689 temporarily to figure out what's the
problem with the failing test
2023-09-19 11:03:16 +01:00
Gastón Fournier
2186e2b568
chore: improve access service (#4689)
## About the changes
This enables us to use names instead of permission ids across all our
APIs at the computational cost of searching for the ids in the DB but
improving the API user experience

## Open topics
We're using methods that are test-only and circumvent our business
logic. This makes our test to rely on assumptions that are not always
true because these assumptions are not validated frequently.

i.e. We are expecting that after removing a permission it's no longer
there, but to test this, the permission has to be there before:

78273e4ff3/src/test/e2e/services/access-service.e2e.test.ts (L367-L375)

But it seems that's not the case.

We'll look into improving this later.
2023-09-19 11:36:29 +02:00
Mateusz Kwasniewski
2843388673
refactor: feature oriented architecture for feature dependencies (#4771) 2023-09-19 11:23:21 +02:00
Mateusz Kwasniewski
59f2ae435e
feat: stub for create dependent features (#4769) 2023-09-19 10:04:05 +02:00
Fredrik Strand Oseberg
a71c3fe43a
feat: add ids to scheduled jobs (#4764)
* Adds an ID to scheduled jobs so that they are easier to identify in
the future
2023-09-18 16:31:42 +02:00
Gastón Fournier
2c55e929ae
chore: merge one of with properties (#4763)
## About the changes
Open API code generator does not get along with `oneOf` alongside
`properties`:
```shell
$ openapi-generator-cli validate -i modified-openapi.json --recommend
Validating spec (modified-openapi.json)
Warnings: 
        - Schemas defining properties and oneOf are not clearly defined in the OpenAPI
          Specification. While our tooling supports this, it may cause issues with other tools.
```


bab67e44e4/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java (L25-L29)

This PR adds a meta-schema rule to validate this and fixes one issue
2023-09-18 15:43:01 +02:00
Tymoteusz Czech
2c826bdbba
feat: Add active users statistics to metrics (#4674)
## About the changes
- `getActiveUsers` is using multiple stores, so it is refactored into
read-model
- Refactored Instance stats service into `features` to co-locate related
code

Closes https://linear.app/unleash/issue/UNL-230/active-users-prometheus

### Important files
`src/lib/features/instance-stats/getActiveUsers.ts`


## Discussion points
`getActiveUsers` is coded less _class-based_ then previous similar
read-models. In one file instead of 3 (read-model interface, fake read
model, sql read model). I find types and functions way more readable,
but I'm ready to refactor it to interfaces and classes if consistency is
more important.
2023-09-18 15:05:17 +02:00
Jaanus Sellin
39d2d065cd
feat: private project filtering and store implementation (#4758) 2023-09-18 11:06:26 +03:00
Nuno Góis
1dcb33d4e7
fix: simplify channels logic in slack app integration (#4756)
https://linear.app/unleash/issue/2-1393/drop-the-always-post-to-default-channels-field

This drops the "Always post to default channels" field in the Slack App
integration in favor of always posting to the configured channels. This
should simplify the configuration of this integration.

Here's a breakdown of the logic with this change:
 - Always post to the configured Slack channels, regardless of tags;
- Tags are still respected. E.g. if we have a configured channel
"channel-1" and a tag for "channel-2", then we post to both channels;
- As channels are optional, if you would like to skip default channels
for certain events and handle everything through tags, you can just
create a new configuration without any default channels;

This also updates the labels and changes the tests to better reflect the
intended behavior.


![image](https://github.com/Unleash/unleash/assets/14320932/a2427bdd-4b92-44b3-9bad-8adb0f94c34d)
2023-09-18 08:32:37 +01:00
Nuno Góis
055cf15262
fix: misc integration-related fixes and improvements (#4754)
https://linear.app/unleash/issue/2-1401/misc-fixes-and-improvements-related-to-the-new-slack-app-integration

This includes multiple UI-related misc fixes and improvements that are
not only related with the new Slack App integration but also
integrations in general.

 - Improves the styling in the "how does it work" section;
 - Improves the text in the `IntegrationMultiSelector`s;
 - Switches "Configure" and "Open" around to match designs;
- Properly handles click event on `IntegrationCardMenu` (fix navigation
on dialog click);
- Fixes titles and contents for "enable/disable" and "delete"
integration dialogs to match designs;
- Updates Slack App integration "how does it work" section to better
reflect the intended behavior;
 - Removes redundant alerts after previous point;
- Adds an alert in the old Slack integration configuration warning of
its deprecation and suggesting the new Slack App integration instead;
 - Fixes typos;
 - Slight refactors;


![image](https://github.com/Unleash/unleash/assets/14320932/17b09742-f00b-4be2-829f-8248ffe67996)

Co-authored by @nicolaesocaciu
2023-09-15 14:50:59 +01:00
Jaanus Sellin
15baea1d25
feat: walking skeleton of private projects (#4753) 2023-09-15 15:52:54 +03:00
Thomas Heartman
94b65542e8
refactor: remove check for feature naming data object (#4745)
We already check for its presence before doing anything. We don't need
to
check it twice (we're not Santa Claus, after all).
2023-09-15 12:51:47 +02:00
Simon Hornby
aa5afad502
feat: patch user access query to return projects provided by groups (#4750) 2023-09-15 12:10:16 +02:00
andreas-unleash
76a834ca91
fix: sort toggleNames before updating last seen (#4747)
Seems like when 2 pods are trying to POST lastSeen metrics, the db gets
into a deadlock state.

This is an attempt to fix the deadlock by sorting the toggleNames before
the update.

The hypothesis is that sorted toggle names will reduce the chance of
working on the same row at the same exact time

Closes #
[1-1382](https://linear.app/unleash/issue/1-1382/order-data-before-updating-the-lastseen-to-reduce-change-of-deadlock)

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-09-15 13:02:38 +03:00
Simon Hornby
7843c93dc5
feat: add a button to download user access information (#4746) 2023-09-15 11:51:29 +02:00
andreas-unleash
f9bca20c78
Feat/project private mode (#4743)
Adds `private` option to project mode
Update schemas and models to accept and persist

Closes #
[1-1366](https://linear.app/unleash/issue/1-1366/introduce-private-in-collaboration-mode)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-09-15 11:01:25 +03:00
Mateusz Kwasniewski
c3540e1396
feat: sdk flat context schema (#4738) 2023-09-15 09:30:54 +02:00
Thomas Heartman
f89d42ff44
fix: disable all errors (#4707)
This was recently flagged as a security warning by our pipeline. AJV
also tells users not to use this in prouduction, which we must have
missed:
https://ajv.js.org/security.html#security-risks-of-trusted-schemas
2023-09-14 14:11:18 +02:00
Tymoteusz Czech
e8d5f0cf56
fix: integrations text review (#4706)
## About the changes
Update copy

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-14 12:01:29 +00:00
Mateusz Kwasniewski
c2b068e28f
fix: include strategy variants in the event log (#4716) 2023-09-14 13:23:11 +02:00
Nuno Góis
f68b0ad001
fix: env variants event changelog (#4712)
https://linear.app/unleash/issue/2-1397/fix-environment-variants-change-event-does-not-include-changelogs

By running `applyPatch` without cloning the `oldVariants`, `applyPatch`
would patch the `oldVariants` by reference, effectively making them the
same as the `newVariants`. This fix `deepClone`s the oldVariants when
sending them in as an `applyPatch` parameter so that the `oldVariants`
variable is left untouched.


![image](https://github.com/Unleash/unleash/assets/14320932/089e118d-c5c4-432e-b11c-08d362ce155d)
2023-09-14 12:22:20 +01:00
Nuno Góis
31216d1ffb
fix: include tags in variants event (#4711)
https://linear.app/unleash/issue/2-1396/fix-variants-event-should-include-the-respective-feature-flag-tags

This fixes an issue where the `feature-environment-variants-updated`
event would not post to a tagged Slack channel, since it would not take
into consideration the feature flag tags.
2023-09-14 13:16:40 +02:00
Mateusz Kwasniewski
878780f068
feat: playground custom properties are nested (#4686) 2023-09-14 12:28:28 +02:00
Simon Hornby
10afbc8a9e
feat: add service method to retrieve group and project access for all users (#4708) 2023-09-14 11:43:39 +02:00
Tymoteusz Czech
66c790fbf1
fix: Integrations quality updates (#4677)
Fix issues uncovered when reviewing integrations list and form.

- YouTube CSP
- Text content and formatting
- Margins
- Update old integration icons
- Fix headers in dark theme
2023-09-14 10:17:33 +02:00
Thomas Heartman
9bdee12ad9
feat: stop regexes with whitespace (#4681)
This PR stops regexes with whitespace from being added as feature naming
patterns.
2023-09-14 07:56:23 +00:00
Thomas Heartman
bf451f6549
test: enforce behavior via test (#4701)
This test enforces that descriptions and examples are cleared if they
are not present in the feature naming data.

This behavior is already present, but it hasn't been encoded in any
tests before.
2023-09-14 09:50:20 +02:00
Thomas Heartman
6dbea08d0b
feat: disallow description when no pattern exists (#4679)
This PR makes it so that adding a feature naming description when there
is no pattern is disallowed. It also changes the validation for feature
naming slightly so that it can return multiple errors at once.
2023-09-14 09:32:07 +02:00
Nuno Góis
ba416e1656
fix: use postmessage in slack app addon (#4688)
https://linear.app/unleash/issue/2-1392/fix-flaky-unhandled-events

- Reverts part of https://github.com/Unleash/unleash/pull/4490 and uses
`postMessage` instead. This prevents an error where scheduling the
message was flaky and some events ended up not being handled at all (see
screenshot below). As a bonus, this simplifies our code and prevents
having a delay. It seems like this method still works with the channel
name instead of needing an id, which was the main motivation towards the
changes in the aforementioned PR;
- Removes `FEATURE_UPDATED` from the event options for the Slack App
addon, as [this event is
deprecated](https://docs.getunleash.io/reference/environments#addons);
- Adds support for events without a specific project, including a test,
similar to https://github.com/Unleash/unleash/pull/4672
 - Misc cleanups;


![image](https://github.com/Unleash/unleash/assets/14320932/3fcd085c-a60f-42f6-9739-b600db7a7cee)
2023-09-14 08:19:38 +01:00
Fredrik Strand Oseberg
99308a7054
fix: add additionalproperties to the sdkContextSchema (#4682)
This was changed a month ago, but it ends up breaking the frontend when
we regenerate the types because the playground needs to have this
structure for now. We'll need to add this back until we can rewrite the
playground to follow the schema.
2023-09-13 12:39:36 +02:00
Mateusz Kwasniewski
14423c5870
feat: Limit exclude archived features (#4680) 2023-09-13 11:48:22 +02:00
Thomas Heartman
392beee114
feat: add implicit surrounding ^ and $ to patterns (#4664)
This PR updates the back-end handling of feature naming patterns to add
implicit leading `^`s and trailing `$`s to the regexes when comparing
them.

It also adds tests for the new behavior, both for new flag names and for
examples.

## Discussion points

Regarding stripping incoming ^ and $: We don't actually need to strip
incoming `^`s and `$`s: it appears that `^^^^^x$$$$$` is just as valid
as `^x$`. As such, we can leave that in. However, if we think it's
better to strip, we can do that too.

Second, I'm considering moving the flag naming validation into a
dedicated module to encapsulate everything a little better. Not sure if
this is the time or where it would live, but open to hearing
suggestions.
2023-09-13 10:50:37 +02:00
Nuno Góis
4de8ea2553
fix: post global events even when filtering by env (#4672)
https://linear.app/unleash/issue/2-1276/deal-with-events-without-an-environment

This makes it so that global events (events not tied to a specific
environment) are always received, no matter the configured environment
filter.

It also includes a respective test and small sentence on the UI
explaining the behavior.


![image](https://github.com/Unleash/unleash/assets/14320932/021a3622-78fe-45af-b68c-dde0813f32f0)
2023-09-13 08:22:18 +01:00
Gastón Fournier
c39d815516
fix: API improvements aligning the types to our schemas (#4650)
Some of our types in OSS have drifted apart from our OpenAPI schemas.
This will help them be aligned again
2023-09-12 15:40:57 +02:00
Mateusz Kwasniewski
2b2f5e20fa
feat: Import limit validation (#4669) 2023-09-12 15:36:19 +02:00
Tymoteusz Czech
ed6547b6f1
fix: integrations UI (#4670)
## About the changes
UI adjustments - text, spacing

Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com>
2023-09-12 15:45:51 +03:00
Tymoteusz Czech
dbaa386697
feat: Edge integration page (#4657)
## About the changes

![image](https://github.com/Unleash/unleash/assets/2625371/6f4dcf7f-c3cf-45a2-9525-2965c31b6d89)
2023-09-12 14:25:38 +02:00
Mateusz Kwasniewski
4dcbb4b997
feat: check toggle limit on import (#4665) 2023-09-12 13:53:04 +02:00
Jaanus Sellin
0cd0d2f153
fix: last seen environment remove duplicate entries (#4663) 2023-09-12 11:43:01 +03:00
Thomas Heartman
9114969869
feat: make import/export work with project patterns (#4652)
This PR adds feature name pattern validation to the import validation
step. When errors occur, they are rendered with all the offending
features, the pattern to match, plus the pattern's description and
example if available.


![image](https://github.com/Unleash/unleash/assets/17786332/69956090-afc6-41c8-8f6e-fb45dfaf0a9d)

To achieve this I've added an extra method to the feature toggle service
that checks feature names without throwing errors (because catching `n`
async errors in a loop became tricky and hard to grasp). This method is
also reused in the existing feature name validation method and handles
the feature enabled chcek.

In doing so, I've also added tests to check that the pattern is applied.
2023-09-12 10:19:40 +02:00
andreas-unleash
1cd0edb11a
feat: variant with number payload (#4654)
Adds `number` as possible payload type for variant.
Adds a flag to enable the feature
Updates all relevant models and schemas
Adds the option to the UI

Closes: #
[1-1357](https://linear.app/unleash/issue/1-1357/support-number-in-variant-payload)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-09-11 16:57:42 +03:00
Jaanus Sellin
77fbac01e4
feat: remove newApplicationsList feature flag (#4653) 2023-09-11 12:28:43 +02:00
Fredrik Strand Oseberg
f6a157f2f5
fix: add experimental flag (#4649) 2023-09-08 16:52:10 +03:00
Fredrik Strand Oseberg
26ade79d66
Fix/dora polish (#4645)
This PR includes:
* Tests for retrieving lead time per feature toggle and project average
* Feedback component
2023-09-08 14:18:58 +02:00
David Leek
10a62642d7
chore: return 404 when adding environment to project that doesnt exist (#4635)
## About the changes

Returns a 404 response instead of 500 when trying to set an environment
on a project that doesn't exist
2023-09-08 12:36:13 +02:00
Tymoteusz Czech
2aa63fbacd
fix: addon schema validation (#4643)
Fix addon schema breaking build
2023-09-08 09:39:57 +00:00
Tymoteusz Czech
dff0420ca8
feat: proxy and edge integration cards (#4636) 2023-09-08 10:45:37 +02:00
Jaanus Sellin
bc0c6fcb62
fix: fix failing group service test (#4642) 2023-09-08 11:32:21 +03:00
Gastón Fournier
feab6db76e
Revert "fix: api token schema" (#4638)
Reverts Unleash/unleash#4633 because of
https://github.com/Unleash/unleash/pull/4633#issuecomment-1710122769
2023-09-07 15:25:49 +02:00
Tymoteusz Czech
e97859af91
Integrations form (#4622)
## About the changes
Redesigned/refactored integrations form.


![image](https://github.com/Unleash/unleash/assets/2625371/9f3ad019-e367-4f89-932d-539d7a370f88)

Closes
[1-1298/resesign-of-integrations-form](https://linear.app/unleash/issue/1-1298/resesign-of-integrations-form)
2023-09-07 10:27:46 +00:00
Gastón Fournier
fe51b501e6
fix: api token schema (#4633)
## About the changes
Create api token schema can either provide the field `project` or its
plural: `projects` so the joi validation makes them optional:
2be77fb55e/src/lib/schema/api-token-schema.ts (L20-L24)

This means that when returning the token, the response will either
contain `project` or `projects` depending on what was provided as input.
Therefore we need to make both fields optional in the response
2023-09-07 12:23:53 +02:00
Thomas Heartman
f55c67fe2e
1-1334: show short error message when validation fails (#4617)
The error message only tells the user that the name doesn't match the
pattern. Because we already show the pattern above the input, we don't
need to repeat it in the error message. This makes for a shorter and
more concise message and better UX.

At the same time, for API users, we can keep the more detailed message
that includes info about the pattern, the example, and the description.


![image](https://github.com/Unleash/unleash/assets/17786332/0492f2ad-810d-435e-bfe6-785afee96892)
2023-09-06 10:20:10 +00:00
Thomas Heartman
0b8b772ff1
1-1333: fix type problems (#4615)
This change makes it so that you can save flag naming data on project
creation.

There was a mismatch between flattened and nested data in the creation
endpoint. Likely because we went back and forth a bit when we created
the feature originally.
2023-09-06 12:13:48 +02:00
Thomas Heartman
73b7cc0b5a
1-1319: add feature naming pattern descriptions (#4612)
This PR adds a feature naming pattern description to the project form.
It's rendered as a multi-line input field. The description is also
stored in the db.

This adapts most of @andreas-unleash's PR #4599 with some minor changes
(using description instead of prompt). Actually displaying this data to
the users will come in a later PR.


![image](https://github.com/Unleash/unleash/assets/17786332/b96d2dbb-2b90-4adf-bc83-cdc534c507ea)
2023-09-06 08:13:28 +00:00
Nuno Góis
c3216ac941
fix: group roles assumption, refactor group types (#4576)
Does what it says on the tin, should help with cleaning up
https://github.com/Unleash/unleash/pull/4512 and respective schema
changes.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2023-09-05 20:30:20 +01:00
Nuno Góis
1ae700a027
feat: add request logger env variable (#4614)
Adds a new env variable for request logger.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2023-09-05 15:32:20 +01:00
Tymoteusz Czech
47a59224bb
Integration card component (#4557)
![image](https://github.com/Unleash/unleash/assets/2625371/42364fdb-1ff1-48c4-9756-a145a39e45b9)


## 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? -->
2023-09-05 12:14:03 +00:00
Thomas Heartman
a1e98056ec
feature naming patterns: allow empty values in examples and patterns (#4611)
Allow empty patterns and examples for feature naming. 

This fixes an issue where the form would break, not allowing you to
create new projects at all.
2023-09-05 11:40:03 +00:00
Thomas Heartman
8a8a7b0899
1-1329: return 400 when pattern is empty but example is not (#4609)
Adding an example when there is no pattern doesn't make any sense, so it
should be an error.

Tests in https://github.com/ivarconr/unleash-enterprise/pull/721
2023-09-05 09:09:55 +00:00
Mateusz Kwasniewski
848b35a7a6
feat: search event log by tags (#4604) 2023-09-04 17:37:23 +02:00
Gastón Fournier
19ec66a9d1
chore: token api simplification (#4600)
## About the changes
We found a problem generating the Go SDK client for the tokens API that
makes use of `oneOf`, combined with `allOf`. The generator doesn't know
how to map this type and leaves it as an object. This PR simplifies the spec and therefore the code generated after it
2023-09-04 16:02:24 +02:00
Jaanus Sellin
53f90d37c5
feat: feature naming patterns (#4591)
Adds a first iteration of feature flag naming patterns. Currently behind a flag.

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
Co-authored-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-04 11:53:33 +00:00
Mateusz Kwasniewski
45e089f27f
chore: strategy variant flag removed (#4603) 2023-09-04 13:15:54 +02:00
Tymoteusz Czech
8aace7f93f
refactor: instance health cleanup (#4602)
## About the changes
Cleanup after hackathon. Discovered project on:
https://linear.app/unleash/project/active-users-and-instance-dashboard-67352abadf49
2023-09-04 13:10:23 +02:00
Mateusz Kwasniewski
5ae86ef196
chore: Change request flags removed (#4601) 2023-09-04 10:57:13 +02:00
Gastón Fournier
adec9138ea
fix: Add feature environment variants updated event (#4598)
## About the changes
Add additional event that can be configured inside Slack App Addon
2023-09-01 16:54:09 +02:00
Thomas Heartman
1799086deb
openapi: sort tags file (#4595)
This change sorts the tags in the tags file and tests that the list is
sorted alphabetically. This makes it easier to
find tags in the file. 

#4580 already introduced a test to check that we have no duplicate
tags, so this isn't as necessary anymore, but it's still nice to have.

It also removes the previous auto-sorting before exporting. This is to
ensure that entries are sorted in the source list. This might seem like
a regression, but it makes it easier to spot near-duplicate tags:

> Despite having the test that validates there are no duplicates, you
can always have Notifications and Notification API by mistake (tags that
mean the same but are different). Keeping the list alphabetically sorted
might help to prevent this before pushing the change to prod. In this
case, we will eventually find out and fix it, so this could be a good
reason to have the list sorted.
2023-09-01 10:15:12 +00:00
Tymoteusz Czech
063a4f7875
fix: config snapshot (#4593) 2023-08-30 15:07:08 +02:00
Tymoteusz Czech
0d5f33f8ba
Feat/instance health (#4586)
Hackathon

---------

Co-authored-by: chriswk <chriswk@getunleash.io>
2023-08-30 12:51:46 +00:00
Fredrik Strand Oseberg
3b2d6a4cbf
feat: DORA metrics lead time to production (#4589)
* Adds initial support for estimating dora metric lead time for changes
per feature toggle
2023-08-30 14:39:43 +02:00
David Leek
ff346adb94
chore: return 404 when projectid not found (#4581)
## About the changes
Returns Not Found on create and get project api tokens when given a
project id that doesn't exist

## Discussion points
- This is an extra lookup per execution of the endpoint
2023-08-30 10:24:20 +02:00
Gastón Fournier
ae18c3d6c1
chore: Remove duplicated tags (#4580)
## About the changes
At https://github.com/Unleash/unleash/pull/4432 we've introduced the
same tags twice which causes issues when generating the api clients.

Closes #2-1350-fix-openapi-duplicated-tags
2023-08-28 14:03:58 +02:00
David Leek
95be24996e
Fixes hangs when sending incorrect parameters to deleteProjectApiToken endpoint (#4579)
## About the changes
Returns either 400 or 404 when token isn't found or doesn't match single
project must be provided projectId criteria

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

## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->
Is projects.length > 1 a 400?
2023-08-28 13:53:32 +02:00
Jaanus Sellin
35fe575d0d
feat: application usage feature flag and cleanup (#4568) 2023-08-25 13:26:44 +03:00
Christopher Kolstad
21b4ada577
feat: multiple project roles (#4512)
https://linear.app/unleash/issue/2-1128/change-the-api-to-support-adding-multiple-roles-to-a-usergroup-on-a

https://linear.app/unleash/issue/2-1125/be-able-to-fetch-all-roles-for-a-user-in-a-project

https://linear.app/unleash/issue/2-1127/adapt-the-ui-to-be-able-to-do-a-multi-select-on-role-permissions-for

- Allows assigning project roles to groups with root roles
- Implements new methods that support assigning, editing, removing and
retrieving multiple project roles in project access, along with other
auxiliary methods
- Adds new events for updating and removing assigned roles
- Adapts `useProjectApi` to new methods that use new endpoints that
support multiple roles
- Adds the `multipleRoles` feature flag that controls the possibility of
selecting multiple roles on the UI
- Adapts `ProjectAccessAssign` to support multiple role, using the new
methods
- Adds a new `MultipleRoleSelect` component that allows you to select
multiple roles based on the `RoleSelect` component
- Adapts the `RoleCell` component to support either a single role or
multiple roles
- Updates the `access.spec.ts` Cypress e2e test to reflect our new logic
- Updates `access-service.e2e.test.ts` with tests covering the multiple
roles logic and covering some corner cases
- Updates `project-service.e2e.test.ts` to adapt to the new logic,
adding a test that covers adding access with `[roles], [groups],
[users]`
- Misc refactors and boy scouting


![image](https://github.com/Unleash/unleash/assets/14320932/d1cc7626-9387-4ab8-9860-cd293a0d4f62)

---------

Co-authored-by: David Leek <david@getunleash.io>
Co-authored-by: Mateusz Kwasniewski <kwasniewski.mateusz@gmail.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
2023-08-25 09:31:37 +01:00
Jaanus Sellin
1f96c1646c
chore: remove configurableFeatureTypeLifetimes flag (#4569) 2023-08-25 09:19:08 +02:00
Mateusz Kwasniewski
2c3514954c
feat: import service validate duplicates (#4558) 2023-08-24 10:05:21 +02:00
Jaanus Sellin
0fb078d4c5
fix: do not allow creation/update of feature toggle with invalid strategy name (#4555) 2023-08-23 16:56:22 +03:00
Tymoteusz Czech
31e2260c46
Remove frontendNavigationUpdate flag (#4547)
https://linear.app/unleash/issue/1-1275/remove-frontendnavigationupdate-feature-flag

Shipping new navigation by default to everyone
2023-08-23 11:42:20 +02:00
Mateusz Kwasniewski
65e62c64b8
fix: import duplicate features (#4550) 2023-08-23 11:11:16 +02:00
Jaanus Sellin
1fbd8b6ef8
feat: applicaton usage endpoint (#4548) 2023-08-23 12:00:22 +03:00
Tymoteusz Czech
573518e48d
Integrations - frontend adjustments (#4527)
## About the changes
  - [x] Create a feature flag
  - [x] Rename page title
  - [x] Rename menu item
  - [x] Update frontend URL (add redirect from old one)


https://linear.app/unleash/issue/1-1263/integrations-frontend-adjustments
2023-08-22 14:40:38 +02:00
andreas-unleash
d19d97cf18
feat: persist client application usage (#4534)
Closes #
[1-1256](https://linear.app/unleash/issue/1-1256/backend-to-save-application-usage)

Adds client application usage persisting on upsert and bulkUpsert
functions

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-08-21 14:36:31 +03:00
Jaanus Sellin
68273da213
chore: remove emitPotentiallyStaleEvents flag (#4537) 2023-08-21 14:35:35 +03:00
Jaanus Sellin
6cefb6021e
chore: remove newProjectLayout flag (#4536) 2023-08-21 13:55:04 +03:00
Mateusz Kwasniewski
2cfb99c768
feat: features overwrite warning (#4535) 2023-08-21 11:09:09 +02:00
Christopher Kolstad
f114aa401a
feat: slack-app can now post to both tagged and default channel (#4520)
Currently the slack-app addon only posts to either the tagged channel
for the feature or the default channels. This PR adds a new field that
will allow you to configure the addon to post to both the default
channels and the tagged channel (s)
2023-08-21 09:00:06 +02:00
Jaanus Sellin
dbae2d1153
feat: application usage new ui (#4528) 2023-08-18 14:55:23 +03:00
andreas-unleash
4ce6c96e04
feat: create client_applications_usage table migration (#4521)
Creates client_applications_usage table

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-08-18 14:26:22 +03:00
Thomas Heartman
3d7393c340
fix: disallow empty summaries and descriptions (#4529) 2023-08-17 16:55:52 +02:00
David Leek
76d3cc59cf
feat: add usage info to project role deletion dialog (#4464)
## 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. -->

Adds projects user and group -usage information to the dialog shown when
user wants to delete a project role

<img width="670" alt="Skjermbilde 2023-08-10 kl 08 28 40"
src="https://github.com/Unleash/unleash/assets/707867/a1df961b-2d0f-419d-b9bf-fedef896a84e">

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2023-08-17 09:43:43 +02:00
Mateusz Kwasniewski
fb4b0f8cf3
feat: get api tokens by name (#4507) 2023-08-16 11:41:20 +02:00
Thomas Heartman
7ea4e5d5b9
chore: remove additionalProperterties: true annotation. (#4508)
Unless you set `additionalProperties` to `false`, additional properties
are always
allowed. By explicitly setting it to `true` the generated
examples contain additional properties, e.g.:

```json
{
  "tokens": [
    "aproject:development.randomstring",
    "[]:production.randomstring"
  ],
  "additionalProp1": {}
}
```

By removing the explicit annotation, we still allow additional
properties, but we don't get them in examples:

```json
{
  "tokens": [
    "aproject:development.randomstring",
    "[]:production.randomstring"
  ]
}
```
2023-08-16 11:17:05 +02:00
Thomas Heartman
eec9593d55
chore: fix formatting of openapi description (#4503)
The indented formatting makes it interpreted as a markdown code block.
This isn't what we want. It's not as pretty, but putting it on one
line makes it render correctly.

What it looks like today:

![image](https://github.com/Unleash/unleash/assets/17786332/5e462931-5a3b-4b75-9cb5-0b21da4838b1)
2023-08-16 08:55:38 +02:00
Mateusz Kwasniewski
16190ddca6
feat: disable scheduler for tests (#4496) 2023-08-15 15:58:36 +02:00
Mateusz Kwasniewski
1eae31527e
feat: enable migration lock by default (#4495) 2023-08-15 14:46:08 +02:00
Christopher Kolstad
d7c7abdda3
fix: update slack-app tests to reflect what we now do 2023-08-15 13:17:06 +02:00
Mateusz Kwasniewski
c58d325173
feat: reject change request dialog (#4491) 2023-08-15 12:49:40 +02:00
Christopher Kolstad
4ad370450d
fix: Change slackapp to using scheduleMessage (#4490)
### What
This PR changes the slack-app addon to use slack-api's scheduleMessage
instead of postMessage.

### Why
When using postMessage we had to find the channel id in order to be able
to post the message to the channel. scheduleMessage allows using the
channel name instead of the id, which saves the entire struggle of
finding the channel name. It did mean that we had to move to defining
blocks of content instead of the easier formatting we did with
postMessage.

### Message look

![image](https://github.com/Unleash/unleash/assets/177402/a9079c4d-07c0-4846-ad0c-67130e77fb3b)
2023-08-15 10:29:45 +00:00