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: onboarding store #8027

Merged
merged 8 commits into from
Sep 2, 2024
Merged

feat: onboarding store #8027

merged 8 commits into from
Sep 2, 2024

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Aug 30, 2024

About the changes

  • adding onboarding service with SQL store implementation
  • added project read model method and user store method (can extract to read model in a separate PR)
  • fixed project create method to allow for date control from the code

Next PR:

  • create tests that combine store and read model
  • plug the service into the rest of the code
  • create composition root for the service
  • write service tests with in-memory store for the listen method testing

Important files

Naming convention:

  • when events progress through the system they change meaning. e.g. lifecycle initial event arrived from the lifecycle subdomain. It is translated to flag-created in the onboarding subdomain. One we confirm it's the first flag created we store it as first-flag in the DB.

Discussion points

Copy link

vercel bot commented Aug 30, 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 Aug 30, 2024 3:19pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Aug 30, 2024 3:19pm

Copy link
Contributor

github-actions bot commented Aug 30, 2024

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

this.eventBus.on(STAGE_ENTERED, async (stage: NewStage) => {
if (!this.flagResolver.isEnabled('onboardingMetrics')) return;

if (stage.stage === 'initial') {
Copy link
Contributor Author

@kwasniew kwasniew Aug 30, 2024

Choose a reason for hiding this comment

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

we do this translation since there's not 100% domain vocab match between lifecycle and onboarding. lifecycle cares about initial flag, while onboarding cares about the first flag created

} from './onboarding-store-type';
import { millisecondsToSeconds } from 'date-fns';

type DBInstanceType = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sticking to dashed convention as in lifecycle events instead of camel casing

event: OnboardingEvent['type'],
): DBInstanceType['event'] => {
if (event === 'flag-created') {
return 'first-flag';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can be also first-flag-created.
Overall progression: 'initial' in lifecycle -> 'flag-created' in service -> 'first-flag-created' when we confirm it's the first one

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

@kwasniew kwasniew merged commit f27e07a into main Sep 2, 2024
9 of 11 checks passed
@kwasniew kwasniew deleted the onboarding-store branch September 2, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants