1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
Commit Graph

2275 Commits

Author SHA1 Message Date
Mateusz Kwasniewski
e9b643761c
feat: Project limit UI (#7518) 2024-07-02 15:29:58 +02:00
Thomas Heartman
b2522f9199
feat: add resource limits for API tokens (#7510)
This PR adds the back end for API token resource limits. 

It adds the limit to the schema and checks the limit in the service.

## Discussion points

The PAT service uses a different service and different store entirely,
so I have not included testing any edge cases where PATs are included.
However, that could be seen as "knowing too much". We could add tests
that check both of the stores in tandem, but I think it's overkill for
now.
2024-07-02 12:41:31 +00:00
Mateusz Kwasniewski
8a9535d352
feat: projects limit (#7514) 2024-07-02 12:03:00 +02:00
Thomas Heartman
be518af228
feat: use new environment limit in Unleash UI (#7500)
This PR updates the Unleash UI to use the new environment limit.

As it turns out, we already had an environment limit in the UI, but it
was hardcoded (luckily, its value is the same as the new default value
🥳).

In addition to the existing places this limit was used, it also disables
the "new environment" button if you've reached the limit. Because this
limit already exists, I don't think we need a flag for it. The only
change is that you can't click a button (that should be a link!) that
takes you to a page you can't do anything on.
2024-07-02 06:14:15 +00:00
Mateusz Kwasniewski
054b44a8dd
feat: allow enterprise override for constraint values limit (#7502) 2024-07-01 15:45:13 +02:00
Mateusz Kwasniewski
57b253c050
feat: constraint values limit UI (#7501) 2024-07-01 15:05:44 +02:00
Mateusz Kwasniewski
2cfd71f34e
feat: constraint values limit (#7498) 2024-07-01 13:28:30 +02:00
Thomas Heartman
441c399f58
feat: add environments to resource limit schema (#7495)
This PR adds limits for environments to the resource limit schema. The
actual limiting will have to be done in Enterprise, however, so this is
just laying the groundwork.
2024-07-01 11:20:22 +02:00
Mateusz Kwasniewski
3525928fea
feat: configurable strategies limit (#7488) 2024-07-01 10:03:26 +02:00
Mateusz Kwasniewski
eaf68af2da
test: remove last seen at assertion (#7487) 2024-06-28 15:18:16 +02:00
Mateusz Kwasniewski
5bd32f264d
feat: strategy limit to 30 (#7473) 2024-06-28 11:18:44 +02:00
Christopher Kolstad
fbda7cdc48
chore: sync dependencies with enterprise (#7482)
As the title says. We had some mismatch in our dependencies where
enterprise was ahead of oss, and some places where oss was ahead of
enterprise. Hence
https://github.com/ivarconr/unleash-enterprise/pull/1419 and this PR
2024-06-28 10:54:37 +02:00
Thomas Heartman
95359ecff8
fix: cap project ids to 90 characters (without suffix) (#7481)
This fixes the issue where project names that are 100 characters long
or longer would cause the project creation to fail. This is because
the resulting ID would be longer than the 100 character limit imposed
by the back end.

We solve this by capping the project ID to 90 characters, which leaves
us with 10 characters for the suffix, meaning you can have 1 billion
projects (999,999,999 + 1) that start with the same 90
characters (after slugification) before anything breaks.

It's a little shorter than what it strictly has to be (we could
probably get around with 95 characters), but at this point, you're
reaching into edge case territory anyway, and I'd rather have a little
too much wiggle room here.
2024-06-28 09:25:27 +02:00
Mateusz Kwasniewski
b67c73a578
chore: resource limits flag (#7471) 2024-06-27 14:25:07 +02:00
Nuno Góis
47b0c61670
chore: better debug logs in slack app (#7467)
Should improve the readability of our Slack App integration logs.
2024-06-27 09:14:37 +01:00
Mateusz Kwasniewski
db525a6617
refactor: largest resources queries (#7466) 2024-06-27 09:26:40 +02:00
Thomas Heartman
a9a87bc84d
chore: change generated project id format to use incrementing numbers instead of hashes (#7456) 2024-06-27 09:21:09 +02:00
Mateusz Kwasniewski
72de574012
feat: largest projects and features metric (#7459) 2024-06-26 16:09:08 +02:00
Jaanus Sellin
e8511789fd
feat: command menu items can have description as tooltip now (#7455)
![image](https://github.com/Unleash/unleash/assets/964450/7a55a1a7-7aea-4f9c-96ac-46adf2edd36f)
2024-06-26 12:39:53 +03:00
Mateusz Kwasniewski
d29230cd49
feat: transactional complete/uncomplete feature (#7451) 2024-06-26 09:05:17 +02:00
Mateusz Kwasniewski
3a3b6a29ff
feat: lifecycle stage entered counter (#7449) 2024-06-25 14:40:16 +02:00
David Leek
5d0fc071e7
chore: remove unused interfaces from old state import (#7448) 2024-06-25 14:30:57 +02:00
Jaanus Sellin
ed7f917df6
fix: make search selects explicit (#7445)
Now we are not returning * columns, but all tables that we join later,
will need to select columns one by one.
2024-06-25 13:56:40 +03:00
Mateusz Kwasniewski
388fe2dbd3
fix: change lifecycle stage duration metric type (#7444) 2024-06-25 12:42:43 +02:00
Mateusz Kwasniewski
c3fa468a9d
refactor: lifecycle stage duration outside instance stats (#7442) 2024-06-25 11:22:26 +02:00
Mateusz Kwasniewski
6a9a2c687d
feat: stage count by project metric (#7441) 2024-06-25 09:54:26 +02:00
Mateusz Kwasniewski
c14c67f476
feat: lifecycle stage count (#7434) 2024-06-25 09:11:46 +02:00
Mateusz Kwasniewski
70c7e3f978
feat: Anonimize demo users list flag view (#7432) 2024-06-24 13:48:08 +02:00
Mateusz Kwasniewski
ea1221c45e
chore: remove unstable label from GA metrics features (#7433) 2024-06-24 13:32:35 +02:00
Thomas Heartman
0af5bbad38
chore: remove createProjectWithEnvironmentConfig and newCreateProjectUI flags (#7429)
This PR removes the last two flags related to the project managament
improvements project, making the new project creation form GA.

In doing so, we can also delete the old project creation form (or at
least the page, the form is still in use in the project settings).
2024-06-24 12:53:55 +02:00
Thomas Heartman
c2a29b49b8
fix: turn off showing usernames and emails in the project cards when the flag is turned on (#7421)
This PR:
- adds a flag to anonymize user emails in the new project cards
- performs the anonymization using the existing `anonymise` function
that we have.

It does not anonymize the system user, nor does it anonymize groups. It
does, however, leave the gravatar url unchanged, as that is already
hashed (but we may want to hide that too).

This PR also does not affect the user's name or username. Considering
the target is the demo instance where the vast majority of users don't
have this (and if they do, they've chosen to set it themselves), this
seems an appropriate mitigation.

With the flag turned off:

![image](https://github.com/Unleash/unleash/assets/17786332/10a84562-c025-4e5c-b642-f949595b4e7e)

With the flag on:

![image](https://github.com/Unleash/unleash/assets/17786332/6fc35203-e2fa-4208-9650-0a87d3898996)
2024-06-21 12:51:37 +02:00
Nuno Góis
4736084e00
fix: check for permission in group access assignment (#7408)
Fix project role assignment for users with `ADMIN` permission, even if
they don't have the Admin root role. This happens when e.g. users
inherit the `ADMIN` permission from a group root role, but are not
Admins themselves.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2024-06-18 17:06:34 +01:00
Thomas Heartman
c4e2159401
chore: add metrics/gauges for "max constraint values" and "max constraints" (#7398)
This PR adds metrics tracking for:
- "maxConstraintValues": the highest number of constraint values that
are in use
- "maxConstraintsPerStrategy": the highest number of constraints used on
a strategy

It updates the existing feature strategy read model that returns max
metrics for other strategy-related things.

It also moves one test into a more fitting describe block.
2024-06-17 11:13:13 +02:00
Simon Hornby
4eaa1525a0
fix: make default for gradual rollout work on the correct strategy name (#7401) 2024-06-14 15:54:00 +02:00
Jaanus Sellin
c33901b332
fix: project to lifecycle events (#7400)
We need project for those events to filter it out in webhook
configuration.
2024-06-14 16:42:10 +03:00
Jaanus Sellin
708183ce26
feat: optimize search store by removing inline EXISTS (#7394)
Instead of running exists on every row, we are joining the exists, which
runs the query only once.
This decreased load time on my huge dataset from 2000ms to 200ms.

Also added tests that values still come through as expected.
2024-06-14 10:26:12 +03:00
Mateusz Kwasniewski
0c79b36b74
feat: Max strategies metrics (#7392) 2024-06-14 09:20:43 +02:00
Jaanus Sellin
1191f162e5
fix: fix unstable search (#7391)
Reverting

https://github.com/Unleash/unleash/pull/7387
https://github.com/Unleash/unleash/pull/7385
2024-06-13 15:37:31 +03:00
Jaanus Sellin
906940948b
feat: optimize search (#7387)
I am moving the strategies join to later part of query, because it is
not used for filtering, only need it for data.
2024-06-13 13:46:06 +03:00
Jaanus Sellin
b9f43f5ba0
feat: optimize search store by removing inline EXISTS (#7385)
Instead of running exists on every row, we are joining the exists, which
runs the query only once.
This decreased load time on my huge dataset from 2000ms to 200ms.

Also added tests that values still come through as expected.
2024-06-13 13:11:47 +03:00
Mateusz Kwasniewski
3cc0dfe35a
fix: playground parent deps check (#7384) 2024-06-13 10:36:44 +02:00
Mateusz Kwasniewski
702ee8cb12
test: describe default stickiness bahavior in a test (#7379) 2024-06-12 16:49:50 +02:00
Jaanus Sellin
7fc87e1647
feat: clean up command bar props (#7368)
A lot of things were passed in for search, but since we only have single
command bar, we do not need them and it was bloating our component.
2024-06-12 09:24:16 +03:00
Mateusz Kwasniewski
c1656d8630
feat: Read flag creator (#7357) 2024-06-11 15:22:52 +02:00
David Leek
576dd04dc5
feat: command bar poc (#7350)
Command bar PoC using clone of search

---------

Co-authored-by: sjaanus <sellinjaanus@gmail.com>
2024-06-11 15:27:59 +03:00
Mateusz Kwasniewski
2a616c28bc
feat: adding full creator information to view used by feature read (#7356) 2024-06-11 14:19:32 +02:00
Jaanus Sellin
3acb3ad2c2
feat: upgrade from react v17 to v18 (#7265)
**Upgrade to React v18 for Unleash v6. Here's why I think it's a good
time to do it:**
- Command Bar project: We've begun work on the command bar project, and
there's a fantastic library we want to use. However, it requires React
v18 support.
- Straightforward Upgrade: I took a look at the upgrade guide
https://react.dev/blog/2022/03/08/react-18-upgrade-guide and it seems
fairly straightforward. In fact, I was able to get React v18 running
with minimal changes in just 10 minutes!
- Dropping IE Support: React v18 no longer supports Internet Explorer
(IE), which is no longer supported by Microsoft as of June 15, 2022.
Upgrading to v18 in v6 would be a good way to align with this change.

TS updates:
* FC children has to be explicit:
https://stackoverflow.com/questions/71788254/react-18-typescript-children-fc
* forcing version 18 types in resolutions:
https://sentry.io/answers/type-is-not-assignable-to-type-reactnode/

Test updates:
* fixing SWR issue that we have always had but it manifests more in new
React (https://github.com/vercel/swr/issues/2373)

---------

Co-authored-by: kwasniew <kwasniewski.mateusz@gmail.com>
2024-06-11 13:59:52 +03:00
Mateusz Kwasniewski
44ca447fd2
chore: remove debug metrics flag (#7348) 2024-06-11 10:44:16 +02:00
Mateusz Kwasniewski
cedf19d2ec
fix: lifecycle metrics on metrics insert (#7322) 2024-06-07 15:55:15 +02:00
Mateusz Kwasniewski
8279da9f9b
feat: show creators from non archived features (#7309) 2024-06-06 14:50:38 +02:00
Thomas Heartman
eb39a212ce
chore: test that the tags API still returns tags that you can't create anymore (#7304)
This change adds a test to the tags API to ensure that even if you
can't create tags that are pure whitespace anymore, you'll still
receive pre-existing tags from the API that fit this description.

The test is here to ensure that we don't break this in future versions
of Unleash.
2024-06-06 14:16:45 +02:00
Mateusz Kwasniewski
6b4d9d0c1d
fix: remove null users in filter (#7308) 2024-06-06 13:38:54 +02:00
Mateusz Kwasniewski
a91b77a7ce
feat: filter by created by (#7306) 2024-06-06 12:59:11 +02:00
Mateusz Kwasniewski
2cc4b5faab
feat: display created by user in search (#7292) 2024-06-06 11:51:54 +02:00
Mateusz Kwasniewski
3c3e888ff0
feat: project flag creators api (#7302) 2024-06-06 11:10:28 +02:00
Mateusz Kwasniewski
1a6197660f
feat: add created by in search results (#7285) 2024-06-05 13:54:24 +02:00
Thomas Heartman
2bad98a121
fix: disallow invalid tag values (#7268)
This PR fixes how Unleash handles tag values. Specifically, it does
these things:
1. Trims leading and trailing whitespace from tag values before
inserting them into the database
2. Updates OpenAPI validation to not allow whitespace-only and to ignore
leading and trailing whitespace

Additionally, it moves the tag length constants into the constants file
from the Joi tag schema file. This is because importing the values
previously rendered them as undefined (probably due to a circular
dependency somewhere in the system). This means that the previous values
were also ignored by OpenAPI.

UI updates reflecting this wil follow.

## Background
When you tag a flag, there's nothing stopping you from using an entirely
empty tag or a tag with leading/trailing whitespace.

Empty tags make little sense and leading trailing whitespace differences
are incredibly subtle:

![image](https://github.com/Unleash/unleash/assets/17786332/ec8fe193-8837-4c6a-b7bf-8766eff34eed)


Additionally, leading and trailing whitespace is not shown in the
dropdown list, so you'd have to guess at which is the right one.

![image](https://github.com/Unleash/unleash/assets/17786332/a14698ab-2bfd-4ec3-8814-b8e876d0aadb)
2024-06-05 08:31:30 +02:00
Gastón Fournier
1fb6eb1593
fix: import export pointing to new docs (#7274)
I believe this link is pointing to old docs and should be updated
2024-06-04 23:00:53 +02:00
Mateusz Kwasniewski
2069af427a
feat: more powerful feature search by type (#7267) 2024-06-04 15:13:11 +02:00
Christopher Kolstad
0db5bc193f
task: upgraded semver dependency (and biome) (#7272)
Sorry for the extra noise here, but this seems to be the biome upgrade
altering formatting slightly.
2024-06-04 15:01:43 +02:00
David Leek
927f911c62
chore: add a flag+ui flag for commandBarUI (#7264) 2024-06-04 08:50:13 +00:00
David Leek
63e300da3b
chore: change to fs/promises and add an import from file e2e test (#7240) 2024-06-03 12:10:12 +02:00
Mateusz Kwasniewski
8c26c038b4
feat: new sidebar by default for OSS (#7239) 2024-06-03 11:05:10 +02:00
Gastón Fournier
54c6ac8163
fix: Created by on application-created adds the ip as created by (#7231)
To avoid leaking potential PII information in the event log, this replaces the IP for the system user as the "created by" field
2024-06-02 15:57:47 +02:00
Gastón Fournier
5845d0e552
chore: make ip mandatory (#7220)
IP should be mandatory for storing events. Automated events should use
127.0.0.1
2024-05-31 14:52:15 +02:00
David Leek
80ba3647a6
feat: file import (#7219) 2024-05-31 13:21:41 +02:00
Jaanus Sellin
d17ae37800
feat: now CLIENT_METRICS event will be emitted with new structure (#7210)
1. CLIENT_METRICS event will be emitted with new structure
2. CLIENT_METRICS event will be emitted from bulkMetrics endpoint
2024-05-31 12:40:46 +03:00
Jaanus Sellin
3c73ce9dd9
fix: increase performance of outdated SDK query (#7226)
Joining might not always be the best solution. If a table contains too
much data, and you later run sorting on top of it, it will be slow.

In this case, we will first reduce the instances table to a minimal
version because instances usually share the same SDK versions. Only
after that, we join.

Based on some customer data, we reduced query time from 3000ms to 60ms.
However, this will vary based on the number of instances the customer
has.
2024-05-31 12:39:52 +03:00
Thomas Heartman
de74faac46
chore: remove flag for new project cards (#7225)
This PR removes the flag for the new project card design, making it GA.

It also removes deprecated components and updates one reference (in the
groups card) to the new components instead.
2024-05-31 10:58:31 +02:00
Thomas Heartman
bea5929460
chore: remove project list split feature flags (#7224)
This PR removes all the feature flags related to the project list split
and updates the snapshot.

Now the project list will always contain "my projects" and "other
projects"
2024-05-31 10:38:23 +02:00
Simon Hornby
d6dc2b4ce2
chore: mark deprecations with version (#7218)
Makes some deprecation messages in open API clearer around which version
they were deprecated in so that they can be removed in v7
2024-05-30 13:49:39 +02:00
Gastón Fournier
07ef4a114f
chore: sync user groups is a system action (#7214)
## About the changes
After an internal conversation, we concluded that syncExternalGroups is
an action that Unleash performs as a system, not something triggered by
the user. We keep the method and just write the event log that the
action was performed by the system user.
2024-05-30 11:47:30 +02:00
Jaanus Sellin
6c8b1d8904
fix: when finding median time to production, ignore 0s (#7200)
We have an issue that if you open up Insights, the Time to Production
chart was showing nothing because it was taking the median across all
projects. You might have many new or empty projects where the median was
0 (no data).

For example, the median from [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.7, 50.3, 140] was 0.

Now, we will remove the 0 values to have a more reasonable median.
2024-05-29 14:17:31 +03:00
David Leek
998abaad67
chore: remove unused and deprecated methods in feature toggle legacy controller and in feature toggle service (#7199) 2024-05-29 11:01:33 +02:00
Jaanus Sellin
ef9f09b58c
feat: insights out of beta and expose 2 widgets to pro (#7177)
1. Remove beta badge
2. Remove exposure from oss
3. Expose 2 widgets to pro and rest to enterprise
2024-05-29 11:55:01 +03:00
David Leek
61a8908694
chore: remove state service (#7184)
## About the changes

Removes the deprecated state endpoint, state-service (despite the
service itself not having been marked as deprecated), and the file
import in server-impl. Leaves a TODO in place of where file import was
as traces for a replacement file import based on the new import/export
functionality
2024-05-28 14:47:31 +02:00
Simon Hornby
f16f8594f5
chore: deprecate custom strategies (#7186) 2024-05-28 12:33:53 +02:00
Christopher Kolstad
cea64dc21d
task: Removed edge bulk metrics endpoint (#7161)
Removes /edge/metrics. This has been superseded by
/api/client/metrics/bulk. Once this is merged, Unleash 6.0 will require
Edge > 17.0.0. (We recommend at least v19.1.3)
2024-05-28 11:30:41 +02:00
Jaanus Sellin
304d619597
chore: upgrade edge banner version (#7180)
Upgrading banner to 19.1.3, because we fixed critical issue there.
2024-05-28 12:16:42 +03:00
Jaanus Sellin
83912d872b
fix: fix empty events when no features need to be deleted (#7181) 2024-05-28 11:32:20 +03:00
Jaanus Sellin
73f0cb6180
chore: switch insights ui flag to kill switch (#7166)
The flag is already set up in our Unleash instance.
2024-05-28 09:44:52 +03:00
gitar-bot[bot]
6e8e807e44
[Gitar] Cleaning up stale feature flag: executiveDashboard with value true (#7158)
We are keeping the UI hidden for mdsol behind kill switch, but I feel
like we can remove the flag completely for backend, so everyone will
keep collecting data.

Co-authored-by: Gitar Bot <noreply@gitar.co>
2024-05-27 14:21:44 +03:00
Gastón Fournier
e5aa1a81cb
feat: add remote ip to all events (2) (#7149)
## About the changes
This aligns us with the requirement of having ip in all events. After
tackling the enterprise part we will be able to make the ip field
mandatory here:
2c66a4ace4/src/lib/types/events.ts (L362)
2024-05-27 11:58:32 +02:00
Thomas Heartman
f518b12b07
chore!: [v6] remove error.description in error messages (#7157)
In preparation for v6, this PR removes usage and references to
`error.description` instead favoring `error.message` (as mentioned
#4380)

I found no references in the front end, so this might be (I believe it
to be) all the required changes.
2024-05-27 11:26:19 +02:00
David Leek
9ea66e8850
chore: remove deprecated legacy features endpoint (#7129)
This PR is part of #4380 - Remove legacy `/api/feature` endpoint.

## About the changes

### Frontend
- Removes the useFeatures hook
- Removes the part of StrategyView that displays features using this
strategy (not been working since v4.4)
- Removes 2 unused features entries from routes 

### Backend
- Removes the /api/admin/features endpoint
- Moves a couple of non-feature related tests (auth etc) to use
/admin/projects endpoint instead
- Removes a test that was directly related to the removed endpoint
- Moves a couple of tests to the projects/features endpoint
- Reworks some tests to fetch features from projects features endpoint
and strategies from project strategies
2024-05-27 09:24:09 +02:00
Christopher Kolstad
6f2a10922d
feat: error log on unsupported pg (#7139)
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2024-05-27 09:21:45 +02:00
Gastón Fournier
8ac8d873b4
chore: edge active tokens cache flag removal (#7094)
## About the changes
EdgeService is the only place where we use active tokens validation in
bulk. By switching to validating from the cache, we no longer need a
method to return all active tokens from the DB.
2024-05-24 14:42:30 +02:00
Jaanus Sellin
bd90d1304e
chore: rename toggle to flag #final (#7146) 2024-05-24 15:07:01 +03:00
Mateusz Kwasniewski
8b5e39c997
feat: hide top nav (#7140) 2024-05-24 12:08:08 +02:00
Gastón Fournier
345c34a945
feat: add ip to state-service and group-service (#7120)
The add ip to two services. Despite state is being deprecated, I think
we better get it out of the way.
2024-05-24 09:53:46 +02:00
Christopher Kolstad
4b68a0b3fd
chore: make it build again 2024-05-23 15:32:46 +02:00
Christopher Kolstad
7e38d6bae1
Node20 (#7095)
Upgrades workflows, nvmrc and package.json to use Node 20.
2024-05-23 14:14:09 +02:00
Jaanus Sellin
b3dd460d2f
chore: rename toggle to flag #7 (#7125) 2024-05-23 13:19:49 +03:00
Jaanus Sellin
d9e631c326
chore: remove e2e that is not needed anymore (#7124)
We talked with @nunogois that this test is testing migration from 2023,
but time has passed and the migration is working properly, so we think
to cut down on test run time, we can remove it.
2024-05-23 12:49:12 +03:00
Jaanus Sellin
c4566baeac
chore: rename roles toggles to flag (#7123)
Running migration to update roles descriptions.
2024-05-23 12:01:04 +03:00
Mateusz Kwasniewski
be6837b53a
feat: navigation sidebar stub (#7121) 2024-05-23 10:49:11 +02:00
Jaanus Sellin
7937301424
chore: rename toggle to flag #6 (#7122) 2024-05-23 11:32:11 +03:00
Jaanus Sellin
4824a02f2b
feat: rename toggle to flag with db migration (#7118)
Renaming also permissions with migration
2024-05-23 10:17:02 +03:00
Jaanus Sellin
2d519469d4
chore: rename feature toggle to feature flag #5 (#7115) 2024-05-23 08:36:58 +03:00
Jaanus Sellin
29e7c4035d
chore: rename toggle to flag #4 (#7114) 2024-05-22 16:26:22 +03:00
Mateusz Kwasniewski
ad4f269d23
feat: debug metrics flag (#7108) 2024-05-22 11:53:10 +02:00
Mateusz Kwasniewski
99403e481b
feat: add prometheus metrics error logging (#7105) 2024-05-22 10:08:31 +02:00
Jaanus Sellin
2fb95339ef
chore: change toggle to flag #3 (#7101) 2024-05-22 09:58:53 +03:00
Mateusz Kwasniewski
45eff83a8a
test: fix flaky lifecycle test (#7093) 2024-05-21 13:40:14 +02:00
Jaanus Sellin
4f46f03843
fix: small improvements (#7090)
Fixing isAdmin method. It is not that critical, because that is mostly
for system users not real usage.
Also fixing wording for outdated sdks.
2024-05-21 12:40:52 +03:00
Jaanus Sellin
45c75a65ce
feat: add global isAdmin method for access service (#7088)
This is preparation, so we do not need to define an `isAdmin` method in
the change request context.
2024-05-21 11:56:22 +03:00
Jaanus Sellin
a204f2c615
feat: outdated sdks project level (#7080)
This adds project level endpoint to catch outdated SDKs only for that
project.
2024-05-20 12:58:30 +03:00
David Leek
dfc0c3c63f
feat: refactor data usage into hooks, estimate monthly added fees (#7048)
- Refactors data processing and overage calculations to separate hooks
- Adds support for estimating traffic costs based on monthly usage up to
current point
- Adds accrued traffic charges to the billing page


![image](https://github.com/Unleash/unleash/assets/707867/39a837c2-5092-49b8-8bbf-46d8757635c0)


![image](https://github.com/Unleash/unleash/assets/707867/55ecfa5e-afe1-4cb6-9aa4-7dd67db4248c)
2024-05-17 15:27:32 +02:00
Mateusz Kwasniewski
150a7b3ed4
feat: Deprecate feature toggle environment variants api (#7066) 2024-05-16 13:43:21 +02:00
Mateusz Kwasniewski
9281d6b694
fix: reached stage should emit feature name (#7068) 2024-05-16 12:11:13 +02:00
Gastón Fournier
7cf9cfa96e
fix: bearer tokens with base-path (#7065)
## About the changes
We've identified that Bearer token middleware is not working for
/enterprise instance.

Looking at a few lines below:
88e3b1b79e/src/lib/app.ts (L81-L84)
we can see that we were missing the basePath in the use definition.
2024-05-16 11:45:16 +02:00
Mateusz Kwasniewski
88e3b1b79e
feat: deprecate feature toggle variants at environment level (#7058) 2024-05-16 10:57:32 +02:00
Zachary Skalko
9903cf1090
fix: Add appropriate response headers to SPA entry point HTML response (#6992)
## About the changes

Current state, when returning the HTML entry point from the server,
there are no headers attached. We encountered an issue with a deployment
and this had an impact for us.

A brief description:

1. We deployed the most recent version. Noticed an unrelated issue.
2. Users tried to use the most recent version and due to their client
cache, requested assets that did not exist in the newest version.
3. Our cache layer cached the assets that were not there with the HTML
response. It had to infer the type based on the filename because there
was no attached `Content-Type` header. This cache was very sticky.
4. After rolling back we saw the HTML response (from the cache) instead
of the appropriate response from the upstream Unleash application.

This PR does a few things.

1. When responding with the HTML entry point, it adds header
(`Content-Type: text/html`).
2. When the client is requesting an asset (a path that ends with an
extension), it also instructs the resource not to be cached
(`Cache-Control: no-cache`) and returns a 404. This will prevent misses
from getting cached.


## Discussion points

To me, there doesn't seem to be a lot of test infra on serving the SPA
application. If that is an error, please indicate where that is and an
appropriate test can be added.
2024-05-15 15:07:07 +02:00
Mateusz Kwasniewski
6b59b30846
feat: backfill current stage on startup (#7057) 2024-05-15 12:47:01 +02:00
Christopher Kolstad
8aa0616698
feat: expose postgres version (#7041)
Adds a postgres_version gauge to allow us to see postgres_version in
prometheus and to post it upstream when version checking. Depends on
https://github.com/bricks-software/version-function/pull/20 to be merged
first to ensure our version-function doesn't crash when given the
postgres-version data.
2024-05-13 14:41:28 +02:00
Mateusz Kwasniewski
dfc065500d
feat: kept and discarded read model (#7045) 2024-05-13 14:24:31 +02:00
Jaanus Sellin
dac3f4a186
feat: webhook data for completed (#7043)
Now we post status and statusValue with webhook.
2024-05-13 12:18:02 +03:00
Jaanus Sellin
958ccabb54
feat: lifecycle prometheus metrics per project (#7032)
When we pushed metrics per feature, it had too many datapoints and
grafana could not handle it. Now I am taking median for a project.
2024-05-10 15:24:27 +03:00
Jaanus Sellin
8a2b977ac0
fix: fix prometheus metrics for lifecycle (#7030)
getAll was not properly tested, added test and fixed query. Now metrics
should come up.
2024-05-10 11:50:47 +03:00
Mateusz Kwasniewski
3fc7714e78
feat: Lifecycle in project overview (#7024) 2024-05-09 13:38:18 +02:00
Jaanus Sellin
79739a1d7f
feat: add completed status backend (#7022)
1. Implemented controller, service, store for status saving
2024-05-09 12:05:19 +03:00
Mateusz Kwasniewski
97d702afeb
feat: expose lifecycle stage in project overview search (#7017) 2024-05-09 10:50:51 +02:00
Jaanus Sellin
28a7797aea
feat: feature lifecycle completed schema (#7021)
1. Added new schema and tests
2. Controller also accepts the data
3. Also sending fake data from frontend currently

Next steps, implement service/store layer and frontend
2024-05-09 09:51:44 +03:00
Jaanus Sellin
8ea034cc2f
feat: add status fields for feature lifecycle table (#7014) 2024-05-09 09:39:01 +03:00
Ivar Conradi Østhus
64c10f9eff
poc: many strategies pagination (#7011)
This fixes the case when a customer have thousands of strategies causing
the react UI to crash. We still consider it incorrect to use that amount
of strategies and this is more a workaround to help the customer out of
a crashing state.

We put it behind a flag called `manyStrategiesPagination` and plan to
only enable it for the customer in trouble.
2024-05-08 14:20:51 +02:00
Jaanus Sellin
cd49ae2a26
feat: add project id to prometheus and feature flag (#7008)
Now we are also sending project id to prometheus, also querying from
database. This sets us up for grafana dashboard.
Also put the metrics behind flag, just incase it causes cpu/memory
issues.
2024-05-08 15:19:23 +03:00
Thomas Heartman
95ac2e6b8d
feat: generate project ids if they're missing (#7003)
This PR updates the project service to automatically create a project id
if it is not provided. The feature is behind a flag. If an ID is
provided, it will still attempt to use that ID instead.
2024-05-08 12:45:11 +02:00
Jaanus Sellin
02440dfed2
feat: duration in stage, add feature lifecycle prometheus metrics (#6973)
Introduce a new concept. Duration in stage.
Also add it into prometheus metric.
2024-05-08 11:33:51 +03:00
Thomas Heartman
861ae6aa93
chore: add automatic ID generation algorithm (#7001)
This PR adds a function to automatically generate a project ID on
creation. Using this when the id is missing will be handled in following
PRs.

The function uses the existing `slug` package to create a slug, and then
takes the 12 characters of a uuidv4 string to generate an ID.

The included tests check that the 12 character hash is added and that
the resulting string is url friendly (by checking that
`encodeURIComponent` doesn't change it).

We could also test a lot of edge cases (such as dealing with double
spaces, trimming the string, etc), but I think that's better handled by
the library itself (but you can check out what I removed in
2d9bcb6390
for an idea).

The function doesn't really need to be in the service; it could be moved to a util. But for proximity, I'll create it here first.
2024-05-08 07:26:35 +00:00
Egor Stronhin
8ae8cbbdb4
feat: Allow to use CA certificate file path for DB (#6985)
Regarding ticket #6892:

I would like to enable the use of a CA certificate without requiring
other certificates. This would be useful for AWS Helm, as AWS only
provides a single PEM file for DB connections.
2024-05-07 14:43:19 +02:00
Mateusz Kwasniewski
8ae78236d2
chore: remove project overview refactor flag (#6897) 2024-05-07 13:58:56 +02:00
Mateusz Kwasniewski
d1803b2e62
feat: increase possible number range for yes/no metrics (#6995) 2024-05-07 13:54:56 +02:00
Jaanus Sellin
206d0190ff
feat: create initial stages for features (#6983)
We are getting questions from engineers, why I do not see lifecycle. The
same will happen with our customers. Now customers will see lifecycle
component unified across features.
2024-05-07 11:38:51 +03:00
Jaanus Sellin
77d5156eba
feat: start exposing environment metrics from feature endpoint (#6986)
We want to start showing same donut that we do show in project page.
This is setting it up for UI.
2024-05-07 09:32:46 +03:00
Mateusz Kwasniewski
8d04772256
fix: duplicate column name in search query (#6989) 2024-05-06 19:26:23 +02:00
Jaanus Sellin
2c05f1a0ce
feat: search order by final (#6976)
Final rank has always been ordering correctly by default. But after 5.12
I see some issues that sometimes it is not ordered. Just to be extra
sure, I am for ordering it.
2024-05-03 13:30:12 +03:00
Jaanus Sellin
5c61667282
feat: add completed event as webhook event (#6968)
Now feature completed event can be used with webhook.
2024-05-02 14:48:33 +03:00
Christopher Kolstad
7754ac69df
task: added migration for scim_external_id (#6966) 2024-04-30 10:24:17 +02:00
andreas-unleash
979220d80d
chore: scheduled change request cache kill switch (#6957)
Removes the `inMemoryScheduledChangeRequests` flag and adds
`killScheduledChangeRequestCache`

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2024-04-30 09:33:42 +03:00
Jaanus Sellin
2ba250fa41
feat: do not insert into database stages that already exist (#6964)
Previously when we had thousands of metrics coming in, we were trying to
write them all to database and running into on conflict
2024-04-30 09:07:20 +03:00
Thomas Heartman
a66b3c65c1
chore: add flag for the new project creation form layout (#6959)
Add a flag to enable/disable the new UI for project creation.
This flag is separate from the impl on the back end so that we can
enable one without the other (but uses flag dependencies in Unleash, so
that we can never enable the new UI without the new back end).

I have not set the flag to `true` in server startup because the form
doesn't work yet, so it's a manual step for now.
2024-04-29 13:52:56 +02:00
Thomas Heartman
491cd588da
chore: remove workaround (#6942)
This PR removes the workaround introduced in
https://github.com/Unleash/unleash/pull/6931. After
https://github.com/ivarconr/unleash-enterprise/pull/1268 has been
merged, this should be safe to apply.

Notably, this PR: 
- tightens up the type for the enable change request function, so we can
use that to inform the code
- skips trying to do anything with an empty array

The last point is less important than it might seem because both the env
validation and the current implementation of the callback is essentially
a no-op when there are no envs. However, that's hard to enforce. If we
just exit out early, then at least we know nothing happens.

Optionally, we could do something like this instead, but I'm not sure
it's better or worse. Happy to take input.
```ts
            const crEnvs = newProject.changeRequestEnvironments ?? []
            await this.validateEnvironmentsExist(crEnvs.map((env) => env.name));
            const changeRequestEnvironments =
                await enableChangeRequestsForSpecifiedEnvironments(crEnvs,);

            data.changeRequestEnvironments = changeRequestEnvironments;
```
2024-04-29 13:47:47 +02:00
Tymoteusz Czech
b6865a5a9d
feat: Project owners UI (#6949)
---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2024-04-29 11:51:44 +02:00
gitar-bot[bot]
010c4ee57b
[Gitar] Cleaning up stale feature flag: applicationOverviewNewQuery with value true (#6956)
---------

Co-authored-by: Gitar Bot <noreply@gitar.co>
Co-authored-by: sjaanus <sellinjaanus@gmail.com>
2024-04-29 11:02:08 +03:00
Mateusz Kwasniewski
49e84d3a91
feat: Check production enabled live stage (#6952) 2024-04-26 13:38:25 +02:00
Mateusz Kwasniewski
1739f8e11d
feat: pre-live is non production not just dev (#6946) 2024-04-26 12:43:10 +02:00
Tymoteusz Czech
66ec9a2f2f
feat: project owners in project service (#6935)
Schema and integrating into service and controller for project owners

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2024-04-26 12:07:11 +02:00
Jaanus Sellin
78b9299ff1
feat: feature lifecycle complete and uncomplete (#6927)
Creating a way to complete and uncomplete feature.
2024-04-26 11:38:42 +03:00
Mateusz Kwasniewski
31ab38e162
fix: ignore metrics for non-existent features (#6945) 2024-04-26 10:30:12 +02:00
Mateusz Kwasniewski
8ed15165d2
feat: revived feature goes to initial lifecycle stage (#6944) 2024-04-26 09:50:13 +02:00