tzdata icon indicating copy to clipboard operation
tzdata copied to clipboard

Automated PR bot

Open pganssle opened this issue 5 years ago • 1 comments

We should create an automated PR bot that watches for releases and makes a PR automatically if it detects a change.

I can see two fairly simple ways of doing this:

  1. Run tox -e update and see if git diff shows any substantive change (depending on how #5 is resolved update.py may end up "resetting" all non-IANA version components even if the version hasn't changed).
  2. Change update.py to store a hash of the most recent tarball(s) somewhere in the repository and generate a PR whenever that changes.

I think the biggest challenge is preventing it from generating multiple PRs if it is triggered more than once before the first one is merged, which requires maintaining some state somewhere. Possibly that's easy enough to do because presumably the bot needs its own fork of the repository (or a branch on the main repository), and if the branch name is the same as the IANA version we can just not create the PR if the branch exists.

pganssle avatar Feb 21 '20 15:02 pganssle

I think the biggest challenge is preventing it from generating multiple PRs if it is triggered more than once before the first one is merged, which requires maintaining some state somewhere.

The https://github.com/peter-evans/create-pull-request GitHub Action can handle this:

If a pull request already exists it will be updated if necessary. Local changes in the Actions workspace, or changes on the base branch, can cause an update. If no update is required the action exits silently.

hugovk avatar May 05 '23 18:05 hugovk