Skip to content
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: activate event emission #4240

Merged
merged 11 commits into from
Jul 17, 2023
Merged

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Jul 14, 2023

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

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.

@sonatype-lift
Copy link

sonatype-lift bot commented Jul 14, 2023

Sonatype Lift is retiring

Sonatype 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.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

@vercel
Copy link

vercel bot commented Jul 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Jul 17, 2023 7:57am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Jul 17, 2023 7:57am

@thomasheartman thomasheartman changed the base branch from main to #4205/emit-potentially-stale-events July 14, 2023 06:29
const potentiallyStaleFeatures =
await this.featureToggleStore.updatePotentiallyStaleFeatures();
if (this.flagResolver.isEnabled('emitPotentiallyStaleEvents')) {
if (potentiallyStaleFeatures.length) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check that there are actual events in here, because otherwise the batchStore methods logs a warning.

Arguably, the batchStore method should accept empty event lists and handle that gracefully. Maybe? I'd be happy to move the check into that store if you think that's sensible, but didn't want to touch more files than necessary.

@thomasheartman thomasheartman marked this pull request as draft July 14, 2023 07:14
Copy link
Contributor

@sjaanus sjaanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

Base automatically changed from #4205/emit-potentially-stale-events to main July 17, 2023 07:53
@thomasheartman thomasheartman marked this pull request as ready for review July 17, 2023 07:57
@thomasheartman thomasheartman enabled auto-merge (squash) July 17, 2023 07:57
@thomasheartman thomasheartman merged commit 11f77a2 into main Jul 17, 2023
10 checks passed
@thomasheartman thomasheartman deleted the #4205/activate-event-emission branch July 17, 2023 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants