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

1914 Commits

Author SHA1 Message Date
Jaanus Sellin
d7eb950f3a
chore: remove featureSearchAPI flag (#6081) 2024-01-31 10:01:31 +02:00
Jaanus Sellin
c6a2303026
chore: remove featureSearchFrontend flag (#6066) 2024-01-31 09:22:26 +02:00
Mateusz Kwasniewski
ccc41dca4e
feat: scheduler init jitter (#6071) 2024-01-30 15:49:35 +01:00
Mateusz Kwasniewski
55b2bb4813
feat: expose project time to production for project flag trends (#6068) 2024-01-30 13:28:20 +01:00
Mateusz Kwasniewski
82e84ec14d
feat: migration for health and time_to_production in flag trends (#6067) 2024-01-30 13:28:10 +01:00
Ivar Conradi Østhus
38df2e1831
fix: add instanceName to license display (#6065)
## About the changes
- Shows the instanceName from the license
- add new feature flag `enableLicenseChecker` used to enforce a valid
license.
2024-01-30 11:05:27 +01:00
Nicolae Socaciu
3ff19f3eb6
improve:schedule-execution-failed-email (#6051)
Improving the email template design


![image](https://github.com/Unleash/unleash/assets/103567375/0c62c1de-6d13-42b8-9898-4567be6ff2aa)

- @andreas-unleash i need you to fix the button for the change request
in case it's not correct like this

- also removing some leftover style from the "scheduled change conflict"
email

---------

Co-authored-by: andreas-unleash <andreas@getunleash.ai>
2024-01-30 11:13:15 +02:00
Fredrik Strand Oseberg
7d6d4064a8
feat: connect dashboard static widgets to data (#6062)
This PR connects the static widgets to actual data
2024-01-30 10:07:16 +01:00
Jaanus Sellin
832884b4f5
fix: admin token should be passed forward from controllers (#5960)
We were sending `user.id` to the service, but if an admin token is used,
there is no `user.id.` Instead, there is
`user.internalAdminTokenUserId`. so we need to use the special method
`extractUserIdFromUser`.

This PR adds this implementation, and now the service correctly
retrieves the appropriate ID for admins.

Related to: https://github.com/Unleash/unleash/pull/5924
2024-01-30 11:03:15 +02:00
David Leek
9d2c65c9c0
chore: events created by userid migration (#6027)
## About the changes

Schedules a best-effort task setting the value of
events.created_by_user_id based on what is found in the created_by
column and if it's capable of resolving that to a userid/a system id.
The process is executed in the events-store, it takes a chunk of events
that haven't been processed yet, attempts to join users and api_tokens
tables on created_by = username/email, loops through and tries to figure
out an id to set. Then updates the record.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2024-01-30 08:22:53 +01:00
David Leek
c08ac86c5f
chore: filter on token username and user id in SQL instead (#6061)
## About the changes

Change the sorting of features to migrate created_by_user_id for, and
filter out unresolvable feature/users

Query tested manually in enterprise
2024-01-29 15:14:44 +01:00
David Leek
bbebd293e5
chore: add a migration that removes incorrectly set sysuserid (#6032)
## About the changes

Resets created_by_user_id on events incorrectly marked as -1337 when an actual user has been set in created_by column, to clean up after a bug
2024-01-29 09:16:18 +01:00
David Leek
e652af49af
chore: default the data migration flag for createdbyuserid to false (#6048)
## About the changes

Sets data migration of features and events created_by_user_id to
disabled by default

Map to promise and await all in created by user id migration for features
2024-01-29 08:07:33 +01:00
andreas-unleash
4a2d1b0364
fix: return 400 when enabling env of archived toggle (#6049)
Creates a new ArchivedFeatureError.
Throw this error when trying to toggle a feature environment for an
archived feature.

Closes
https://github.com/orgs/Unleash/projects/8/views/1?pane=issue&itemId=51242922

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-26 16:02:17 +02:00
Mateusz Kwasniewski
a1fa5a4212
feat: flag trends db migration (#6044) 2024-01-26 14:37:15 +01:00
Mateusz Kwasniewski
9b281ca508
feat: stale flags count per project (#6043) 2024-01-26 12:04:43 +01:00
Christopher Kolstad
32dd377c3e
fix: Use knex whereLike instead of whereRaw to fix escaping (#6041)
This escape with `??` double escaped the LIKE query causing no results.
This updates to using whereLike, which does the correct escaping for
string query.
2024-01-26 10:44:53 +01:00
David Leek
c7f13aec0b
chore: implement created_by_user_id in features (#5994)
## About the changes

Adds a scheduled task that every 5 seconds updates 500 entries in the
features table setting `created_by_user_id`.
It does this by looking at the related event, checks created_by and
joins users table for match on username or email, and joins api_tokens
table on username matches. Then picks either a users id if set, or uses
-42 (admin token user)
2024-01-25 13:09:30 +01:00
Mateusz Kwasniewski
8ab4aa3d0e
feat: user trends migration (#6030) 2024-01-25 12:56:29 +01:00
David Leek
0045fcbcdf
chore: replace systemUser -1 with new -1337 system user (#5999)
## About the changes
This PR replaces the old systemUser -1 in user-service.ts with the new
SYSTEM_USER -1337 and adds a migration to move events created_by = -1 to
-1337


## Discussion points
Does it make sense to do both of these things? Or should we skip the
migration? How would this behave in a large system with hundreds of
thousands of events, should this be split up?
2024-01-25 11:19:39 +01:00
andreas-unleash
8f3275ee40
chore: change users image_url column to text (#6031)
Change the image_url column to text

Closes #
https://github.com/orgs/Unleash/projects/8/views/1?pane=issue&itemId=51021534

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-25 11:40:18 +02:00
andreas-unleash
89bea0d532
fix: clone variants (featureEnv and strategy) when cloning an env (#6026)
Fixes 2 bugs
- Strategy variants
- Feature env variants 
not being cloned when cloning an environment

Closes #
[SR-350](https://linear.app/unleash/issue/SR-350/cloning-environment-does-not-clone-variants-or-strategy-variants)

Manual test verifies the fix
<img width="1659" alt="Screenshot 2024-01-24 at 16 48 28"
src="https://github.com/Unleash/unleash/assets/104830839/ba9fc9b8-e792-47bb-b6e8-660350384ea8">
<img width="1408" alt="Screenshot 2024-01-24 at 16 48 10"
src="https://github.com/Unleash/unleash/assets/104830839/1e2d5287-35d0-42d2-9ab2-8caa313bd5a8">

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-25 10:53:43 +02:00
Mateusz Kwasniewski
41351a694e
refactor: Instance stats service composition root (#6029) 2024-01-25 09:11:26 +01:00
Christopher Kolstad
17d826ddf4
task: Add banner encouraging edge upgrade (#6018)
Only triggers if there is any rows in client instances that have

    sdk_version: unleash-edge with version < 17.0.0

The function that checks this memoizes the check for 10 minutes to avoid
scanning the client instances table too often.
2024-01-24 14:22:48 +00:00
Christopher Kolstad
3acdfc2cf4
task: Make /edge/metrics toggleable by toggle (#6003)
Previously we used a killswitch and returned 404 if the feature was
enabled. This flips that to a default disabled toggle, that has to be
turned on to handle old Edge (pre 17.0.0) posting bulk metrics
2024-01-24 14:09:03 +01:00
Nuno Góis
331033408c
fix: flag resolver get variant (#6020)
https://linear.app/unleash/issue/2-1880/fix-flag-resolver-getvariant-behavior

Fixes the flag resolver `getVariant` behavior when there's a variant
object set in `experimental` - The flag resolver should call the
external resolver `getVariant` when not overridden to be true, even if
set as variant object in `experimental`.

Related: https://github.com/Unleash/unleash/pull/3808
2024-01-24 11:53:04 +00:00
Gastón Fournier
cee2500a4d
feat(2-1879): add enabled to action sets (#6023)
## About the changes
Adds enabled to action sets table
2024-01-24 12:52:04 +01:00
Tymoteusz Czech
68eb3dec07
fix: upgrade unleash-client to v5.3.0 (#5800) 2024-01-24 09:12:07 +01:00
Gastón Fournier
9f550331ce
chore: validate all tables have primary keys (#6005)
## About the changes
This is a helpful reminder to have primary keys in all our tables.

Related to [#4303](https://github.com/Unleash/unleash/issues/4303)
2024-01-23 16:38:16 +01:00
Gastón Fournier
82ac5a47ad
chore: This helps output the migrations being applied (#6004)
## About the changes
This outputs to console.log but should be indexable:

![image](https://github.com/Unleash/unleash/assets/455064/cb696936-7060-447d-b22d-ff62b4dbcbc3)
2024-01-23 16:01:36 +01:00
andreas-unleash
cc5a4cbe33
fix: add unleash to default email sender string (#6002)
Adds "Unleash" to the "noreply@getunleash.io" for default email sender

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-23 14:32:40 +02:00
Gastón Fournier
db93ab57f0
chore: remove flagResolver option (#6001)
## About the changes
This option is not referenced in the code

I believe its original intent was to be able to override flagResolver,
but it's currently not being used:

a46f54f48a/src/lib/create-config.ts (L490-L491)

Instead, we're using `experimental`, `flags`, and `externalResolver`


a46f54f48a/src/lib/create-config.ts (L64-L73)


f63581c03a/src/lib/util/flag-resolver.ts (L12-L20)
2024-01-23 13:16:32 +01:00
Gastón Fournier
f63581c03a
fix: enabled lock check (#5997)
We should use the enhanced flagResolver
Tested locally:
```
9:44:13 AM - Starting compilation in watch mode...
[dev:backend] 
[dev:backend] 
[dev:backend] 9:44:26 AM - Found 0 errors. Watching for file changes.
[dev:backend] [2024-01-23T09:44:27.498] [INFO] server-impl.js - DB migration: start
[dev:backend] [2024-01-23T09:44:27.499] [INFO] server-impl.js - Running migration with lock
[dev:backend] [2024-01-23T09:44:29.884] [INFO] server-impl.js - DB migration: end
```
2024-01-23 10:46:48 +01:00
Gastón Fournier
0b1d565dad
chore: add logs (#5996)
Validate we're not using locks
2024-01-23 10:24:58 +01:00
Fredrik Strand Oseberg
60d2176efa
feat: add option to use variants with feedback (#5986)
This PR will allow us to use a feature flag with variants to control
whether or not we should show the comments field of the feedback form.
This will allow us to see whether we can increase feedback collection if
we reduce the load on the customer.
2024-01-22 13:14:27 +01:00
Gastón Fournier
c5afa8ff11
fix: unauthorized disable feature (#5982)
## About the changes
This was spotted while testing automated actions. Steps to reproduce:

1. Add an editor user
2. Get a PAT for the editor user
3. As Admin create a feature in a project where the editor user is not a
member and enable the feature
4. Try using the editor's PAT to modify the feature
5. As the editor create a project (you'd be made owner) and try the same
request but just change the project name for the new project just
created (don't change anything else)

**Expected behavior**: you can't disable the feature
**Actual behavior**: the feature is disabled

This does not happen when trying to turn on a flag because during the
turn-on process we do validate if the feature belongs to project when we
call updateStrategy:
c18a7c0dc2/src/lib/features/feature-toggle/feature-toggle-service.ts (L1751-L1764)
2024-01-22 12:50:14 +01:00
Gastón Fournier
8ba5cdced1
feat: add action states (#5983)
## About the changes
Add action states table without an index yet
2024-01-22 11:49:35 +01:00
Nuno Góis
5253482f61
refactor: add typesafe wrappers for prom client metrics (#5969)
https://linear.app/unleash/issue/2-1856/add-typesafe-wrappers-over-prom-clients-metrics

As discussed on the latest knowledge sharing session, this adds typesafe
wrappers over prom client's metrics, requiring us to specify all the
configured labels for each metric.

This uses a functional approach and only exposes the methods that are
currently relevant to us, while also exposing the underlying instance of
the metric for an easy access if needed.

Since we often chain `labels` with `inc` in counters, this adds a
convenience `increment` method for counters which does both in a single
call.
2024-01-19 14:51:29 +00:00
Nicolae Socaciu
7b30ab09d2
Fix email template scheduled change conflict (#5957)
Fixing the mobile template (this is before the fix)
- reducing padding around the content
- fixing line-height for the content
- fixing the footer links  

![image](https://github.com/Unleash/unleash/assets/103567375/dbe88f5a-a798-4fd4-ab42-543689605043)
2024-01-19 14:57:00 +02:00
Gastón Fournier
80bc4e05a2
chore: add types to pat middleware (#5951)
Add proper types
2024-01-18 14:36:42 +01:00
Nuno Góis
3dd188e77c
refactor: shared url_safe_basic constant (#5952)
Uses a new `URL_SAFE_BASIC` regex constant that checks for characters
that are commonly used in URL path sections: alphanumeric lowercase
characters, dashes and underscores.

This will allow us to re-use this constant in our server-side
validation.
2024-01-18 12:33:33 +00:00
Gastón Fournier
b91df61994
chore: re use extract user methods (#5947)
## About the changes
1. Re-use existing methods in extract-user.ts:
70f6a07f2c/src/lib/features/events/event-service.ts (L93-L101)
2. Move event-service and event-store to features/event
3. Add export default in previous paths for backward compatibility:
70f6a07f2c/src/lib/services/event-service.ts (L1-L4)
and
70f6a07f2c/src/lib/db/event-store.ts (L1-L4)
2024-01-18 13:15:21 +01:00
Jaanus Sellin
605125fbb5
feat: add primary keys to missing tables (#5943)
Follow up of https://github.com/Unleash/unleash/issues/4303

We are adding primary keys to all tables missing them, currently
**role_permission**, **api_token_project**, and **project_stats**.
By adding primary keys, the issue with migrations failing during
upgrades in replicated database setups will be resolved.
2024-01-18 13:52:51 +02:00
Tymoteusz Czech
4b02d6aa9c
Executive Dashboard page setup (#5949) 2024-01-18 12:32:25 +01:00
Mateusz Kwasniewski
d3215335c9
feat: metrics periods expressed in days (#5928) 2024-01-18 11:54:20 +01:00
Christopher Kolstad
86b5f108d0
fix: feature toggle update total needs 4 labels (#5946)
So, this was causing a lot of ERROR in our logs, due to the metric
having gotten an extra label the last month.

Two things for this fix.
1. add the missing label to the two calls that did not have it added
2. update the log line to include the error as another argument to the
logger, so we actually get a stacktrace from the error.
2024-01-18 11:00:56 +01:00
Christopher Kolstad
fa72ced1e5
feat: added more granular project permissions (#5932)
### What
Adds Read and Write permissions for project administration settings
(user access, change request settings, default strategy, other).

### Why
On request from two large customers that wanted our RBAC controls to be
more granulated to easier be able to limit the access they granted their
users.
2024-01-18 09:57:44 +01:00
Gastón Fournier
ceaaf3d0f3
feat: admin token calls get an admin token user (#5924)
## About the changes
Whenever we get a call from an admin token we want to associate it with
the [admin token
user](4d42093a07/src/lib/types/core.ts (L34-L41)).
This should give us the needed audit for this type of calls that
currently were lacking a user id (we only stored a string with the token
name in the event log).

We consciously decided not to use `id` as the property to prevent any
unforeseen side effects. The reason is that only `IUser` type has an id
and adding an id to `IApiUser` might lead to confusion.
2024-01-17 16:55:59 +01:00
Daniel Brooks
1392b10727
fix(import): making all imports relative and removing baseUrl (#5847)
Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2024-01-17 15:33:03 +02:00
andreas-unleash
60813acb09
fix: make the conflcit email template button conditionally render (#5931)
Makes the schedule conflict email button conditional to having the link
present.

Closes #
[1-1950](https://linear.app/unleash/issue/1-1950/modify-the-template-to-make-the-new-button-conditional)

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-17 13:26:07 +00:00
Jaanus Sellin
ee08bd8d42
chore(deps): update dependency @types/supertest to v6 (#5926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-17 13:36:17 +02:00
Thomas Heartman
bbaf574841
chore: add flag to experimental.ts (#5925)
This change adds the new changeRequestConflictHandling flag to Unleash.
2024-01-17 09:55:58 +00:00
Christopher Kolstad
2b1111044f
feat: added killswitch for admin tokens (#5905)
Since we've now added PAT's we really do recommend switching to those,
or for enterprises, we recommend using service accounts.

Admin tokens have an obvious disadvantage in that they're not connected
to any user, so actions performed by them are harder to audit.

This PR adds a killswitch for turning it off, in preparation for
deprecating them and ultimately removing them in the future.
2024-01-17 10:27:36 +01:00
Mateusz Kwasniewski
16691d72d7
refactor: metrics in feature oriented architecture (#5919) 2024-01-17 09:14:31 +01:00
Gastón Fournier
04e55831e3
chore: add another system user for admin tokens (#5915)
## About the changes
This admin token user will help us differentiate actions performed by
the system from actions performed with an admin token.

Events created with an admin token should have the id of this user as
createdByUserId property and the username of the token used as the
createdBy property. i.e.
```json
{
  "id": 11,
  "type": "pat-created",
  "createdBy": "admin-token",
  "createdAt": "2024-01-16T13:16:27.887Z",
  "createdByUserId": -42,
  "data": {
    "description": "admin-pat",
    "expiresAt": "2024-02-15T13:16:25.586Z",
    "secret": "***",
    "userId": 1
  },
  "preData": null,
  "tags": [],
  "featureName": null,
  "project": null,
  "environment": null
}
```
2024-01-16 19:28:36 +01:00
Nicolae Socaciu
9f72030578
Updated scheduled-change-conflict (#5908)
Updating the UI of the email template

Closes #
[1-1940](https://linear.app/unleash/issue/1-1940/improve-scheduled-change-conflict-template)

Before

![image](https://github.com/Unleash/unleash/assets/103567375/bf6804dc-b4cc-4187-8a8f-c97dd9245faf)


After:

![image](https://github.com/Unleash/unleash/assets/103567375/de9eb257-d747-47c3-996d-e58a7a3aa84f)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: andreas-unleash <andreas@getunleash.ai>
2024-01-16 16:12:25 +02:00
Mateusz Kwasniewski
f6c0624869
feat: prevent double daily metrics insert (#5906) 2024-01-16 13:52:56 +01:00
Mateusz Kwasniewski
af4c3a86d1
fix: should not import archived child and parent (#5912) 2024-01-16 13:42:25 +01:00
Gastón Fournier
9989688d36
chore: missing export (#5911)
## About the changes
Overlooked on https://github.com/Unleash/unleash/pull/5910
2024-01-16 13:35:57 +01:00
Gastón Fournier
2ddc56927e
chore: centralize events service creation (#5910)
## About the changes
EventsService is a dependency in most of our services. This creates
helper methods to create them easily and replace a few places where
we're creating them manually
2024-01-16 13:11:28 +01:00
Gastón Fournier
317e0e7ecd
feat: event types for actions (#5907)
Define event types for actions
2024-01-16 11:59:09 +01:00
Nuno Góis
aeb9c85f11
chore: delete unnecessary column permission_id (#5413)
Follows up on https://github.com/Unleash/unleash/pull/5409 and drops
this column, since it's no longer used.
See: https://github.com/Unleash/unleash/pull/5409#discussion_r1404112310

Should only be merged after ~~`5.7`~~ `5.8` has been released.
2024-01-16 10:56:22 +00:00
Thomas Heartman
6e234727ee
chore: align with system user in db (#5893)
This change removes the system user's email from the definition, instead
setting it to `null`. It also changes the name to "Unleash System".

The IUser interface doesn't allow `null` email addresses, so we change
the type definition of the system user to get around it. However, using
`null` (instead of just removing the property entirely) is useful
because when you get the system user from the DB, it's email value will
be null (after it has been nulled out).

As of today, there is nowhere in the Unleash system (OSS or Enterprise)
where we use the system user as an IUser (we only use username and ID).
So this change shouldn't break anything.

This should follow https://github.com/Unleash/unleash/pull/5849.
2024-01-16 05:49:54 +00:00
Thomas Heartman
4564c97927
chore: remove system user's email in db. (#5849)
Updates it from 'system@getunleash.io' to `null`. We don't have that
address registered (and probably don't want it), so we'll leave it
empty.

This is a companion PR to
https://github.com/Unleash/unleash/pull/5893. With both of those
merged, the system user in the DB should match the one defined in
`core.ts`
2024-01-16 11:15:29 +05:30
Mateusz Kwasniewski
65eb8956e1
feat: Prometheus last day metrics (#5878) 2024-01-15 15:31:38 +01:00
Mateusz Kwasniewski
3e186f1986
chore: remove schedulers (#5895) 2024-01-15 15:10:15 +01:00
Nuno Góis
1c84a81178
fix: include custom root roles in user access overview (#5898)
https://linear.app/unleash/issue/2-1844/fix-add-custom-root-roles-to-user-access-overview

I noticed our user access overview method did not take into account
custom root roles, which meant only users with default root roles were
being returned.

This changes the query to check for `IN ('root', 'root-custom')`
instead, including both "root" and "custom root" roles.


![image](https://github.com/Unleash/unleash/assets/14320932/aa808e8f-edc0-4a94-b59f-a8b619ae54ca)
2024-01-15 13:38:31 +00:00
Nuno Góis
0ba37e8622
feat: list all root roles in SSO config (#5887)
Lists all root roles in SSO config, including custom root roles.


![image](https://github.com/Unleash/unleash/assets/14320932/30114169-4184-4a22-9671-c7041b750d1c)
2024-01-15 13:13:29 +00:00
Christopher Kolstad
9d839299e2
fix: differentiated interval and initial schedule call (#5896)
Differentiate log lines so we can see if it happens on every call, or
just on the initial call.
2024-01-15 11:50:32 +00:00
Mateusz Kwasniewski
8eb5a53ad9
feat: metrics calculation limit (#5853) 2024-01-12 12:32:31 +01:00
Christopher Kolstad
5a3bb1ffc3
Biome1.5.1 (#5867)
Lots of work here, mostly because I didn't want to turn off the
`noImplicitAnyLet` lint. This PR tries its best to type all the untyped
lets biome complained about (Don't ask me how many hours that took or
how many lints that was >200...), which in the future will force test
authors to actually type their global variables setup in `beforeAll`.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2024-01-12 09:25:59 +00:00
Mateusz Kwasniewski
e27a578fab
feat: separate UI flag and backend flag for extended metrics (#5875) 2024-01-12 10:20:03 +01:00
Gastón Fournier
79d438ac46
feat: add automated actions tables (#5857)
Add tables to support automated actions based on the [design
document](https://docs.google.com/document/d/15xPgn6B8gzMPk9RjMAUGu8XvozQ_45jjrsVl_Bm6Chg/edit?usp=sharinghttps://docs.google.com/document/d/15xPgn6B8gzMPk9RjMAUGu8XvozQ_45jjrsVl_Bm6Chg/edit?usp=sharing)
2024-01-11 14:42:37 +01:00
Nuno Góis
b496990f79
chore: add no unused imports biome rule (#5855)
Adds a Biome rule for "no unused imports", which is something we
sometimes have trouble catching.

We're adding this as a warning for now. It is safely and easily fixable
with `yarn lint:fix`.


![image](https://github.com/Unleash/unleash/assets/14320932/fd84dea8-6b20-4ba5-bfd8-047b9dcf2bff)

![image](https://github.com/Unleash/unleash/assets/14320932/990bb0b0-760a-4c5e-8136-d957e902bf0b)
2024-01-11 12:44:05 +00:00
andreas-unleash
6ae6193d3f
chore: remove unused event (#5854)
Removes the SCHEDULED_CHANGE_REQUEST_EXECUTED event - replaced with
CHANGE_REQUEST_SCHEDULED_APPLICATION_FAILURE,
CHANGE_REQUEST_SCHEDULED_APPLICATION_SUCCESS events

Closes #
[1-1900](https://linear.app/unleash/issue/1-1900/remove-old-schedule-executed-event)

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-01-11 13:59:44 +02:00
Thomas Heartman
3779a6f0fb
Revert "chore: align the system user defined in core.ts with the one created in the migration (#5845)" (#5852)
This reverts commit 0b5ac19d9a.
2024-01-11 15:31:15 +05:30
Mateusz Kwasniewski
ca3b4c5057
feat: Metrics api returning daily data (#5830) 2024-01-11 10:39:41 +01:00
Thomas Heartman
0b5ac19d9a
chore: align the system user defined in core.ts with the one created in the migration (#5845)
This change adjusts the exported `SYSTEM_USER` constant in `core.ts` to
match the one created in the migration in
`src/migrations/20231222071533-unleash-system-user.js`

The slight discrepancy between these two caused me some minor headache
when trying to write a test in enterprise. 

It also removes the email because we have no inbox at that address (and
we probably don't want one).

For reference, the migration looks like this:

``` sql
ALTER TABLE users ADD COLUMN IF NOT EXISTS is_system BOOLEAN NOT NULL DEFAULT FALSE;
INSERT INTO users
    (id, name, username, email, created_by_user_id, is_system)
VALUES
    (-1337, 'Unleash System', 'unleash_system_user', 'system@getunleash.io', -1337, true);

```
2024-01-11 15:08:59 +05:30
Christopher Kolstad
e7642c02aa
feat: Added bulk metrics support under /api/client/metrics/bulk path (#5779)
This adds a bulk endpoint under `/api/client/metrics`. Accessible under
`/api/client/metrics/bulk`.

This allows us to piggyback on the need for an API user with access.
This PR mostly copies the behaviour from our `/edge/metrics` endpoint,
but it filters metrics to only include the environment that the token
has access to.

So a client token that has access to the `production` will not be
allowed to report metrics for the `development` environment. More
importantly, a `development` token will not be allowed to post metrics
for the `production` environment.
2024-01-10 14:52:34 +01:00
Mateusz Kwasniewski
d71108526e
feat: read extended metrics from more than 48 hours (#5822) 2024-01-10 11:48:06 +01:00
Thomas Heartman
336eab9c5a
feat: allow slack-app and webhook to listen to schedule suspended events (#5821)
This PR adds the schedule suspended event to the slack-app and webhook
definitions.

It also slightly tweaks the markdown formatting of change requests to
add a definite article. This means the snapshot also needs to be
updated.
2024-01-10 15:14:31 +05:30
renovate[bot]
92ae2235a0
chore(deps): update dependency @biomejs/biome to v1.4.1 (#5709)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@biomejs/biome](https://biomejs.dev)
([source](https://togithub.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome))
| [`1.4.0` ->
`1.4.1`](https://renovatebot.com/diffs/npm/@biomejs%2fbiome/1.4.0/1.4.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@biomejs%2fbiome/1.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@biomejs%2fbiome/1.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@biomejs%2fbiome/1.4.0/1.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@biomejs%2fbiome/1.4.0/1.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>biomejs/biome (@&#8203;biomejs/biome)</summary>

###
[`v1.4.1`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#141-2023-11-30)

[Compare
Source](889593e3f9...a887513062)

##### Editors

- Fix [#&#8203;933](https://togithub.com/biomejs/biome/issues/933). Some
files are properly ignored in the LSP too. E.g. `package.json`,
`tsconfig.json`, etc.

##### Formatter

##### Bug fixes

- Fix some accidental line breaks when printing array expressions within
arrow functions and other long lines
[#&#8203;917](https://togithub.com/biomejs/biome/pull/917). Contributed
by [@&#8203;faultyserver](https://togithub.com/faultyserver)

- Match Prettier's breaking strategy for `ArrowChain` layouts
[#&#8203;934](https://togithub.com/biomejs/biome/pull/934). Contributed
by [@&#8203;faultyserver](https://togithub.com/faultyserver)

- Fix double-printing of leading comments in arrow chain expressions
[#&#8203;951](https://togithub.com/biomejs/biome/pull/951). Contributed
by [@&#8203;faultyserver](https://togithub.com/faultyserver)

##### Linter

##### Bug fixes

- Fix [#&#8203;910](https://togithub.com/biomejs/biome/issues/910),
where the rule `noSvgWithoutTitle` should skip elements that have
`aria-hidden` attributes. Contributed by
[@&#8203;vasucp1207](https://togithub.com/vasucp1207)

##### New features

-   Add [useForOf](https://biomejs.dev/linter/rules/use-for-of) rule.
The rule recommends a for-of loop when the loop index is only used to
read from an array that is being iterated.
Contributed by [@&#8203;victor-teles](https://togithub.com/victor-teles)

##### Enhancement

- Implements
[#&#8203;924](https://togithub.com/biomejs/biome/issues/924) and
[#&#8203;920](https://togithub.com/biomejs/biome/issues/920).
[noUselessElse](https://biomejs.dev/linter/rules/no-useless-else) now
ignores `else` clauses that follow at least one `if` statement that
doesn't break early. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

    For example, the following code is no longer reported by the rule:

    ```js
    function f(x) {
        if (x < 0) {
          // this `if` doesn't break early.
        } else if (x > 0) {
            return x;
        } else {
            // This `else` block was previously reported as useless.
        }
    }
    ```

##### Bug fixes

- Fix [#&#8203;918](https://togithub.com/biomejs/biome/issues/918),
[useSimpleNumberKeys](https://biomejs.dev/linter/rules/use-simple-number-keys)
no longer repports false positive on comments. Contributed by
[@&#8203;kalleep](https://togithub.com/kalleep)

- Fix [#&#8203;953](https://togithub.com/biomejs/biome/issues/953),
[noRedeclare](https://biomejs.dev/linter/rules/no-redeclare) no longer
reports type parameters with the same name in different mapped types as
redeclarations. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;608](https://togithub.com/biomejs/biome/issues/608),
[useExhaustiveDependencies](https://biomejs.dev/linter/rules/use-exhaustive-dependencies)
no longer repports missing dependencies for React hooks without
dependency array. Contributed by
[@&#8203;kalleep](https://togithub.com/kalleep)

##### Parser

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 7pm every weekday,before 5am
every weekday" in timezone Europe/Madrid, 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://developer.mend.io/github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEyNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: David Leek <david@getunleash.io>
2024-01-10 09:11:49 +00:00
Mateusz Kwasniewski
2c0c4e70ea
feat: Schedule daily metrics deletion (#5807) 2024-01-10 08:52:40 +01:00
Thomas Heartman
920e80c17e
chore: add schedule suspended event type (#5820)
To facilitate emitting this event in Enterprise
2024-01-10 13:21:11 +05:30
renovate[bot]
51e2d3ed46
chore(deps): update dependency node to v18.19.0 (#4957)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change | Pending | Age | Adoption | Passing
| Confidence |
|---|---|---|---|---|---|---|---|---|
| [node](https://togithub.com/nodejs/node) | | minor | `18.18.0` ->
`18.19.0` | |
[![age](https://developer.mend.io/api/mc/badges/age/github-tags/node/v18.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/github-tags/node/v18.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/github-tags/node/18.18.0/v18.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/github-tags/node/18.18.0/v18.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node)
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node))
| devDependencies | minor | [`18.17.19` ->
`18.19.4`](https://renovatebot.com/diffs/npm/@types%2fnode/18.17.19/18.19.4)
| `18.19.6` (+1) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fnode/18.19.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fnode/18.19.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fnode/18.17.19/18.19.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fnode/18.17.19/18.19.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nodejs/node (node)</summary>

###
[`v18.19.0`](https://togithub.com/nodejs/node/compare/v18.18.2...v18.19.0)

[Compare
Source](https://togithub.com/nodejs/node/compare/v18.18.2...v18.19.0)

###
[`v18.18.2`](https://togithub.com/nodejs/node/compare/v18.18.1...v18.18.2)

[Compare
Source](https://togithub.com/nodejs/node/compare/v18.18.1...v18.18.2)

###
[`v18.18.1`](https://togithub.com/nodejs/node/releases/tag/v18.18.1):
2023-10-10, Version 18.18.1 &#x27;Hydrogen&#x27; (LTS),
@&#8203;richardlau

[Compare
Source](https://togithub.com/nodejs/node/compare/v18.18.0...v18.18.1)

##### Notable Changes

This release addresses some regressions that appeared in Node.js
18.18.0:

- (Windows) FS can not handle certain characters in file name
[#&#8203;48673](https://togithub.com/nodejs/node/issues/48673)
- 18 and 20 node images give error - Text file busy (after re-build
images)
[nodejs/docker-node#1968](https://togithub.com/nodejs/docker-node/issues/1968)
- libuv update in 18.18.0 breaks webpack's thread-loader
[#&#8203;49911](https://togithub.com/nodejs/node/issues/49911)

The libuv 1.45.0 and 1.46.0 updates that were released in Node.js
18.18.0 have been temporarily reverted.

##### Commits

- \[[`3e3a75cc46`](https://togithub.com/nodejs/node/commit/3e3a75cc46)]
- ***Revert*** "**build**: sync libuv header change" (Richard Lau)
[#&#8203;50036](https://togithub.com/nodejs/node/pull/50036)
- \[[`14ece2c479`](https://togithub.com/nodejs/node/commit/14ece2c479)]
- ***Revert*** "**deps**: upgrade to libuv 1.45.0" (Richard Lau)
[#&#8203;50036](https://togithub.com/nodejs/node/pull/50036)
- \[[`022352acbe`](https://togithub.com/nodejs/node/commit/022352acbe)]
- ***Revert*** "**deps**: upgrade to libuv 1.46.0" (Richard Lau)
[#&#8203;50036](https://togithub.com/nodejs/node/pull/50036)
- \[[`d9f138189c`](https://togithub.com/nodejs/node/commit/d9f138189c)]
- ***Revert*** "**deps**: add missing thread-common.c in uv.gyp"
(Richard Lau)
[#&#8203;50036](https://togithub.com/nodejs/node/pull/50036)
- \[[`7a3e1ffbb8`](https://togithub.com/nodejs/node/commit/7a3e1ffbb8)]
- **fs**: make sure to write entire buffer (Robert Nagy)
[#&#8203;49211](https://togithub.com/nodejs/node/pull/49211)
- \[[`04cba95a67`](https://togithub.com/nodejs/node/commit/04cba95a67)]
- **test**: add `tmpdir.resolve()` (Livia Medeiros)
[#&#8203;49079](https://togithub.com/nodejs/node/pull/49079)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 7pm every weekday,before 5am
every weekday" in timezone Europe/Madrid, 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 these
updates 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://developer.mend.io/github/Unleash/unleash).

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

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.ai>
2024-01-10 07:23:19 +00:00
Thomas Heartman
e8ffea3920
chore: add reason column to change request schedule table (#5802)
This PR adds a new `reason` column to the change request schedules table
and populates it with the data that is in the `failure_reason` column.

This is the expand phase of the expand/contract pattern. The code in
enterprise will be updated to try and use the new column name, but fall
back to the old one if no value is present.

The old column can be removed later.
2024-01-10 08:47:30 +05:30
Ivar Conradi Østhus
6d4a727bdf
fix: remove unsued metric 'optimal304DiffingCounter' (#5810)
This metric was used while developing the optimal304 feature. The
feature flag has been removed and this data is not longer being
collected and this will remove the metric from Prometheus.
2024-01-09 18:54:28 +01:00
Gard Rimestad
24b202ef0b
feat: include environment type label in feature_toggle_update metrics (#5809)
This is needed in order to identify what type of an environment a toggle
is updated in. This can be test, development, pre-production or
production.
2024-01-09 16:33:00 +01:00
Mateusz Kwasniewski
a1b04e4b8d
feat: Aggregate daily metrics (#5804) 2024-01-09 13:46:49 +01:00
Gard Rimestad
adc47fd778
feat: add db metrics for environment-store (#5808)
This will give us prometheus metrics on environment lookups in the
database
2024-01-09 13:17:16 +01:00
Gastón Fournier
eb7882e2eb
feat: add automated actions flag (#5805)
Just a flag for an enterprise feature
2024-01-09 11:42:28 +00:00
Mateusz Kwasniewski
99b165741d
feat: daily metrics db migration (#5791) 2024-01-09 11:56:12 +01:00
Nuno Góis
24b4e8dcb2
chore: incoming webhooks description migration (#5803)
https://linear.app/unleash/issue/2-1822/incoming-webhooks-add-description

A description field will help us better distinguish incoming webhooks
and their purpose.
2024-01-09 10:39:51 +00:00
Mateusz Kwasniewski
8955a9906d
feat: extended metrics options ui (#5786) 2024-01-08 14:49:41 +01:00
Gastón Fournier
1724219487
feat: encrypt emails at rest for demo login (#5759)
## About the changes
This allows us to encrypt emails at signup for demo users to further
secure our demo instance. Currently, emails are anonymized before
displaying events performed by demo users. But this means that emails
are stored at rest in our DB. By encrypting the emails at login, we're
adding another layer of protection.

This can be enabled with a flag and requires the encryption key and the
initialization vector (IV for short) to be present as environment
variables.
2024-01-05 14:21:20 +01:00
Christopher Kolstad
e769ceab05
task: Add an X-Unleash-Version header to register response (#5774)
Related to our work for making Edge bulk metrics a 1st class citizen of
Unleash, this PR adds an X-Unleash-Version header to the response from
client registration.

Based on when we add the new `/api/client/metrics/bulk` endpoint, Edge
can use the response header from upstream to decide whether to post
metrics to `/edge/metrics` or `/api/client/metrics/bulk`.
2024-01-05 11:54:28 +01:00
Jaanus Sellin
75e81515c8
chore: disable search feedback by default (#5767) 2024-01-04 14:44:17 +00:00
Christopher Kolstad
4c574a1e50
task: add kill-switch for edge bulk metrics (#5758)
If the kill switch is enabled unleash returns 404 and a json body explaining why a 404 was given, encouraging users to upgrade to the most recent version of Edge.
2024-01-04 11:21:48 +01:00
Fredrik Strand Oseberg
70600552d2
Feat/add feedback to new strategy form (#5745)
This PR adds the feedback form to the new create / edit strategy form
behind a feature flag.

* Add feedback form
* Minor refactor to useFeedback
2024-01-03 15:43:22 +01:00
Ivar Conradi Østhus
31124e4a90
fix: add feature-flag for license 2024-01-03 15:25:54 +01:00
Jaanus Sellin
a73d87a943
feat: make feedback available for OSS (#5748) 2024-01-03 15:08:01 +02:00
Nuno Góis
9c4a044543
chore: observable events db migration (#5749)
https://linear.app/unleash/issue/2-1773/db-create-migration-for-a-new-observable-events-table

Adds a new DB migration to create a new `observable_events` table. Even
though we are thinking long term with the `source` columns, the short
term purpose of this table will be to store incoming webhook calls.
2024-01-03 12:08:14 +00:00
Gastón Fournier
2a1c0616e0
feat: support null created_by_user_id (#5744)
## About the changes
Creating an incoming webhook with an admin token means we can't
correlate the action with a real user. In this case we should support
null.
2024-01-02 17:53:29 +01:00
Christopher Kolstad
e993846471
task: add timer for client feature query (#5734)
Adds a database query timer for the client features query.
2024-01-02 16:02:03 +01:00
Jaanus Sellin
dc0df235dd
chore: remove private projects flag (#5743) 2024-01-02 15:53:26 +02:00
Jaanus Sellin
f53204c9b2
feat: add feature flag for posting feedback (#5741) 2024-01-02 13:10:54 +02:00
Nuno Góis
cda7d2070c
test: specify custom config in dbm (#5550)
Was having some trouble running these migration tests locally due to
`dbm` not correctly picking up the passed in config. This fixes it by
setting the custom config property after it has been initialized, always
overriding any wrong values.

PS: I think I found the issue. `dbm` was prioritizing my `DATABASE_URL`
for some reason, as I started having issues when it was set, and stopped
having issues when I unset it.

I still think this is a good change, as it prevents similar
hard-to-debug issues in the future.

To help clarify this, running this locally:
- `export
DATABASE_URL=postgres://unleash_user:passord@localhost:5432/unleash`
 - `yarn test dedupe-permissions`

Fails on `main`, but passes on this branch. For some reason the `dbm`
instance prioritizes whatever is set in `DATABASE_URL` instead of the
options that are passed in `getInstance`.
2024-01-02 10:47:59 +00:00
Christopher Kolstad
1fd233abc2
chore: make security optional for /edge/validate endpoint (#5739)
We've had a couple of misunderstandings from people surprised that
Unleash allows posts against the `/edge/validate` endpoint without an
API key. It is intentional that this endpoint does not require an
Authorization header, so this PR updates our OpenAPI spec to clarify
that there is no security required for `/edge/validate`
2024-01-02 10:09:49 +01:00
Christopher Kolstad
3a7824a2e8
Added a check that allows posting edge bulk metrics with a client token (#5735)
This allows bulk metrics posted with a Client token to be accepted.
Previously you needed an admin token to have bulk metrics accepted
2024-01-02 09:51:01 +01:00
Jaanus Sellin
e4c9a257ad
feat: make local storage work and make feedback url configurable (#5738)
Make storage work react way.
Make feedback url configurable by env variable.
2023-12-29 13:19:08 +02:00
Jaanus Sellin
55bd0a6760
feat: keep feedback submission in local storage (#5737)
Now it will track if feedback has been submitted in local storage.
2023-12-29 10:08:19 +02:00
Tymoteusz Czech
71a65b1d6b
Fix: strategy import (#5731)
Some optional properties of `strategy` where not included after importing
2023-12-27 19:37:51 +01:00
David Leek
9ac1070f43
feat: implement createdByUserId for all features (#5725)
## About the changes

Implements setting values on the created_by_user_id column on the
features table in the db
2023-12-22 14:33:16 +01:00
David Leek
1dadd23594
chore:system user and events created by userid migrations (#5612)
## About the changes

Migrations for:
- Adds column is_system to users
- Inserts unleash_system_user id -1337 to users 

includes `is_system: false` in the activeUsers and activeAccounts where filter

Tested by running:
`
select * into users_pre_check from users where id > -1;
delete from users where id > -1;
`
before starting unleash, then inspecting users table after unleash has
started and verifying that an 'admin' user has been created.

---------

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2023-12-22 11:19:39 +01:00
Nuno Góis
fb94138c5c
chore: support full path schemas (#5723)
This backwards compatible change allows us to specify a schema `id`
(full path) which to me feels a bit better than specifying the schema
name as a string, since a literal string is prone to typos.

### Before

```ts
requestBody: createRequestSchema(
    'createResourceSchema',
),
responses: {
    ...getStandardResponses(400, 401, 403, 415),
    201: resourceCreatedResponseSchema(
        'resourceSchema',
    ),
},
```

### After

```ts
requestBody: createRequestSchema(
    createResourceSchema.$id,
),
responses: {
    ...getStandardResponses(400, 401, 403, 415),
    201: resourceCreatedResponseSchema(
        resourceSchema.$id,
    ),
},
```
2023-12-22 08:17:23 +00:00
Jaanus Sellin
d57e26b8ea
feat: feedback table (#5721) 2023-12-21 15:34:35 +02:00
andreas-unleash
f0c0504b31
fix: email link (#5719)
Fixes missing base url 

Relates to
#[1-1827](https://linear.app/unleash/issue/1-1827/email-link-to-revive-feature-is-wrong)

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-21 14:51:15 +02:00
Mateusz Kwasniewski
029af91e9e
fix: is after undefined parsing (#5718) 2023-12-21 13:25:10 +01:00
Nuno Góis
efa691d120
chore: helper methods to extract user data from req (#5710)
With the recent changes it's common that we'll need both the id and
processed username from the auth user in the request, so this PR
provides some helper methods to simplify this.
2023-12-21 12:06:20 +00:00
Mateusz Kwasniewski
60d3768ab1
fix: copy last seen at from env (#5713) 2023-12-21 12:37:28 +01:00
David Leek
4e56d1d8d5
feat: implement column created_by_user_id in feature_tag (#5695)
## About the changes

Adds the new nullable column created_by_user_id to the data used by
feature-tag-store and feature-tag-service. Also updates openapi schemas.
2023-12-21 10:00:45 +01:00
Fredrik Strand Oseberg
3ab331dce7
feat: increase unleash width (#5707)
This PR adds two feature flags:
* One is to add some holiday cheer to the unleash logo
* The other allows us to increase the width of unleash if the screen
allows it

<img width="1837" alt="Skjermbilde 2023-12-20 kl 16 18 16"
src="https://github.com/Unleash/unleash/assets/16081982/a25ccfb0-fd99-470f-8583-3ba9ef9186f9">
2023-12-21 08:42:28 +01:00
Jaanus Sellin
8e7e389d1d
fix: context updated event now does stores correct fields (#5705) 2023-12-20 15:57:17 +02:00
Nuno Góis
1a79921a38
chore: incoming webhook events (#5693)
https://linear.app/unleash/issue/2-1748/create-new-incoming-webhook-events

Adds new events for write operations on incoming webhooks and their
tokens.
2023-12-20 11:48:25 +00:00
andreas-unleash
b933a03e8a
fix: conflict email naming bug - cleanup files (#5683)
Fixes name bug in template folder
Removes/cleans up the plain html files

Relates to #
[1-1605](https://linear.app/unleash/issue/1-1605/send-an-email-to-the-user-whose-scheduled-changes-can-no-longer-be)

Closes #
[1-1726](https://linear.app/unleash/issue/1-1726/manual-testing)

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-19 16:01:16 +02:00
David Leek
33f82daa8c
chore: add migration that renames new created_by columns (#5681)
## About the changes

Replaces #5616

Renamed newly added `created_by` columns to `created_by_user_id` for
these tables:
features
feature_tag
feature_strategies
feature_types
role_permission
role_user
roles
users
api_tokens
2023-12-19 13:14:15 +01:00
Gastón Fournier
061bd7ef32
chore: use semver compatible version (#5678)
## About the changes
Replicate the change made to respect semver
2023-12-19 12:47:03 +01:00
David Leek
5603e8683d
chore: list users and groups under each role in projectaccessadded event (#5581)
## About the changes

Changes the project access added event to list all users and groups
added to each role instead of in root event.
2023-12-19 10:16:17 +01:00
Mateusz Kwasniewski
7800d9d1b4
feat: export all features in project (#5677) 2023-12-19 08:57:10 +01:00
Nuno Góis
138d303da4
chore: rename secret to token in incoming_webhook_tokens (#5679)
Renames `secret` to `token` in `incoming_webhook_tokens` for
consistency. This table is not being used yet, so this should be a very
safe change.
2023-12-18 17:11:59 +00:00
Nuno Góis
5f975bbad7
chore: incoming webhooks and tokens migration (#5670)
https://linear.app/unleash/issue/2-1699/db-create-migration-for-a-new-incoming-webhooks-table

Adds a migration that creates 2 tables:
 - `incoming_webhooks`
 - `incoming_webhook_tokens`
2023-12-18 13:22:28 +00:00
Jaanus Sellin
d0facc7101
fix: adjust page limit normalization (#5672) 2023-12-18 14:33:45 +02:00
Jaanus Sellin
3b635132f9
feat: enable sorting by project (#5671) 2023-12-18 14:33:38 +02:00
Jaanus Sellin
4af0abc6c2
fix: increase page size in backend to 100 (#5669) 2023-12-18 14:18:05 +02:00
Nuno Góis
00ed539c19
Revert "chore: incoming webhooks and tokens migration"
This reverts commit 695474576e.
2023-12-18 11:47:04 +00:00
Nuno Góis
695474576e
chore: incoming webhooks and tokens migration 2023-12-18 11:44:29 +00:00
Jaanus Sellin
f4268347da
fix: last seen now sorts nulls last (#5664)
Two changes were needed to sort better

1. Since we are still using `last seen` from `features` table for
backwards compatibility, we needed to add it to sort condition.
2. Nulls break the order, so now sorting nulls as last.
2023-12-18 10:36:50 +02:00
Thomas Heartman
ab2281d7e7
fix: make username nullable in user-schema (#5656)
I noticed I was getting warnings logged in my local instance when
visiting the users page (`/admin/users`)

```json
{
    "schema": "#/components/schemas/publicSignupTokensSchema",
    "errors": [
        {
            "instancePath": "/tokens/0/users/0/username",
            "schemaPath": "#/components/schemas/userSchema/properties/username/type",
            "keyword": "type",
            "params": {
                "type": "string"
            },
            "message": "must be string"
        }
    ]
}
```

It was complaining because one of my users doesn't have a username, so
the value returned from the API was:

```json
{
    "users": [
        {
            "id": 2,
            "name": "2mas",
            "username": null
        }
    ]
}
```

This adjustment fixes that oversight by allowing `null` values for the
username.
2023-12-16 08:28:22 +01:00
Pedro Papadopolis
24c2a70138
feat: Make compression middleware optional (#5306)
## Why
Currently AWS API Gateway doesn't have compression enabled by default,
this PR will make it easier to for example deploy Unleash over to AWS
Lambda without further configuration in API Gateway, frameworks like
Serverless requires a bit more work to set up compression and some times
one might not need compression at all.

## How
Create a new config flag called `disableCompression` which will not
include `compression` middleware in express' instance when set as true.
2023-12-16 08:06:26 +01:00
Jaanus Sellin
dafec2e672
fix: reducing of features will not break order anymore (#5654) 2023-12-15 14:46:40 +02:00
Mateusz Kwasniewski
8283edfc0a
feat: Sort by stale (#5653) 2023-12-15 11:56:06 +00:00
Nuno Góis
8be09510e8
chore: clean up banners feature flag (#5648)
Cleans up some leftover references to the `banners` feature flag. 

Related to https://github.com/Unleash/unleash/pull/5348
2023-12-15 10:16:13 +00:00
Nuno Góis
f84fa81ebe
chore: add incomingWebhooks feature flag (#5647)
https://linear.app/unleash/issue/2-1683/feature-flag-add-a-new-incomingwebhooks-feature-flag-for-this-feature

Adds a new `incomingWebhooks` feature flag.
2023-12-15 10:15:52 +00:00
Gastón Fournier
1338496445
chore: enable manual testing of migrations (#5645)
## About the changes
This adds a Makefile to make it easy to test migrations from one version
of Unleash to another.

The script depends on [docker compose
V2](https://docs.docker.com/compose/migrate/)

**Before starting**: make sure you're inside test-migrations folder and
run `make clean` to be in a clean state.

We can run 2 versions of Unleash side by side with a shared database
(the second version will apply migrations to the DB):
```shell
UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:5.6.10 make start-unleash # defaults to port 4242
UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:latest make start-another-unleash # defaults to port 4243
make test # run basic UI tests against port 4242 (first image)
EXPOSED_PORT=4243 make test # run basic UI tests against port 4243
```

This also enables us to test our local repository with our code of
Unleash server running at port 4244 (`EXPOSE_PORT=4444 make run-current`
if you want to change it):
```shell
UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:5.6.10 make start-unleash # defaults to port 4242
make run-current # exposes the current backend at 4244
```

You can also connect the latest UI to any of the ports specified above,
starting the UI at port 3000:
```shell
EXPOSED_PORT=4242 make run-current-ui # exposed port defaults to 4244 which is the port of the current backend
```
2023-12-14 15:12:13 +01:00
Jaanus Sellin
fa087fb473
refactor: move search implementation out of strategies store (#5642)
This is first step of refactoring. Next steps follow with possibly a
query builder, or atleast using some reusable methods.
2023-12-14 15:45:36 +02:00
Jaanus Sellin
fbb5dd9022
feat: add icons to filters (#5640) 2023-12-14 15:06:26 +02:00
Christopher Kolstad
bfa82d79bf
feat: adds created_by_user_id to all events (#5619)
### What
Adds `createdByUserId` to all events exposed by unleash. In addition
this PR updates all tests and usages of the methods in this codebase to
include the required number.
2023-12-14 13:45:25 +01:00
Ivar Conradi Østhus
e6442d9304
fix: frontend api should use cache-control strategy 'no-cache' (#5641) 2023-12-14 10:35:21 +01:00
Ivar Conradi Østhus
4618a52014
fix: optimize cores headers (#5629)
This commit enhances two aspects of CORS:

- Always support CORS preflight requests.
- Do not add additional secuity headers for prefligh calls.
2023-12-13 16:12:17 +01:00
andreas-unleash
6c52158723
feat: add reason column to change_request_schedule (#5631)
What it says on the tin.

Closes: #
[1-1766](https://linear.app/unleash/issue/1-1766/add-reason-column-to-change-request-schedule)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-13 14:07:02 +02:00
David Leek
d632690203
chore: add created by user id to events (#5621)
## About the changes

Adds the column `created_by_user_id` to `events` table and adds index
for it

---------

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2023-12-12 15:57:59 +01:00
Thomas Heartman
8e430810ef
fix: return 400 on invalid POST data to project access endpoint (#5610)
This PR fixes the issue discussed in SR-234, where you would get a 200
OK response even if your POST request to
`/api/admin/projects/<project-name>/access` contains invalid data (and
nothing is persisted).
2023-12-12 14:46:23 +01:00
Gard Rimestad
d6afe80bab
feat: datadog integration - link to valid source type names (#5608)
Datadog only supports know source_type_names, lets make that easy to
figure out for the user.
2023-12-12 14:37:41 +01:00
Ivar Conradi Østhus
43c563af57
fix: optimize headers we return for API calls. (#5607)
Today we include a lot of "secutiry headers" for all API calls. Quite a
lot of them are only relevent when we return a HTML document for the
browser.

This PR removes and simplify these headers for API calls, so that we do
not include unecessary data in the HTTP headers.

Each header have been carfully examied by following best practices from
these source:

-
https://cheatsheetseries.owasp.org/cheatsheets/REST_Security_Cheat_Sheet.html
- https://owasp.org/www-project-secure-headers/

This feature is protected with feature flag named 'stripHeadersOnAPI'.
2023-12-12 10:20:28 +01:00
Ivar Conradi Østhus
abf540a1cc
fix: add 'Vary: Origin' header to cors response 2023-12-12 08:05:43 +01:00
Christopher Kolstad
18ea7349c6
feat: add created_by to api_tokens table (#5596)
Adds a migration for adding created_by column to the api_tokens table.
2023-12-11 15:41:36 +01:00
Christopher Kolstad
150e6b03dc
feat: add column created_by to roles table (#5595)
Tracking who creates roles
2023-12-11 15:40:17 +01:00
Christopher Kolstad
4f7b3aa759
feat: add column created_by to role_user table (#5594)
As it says in the title. Adds a created_by column to the role_user table
to more easily track who's doing what.
2023-12-11 15:40:02 +01:00
Christopher Kolstad
0f250ba06c
feat: add created_by to role_permission table (#5592)
As it says on the tin. In an attempt to make all operations in Unleash
traceable to an originator. This PR adds created_by to role_permission,
which will show which user assigned a permission to a role.
2023-12-11 15:39:44 +01:00
Christopher Kolstad
ed220c0b89
feat: add column created_by to users table (#5597) 2023-12-11 15:39:07 +01:00
David Leek
5b6a26a828
chore: migration for features created by (#5593)
Contains the migration that adds the column created_by to `features`
2023-12-11 14:58:23 +01:00
David Leek
427abbd8d1
chore: add migration for adding created_by to feature_types table (#5591)
Contains the migration that adds the column created_by to
`feature_types`
2023-12-11 14:57:58 +01:00
David Leek
0f1b89b259
chore: add migration for adding created_by to feature_tag table (#5590)
## About the changes

Contains the migration that adds the column created_by to `feature_tag`
2023-12-11 14:57:40 +01:00
David Leek
27732274a3
chore: add migration for adding created_by to feature_strategies table (#5589)
## About the changes

Contains the migration that adds the column created_by to
`feature_strategies`
2023-12-11 14:57:18 +01:00
Jaanus Sellin
e8f19e6341
fix: added stronger tag validations (#5585)
Now it is impossible to filter based on invalid tag syntax.
2023-12-11 13:34:51 +02:00
Fredrik Strand Oseberg
ec670450fd
feat: initial setup (#5583)
This PR sets up the feature flag for the new strategy configuration and
duplicates the components for the new setup
2023-12-11 12:23:18 +01:00
andreas-unleash
2322e1149a
feat: more info on staleness in health report (#5582)
Adds an info tooltip for potentially stale and a link to configure
feature toggle type lifetime


Closes
[UNL-215](https://linear.app/unleash/issue/UNL-215/improve-health-page-with-some-guidance-about-staleness)
<img width="1323" alt="Screenshot 2023-12-11 at 11 39 36"
src="https://github.com/Unleash/unleash/assets/104830839/386ec6e6-55df-42ca-b5e0-ef3e75448452">

<img width="1316" alt="Screenshot 2023-12-11 at 11 43 07"
src="https://github.com/Unleash/unleash/assets/104830839/5bf7df15-ff87-4ce0-be25-0c031c881d05">

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-11 13:11:28 +02:00
Thomas Heartman
fb5a487663
feat: add schema for change request strategies (#5578)
This change adds a property to the segmentStrategiesSchema to make sure
that change request strategies are listed in the openapi spec

It also renames the files that contains that schema and its tests from
`admin-strategies-schema` to `segment-strategies-schema`.
2023-12-11 11:01:47 +00:00
Ivar Conradi Østhus
9508c79451
fix: remove secure headers on local dev 2023-12-08 19:51:12 +01:00
Jaanus Sellin
166432bcb0
feat: support localization in date filter (#5572) 2023-12-08 13:20:39 +02:00
Ivar Conradi Østhus
b6f1929efb
Poc/strip client headers on 304 (#5574)
To reduce traffic returned on 304.
2023-12-08 12:14:37 +01:00
Jaanus Sellin
1173b664da
feat: add created date filter component (#5569) 2023-12-08 10:07:57 +02:00
Jaanus Sellin
d9648de08d
chore: rename is not any of to is none of (#5544) 2023-12-06 12:53:51 +02:00
andreas-unleash
12f79f90bb
feat: Scheduled change conflict email templates and function (#5547)
Creates a new email template for scheduled change conflicts and a
function to send it.

Relates to:
#[1-1686](https://linear.app/unleash/issue/1-1686/send-an-email-when-the-conflicts-are-detected)


![Screenshot 2023-12-05 at 16 55
51](https://github.com/Unleash/unleash/assets/104830839/4d37527e-bb83-4ac5-9437-09b6ab08c979)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2023-12-06 11:57:19 +02:00
Mateusz Kwasniewski
2dcf4af7b1
feat: filter persisted in url (#5549) 2023-12-05 17:31:23 +01:00
Jaanus Sellin
6f497e6708
feat: add openapi validation for search (#5541) 2023-12-05 11:25:56 +02:00
Jaanus Sellin
d1984b2447
feat: validate date filter and add more tests (#5525) 2023-12-04 15:41:05 +02:00
andreas-unleash
3056456770
fix: scheduled cr failed email (#5522)
Relates to #
[1-1687](https://linear.app/unleash/issue/1-1687/send-an-email-when-the-scheduling-fails)

Removed `name` - not in template
Added missed `changeRequestTitle` for the html template context

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-12-04 11:51:06 +02:00
andreas-unleash
be17b7f575
feat: new email template for scheduled-execution-failed email (#5519)
What it says on the box.

Relates to #
[1-1687](https://linear.app/unleash/issue/1-1687/send-an-email-when-the-scheduling-fails)


<img width="782" alt="Screenshot 2023-12-01 at 15 33 08"
src="https://github.com/Unleash/unleash/assets/104830839/513a0a71-5ca5-4ea7-8482-7903c8485737">

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2023-12-01 15:48:13 +02:00
Mateusz Kwasniewski
26f9cf98d5
refactor: feature oriented architecture for project-environment (#5510) 2023-12-01 12:41:46 +01:00
Jaanus Sellin
63f6af06da
feat: new project overview backend (#5344)
Adding new project overview endpoint and deprecating the old one.
The new one has extra info about feature types, but does not have
features anymore, because features are coming from search endpoint.
2023-12-01 11:20:24 +02:00
Jaanus Sellin
feae69643c
feat: created date operators for search (#5513)
1. Added operators for created date
2. Added better descriptions for searchable fields
2023-11-30 12:00:39 +02:00
Fredrik Strand Oseberg
e5760b5690
Feat: remove last seen refactor flag (#5423)
What it says on the box

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: andreas-unleash <andreas@getunleash.ai>
2023-11-30 10:17:50 +02:00
Jaanus Sellin
a743ca0df6
feat: add operators for state filtering (#5497)
No changes in store needed, already utilizing reusable logic.
2023-11-29 15:22:42 +02:00
Ivar Conradi Østhus
07fcdbb053
fix: add metrics for service account and api tokens (#5478) 2023-11-29 13:09:30 +01:00
Mateusz Kwasniewski
5a99ac6c1e
fix: missing export (#5493) 2023-11-29 12:01:52 +01:00
Mateusz Kwasniewski
7a6cb0c527
refactor: tag type service feature oriented architecture and tx support (#5489) 2023-11-29 11:44:56 +01:00
Jaanus Sellin
d73a2937a7
feat: search now also returns project (#5488) 2023-11-29 12:13:41 +02:00
Jaanus Sellin
5fd1c16def
feat: operators for segments (#5485)
1. Added way to filter segments
2. Refactored some code, so tags and segments use same SQL methods.
2023-11-29 10:40:25 +02:00
Mateusz Kwasniewski
5ea5c66f35
feat: new event type for CR config update (#5476) 2023-11-29 08:50:42 +01:00
Jaanus Sellin
51f87bdfd9
feat: search now also returns segments used (#5429) 2023-11-28 21:34:57 +02:00
Gastón Fournier
cf58140c42
feat: report users on group change (#5445)
## About the changes
Add user ids to group changes. This also modifies the payload of group created to include only the user id and creates events for SSO sync functionality
2023-11-28 17:02:51 +01:00
Mateusz Kwasniewski
05614ed20d
fix: Default strategy event user (#5470) 2023-11-28 15:46:42 +01:00
Mateusz Kwasniewski
f6bc418bdd
feat: updated default strategy event (#5462) 2023-11-28 14:59:20 +01:00
Nuno Góis
fd601762b2
refactor: maintenance read model (#5374)
https://linear.app/unleash/issue/2-1655/refactor-maintenance-to-feature-folder-and-add-a-read-model-for-status

This PR does 2 things:
 - Moves all "maintenance" files to a `maintenance` features folder
- Adds a `IMaintenanceStatus` read model that only includes
`isMaintenanceMode()`, so we can use this interface in SchedulerService
and expose only the `isMaintenanceMode()` method instead of the entire
`MaintenanceService`

Is this what you meant in
https://github.com/Unleash/unleash/pull/5363#discussion_r1400170835
@FredrikOseberg?
2023-11-28 13:03:02 +00:00
Gard Rimestad
c1fe3f964c
feat: include more data in setting event (#5440)
This adds more data to the setting events, so that its possible to see
what has changed

Used to look like:
```
{
  "id": "maintenance.mode"
}
```

Now it looks like this:
```
{
  "id": "maintenance.mode",
  "enabled": false
}
```

because this is setting events, the default behaviour is to hide the content.
2023-11-28 13:47:51 +01:00
Mateusz Kwasniewski
2965daa195
feat: project environment added and removed events (#5459) 2023-11-28 12:58:30 +01:00
renovate[bot]
c7498dcac6
chore(deps): update dependency @biomejs/biome to v1.4.0 (#5288)
[![Mend Renovate logo
banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@biomejs/biome](https://biomejs.dev)
([source](https://togithub.com/biomejs/biome)) | [`1.3.3` ->
`1.4.0`](https://renovatebot.com/diffs/npm/@biomejs%2fbiome/1.3.3/1.4.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@biomejs%2fbiome/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@biomejs%2fbiome/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@biomejs%2fbiome/1.3.3/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@biomejs%2fbiome/1.3.3/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>biomejs/biome (@&#8203;biomejs/biome)</summary>

###
[`v1.4.0`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#140-2023-11-27)

[Compare
Source](af24597c18...889593e3f9)

##### CLI

- Remove the CLI options from the `lsp-proxy`, as they were never meant
to be passed to that command. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

- Add option `--config-path` to `lsp-proxy` and `start` commands. It's
now possible to tell the Daemon server to load `biome.json` from a
custom path. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

- Add new `--diagnostic-level` option to let users control the level of
diagnostics printed by the CLI. Possible values are: `"info"`, `"warn"`,
`"hint"`. Contributed by
[@&#8203;simonxabris](https://togithub.com/simonxabris)

- Add option `--line-feed` to the `format` command. Contributed by
[@&#8203;SuperchupuDev](https://togithub.com/SuperchupuDev)

- Add option `--bracket-same-line` to the `format` command. Contributed
by [@&#8203;faultyserve](https://togithub.com/faultyserve)

- Add option `--bracket-spacing` to the `format` command. Contributed by
[@&#8203;faultyserve](https://togithub.com/faultyserve)

##### Bug fixes

- Fix the command `format`, now it returns a non-zero exit code when if
there pending diffs. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

##### Configuration

- Add option `formatter.lineFeed`. Contributed by
[@&#8203;SuperchupuDev](https://togithub.com/SuperchupuDev)
- Add option `javascript.formatter.bracketSameLine`. Contributed by
[@&#8203;faultyserve](https://togithub.com/faultyserve)
- Add option `javascript.formatter.bracketSpacing`. Contributed by
[@&#8203;faultyserve](https://togithub.com/faultyserve)

##### Formatter

##### New features

- Add a new option
[`--line-ending`](https://biomejs.dev/reference/configuration/#formatterlineending).
This option allows changing the type of line endings. Contributed by
[@&#8203;SuperchupuDev](https://togithub.com/SuperchupuDev)
- Added a new option called `--bracket-spacing` to the formatter. This
option allows you to control whether spaces are inserted around the
brackets of object literals.
[#&#8203;627](https://togithub.com/biomejs/biome/issues/627).
Contributed by [@&#8203;faultyserver](https://togithub.com/faultyserver)
- Added a new option called `--bracket-same-line` to the formatter. This
option allows you to control whether spaces are inserted around the
brackets of object literals.
[#&#8203;627](https://togithub.com/biomejs/biome/issues/627).
Contributed by [@&#8203;faultyserver](https://togithub.com/faultyserver)

##### Bug fixes

- Fix [#&#8203;832](https://togithub.com/biomejs/biome/issues/832), the
formatter no longer keeps an unnecessary trailing comma in type
parameter lists. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;301](https://togithub.com/biomejs/biome/issues/301), the
formatter should not break before the `in` keyword. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

##### Linter

##### Promoted rules

-
[a11y/noInteractiveElementToNoninteractiveRole](https://biomejs.dev/linter/rules/no-interactive-element-to-noninteractive-role)
-
[complexity/noThisInStatic](https://biomejs.dev/linter/rules/no-this-in-static)
-
[complexity/useArrowFunction](https://biomejs.dev/linter/rules/use-arrow-function)
-
[correctness/noEmptyCharacterClassInRegex](https://biomejs.dev/linter/rules/no-empty-character-class-in-regex)
-
[correctness/noInvalidNewBuiltin](https://biomejs.dev/linter/rules/no-invalid-new-builtin)
-
[style/noUselessElse](https://biomejs.dev/linter/rules/no-useless-else)
-
[style/useAsConstAssertion](https://biomejs.dev/linter/rules/use-as-const-assertion)
-
[style/useShorthandAssign](https://biomejs.dev/linter/rules/use-shorthand-assign)
-
[suspicious/noApproximativeNumericConstant](https://biomejs.dev/linter/rules/no-approximative-numeric-constant)
-
[suspicious/noMisleadingInstantiator](https://biomejs.dev/linter/rules/no-misleading-instantiator)
-
[suspicious/noMisrefactoredShorthandAssign](https://biomejs.dev/linter/rules/no-misrefactored-shorthand-assign)

The following rules are now recommended:

-   [a11y/noAccessKey](https://biomejs.dev/linter/rules/no-access-key)
-
[a11y/useHeadingContent](https://biomejs.dev/linter/rules/use-heading-content)
-
[complexity/useSimpleNumberKeys](https://biomejs.dev/linter/use-simple-number-keys)

The following rules are now deprecated:

-
[correctness/noNewSymbol](https://biomejs.dev/linter/rules/no-new-symbol)
The rule is replaced by
[correctness/noInvalidNewBuiltin](https://biomejs.dev/linter/rules/no-invalid-new-builtin)

##### New features

- Add
[noDefaultExport](https://biomejs.dev/linter/rules/no-default-export)
which disallows `export default`. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Add
[noAriaHiddenOnFocusable](https://biomejs.dev/linter/rules/no-aria-hidden-on-focusable)
which reports hidden and focusable elements. Contributed by
[@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Add
[noImplicitAnyLet](https://biomejs.dev/linter/rules/no-implicit-any-let)
that reports variables declared with `let` and without initialization
and type annotation. Contributed by
[@&#8203;TaKO8Ki](https://togithub.com/TaKO8Ki) and
[@&#8203;b4s36t4](https://togithub.com/b4s36t4)

- Add [useAwait](https://biomejs.dev/linter/rules/use-await) that
reports `async` functions that don't use an `await` expression.

- Add
[useValidAriaRole](https://biomejs.dev/linter/rules/use-valid-aria-role).
Contributed by [@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Add [useRegexLiterals](https://biomejs.dev/linter/use-regex-literals)
that suggests turning call to the regex constructor into regex literals.
COntributed by [@&#8203;Yuiki](https://togithub.com/Yuiki)

##### Enhancements

- Add an unsafe code fix for
[a11y/useAriaActivedescendantWithTabindex](https://biomejs.dev/linter/rules/use-aria-activedescendant-with-tabindex)

##### Bug fixes

- Fix [#&#8203;639](https://togithub.com/biomejs/biome/issues/639) by
ignoring unused TypeScript's mapped key. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;565](https://togithub.com/biomejs/biome/issues/565) by
handling several `infer` with the same name in extends clauses of
TypeScript's conditional types. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;653](https://togithub.com/biomejs/biome/issues/653).
[noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports)
now correctly removes the entire line where the unused `import` is.
Contributed by [@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;607](https://togithub.com/biomejs/biome/issues/609)
`useExhaustiveDependencies`, ignore optional chaining, Contributed by
[@&#8203;msdlisper](https://togithub.com/msdlisper)

- Fix [#&#8203;676](https://togithub.com/biomejs/biome/issues/676), by
using the correct node for the `"noreferrer"` when applying the code
action. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

- Fix [#&#8203;455](https://togithub.com/biomejs/biome/issues/455). The
CLI can now print complex emojis to the console correctly.

- Fix [#&#8203;727](https://togithub.com/biomejs/biome/issues/727).
[noInferrableTypes](https://biomejs.dev/linter/rules/no-inferrable-types)
now correctly keeps type annotations when the initialization expression
is `null`. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;784](https://togithub.com/biomejs/biome/issues/784),
[noSvgWithoutTitle](https://biomejs.dev/linter/rules/no-svg-without-title)
fixes false-positives to `aria-label` and reports svg's role attribute
is implicit. Contributed by
[@&#8203;unvalley](https://togithub.com/unvalley)

- Fix [#&#8203;834](https://togithub.com/biomejs/biome/issues/834) that
made
[noUselessLoneBlockStatements](https://biomejs.dev/linter/rules/no-useless-lone-block-statements)
reports block statements of switch clauses. Contributed by
[@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Fix [#&#8203;783](https://togithub.com/biomejs/biome/issues/834) that
made
[noUselessLoneBlockStatements](https://biomejs.dev/linter/rules/no-useless-lone-block-statements)
reports block statements of `try-catch` structures. Contributed by
[@&#8203;hougesen](https://togithub.com/hougesen)

- Fix [#&#8203;69](https://togithub.com/biomejs/biome/issues/69) that
made
[correctness/noUnnecessaryContinue](https://biomejs.dev/linter/rules/no-unnecessary-continue)
incorrectly reports a `continue` used to break a switch clause.
Contributed by [@&#8203;TaKO8Ki](https://togithub.com/TaKO8Ki)

- Fix [#&#8203;664](https://togithub.com/biomejs/biome/issues/664) by
improving the diagnostic of
[style/useNamingConvention](https://biomejs.dev/linter/use-naming-convention)
when double capital are detected in strict camel case mode. Contributed
by [@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Fix [#&#8203;643](https://togithub.com/biomejs/biome/issues/643) that
erroneously parsed the option of
[complexity/useExhaustiveDependencies](https://biomejs.dev/linter/use-naming-convention).
Contributed by [@&#8203;arendjr](https://togithub.com/arendjr)

##### Parser

##### Bug fixes

- Fix [#&#8203;846](https://togithub.com/biomejs/biome/issues/846) that
erroneously parsed `<const T,>() => {}` as a JSX tag instead of an arrow
function when both TypeScript and JSX are enabled.

##### VSCode

</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://developer.mend.io/github/Unleash/unleash).

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

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christopher Kolstad <chriswk@getunleash.io>
2023-11-28 09:32:00 +00:00
andreas-unleash
473741a65e
chore: Add environment mutation events (c.u.d) (#5455)
Adds the events for create, update and delete environment

Relates to:
[CTO-41](https://linear.app/unleash/issue/CTO-41/environment-mutation-not-in-event-log)

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-11-28 10:39:08 +02:00
Mateusz Kwasniewski
c6f878682f
fix: naming pattern update event should keep old project settings (#5443) 2023-11-28 08:25:07 +01:00