asyncapi / .github

Location of all reusable community health files
29 stars 65 forks source link

feat: add autoupdate-workflow #262

Closed Shurtu-gal closed 5 months ago

Shurtu-gal commented 10 months ago

Description

Related issue(s) Fixes #227

Shurtu-gal commented 7 months ago

@derberg as was discussed over slack, to not consume too much action minutes right now auto-update is only enabled for comments like \u or /update. Hence there is no need of filtering based on labels.

Successful run The related PR

Labels were meant for filtering in case of mass updates, like in this case

Also, I had removed the previous one as I this one was sufficient for both tasks, but before we do so we have to consider amount of action minutes it will take. Furthermore, GH API limit may also be reached.

Why wasn't the previous one working?

Because the API used by it requires admin access for the updation. Meanwhile, I am this mutation which basically uses a merge PR already created by GitHub (Yeah, I know it sounds unreal 😆), and applies it on top of the HEAD, this was custom made for PR branches.

derberg commented 7 months ago

the problem with saving minutes is that we have a huge amount of bot-created PRs, that quite often require autoupdating

one example: https://github.com/asyncapi/asyncapi-react/pull/924 -> by default autoupdate is added and the bot merges master in like a charm

Shurtu-gal commented 7 months ago

/help

asyncapi-bot commented 7 months ago

Hello, @Shurtu-gal! 👋🏼

    I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand!

    At the moment the following comments are supported in pull requests:

    - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
    - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
    - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.
Shurtu-gal commented 7 months ago

/autoupdate

Shurtu-gal commented 7 months ago

/update

Shurtu-gal commented 7 months ago

@derberg A successful run on comment:- https://github.com/ash17290/asyncapi-github/actions/runs/8086468906 A Successful run on push:- https://github.com/ash17290/asyncapi-github/actions/runs/8086440737

Note that only labelled PRs are auto-updated rest have to be manually done.

derberg commented 6 months ago

@Shurtu-gal I see you requested review again, but I understand you will do further refactor first right?

Shurtu-gal commented 6 months ago

@derberg The refactoring has been done.

Shurtu-gal commented 6 months ago

also in error messages for user, we do not write anything about merge conflicts, that in case of merge conflicts it will also not work

Added that as well.

derberg commented 5 months ago

/rtm

Shurtu-gal commented 5 months ago

/help

asyncapi-bot commented 5 months ago

Hello, @Shurtu-gal! 👋🏼

    I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand!

    At the moment the following comments are supported in pull requests:

    - `/please-take-a-look` or `/ptal` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet.
    - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
    - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
    - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. (Currently only works for upstream branches.)
    - `/update` or `/u` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.
Shurtu-gal commented 5 months ago

/update