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

Adding missing RequiresLinearHistory #935

Merged
merged 1 commit into from
Dec 13, 2021
Merged

Conversation

jtyr
Copy link
Contributor

@jtyr jtyr commented Oct 8, 2021

This PR is adding missing parameter that sets the required_linear_history in the branch protection. Without this patch, I can don't see the requiresLinearHistory in the request data:

2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: 2021/10/08 14:21:23 [DEBUG] Github API Request Details:
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: ---[ REQUEST ]---------------------------------------
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: POST /graphql HTTP/1.1
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Host: api.github.com
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: User-Agent: Go-http-client/1.1
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Content-Length: 665
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Content-Type: application/json
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Accept-Encoding: gzip
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: 
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: {
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:  "query": "mutation($input:UpdateBranchProtectionRuleInput!){updateBranchProtectionRule(input: $input){branchProtectionRule{id}}}",
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:  "variables": {
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:   "input": {
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "branchProtectionRuleId": "BPR_kwDOGLwnv84BVkxt",
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "pattern": "release",
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresApprovingReviews": true,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiredApprovingReviewCount": 1,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresCommitSignatures": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "allowsForcePushes": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "allowsDeletions": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "isAdminEnforced": true,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresStatusChecks": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresStrictStatusChecks": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresCodeOwnerReviews": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "dismissesStaleReviews": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "restrictsReviewDismissals": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "reviewDismissalActorIds": null,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "restrictsPushes": false,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "pushActorIds": null,
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiredStatusCheckContexts": null
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:   }
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:  }
2021-10-08T14:21:23.703+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: }

With this patch, I can see the requiresLinearHistory in the request data:

2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: 2021/10/08 14:11:47 [DEBUG] Github API Request Details:
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: ---[ REQUEST ]---------------------------------------
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: POST /graphql HTTP/1.1
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Host: api.github.com
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: User-Agent: Go-http-client/1.1
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Content-Length: 694
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Content-Type: application/json
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: Accept-Encoding: gzip
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: 
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: {
2021-10-08T14:11:47.287+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:  "query": "mutation($input:UpdateBranchProtectionRuleInput!){updateBranchProtectionRule(input: $input){branchProtectionRule{id}}}",
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:  "variables": {
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:   "input": {
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "branchProtectionRuleId": "BPR_kwDOGLwnv84BVkxt",
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "pattern": "release",
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresApprovingReviews": true,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiredApprovingReviewCount": 1,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresCommitSignatures": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresLinearHistory": true,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "allowsForcePushes": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "allowsDeletions": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "isAdminEnforced": true,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresStatusChecks": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresStrictStatusChecks": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiresCodeOwnerReviews": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "dismissesStaleReviews": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "restrictsReviewDismissals": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "reviewDismissalActorIds": null,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "restrictsPushes": false,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "pushActorIds": null,
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:    "requiredStatusCheckContexts": null
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:   }
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0:  }
2021-10-08T14:11:47.288+0100 [DEBUG] provider.terraform-provider-github_v4.16.0: }

@jcudit jcudit added this to the v4.19.0 milestone Nov 2, 2021
Copy link
Contributor

@majormoses majormoses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@jcudit jcudit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patience on this one 🙇🏾

Looks good to ship! @jtyr can I get some help with the conflicts?

@jtyr
Copy link
Contributor Author

jtyr commented Dec 8, 2021

@jcudit Code rebase.

@philippeboyd
Copy link

It seems to be missing a final approval from @majormoses

@majormoses
Copy link
Contributor

It seems to be missing a final approval from @majormoses

Just a contributor. Will need assistance from @jcudit or another maintainer.

@jcudit jcudit merged commit 2c980cf into integrations:main Dec 13, 2021
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
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.

4 participants