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

ResourceState.definition_type: introduce for run-time accessible definition type validation #1388

Merged
merged 4 commits into from Sep 9, 2020

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Jul 22, 2020

This is paired with NixOS/nixops-aws#108. Adding these types here showed zillions of type errors in the nixops-aws plugin. #108 fixes a zillion issues in the types, which makes it actually work. :)

ResourceDefinitionType = TypeVar(
"ResourceDefinitionType", bound="ResourceDefinition", contravariant=True
)
ResourceDefinitionType = TypeVar("ResourceDefinitionType", bound="ResourceDefinition")
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is nice, actually, since we really did want it to be invariant I think.

@grahamc
Copy link
Member Author

grahamc commented Jul 23, 2020

Ratchet going down was just about unavoidable in this case, so I think it is good to go!

@gilligan gilligan force-pushed the defntype branch 2 times, most recently from 53fe628 to 1e27841 Compare September 3, 2020 14:44
@andir
Copy link
Member

andir commented Sep 9, 2020

I think this is in a good enough state to merge it. I've been able to deploy to AWS (with fixes in the AWS plugin) and to libvirt (without any modifications on the code) with this nixops branch.

@grahamc grahamc merged commit 958af5e into NixOS:master Sep 9, 2020
@grahamc grahamc deleted the defntype branch September 9, 2020 13:21
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.

None yet

2 participants