knl / niv-updater-action

A GitHub Action that creates meaningful pull requests with updates to your niv-managed dependencies, so you don't have to do menial chores.
BSD 3-Clause "New" or "Revised" License
29 stars 11 forks source link

Option to keep updating PR with new updates #14

Closed knl closed 3 years ago

knl commented 4 years ago

I'm not sure if this is an useful option, but might be helpful in the cases where something changes frequently.

The problem is how to detect the need to do the update.

nomeata commented 4 years ago

I was about to report this. I have a PR created by niv-update-action a which fails CI, so obviously can’t be merged. Ideally, as soon as someone fixes the upstream repo and the action runs, a new commit gets pushed to this branch (I guess force-pushed works too), and also the description gets updated. This way, when upstream works again, things just smoothly sail into the downstream repo.

nomeata commented 3 years ago

Just nudging about this; at work we just had a problem where one of the PRs failed (needed some adjustments in the target repo), and was forgotten, and then for a few months one repo didn’t update at all, and nobody noticed. If niv-updater-action would keep updating that PR, it would keep showing up in the notificaitons and remind us that there is still work to do.

In order to handle changes to that branch gracefully, maybe the logic should be: If there is an existing update branch, use that (not master), and push to that (don’t create a new PR). That should work rather nicely, I think.

knl commented 3 years ago

@nomeata sorry for silence, there was a lot of other work to do. I implemented this functionality in https://github.com/knl/niv-updater-action/pull/37 -- The difference from the proposed approach is that I keep creating a new commit and changing the branch and the PR's title/description to point to the new commit.

nomeata commented 3 years ago

Hmm, this doesn’t seem to be updating the PR description, does it?

knl commented 3 years ago

Hmm, this doesn’t seem to be updating the PR description, does it?

It should. These lines are responsible for such changes: https://github.com/knl/niv-updater-action/pull/37/files#diff-5aa8518f530033ed2efd0db4dd918d9144d524fde9dbd12d305bf0a40579bca4R472-R486.

I've noticed the update on some test PRs I have, but it was not obvious, because the updated commits come at the very end of the description. Do you see any errors?

knl commented 3 years ago

Moving to a new issue.