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

[CMDCT-3750] Add a seed mechanism #14965

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

[CMDCT-3750] Add a seed mechanism #14965

wants to merge 11 commits into from

Conversation

BearHanded
Copy link
Contributor

@BearHanded BearHanded commented Oct 3, 2024

Description

Implementing a slightly modified version of the carts seeding mechanism.

  • Sets up a handler for running seeds, exclusively for ephem branches
  • Takes the same data we seed locally and places it in the tables for ephem branches
  • moved initial data load folder within the database service, so that it is accessible to the lambda
  • Uses the same mechanism to seed locally, invoked via run.ts
  • Each table gets a file to configure the keys (they're formatted differently in the db calls, and need to be known ahead of time), and the json files to pull through.
  • These files are threaded to an index file
  • seedRunner handles the seeding mechanism
  • the seed lambda just sets up the runner and lets it do its thing

Notable differences:

  • Seed files takes an array of filenames vs carts that expects a file per json file. SEDS has too many json files for that nonsense.
  • Adds all data for ephemeral branches, rather than different chunks of data for ephem vs main. It's easy enough to change if we want in the future, to always include baseline entries in all environments, and the specific test data otherwise, but I have done no verification that the data is identical to the seed yet.

Open questions:

  • Do we want to seed some baseline data in every env?
  • Do we want to remove anything remaining in src/database (old_data, schemas, and tables)

Related ticket(s)

CMDCT-3750


How to test

Login here with a state user, check out some AL data!
https://d1vea0rmnuva1b.cloudfront.net/

Notes


Pre-review checklist

  • I have added thorough tests, if necessary
  • I have updated relevant documentation, if necessary
  • I have performed a self-review of my code
  • I have manually tested this PR in the deployed cloud environment

Pre-merge checklist

Review

  • Design: This work has been reviewed and approved by design, if necessary
  • Product: This work has been reviewed and approved by product owner, if necessary

Security

If either of the following are true, notify the team's ISSO (Information System Security Officer).

  • These changes are significant enough to require an update to the SIA.
  • These changes are significant enough to require a penetration test.

convert to a different template: test → val | val → prod

copy paste error

create boundary
@BearHanded BearHanded marked this pull request as ready for review October 4, 2024 17:06
@BearHanded BearHanded changed the title add a working seed mechanism [CMDCT-3750] Add a seed mechanism Oct 4, 2024
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17794 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17782 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17792 lines exceeds the maximum allowed for the inline comments feature.

Copy link

codeclimate bot commented Oct 8, 2024

Code Climate has analyzed commit 0b8329a and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (90% is the threshold).

This pull request will bring the total coverage in the repository to 82.3% (0.0% change).

View more on Code Climate.

Copy link

@ailZhou ailZhou left a comment

Choose a reason for hiding this comment

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

tested locally and on deploy, i have test data in both!

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.

3 participants