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

fix: count lifecycle more accurately #8816

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

thomasheartman
Copy link
Contributor

This PR fixes three things that were wrong with the lifecycle summary count query:

  1. When counting the number of flags in each stage, it does not take into account whether a flag has moved out of that stage. So if you have a flag that's gone through initial -> pre-live -> live, it'll be counted for each one of those steps, not just the last one.

  2. Some flags that have been archived don't have the corresponding archived state row in the db. This causes them to count towards their other recorded lifecycle stages, even when they shouldn't. This is related to the previous one, but slightly different. Cross-reference the features table's archived_at to make sure it hasn't been archived

  3. The archived number should probably be all flags ever archived in the project, regardless of whether they were archived before or after feature lifecycles. So we should check the feature table's archived_at flag for the count there instead

Copy link

vercel bot commented Nov 21, 2024

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

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 7:59am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Nov 21, 2024 7:59am

Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@thomasheartman thomasheartman enabled auto-merge (squash) November 21, 2024 08:09
@thomasheartman thomasheartman merged commit 6d75ad7 into main Nov 21, 2024
12 of 13 checks passed
@thomasheartman thomasheartman deleted the 1-3141/fix-lifecycle-counter-query branch November 21, 2024 08:12
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.

2 participants