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

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

Merged
merged 2 commits into from
Mar 1, 2021

Conversation

tibbes
Copy link
Contributor

@tibbes tibbes commented Feb 28, 2021

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