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

Don't try other merge method on github when required status checks are missing #17782

Closed
viceice opened this issue Sep 14, 2022 · 2 comments · Fixed by #21063
Closed

Don't try other merge method on github when required status checks are missing #17782

viceice opened this issue Sep 14, 2022 · 2 comments · Fixed by #21063
Assignees
Labels
platform:github GitHub Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:bug Bug fix of existing functionality

Comments

@viceice
Copy link
Member

viceice commented Sep 14, 2022

How are you running Renovate?

Mend Renovate hosted app on github.com

If you're self-hosting Renovate, tell us what version of Renovate you run.

No response

If you're self-hosting Renovate, select which platform you are using.

No response

If you're self-hosting Renovate, tell us what version of the platform you run.

No response

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

Renovate retries other merge methods on github

happens here: https://github.com/renovatebot/osv-offline

We should check response and break early

DEBUG: GitHub blocking PR merge -- will keep trying(branch="renovate/jest-monorepo")
{
  "response": {
    "message": "Required status check \"build\" is expected.",
    "documentation_url": "https://docs.github.com/articles/about-protected-branches"
  }
}

Relevant debug logs

Logs
DEBUG: mergePr(57, renovate/jest-monorepo)(branch="renovate/jest-monorepo")
DEBUG: mergePr(branch="renovate/jest-monorepo")
{
  "options": {
    "body": {
      "merge_method": "squash"
    }
  },
  "url": "repos/renovatebot/osv-offline/pulls/57/merge"
}
DEBUG: Unknown GitHub error(branch="renovate/jest-monorepo")
{
  "err": {
    "name": "HTTPError",
    "code": "ERR_NON_2XX_3XX_RESPONSE",
    "timings": {
      "start": 1663138182418,
      "socket": 1663138182418,
      "lookup": 1663138182426,
      "connect": 1663138182426,
      "secureConnect": 1663138182437,
      "upload": 1663138182437,
      "response": 1663138182942,
      "end": 1663138182943,
      "phases": {
        "wait": 0,
        "dns": 8,
        "tcp": 0,
        "tls": 11,
        "request": 0,
        "firstByte": 505,
        "download": 1,
        "total": 525
      }
    },
    "message": "Response code 405 (Method Not Allowed)",
    "stack": "HTTPError: Response code 405 (Method Not Allowed)\n    at Request.<anonymous> (/home/ubuntu/renovateapp/node_modules/got/dist/source/as-promise/index.js:118:42)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)",
    "options": {
      "headers": {
        "user-agent": "Renovate Bot (GitHub App 2740)",
        "accept": "application/vnd.github.machine-man-preview+json",
        "authorization": "***********",
        "content-type": "application/json",
        "content-length": "25",
        "accept-encoding": "gzip, deflate, br"
      },
      "url": "https://api.github.com/repos/renovatebot/osv-offline/pulls/57/merge",
      "hostType": "github",
      "username": "",
      "password": "",
      "method": "PUT",
      "http2": false
    },
    "response": {
      "statusCode": 405,
      "statusMessage": "Method Not Allowed",
      "body": {
        "message": "Required status check \"build\" is expected.",
        "documentation_url": "https://docs.github.com/articles/about-protected-branches"
      },
      "headers": {
        "server": "GitHub.com",
        "date": "Wed, 14 Sep 2022 06:49:42 GMT",
        "content-type": "application/json; charset=utf-8",
        "content-length": "138",
        "x-github-media-type": "github.v3; param=machine-man-preview; format=json",
        "x-ratelimit-limit": "5900",
        "x-ratelimit-remaining": "5675",
        "x-ratelimit-reset": "1663138715",
        "x-ratelimit-used": "225",
        "x-ratelimit-resource": "core",
        "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",
        "access-control-allow-origin": "*",
        "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
        "x-frame-options": "deny",
        "x-content-type-options": "nosniff",
        "x-xss-protection": "0",
        "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
        "content-security-policy": "default-src 'none'",
        "vary": "Accept-Encoding, Accept, X-Requested-With",
        "x-github-request-id": "CBB8:4916:363D508:379F7E0:63217986",
        "connection": "close"
      },
      "httpVersion": "1.1"
    }
  }
}
DEBUG: GitHub blocking PR merge -- will keep trying(branch="renovate/jest-monorepo")
{
  "response": {
    "message": "Required status check \"build\" is expected.",
    "documentation_url": "https://docs.github.com/articles/about-protected-branches"
  }
}
DEBUG: mergePr(branch="renovate/jest-monorepo")
{
  "options": {
    "body": {
      "merge_method": "rebase"
    }
  },
  "url": "repos/renovatebot/osv-offline/pulls/57/merge"
}
DEBUG: Unknown GitHub error(branch="renovate/jest-monorepo")
{
  "err": {
    "name": "HTTPError",
    "code": "ERR_NON_2XX_3XX_RESPONSE",
    "timings": {
      "start": 1663138182949,
      "socket": 1663138182949,
      "lookup": 1663138182958,
      "connect": 1663138182958,
      "secureConnect": 1663138182969,
      "upload": 1663138182970,
      "response": 1663138183286,
      "end": 1663138183286,
      "phases": {
        "wait": 0,
        "dns": 9,
        "tcp": 0,
        "tls": 11,
        "request": 1,
        "firstByte": 316,
        "download": 0,
        "total": 337
      }
    },
    "message": "Response code 405 (Method Not Allowed)",
    "stack": "HTTPError: Response code 405 (Method Not Allowed)\n    at Request.<anonymous> (/home/ubuntu/renovateapp/node_modules/got/dist/source/as-promise/index.js:118:42)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)",
    "options": {
      "headers": {
        "user-agent": "Renovate Bot (GitHub App 2740)",
        "accept": "application/vnd.github.machine-man-preview+json",
        "authorization": "***********",
        "content-type": "application/json",
        "content-length": "25",
        "accept-encoding": "gzip, deflate, br"
      },
      "url": "https://api.github.com/repos/renovatebot/osv-offline/pulls/57/merge",
      "hostType": "github",
      "username": "",
      "password": "",
      "method": "PUT",
      "http2": false
    },
    "response": {
      "statusCode": 405,
      "statusMessage": "Method Not Allowed",
      "body": {
        "message": "Rebase merges are not allowed on this repository.",
        "documentation_url": "https://docs.github.com/rest/reference/pulls#merge-a-pull-request"
      },
      "headers": {
        "server": "GitHub.com",
        "date": "Wed, 14 Sep 2022 06:49:43 GMT",
        "content-type": "application/json; charset=utf-8",
        "content-length": "151",
        "x-github-media-type": "github.v3; param=machine-man-preview; format=json",
        "x-ratelimit-limit": "5900",
        "x-ratelimit-remaining": "5674",
        "x-ratelimit-reset": "1663138715",
        "x-ratelimit-used": "226",
        "x-ratelimit-resource": "core",
        "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",
        "access-control-allow-origin": "*",
        "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
        "x-frame-options": "deny",
        "x-content-type-options": "nosniff",
        "x-xss-protection": "0",
        "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
        "content-security-policy": "default-src 'none'",
        "vary": "Accept-Encoding, Accept, X-Requested-With",
        "x-github-request-id": "CBBA:9212:1334D8F:13C4624:63217986",
        "connection": "close"
      },
      "httpVersion": "1.1"
    }
  }
}

Have you created a minimal reproduction repository?

No reproduction, but I have linked to a public repo where it occurs

@viceice viceice added type:bug Bug fix of existing functionality priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others platform:github GitHub Platform status:ready labels Sep 14, 2022
@rarkins
Copy link
Collaborator

rarkins commented Sep 14, 2022

Looks like we should search for the "Required status check" string and add intelligence for that condition

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 35.18.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform:github GitHub Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants