-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#4205: update to prepare for emitting potentially stale events #4239
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
Because the predata can be inferred to be the opposite, this gives as much information and renders more cleanly in the UI
This is probably better left for a later PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR activates the event emission that was prepared for in #4239. It emits events (behind a flag) when something is marked as potentially stale or the opposite. It takes the features returned from the store and creates events out of them. The events only contain data, no preData. This is because the preData can easily be inferred and because it gives a nicer event in the event log. Here is an image of the difference. The top event uses only data, so it shows the name of the feature and the new potentiallyStale status. The bottom event uses both preData and data, so it only shows the new potentiallyStale status and not the feature name (unless you show the raw event): ![image](https://github.com/Unleash/unleash/assets/17786332/5ec0fbef-f4cf-4dc6-9af6-9203fca30e5d) Should not be merged before #4239. Merge that and then rebase this off main or cherry the commit. ## Discussion ### `preData` Should we also use preData or is it enough to use only data? It seems unnecessary in this event, but I'm open to hearing your thoughts. ### event author: `createdBy` I've set `unleash-system` as the `createdBy` property on these events because they are generated by the system. I found the same string used some other places. However, it may be that there we want to use a different author.
This PR adds updates the potentially stale status change events whenever the potentially stale update function is run.
No events are emitted yet. While the emission is only a few lines of code, I'd like to do that in a separate PR so that we can give it the attention it deserves in the form of tests, etc.
This PR also moves the potentially stale update functionality from the
update
method to only being done in theupdatePotentiallyStaleFeatures
method. This keeps all functionality related to markingpotentiallyStale
in one place.The emission implementation was removed in 4fb7cbd
The update queries
While it would be possible to do the state updates in a single query instead of three separate ones, wrangling this into knex proved to be troublesome (and would also probably be harder to understand and reason about). The current solution uses three smaller queries (one select, two updates), as Jaanus suggested in a private slack thread.
Input is welcome if you have any.