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

Force-pushing over modified branches #3301

Closed
rossabaker opened this issue Feb 28, 2024 · 5 comments
Closed

Force-pushing over modified branches #3301

rossabaker opened this issue Feb 28, 2024 · 5 comments

Comments

@rossabaker
Copy link
Contributor

Likely a duplicate of #3300, but opening as a separate issue since it involves commit loss unmentioned by the other.

We're seeing pull requests opened by Scala Steward and appended to by a person being force pushed. All known instances of this are failing with a 422 error.

I think [this is one of the losing builds](https://github.com/typelevel/steward/actions/runs/8083406188/job/22086400559#step:5:1671).
  2024-02-28 16:11:26,296 INFO  typelevel/log4cats is outdated:
    PR outdated: org.scala-lang:scala-library : 2.13.12 -> 2.13.13 (https://github.com/typelevel/log4cats/pull/821)
    PR outdated: org.scala-lang:scala-reflect : 2.13.12 -> 2.13.13 (https://github.com/typelevel/log4cats/pull/821)
  2024-02-28 16:11:26,296 INFO  Nurture typelevel/log4cats
  2024-02-28 16:11:26,296 INFO  Found 1 update:
    org.scala-lang:{scala-library, scala-reflect} : 2.13.12 -> 2.13.13
  2024-02-28 16:11:26,300 INFO  Process update org.scala-lang:{scala-library, scala-reflect} : 2.13.12 -> 2.13.13
  2024-02-28 16:11:26,614 INFO  Create branch update/scala-library-2.13.13
  2024-02-28 16:11:28,430 INFO  Executing post-update hook for org.scala-lang:scala-library with command 'sbt githubWorkflowGenerate'
  2024-02-28 16:11:44,548 INFO  Push 1 commit(s)
  2024-02-28 16:11:45,445 INFO  Create PR update/scala-library-2.13.13
  2024-02-28 16:11:45,837 ERROR Steward typelevel/log4cats failed
  org.scalasteward.core.util.UnexpectedResponse: uri: https://api.github.com/repos/typelevel/log4cats/pulls
  method: POST
  status: 422 Unprocessable Entity
  headers:
    access-control-allow-origin: *
    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
    content-length: 256
    content-security-policy: default-src 'none'
    content-type: application/json; charset=utf-8
    date: Wed, 28 Feb 2024 16:11:45 GMT
    referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
    server: GitHub.com
    strict-transport-security: max-age=31536000; includeSubdomains; preload
    vary: Accept-Encoding, Accept, X-Requested-With
    x-accepted-github-permissions: pull_requests=write
    x-content-type-options: nosniff
    x-frame-options: deny
    x-github-api-version-selected: 2022-11-28
    x-github-media-type: github.v3
    x-github-request-id: 2401:0D9D:1DCD1F2:3B27210:65DF5B2E
    x-ratelimit-limit: 12100
    x-ratelimit-remaining: 12014
    x-ratelimit-reset: 1709139847
    x-ratelimit-resource: core
    x-ratelimit-used: 86
    x-xss-protection: 0

  body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for typelevel:update/scala-library-2.13.13."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}

This may have started on the Typelevel Steward as early as 024-02-27 20:06, though I don't know whether that branch had human commits. Force-pushed commits can sometimes be recovered from the audit trail on the PR, but if not caught quickly enough may be rolled up into one of N force pushes.

@Dichotomia
Copy link
Contributor

Hello. Same problem here since one or two days

@rtyley
Copy link
Contributor

rtyley commented Feb 29, 2024

Yeah, I think the force-pushing over modified branches is a consequence of Scala Steward being unable to find existing PRs now that GitHub has made some kind of change to their List pull requests API endpoint, so that it's now stricter about the head parameter it accepts.

I've raised a fix for this in PR #3303!

@mzuehlke
Copy link
Member

I released v.0.29.1 which hopefully fixes this problem, too.

@rossabaker
Copy link
Contributor Author

This fixed our problem, too. Nice work!

@danicheg
Copy link
Contributor

danicheg commented Mar 2, 2024

Wow, what a fantastic speed of delivering the fix. Thanks a lot!

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

No branches or pull requests

5 participants