integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
905 stars 746 forks source link

Bump go-github to v57 #2081

Closed kfcampbell closed 10 months ago

kfcampbell commented 10 months ago

This PR supercedes #2011. I've chosen to follow 2 redirects in repository.GetBranch, the same as in that PR.

There were 10 instances of our project using now-deprecated methods, so I've switched those uses to the recommended methods.

goodtune commented 8 months ago

I believe that this has caused a reoccurrence of #1147.

5.43.0

2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: 2024/02/16 16:41:08 [DEBUG] GitHub API Request Details:
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: ---[ REQUEST ]---------------------------------------
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: PUT /repos/MYCOMPANY/MYREPO/branches/main/protection HTTP/1.1
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: Host: api.github.com
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: User-Agent: go-github/v55.0.0
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: Content-Length: 301
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: Accept: application/vnd.github.luke-cage-preview+json,application/vnd.github.stone-crop-preview+json
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: Content-Type: application/json
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: X-Github-Api-Version: 2022-11-28
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: Accept-Encoding: gzip
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: {
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:  "required_status_checks": {
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:   "strict": false,
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:   "checks": []
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:  },
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:  "required_pull_request_reviews": {
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:   "dismissal_restrictions": {},
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:   "dismiss_stale_reviews": false,
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:   "require_code_owner_reviews": true,
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:   "required_approving_review_count": 1
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:  },
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:  "enforce_admins": false,
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:  "restrictions": null,
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0:  "required_conversation_resolution": true
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: }
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0
2024-02-16T16:41:08.606+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: -----------------------------------------------------
2024-02-16T16:41:09.022+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: 2024/02/16 16:41:09 [DEBUG] GitHub API Response Details:
2024-02-16T16:41:09.022+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: ---[ RESPONSE ]--------------------------------------
2024-02-16T16:41:09.022+1100 [DEBUG] provider.terraform-provider-github_v5.43.0: HTTP/2.0 200 OK

5.45.0

2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: 2024/02/16 14:27:01 [DEBUG] GitHub API Request Details:
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: ---[ REQUEST ]---------------------------------------
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: PUT /repos/MYCOMPANY/MYREPO/branches/main/protection HTTP/1.1
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Host: api.github.com
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: User-Agent: go-github/v57.0.0
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Content-Length: 288
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Accept: application/vnd.github.luke-cage-preview+json,application/vnd.github.stone-crop-preview+json
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Content-Type: application/json
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Github-Api-Version: 2022-11-28
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Accept-Encoding: gzip
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: {
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  "required_status_checks": {
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:   "strict": true
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  },
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  "required_pull_request_reviews": {
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:   "dismissal_restrictions": {},
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:   "dismiss_stale_reviews": false,
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:   "require_code_owner_reviews": true,
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:   "required_approving_review_count": 1
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  },
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  "enforce_admins": false,
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  "restrictions": null,
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  "required_conversation_resolution": true
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: }
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0
2024-02-16T14:27:01.527+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: -----------------------------------------------------
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: 2024/02/16 14:27:01 [DEBUG] GitHub API Response Details:
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: ---[ RESPONSE ]--------------------------------------
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: HTTP/2.0 422 Unprocessable Entity
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Content-Length: 299
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Access-Control-Allow-Origin: *
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Content-Security-Policy: default-src 'none'
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Content-Type: application/json; charset=utf-8
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Date: Fri, 16 Feb 2024 03:27:01 GMT
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Server: GitHub.com
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: Vary: Accept-Encoding, Accept, X-Requested-With
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Accepted-Github-Permissions: administration=write
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Content-Type-Options: nosniff
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Frame-Options: deny
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Github-Api-Version-Selected: 2022-11-28
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Github-Media-Type: github.v3; param=luke-cage-preview; format=json, github.stone-crop-preview; format=json
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Github-Request-Id: 2AD1:3A73B4:1BCF528:1D91883:65CED602
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Ratelimit-Limit: 15000
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Ratelimit-Remaining: 14417
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Ratelimit-Reset: 1708054541
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Ratelimit-Resource: core
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Ratelimit-Used: 583
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: X-Xss-Protection: 0
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: {
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  "message": "Invalid request.\n\nNo subschema in \"anyOf\" matched.\nNo subschema in \"oneOf\" matched.\nNot all subschemas of \"allOf\" matched.\nFor 'anyOf/1', {\"strict\"=>true} is not a null.",
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0:  "documentation_url": "https://docs.github.com/rest/branches/branch-protection#update-branch-protection"
2024-02-16T14:27:01.863+1100 [DEBUG] provider.terraform-provider-github_v5.45.0: }

We are an Enterprise user and have just encountered this. Will downgrade in the short term, but this will be an ongoing problem.