-
-
Notifications
You must be signed in to change notification settings - Fork 739
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: Feature lifecycle sql store #6790
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
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.
❌ Code Health Quality Gates: FAILED
-
Declining Code Health: 1 findings(s) 🚩
-
Affected Hotspots: 1 files(s) 🔥
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.
❌ Code Health Quality Gates: FAILED
-
Declining Code Health: 1 findings(s) 🚩
-
Affected Hotspots: 1 files(s) 🔥
|
||
return results.map(({ stage, created_at }: DBType) => ({ | ||
stage, | ||
enteredStageAt: created_at, |
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.
will probably rename enteredStageAt to createdAt in the service and openapi
@@ -8,9 +8,12 @@ export class FakeFeatureLifecycleStore implements IFeatureLifecycleStore { | |||
private lifecycles: Record<string, FeatureLifecycleView> = {}; | |||
|
|||
async insert(featureLifecycleStage: FeatureLifecycleStage): Promise<void> { | |||
const existing = await this.get(featureLifecycleStage.feature); | |||
if (await this.stageExists(featureLifecycleStage)) { |
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.
prevent double inserts in fake impl
db.runSql( | ||
` | ||
CREATE TABLE IF NOT EXISTS feature_lifecycles ( | ||
feature VARCHAR(255) NOT NULL REFERENCES features(name) ON DELETE CASCADE, |
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.
we want to delete feature lifecycle when feature is removed
CREATE TABLE IF NOT EXISTS feature_lifecycles ( | ||
feature VARCHAR(255) NOT NULL REFERENCES features(name) ON DELETE CASCADE, | ||
stage VARCHAR(255) NULL, | ||
created_at TIMESTAMP WITH TIME ZONE default now(), |
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.
sticking to generic name instead of specific stage_entered_at
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.
using timestamp with timezone to have the same type as features table
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.
❌ Code Health Quality Gates: FAILED
-
Declining Code Health: 1 findings(s) 🚩
-
Affected Hotspots: 1 files(s) 🔥
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
About the changes
await ms(randomTime)
Important files
Discussion points