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

Tries to update a past closed pull request #183

Open
mihkeleidast opened this issue May 12, 2022 · 3 comments
Open

Tries to update a past closed pull request #183

mihkeleidast opened this issue May 12, 2022 · 3 comments

Comments

@mihkeleidast
Copy link

Noticed that the action had not opened a new PR when a changeset was merged. The action ran successfully, the logs said that it tried to update a past PR that had been merged the day before.

Not sure if the GH API result was wrong for some reason, or whatever the particular reason is... Could there be a check added, that checks whether the "existing" PR is still open, and if not, the action should open a new PR? The info seems to be there in the result

Logs (I removed a lot that should not be necessary, the closed state is important):

remote: 
remote: Create a pull request for 'changeset-release/master' on GitHub by visiting:
remote: 
 * [new branch]      HEAD -> changeset-release/master
{
  "total_count": 1,
  "incomplete_results": false,
  "items": [
    {
      "number": 309,
      "title": "chore: version packages",
      "labels": [],
      "state": "closed",
      "locked": false,
      "assignee": null,
      "assignees": [],
      "milestone": null,
      "comments": 0,
      "created_at": "2022-05-11T13:40:40Z",
      "updated_at": "2022-05-11T13:45:10Z",
      "closed_at": "2022-05-11T13:45:09Z",
      "author_association": "CONTRIBUTOR",
      "active_lock_reason": null,
      "draft": false,
      "reactions": {
        "total_count": 0,
        "+1": 0,
        "-1": 0,
        "laugh": 0,
        "hooray": 0,
        "confused": 0,
        "heart": 0,
        "rocket": 0,
        "eyes": 0
      },
      "performed_via_github_app": null,
      "score": 1
    }
  ]
}
updating found pull request #309
@Andarist
Copy link
Member

This was reported to me a few weeks back by @mikearnaldi. I was investigating this and I've concluded that this was a bug in the GitHub API itself. I was performing the requests manually, with the correct filter for the open/closed status and it just returned stale/invalid results to me.

I think it's worth reporting this to GitHub as something wrong is happening with their API, but perhaps we can check the status of the retrieved PR and try to handle this bug on our side 🤔

@mihkeleidast
Copy link
Author

BTW, in this scenario, is it okay to simply open a new PR myself, will the action update it with any added changesets?

@Andarist
Copy link
Member

maybe if it would match the query. It's hard to tell because this thing shouldn't happen in the first place ;p

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

2 participants