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

9161 Commits

Author SHA1 Message Date
Salar Nosrati-Ershad
4fd7035888
chore: update DATABASE_URL to use the database created via POSTGRES_D… (#4836)
…B in compose

## About the changes
I've noticed that all migrations are applied to the `postgres` database
along we've the variable POSTGRES_DB=db in docker compose.
The reason is the DATABASE_URL variable still refers to `postgres`
instead `db`. I updated the URL and now it works with `db`.
2023-09-28 13:07:03 +02:00
Gastón Fournier
93da4a1217
Fix open handles in tests (#4858)
## About the changes
This fixes a bunch of openHandles from our tests

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

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

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

---
Co-authored-by: Ivar Østhus <ivar@getunleash.io>
Co-authored-by: Gard Rimestad <gard@getunleash.io>
2023-09-28 10:21:16 +02:00
Christopher Kolstad
19053cd75c
fix: version checker update needs permissions to write id-token 2023-09-28 09:38:20 +02:00
Mark Fulton
d0e9e33573
docs: add video to SDK overview reference (#4855)
Added video embed into the SDK overview reference doc:
https://docs.getunleash.io/reference/sdks
2023-09-27 14:06:41 -05:00
Mark Fulton
a7040a29c4
doc: Strategy variants video update (#4854)
Added video embed for Strategy Variants reference
2023-09-27 13:50:57 -05:00
Gastón Fournier
e2ffbee468
chore: limit the amount of unannounced events we announce (#4845)
## About the changes
When the events table is large we might be doing a full table scan
searching for unannounced events. We spotted it due to a performance
alert and confirmed in AWS performance insights

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

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


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

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

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

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

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

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

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

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2023-09-27 14:23:05 +01:00
Mateusz Kwasniewski
a06037625d
refactor: expicit names in queries (#4850) 2023-09-27 15:17:04 +02:00
Fredrik Strand Oseberg
d3e01d84d9
fix: account for array length (#4849)
Small fix to account for array length in conditional check
2023-09-27 15:12:01 +02:00
Mateusz Kwasniewski
87a81120d2
feat: feature admin API returns dependencies and children (#4848) 2023-09-27 15:07:20 +02:00
Mateusz Kwasniewski
fd8775f13d
feat: read model for dependent features (#4846) 2023-09-27 14:33:51 +02:00
Nuno Góis
b9910bf114
chore: bump version to 5.6.0 (#4847)
Bumps version to v5.6.0 as part of the release process.
2023-09-27 12:32:25 +01:00
Jaanus Sellin
960bc110ce
feat: enterprise project settings (#4844) 2023-09-27 13:10:10 +03:00
Fredrik Strand Oseberg
ebb76a5354
Feat/reset pnps (#4841)
This PR resets pnps prompts by removing entries in the user_feedback
table
2023-09-27 12:03:02 +02:00
Tymoteusz Czech
f82ae354eb
fix: project features table initial state (#4843)
When loading don't keep initial state, but recalculate if after proper
data is present. (issue 1-1432)
2023-09-27 08:37:25 +00:00
Mateusz Kwasniewski
6f4f6f049b
feat: inject project id to dependencies hooks (#4839) 2023-09-27 10:09:38 +02:00
Mateusz Kwasniewski
40b9c46018
fix: empty object playground (#4842) 2023-09-27 10:01:03 +02:00
Shreyans Gandhi
e6cdf5a540
feat: add json editor (#4784)
In this PR we are adding a JSON Editor that will be used for `json`
variant payload type. Its using `vanilla-jsoneditor` package
https://www.npmjs.com/package/vanilla-jsoneditor and is lazy loaded only
when the `json` payload type is selected in the dropdown UI.
2023-09-27 09:27:38 +02:00
andreas-unleash
3c507c6a8a
bug fix (#4840)
Fixing leftover bug

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-09-27 07:20:03 +00:00
Mateusz Kwasniewski
889377a246
feat: show available parent dependency options (#4837) 2023-09-27 08:10:15 +02:00
Fredrik Strand Oseberg
6d5eec2810
fix: change check for slider (#4838)
Change the check for when to display the variant preview
2023-09-26 19:12:32 +02:00
Mateusz Kwasniewski
76a2ec53f1
feat: Enforce one dependency (#4835) 2023-09-26 14:31:13 +02:00
Mateusz Kwasniewski
e030b67a19
feat: Api to list available parent options (#4833) 2023-09-26 14:03:24 +02:00
David Leek
0938b2e545
docs: improve datadog integration docs (#4802)
## About the changes

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

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-26 11:15:22 +01:00
Mateusz Kwasniewski
45aca5b09e
feat: Connect add dependency api (#4831) 2023-09-26 11:18:42 +02:00
andreas-unleash
e7b1e7979e
Feat: add prod guard when toggling envs (#4774)
Adds the prod guard dialog when enabling/disabling production
environment

Closes # [1-1386]
(https://linear.app/unleash/issue/1-1386/production-guard-modal-for-enablingdisabling-environment-is-gone)



https://github.com/Unleash/unleash/assets/104830839/0041bfc8-872b-455c-b4fa-e03cc160c3e9

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-09-26 12:16:26 +03:00
Gard Rimestad
7cb471a0a4
chore: pin node version 18.17.1 (#4834)
We are pinning node to version 18.17.1 as we have seen some performance
degregation on node 18.18.0 on arm64. We will investigate this further
at a later point. This is to mitigate the issue.

Our next step in pinpointing the issue will be to compare between
running on musl vs libc on arm64.
2023-09-26 10:41:13 +02:00
Mateusz Kwasniewski
d49ff03464
feat: delete all feature dependencies (#4832) 2023-09-26 09:38:34 +02:00
Mateusz Kwasniewski
2b9678266c
feat: Add dependency dialogue (#4828) 2023-09-26 09:38:13 +02:00
Fredrik Strand Oseberg
b919c445b4
feat: add kill switch for client metrics (#4829)
This PR adds a killswitch for client metrics that we can use to disable
metrics in our cloud offering.
2023-09-26 09:37:42 +02:00
Nuno Góis
d16334f3fb
chore: revert #4823 and bump @swc/core to 1.3.88 (#4827)
Reverts #4823 and bumps
[@swc/core](https://www.npmjs.com/package/@swc/core) to the latest
**v1.3.88**.
2023-09-25 15:24:35 +01:00
Mateusz Kwasniewski
a9805b312b
feat: Delete dependency api (#4824) 2023-09-25 15:50:05 +02:00
Michael Ferranti
6a49089d6f
Added 2 links to getunleash.io (#4822)
Added two links for
https://docs.getunleash.io/topics/feature-flags/feature-flag-best-practices
and getunleash.io

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-25 15:19:33 +02:00
Jaanus Sellin
2bf995e731
feat: context/segment usage private (#4826) 2023-09-25 15:50:44 +03:00
Christopher Kolstad
fd9aeec0fb
task: Added workflow for calling update-version-action (#4805)
## What
This adds a workflow which automatically triggers on published releases
to update the version number for our version checker. In addition it
adds a workflow dispatch, in case the version number ended up wrong
after an automatic run (for instance when patching an earlier released
minor).

## Observations
Currently the version checker which receives the update only validates
that the new version is also valid semver, it does not however
check/verify that we're not suddenly telling it an older version is the
newest (improvement available in the version updater repo).
2023-09-25 14:36:19 +02:00
Jaanus Sellin
c84f39ad7c
fix: project mode count even if no settings exist (#4825) 2023-09-25 12:44:02 +03:00
Jaanus Sellin
f7d87a2339
feat: add project collaboration mode to prometheus (#4819) 2023-09-25 12:07:59 +03:00
Nuno Góis
9041422cc9
chore: pin @swc/core to v1.3.83 (#4823)
Reverts
ebc9cb20a9
allowing us to test and debug the latest changes while excluding this
version bump.
2023-09-25 10:07:01 +01:00
Mateusz Kwasniewski
06ea70ef00
feat: enforce no transitive parents (#4818) 2023-09-25 10:12:32 +02:00
Gastón Fournier
eb259a3783
chore: Doc only should skip build (#4820)
## About the changes
This fakes the build on docs-only PRs to be able to have a green build.
Touching a doc to validate it works
2023-09-25 09:12:03 +02:00
Nuno Góis
b9946ee35c
docs: Unleash Slack App integration (#4801)
https://linear.app/unleash/issue/2-1235/docs-slack-app-integration-documentation

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

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

---------

Co-authored-by: David Leek <david@getunleash.io>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-22 23:19:17 +01:00
Michael Ferranti
e197934fa4
docs:Add Feature Flag Migration guide to docs (#4792)
I'm adding a Feature Flag Migration tutorial written by Customer Success
to the docs.

The content should live in the Topic Guide section

Topic Guides

Feature Flags Migration Best Practices index page with subpages for 
* Define scope
* Make business case 
* Planning 
* Execution
* Onboarding users

---------

Co-authored-by: Thomas Heartman <thomasheartman+github@gmail.com>
Co-authored-by: Gastón Fournier <gastonfournier@gmail.com>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Mark Fulton <128738155+markunl@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-09-22 16:41:11 +02:00
Fredrik Strand Oseberg
cefbf01934
feat: visualize feature variants on cr (#4809)
Adds a view over feature strategy variants on addStrategy or
editStrategy action
2023-09-22 16:17:41 +02:00
Michael Ferranti
4f5f1f347c
docs: Create feature-flag-best-practices.md (#4804)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

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

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


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

---------

Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.io>
2023-09-22 14:09:41 +02:00
Nuno Góis
91edae3ccf
refactor: contract event group deleted after #4816 (#4817)
As mentioned in
https://github.com/Unleash/unleash/pull/4816#discussion_r1334162284
2023-09-22 12:57:09 +01:00
Nuno Góis
b6b0f83e3d
feat: add group-deleted event (#4816)
Adds a missing `group-deleted` event.
2023-09-22 11:04:46 +01:00
Mateusz Kwasniewski
b4742df8be
feat: UI stub for adding dependent features (#4814) 2023-09-22 11:26:45 +02:00
Bolaji Ayodeji
d28e7e5a69
docs: update the bulleted list case in about-the-docs.md (#4811)
## About the changes

While exploring the [About the docs](https://docs.getunleash.io) page
for the first time, I observed the first bulleted list started with
lowercase, which isn't consistent with other sections of the page. This
minor PR capitalizes the first letter of the bullet lists in the
"Documentation structure" section. This ensures the list follows the
existing style across the page and the stable rule of written language
([reference](https://www.purchase.edu/editorial-style-guide/general-style-preferences/punctuation/bulleted-and-numbered-lists/#C)).
2023-09-22 11:06:41 +02:00
Jaanus Sellin
ac018447f9
feat: optimize private projects for enterprise (#4812) 2023-09-22 11:54:33 +03:00