Skip to content

Fix branch protection import by repository node ID and pattern - #713

Merged
jcudit merged 2 commits into
integrations:masterfrom
tibbes:fix-branch-protection-import
Mar 1, 2021
Merged

jcudit merged 2 commits into
integrations:masterfrom
tibbes:fix-branch-protection-import

Conversation

@tibbes

@tibbes tibbes commented Feb 28, 2021

Copy link
Copy Markdown
Contributor

Importing github_branch_protection using an ID of the form <repo-node-id>:<pattern> was broken, because the repository node ID was used as a repository name in the GraphQL query to fetch the branch protection rule.

I've updated the tests so that there is now an import test for both both ways of importing branch protection rules (<repo-name>:<pattern> and <repo-node-id>:<pattern>).

Closes: #671

There was an existing test for importing by <repo-name>:<pattern>,
but not a test for <repo-node-id>:<pattern>.
Importing a branch protection rule by an ID of the form
<repo-node-id>:<pattern> was broken.

Closes: integrations#671
@jcudit
jcudit merged commit b23a4cb into integrations:master Mar 1, 2021
@tibbes
tibbes deleted the fix-branch-protection-import branch March 3, 2021 21:19
@jcudit jcudit added this to the v4.6.0 milestone Mar 4, 2021
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
…rations#713)

* Add test for importing github_branch_protection

There was an existing test for importing by <repo-name>:<pattern>,
but not a test for <repo-node-id>:<pattern>.

* Fix importing github_branch_protection

Importing a branch protection rule by an ID of the form
<repo-node-id>:<pattern> was broken.

Closes: integrations#671
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.

Can't import github_branch_protection using repository node_id:branch pattern

2 participants