Skip to content

Vdb 1318 CI/CD protection from out of order migrations#204

Merged
paytonrules merged 16 commits intostagingfrom
vdb-1318-ci-cd-protection-from-out-of-order-migrations
Jun 10, 2020
Merged

Vdb 1318 CI/CD protection from out of order migrations#204
paytonrules merged 16 commits intostagingfrom
vdb-1318-ci-cd-protection-from-out-of-order-migrations

Conversation

@paytonrules
Copy link
Copy Markdown
Contributor

@paytonrules paytonrules commented Jun 4, 2020

This validates that every new migration comes after those in staging, so a staging deployment shouldn't fail. It also validates that the migrations are of a valid format.

@paytonrules paytonrules force-pushed the vdb-1318-ci-cd-protection-from-out-of-order-migrations branch 3 times, most recently from 6e14432 to 7e1136d Compare June 5, 2020 15:00
Copy link
Copy Markdown
Contributor

@rmulhol rmulhol left a comment

Choose a reason for hiding this comment

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

No blockers 👍

Copy link
Copy Markdown
Contributor

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

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

Looking good! 👍

These flags don't make sense in the checkMigrations command I'm
currently writing.

We may wish to, in the future, but anything that requires all these
params in one sub-package to specify the params once.
Preliminary. This requires more testing, command line params and
integration with CI.
To make it possible to test that little filter I had to add an
interface (fine) but a bunch of code to copy slice of objects into a
slice of interfaces (less fine). To make the GitHubfile structure match
the NamedFile interface I had to make its Name field lowercase (private). Also
fine, but then that meant it didn't marshal from JSON, so I had to add
an internal struct with exported fields. Whew.
Testing revealed I was mutating in place, which I did not want to do, so hooray!
You still have to point at Github though
Anything that isn't shared is moved to backfill.go. This is kind of
misleading since all the code is in the same package anyway, but as part
of this I did need to move the PreRunPersistent in checkMigrationsCmd to
be PreRun so that both the logging and initGithubParams functions are called.
Add validatemigrationorder to Makefile. The name checkmigrations has other,
similar names in the Makefile related to generating migrations, so don't
use that.

Add an executable target to the Makefile, and depend on that for
validatemigrationorder. This is more make appropriate.

Make the build task always rebuild the executable, to match existing behavior.
Use wrapped errors for clarification, and use differently errors instead
of reusing err.
@paytonrules paytonrules force-pushed the vdb-1318-ci-cd-protection-from-out-of-order-migrations branch from 334a33a to 3499864 Compare June 10, 2020 17:28
@paytonrules paytonrules changed the title Vdb 1318 ci cd protection from out of order migrations Vdb 1318 CI/CD protection from out of order migrations Jun 10, 2020
@paytonrules paytonrules merged commit 7b1edc5 into staging Jun 10, 2020
@rmulhol rmulhol deleted the vdb-1318-ci-cd-protection-from-out-of-order-migrations branch June 18, 2020 20:27
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