refactor(runner_group): selected_workflows set#3480
Open
sheeeng wants to merge 1 commit into
Open
Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
selected_workflowsselected_workflows set
c471768 to
aefbde2
Compare
Change `selected_workflows` from `TypeList` to `TypeSet` in both `github_actions_runner_group` and `github_enterprise_actions_runner_group` resources. A `TypeList` is order-sensitive, causing Terraform to detect spurious drift when the GitHub API returns workflows in a different order than specified in configuration. A `TypeSet` compares elements regardless of order, eliminating the persistent plan diff. Fix integrations#3478.
aefbde2 to
eadd7e4
Compare
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.
Change
selected_workflowsfromTypeListtoTypeSetin bothgithub_actions_runner_groupandgithub_enterprise_actions_runner_groupresources. ATypeListis order-sensitive, causing Terraform to detect spurious drift when the GitHub API returns workflows in a different order than specified in configuration. ATypeSetcompares elements regardless of order, eliminating the persistent plan diff.Fix #3478.
Resolves #3478.
Before the change?
selected_workflows.selected_workflowsingithub_actions_runner_groupandgithub_enterprise_actions_runner_groupis defined as aTypeList,which is order-sensitive. When the GitHub API returns workflows in a
different order than the Terraform configuration specifies, Terraform
detects a spurious diff and plans an unnecessary update on every run.
After the change?
selected_workflowsis now aTypeSet, which compares elementsregardless of order. The persistent plan drift is eliminated.
SchemaVersionbump to1andStateUpgradersentry ensuresexisting state is migrated automatically on the next
terraform planorterraform apply.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
What changed:* The
selected_workflowsattribute type changed fromTypeListtoTypeSet. Per the [breaking changes policy][breaking],this qualifies as "changing the type of a response model field or
parameter."
Impact: Users who reference individual
selected_workflowselementsby index will need to update their configurations:
Migration steps:
selected_workflowsby index, wrap the attribute intolist(...)as shown above.