-
Notifications
You must be signed in to change notification settings - Fork 15
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
ENH: Generalize schema configuration and dumping #952
Conversation
db3b4fa
to
f6720fd
Compare
f4d578d
to
09b96d6
Compare
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.
One step closer 🚀
|
||
@classmethod | ||
def __init_subclass__(cls, **kwargs: dict[str, Any]) -> None: | ||
super().__init_subclass__(**kwargs) |
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.
I always learn something new 🙂 never seen this __init_subclass__
before
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.
It didn't feel quite right to use use a Pydantic model as an abstract interface with methods (and Pydantic also didn't seem to like using an ABC as a mixin), so Pydantic-light it was
This creates a pattern for defining schema versions, filenames, and paths. These can then be used throughout the code without being hardcoded strings. The dev and prod URLs are also now present in the code. In the main branch the `$id` URLs now point to the dev enviroment, as this environment tracks main anyway. The idea is that these URLs switching to the production ones will be a step during the promotion to the staging environment. Currently this is done "secretly" with a shell script but as the number of schemas grows, I think it makes more sense to have this be explicit.
09b96d6
to
5e00283
Compare
Toward #895 + schema versioning
This creates a pattern for defining schema versions, filenames, and paths. These can then be used throughout the code without being hardcoded strings.
The dev and prod URLs are also now present in the code. In the main branch the
$id
URLs now point to the dev enviroment, as this environment tracks main anyway. The idea is that these URLs switching to the production ones will be a step during the promotion to the staging environment. Currently this is done "secretly" with a shell script in the docker start-up instance, but as the number of schemas grows, I think it makes more sense to have this be explicit and transparent. What you see is what you get.Follow-up PRs:
SchemBase
onInplaceVolumesResult
update-schema
to also check and dump that schemaupdate-schema
to take a--release
flag$id
to use the production URLThen, additional schemas can be easily dumped. They will all go into the
schemas/
directory, and the contents of this directory will mirror what's on the Radix instance.Effectively that will accomplish schema versioning as well.