-
Notifications
You must be signed in to change notification settings - Fork 45
Optimizations to the Nexus schema tests #8271
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
base: main
Are you sure you want to change the base?
Conversation
// Used as a regression test against | ||
// https://github.com/oxidecomputer/omicron/issues/5561 |
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.
Full admission, I'm dropping this regression test. It's sorta clinging onto the side of this data migration test, but is actually not validating data migration.
It was originally added in #5565, and moved in #7471 , but it's painful to maintain, because it relies on "finding an enum that has been created, dropped, and re-created with the same name", and then applying all updates to the most recent schema so we can issue diesel commands against it.
This cache has been gone for over a year - I think we can re-visit this if/when we ever add back an OID cache.
Noting that the |
Good call, updated the description |
schema/crdb/README.adoc
Outdated
@@ -125,6 +127,7 @@ same `NEW_VERSION`:**, then your `OLD_VERSION` has changed and so _your_ | |||
`NEW_VERSION` and still appears at the top of the list (logically after the | |||
new version that came in from "main"). | |||
* Update the version in `dbinit.sql` to match the new `NEW_VERSION`. | |||
* Re-run `cargo xtask schema generate-previous`. |
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.
Curious what is supposed to happen (like in CI) if you fail to do this
Should we consider just removing old schema versions altogether? I'm imagining something where:
Concretely, say that today:
In this world:
Basically:
I think it's also pretty easy to do mechanically, though probably annoying to automate. |
Sounds totally reasonable to me. I might tweak some of the names and things, but if we're fine dropping old support beyond the past release, this seems like it would clean up a lot, and let us release a lot of the data migration tests too. I'll give this a swing. I think I can modify the existing xtask to handle a lot of the functionality of "check out the base dbinit we want". |
Okay, went ahead and implemented this, using |
This PR optimizes several of the Nexus schema tests:
cargo xtask schema generate-base
command to help pull down this baseline.cargo xtask schema old-migrations
to assist with cleaning up old migrations that are before the "baseline", and are no longer supported.