kubevirt / project-infra

Project infrastructure administrative tools
Apache License 2.0
25 stars 134 forks source link

botreview - automate simple reviews #3100

Open dhiller opened 9 months ago

dhiller commented 9 months ago

botreview aims to automate reviews that follow simple patterns.

Motivation of this is to check automatically created PRs like image bumps, prow bumps, kubevirtci bumps etc., i.e. all PRs that follow simple patterns, are tedious to review but still required to check.

If anything beyond those patterns appears, it will backoff and add a comment with suspicious changes it found.

Note: botreview only acts as a first gate to filter out those PRs that really require a humans review!

Roadmap

How to run

It can be run in two ways:

as a command

Example run:

go run ./robots/cmd/botreview/... --dry-run=false --github-token-path ... --pr-number=2485 --repo=project-infra

If --dry-run=false is set, it will attach a comment to the review that states the review result.

Result: https://github.com/kubevirt/project-infra/pull/2485#issuecomment-1327188198

Note: using --dry-run=true or omitting the flag will run the tool in dry-run which will just print out the result)

as an external plugin for prow

It will react on pull request events for the repos it's configured for in the plugins config and will review simple PRs automatically.

Note that the deployment currently has `--dry-run=true enabled, since we want to test it's stability gradually.

Review strategies

Review strategies implemented today:

Note: It can also handle mixed PRs, where each change abides by the rules of the strategy.

[^1]: required since kubevirt-bot can't lgtm their own PRs

dhiller commented 9 months ago

/area automation /area prow

dhiller commented 9 months ago

/kind tracker

dhiller commented 9 months ago

From the first round of testing I got these results:

dhiller commented 9 months ago

Need to improve kubevirtci bump selection: https://github.com/kubevirt/kubevirt/pull/10747#issuecomment-1851616047

kubevirt-bot commented 5 months ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot commented 4 months ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

kubevirt-bot commented 3 months ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

kubevirt-bot commented 3 months ago

@kubevirt-bot: Closing this issue.

In response to [this](https://github.com/kubevirt/project-infra/issues/3100#issuecomment-2154717871): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
dhiller commented 3 months ago

/reopen

We still want to do this.

kubevirt-bot commented 3 months ago

@dhiller: Reopened this issue.

In response to [this](https://github.com/kubevirt/project-infra/issues/3100#issuecomment-2154731354): >/reopen > >We still want to do this. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
dhiller commented 3 months ago

/remove-lifecycle rotten

kubevirt-bot commented 1 week ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale