fix: check if catalog type is editable before deletion#285
Open
maxtacu wants to merge 3 commits intoincident-io:masterfrom
Open
fix: check if catalog type is editable before deletion#285maxtacu wants to merge 3 commits intoincident-io:masterfrom
maxtacu wants to merge 3 commits intoincident-io:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
small context
We let people manage schedules directly in incident.io, but want governance over naming and enforce conventions. We achieve this by initializing empty schedules via Terraform using the
incident_scheduleresource, with lifecycle rules to ignore changes except the name. This lets people init schedules through Git and approval, then edit them in incident.io. We also set a custom boolean catalog entry attribute to mark if a schedule is paid, managed in theincident_catalog_entryresource.problem statement:
When destroying a schedule in Terraform, the provider tries to delete the linked catalog entry first. But for externally synced catalog types (like the built-in "Schedule" type), this fails because they can't be edited. Since incident.io automatically removes entries from synced types when the source is deleted, Terraform shouldn't try to delete them.
how it works
This ensures that catalog entries for externally synced types (like the built-in "Schedule" type) are not deleted by Terraform, preventing the "Externally synced catalog types can't be edited" error.