Git Product home page Git Product logo

gitea-backporter's People

Contributors

delvh avatar denyskon avatar giteabot avatar github-actions[bot] avatar jolheiser avatar kn4ck3r avatar lunny avatar oliverpool avatar techknowlogick avatar yardenshoham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gitea-backporter's Issues

Support PR re-request / self-request review

Currently this is not possible using the GitHub REST API because re-requests or self-request after approval are not visible in the GitHub review REST API. I think the GraphQL API exposes these and we would have to use that API to correctly parse re-request.

Idea: Run a command on a PR branch

The bot could accept a mention with a command like

@GiteaBot run `make fmt`

If this exact syntax is matched, check out the branch, run the command, and commit the results with a message run `make fmt` requested by @silverwind. Usage should be restricted to maintainer roles and above.

Direct users who add non-english translation changes to crowdin

Sometimes users (very kindly) add translations for other languages in their PR. We should add a gentle reminder to direct them to crowdin to let them know to contribute their changes there instead.

Maybe something like: "Hi, I noticed you've updated the locales for non-English languages. These will be overwritten during the sync from our translation tool Crowdin. If you'd like to contribute your translations, please visit https://crowdin.com/project/gitea."

Idea: Auto-Set labels based on modified path

From go-gitea/gitea#25667 (comment), I think it would be useful if the bot could auto-set some labels based on modified path. There are two kind of matching mechanisms needed:

  1. If any path is modified. For example, every change in Makefile should get a build label.
  2. If only a path is modified. For example a change only in docs should get a kind/docs label and maybe a skip-changelog, but a change that includes changes in docs and templates should not.

The config should be in the repo itself in .github/giteabot.yaml to be flexible to change:

autolabels:
  only:
    - globs: [docs/**]
      labels: [kind/docs, skip-changelog]
  any:
    - globs: [Makefile]
      labels: [build]

Handle LGTM and replace lgtm bot

The lgtm bot is essentially unmaintained and has a number of bugs:

  • It forgets approval status after the branch is updated via merge and needs to be triggered with a comment to update status, which is very annoying.
  • It incorrectly parses "LGTM after ..." from comments

I think we could replace it with lightweight functionality in this bot. The bot tasks are:

  • Handle lgtm/need-* labels, a subtraction of required approver count against actual approvers.
  • Add a commit status or check that suceeds if approval count is >= 2. See here for the diferences between the APIs.

Parsing comments is out of scope for this bot. It is simply not needed any more now that GH has the approvers data (the lgtm bot came from a time before this where a PR could only have a single approver).

For counting approvers, it should count maintainer role and above and this is where we differ from GitHub's view of approvers, where we allow even people without push access to approve and those are visible by the green checkmark. Maybe the upcoming repo rules will allow us to give maintainers a green checkmark.

Incorrect milestone

image

I think this is caused by that v1.19 does not support any more, so bot can not find the correct milestone.
Maybe we can add a check of this in L14:

// find the gitea version that matches the PR's base branch
let giteaVersion = giteaVersions.find((version) =>
pr.base.ref === `release/v${version.majorMinorVersion}`
);

Remove `reviewed/wait-merge` after merge

I know it's not the original purpose of the bot, but it would be useful if the bot would remove the label after any sucessful PR merge, even if the bot is not the author.

Fails to backport clean cherry-picks

go-gitea/gitea#27503 is a clean cherry-pick against both 1.21 and 1.20, but the bot failed for unknown reasons. Here's how I do it, maybe the bot tries it differently?

git checkout release/v1.21
git reset --hard origin/release/v1.21
git checkout -b backport-27503-21
git cherry-pick 08efeb5
git push silverwind backport-27503-21

Better comment in case of backport failure

Suggested in go-gitea/gitea#24470 (comment)

Instead of the current message

`I was unable to create a backport for ${giteaVersion.majorMinorVersion}. @${originalPr.user.login}, please send one manually. :tea:`,

The bot could point to the contrib/backport tool (untested):

`I was unable to create a backport for ${giteaVersion.majorMinorVersion}. @${originalPr.user.login}, please send one manually. :tea:

\`\`\`
go run ./contrib/backport ${originalPr.number}
...  // fix git conflicts if any
go run ./contrib/backport --continue
\`\`\`
`

Update merge queue

As we merge PRs, this code could also update 2-3 of the next-in-line PRs to be merged that have reviewed/wait-merge.

It may also be beneficial to do this per-branch, so we update things targeting main as well as release/v1.19 etc.

/cc @delvh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.