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

feat: revived feature goes to initial lifecycle stage #6944

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Apr 26, 2024

About the changes

Revived feature goes back to the initial stage. This is a new initial stage with a date matching the revive time.
Screenshot 2024-04-26 at 09 41 34

Important files

Discussion points

Copy link

vercel bot commented Apr 26, 2024

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 Apr 26, 2024 7:43am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Apr 26, 2024 7:43am

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩

View detailed results in CodeScene

Comment on lines +86 to +93

eventStore.emit(FEATURE_REVIVED, { featureName });
await reachedStage('initial');
const initialLifecycle =
await featureLifecycleService.getFeatureLifecycle(featureName);
expect(initialLifecycle).toEqual([
{ stage: 'initial', enteredStageAt: expect.any(Date) },
]);

Choose a reason for hiding this comment

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

❌ New issue: Large Method
'can insert and read lifecycle stages' has 71 lines, threshold = 70

Suppress

@@ -155,4 +161,9 @@ export class FeatureLifecycleService extends EventEmitter {
]);
this.emit(STAGE_ENTERED, { stage: 'archived' });
}

private async featureRevived(feature: string) {
await this.featureLifecycleStore.delete(feature);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

delete all previous stages

Copy link
Contributor

Choose a reason for hiding this comment

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

LG, but I was thinking about it. If we want to measure how long we were in each stage, this makes it not countable, the first stage. Unless we take it from feature created date.
But if we use created date, then after revive, the created date could have been 2 years ago.

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 an opinion here. One option would be to delete all events expect from the initial event. So when you revive you only erase later stages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since I don't know which is better I'll merge it now with an easy option to change it later


private async featureRevived(feature: string) {
await this.featureLifecycleStore.delete(feature);
await this.featureInitialized(feature);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

re-initialize with a new date

@kwasniew kwasniew requested a review from sjaanus April 26, 2024 07:44
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, but some thoughts added.

@kwasniew kwasniew merged commit 8ed1516 into main Apr 26, 2024
9 checks passed
@kwasniew kwasniew deleted the revive-initial-lifecycle-stage branch April 26, 2024 07:50
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