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

Detect removing an enum value (without removing the whole enum) as a breaking change #22057

Open
melinath opened this issue Mar 25, 2025 · 3 comments

Comments

@melinath
Copy link
Collaborator

What kind of contribution is this issue about?

Pull request UX

Details

Removing an enum value (even UNSPECIFIED values) is unsafe and shouldn't happen outside a major release.

References

No response

@ScottSuarez
Copy link
Collaborator

This is going to be very to difficult to support. The breaking change detector works off the Provider Schema directly.

Enum fields aren't natively supported on the schema and are manually implemented through validation functions. Thus this item would require much more work at either:

  • parsing AST (dubious)
  • diffing mmv1 schemas (needs new implementation)

@ScottSuarez
Copy link
Collaborator

Parsing AST could work if we git diff the LOC on the validation functions. t-shirt size may be smaller in that case

@melinath
Copy link
Collaborator Author

melinath commented Apr 8, 2025

This might be easier to do for plugin-framework resources, since (I think?) we could represent enums as a "custom type": https://developer.hashicorp.com/terraform/plugin/framework/handling-data/types/custom (which would mean they could include Values as a part of the schema instead of us needing to parse the AST)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants