## 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
## 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>
## 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.
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>
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.
## 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>
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.
## 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).
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>
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>
<!-- 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>
## 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)).