Commit Graph
114 Commits
Author SHA1 Message Date
Reed Loden 52e60dae85 ci: Don't run the Dependency Review workflow on push actions (#16700)
The Dependency Review action only supports the `pull_request` operation
currently. Running it on `push` operations throws an error, so remove for
now until the action supports that operation.
2022-09-24 04:58:21 +00:00
Reed Loden 0d60cfaa5e ci: Add Dependency Review linting tool (#16640)
Use https://github.com/actions/dependency-review-action to scan all PRs for
out-of-date dependencies and for license enforcement.

https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
2022-09-22 21:40:57 +00:00
Philippe M. Chiasson 2657be4c1d Fix backport bot flow (#16609)
The backport portion of the review bot assumes its current working directory is a checkout
of teleport's master branch (see https://github.com/gravitational/shared-workflows/blob/main/bot/internal/bot/backport.go#L178)

And since `go run` needs the cwd to be right, switching to go build && exec instead

Deprecates #16608
2022-09-21 21:27:01 +00:00
Philippe M. Chiasson bb59734edf Move GitHub review bot to shared-workflows repository (#16226)
* RFD 0029 : Move GitHub review bot to shared-workflows repository

Apart from relocating the code to a different location and renaming the package, this
is a no-op change

Depends-on: gravitational/shared-workflows#12

* remove mentions of the GitHub review bot from Makefile targets
2022-09-20 14:10:31 +00:00
Reed Loden 05323821d8 ci: Swap CIFuzz and CodeQL to larger runner and improve CodeQL workflow (#16490)
We now have access to larger runners, so move CIFuzz and CodeQL workflows to use
a runner with Ubuntu 22.04 LTS with 32 cores and 128GB RAM.

https://docs.github.com/en/actions/using-github-hosted-runners/using-larger-runners

Additionally, change CodeQL workflow to include recommendations from GitHub CodeQL team.
2022-09-19 08:46:53 -07:00
Roman Tkachenko fc72945125 bot: Add support for preferred reviewers (#15623) 2022-08-24 15:23:24 -06:00
Reed Loden 8a4ee05dbb ci: Add paths/paths-ignore to GitHub Actions workflows to reduce unnecessary builds (#15636)
We're running CIFuzz and CodeQL in many cases where it doesn't make sense. We get
charged for GitHub Actions minutes used, so let's make sure to only run them when
absolutely necessary.

For CIFuzz, only run if a *.go file has been modified.
For CodeQL, only run if a path outside of docs/* and rfd/* has been modified.
2022-08-19 23:46:32 +00:00
Reed Loden 9bfa8dea92 ci: Reduce CodeQL max goroutines to address failed extraction (#15683)
Ref https://github.com/github/codeql/issues/9888

CodeQL was failing intermittently due to exceeding limits when
going through the Go extraction phase. Reduce the concurrent
extractions by half (32 --> 16) in an attempt to fix this.
2022-08-19 22:24:00 +00:00
Roman Tkachenko 960a82a81c Fix bot's test (#15586) 2022-08-16 20:31:21 +00:00
Zac Bergquist eff38e2fa5 bot: don't treat docs reviewers as external authors (#15510)
This fixes a corner case where a docs review who submits a PR that
touches code or examples is treated as an external author instead
of an internal employee.
2022-08-13 20:10:31 +00:00
rosstimothy 86e84ddbca Exclude vendor from large PR check (#15249) 2022-08-06 19:15:12 +00:00
Reed Loden d4bbb0a1ab Run terraform linting on all release branches (not just master) (#15264)
This is a no-op change on master, but will be useful next time we cut a release branch.
2022-08-06 16:14:43 +00:00
Reed Loden 4cb859e554 ci: Implement CIFuzz for fuzzing pull requests and pushes (#15110)
OSS-Fuzz provides CIFuzz as a way to fuzz individual pull requests and pushes using
code coverage data to make it more effective and provide regression testing.

https://google.github.io/oss-fuzz/getting-started/continuous-integration/
2022-08-05 23:49:53 +00:00
Reed Loden c9ccc36efd ci: Implement code scanning with CodeQL (#15109)
Use CodeQL to scan all pull requests and pushes for known security issues.

https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql
2022-08-05 22:20:51 +00:00
Reed Loden bbeb689a15 Bump go.mod in .cloudbuild/scripts and .github/workflows/robot to use Go 1.18 (#13959)
Missed two CI-related go.mod files in #13771, so bumping them to keep everything consistent.
2022-08-04 02:43:29 +00:00
Reed Loden 81e8eac68c Add linting for terraform changes (#12815)
Use the shared workflow for linting terraform changes.
2022-08-03 21:02:19 +00:00
Zac Bergquist 2e32065ea6 bot: delete backport branches when a backport is merged (#14068)
The backport workflow runs when any PR is merged to any banch.
Prior to this change, the workflow was a no-op if the target branch
was a release branch.

Update the workflow so that when it runs on merged backports
it deletes the auto-generated backport branch.

Also fixes #12412
2022-08-01 19:47:27 +00:00
Zac Bergquist 560ab638c5 bot: only comment about large PRs once (#15034) 2022-07-29 19:54:45 +00:00
Zac Bergquist 90e66fdd00 bot: only dismiss reviewers if we have 2+ internal approvals (#14440)
This prevents an old approval from counting if the reviewer changes
their review state, and also ensures that multiple approvals from
the same author don't count as more than one approval.
2022-07-13 18:37:04 -07:00
Edoardo Spadolini 992a5d5fd4 Move the stale review dismissal to Check (#14377) 2022-07-12 16:27:41 +00:00
Zac Bergquist 376939d517 bot: dismiss unnecessary reviewers (#14100)
Re-run the assign workflow whenever a review is submitted.
If the PR meets the required approvals and there are additional
reviewers still assigned, dismiss them.

This makes it easier on reviewers to filter PRs on
"awaiting review from me" as the list will not include PRs that
already have the required reviews.

Fixes #11855
2022-07-12 14:04:17 +00:00
Zac Bergquist 06fd14d7c2 bot: require admin approval for large PRs (#13350)
This check requires that PRs which add > 1500 lines of new code
require an admin approval in order to be merged.
2022-07-02 15:51:22 +00:00
Russell Jones cf504afedc Updated automatic backport creation workflow.
Removed automatic creation of backport Pull Requests due to limitations
within GitHub Actions on recursive creation of workflows not allowing
the "Check" workflow to run upon automation creation of the Pull
Request.

As a temporary workaround, prepare the backport branch and provide a
link the user can click on to create the backport Pull Request.
2022-05-02 10:15:26 -07:00
Russell Jones 60b0267956 Added support for automatic backports. 2022-04-28 18:08:54 -07:00
Russell Jones 94802175fa Fixed backport assignment issues.
Added ability to detect URLs for issues and deduplicate list of
reviewers.
2022-03-08 18:52:57 -08:00
Russell Jones 50449c27e4 Assign original reviewers for backports.
Updated review assignment logic to assign original reviewers when a
backport PR is found.
2022-03-07 17:19:36 -08:00
Russell Jones de42b31989 Skip COMMENTED review state after APPROVED. 2022-03-07 10:21:53 -08:00
rosstimothy 896261acaf Add more lint coverage (#10049)
* Add more lint coverage

golanglint-ci doesn't pick up subdirectories with their own go.mod
which left certain directories unlinted. To get around this we can
run golanglint-ci directly against those submodules.
2022-02-07 12:03:10 -05:00
Russell Jones 0d65746fa7 Updated assign and check logic for Cloud.
Updated assign and check logic to assign Cloud team reviewers from Core.
2022-02-02 15:54:53 -08:00
Russell Jones 9a8dfc35fa Cleanup of minor bot issues.
* Don't attempt to submit an empty list of labels to GitHub.
* Be less aggressive when labeling docs.
* Use range for loop iteration.
2022-01-20 08:10:49 -08:00
Edoardo Spadolini b9803adeb3 Revert bot changes for vendor/ (#9743)
The bot runs code from the `master` branch even for the stable branches
that still use vendored dependencies, so we should keep ignoring the
`vendor/` directory in the bot, or we might miscategorize PRs.
2022-01-11 20:22:40 +00:00
Zac Bergquist d0eb86191d Remove vendor
- Remove the vendor directory
- Update bot to stop accounting for vendor
- Update linter config
- Remove update-vendor make target
2022-01-07 02:15:11 -07:00
Zac Bergquist 041f1ea697 bot: label PRs that touch lib/events with "audit-log" 2022-01-05 13:24:07 -07:00
Russell Jones 9edf72b86f Fixed missing reviewers issue.
In a3d85ab removed reviewers from jobs that don't require it and did not
update parsing logic. Instead pass reviewers to all jobs as it is not a
secret and will be inlined into actions/bot soon.
2021-12-23 14:24:07 -08:00
Russell Jones a3d85ab5fe Added support for automatic labeling of PRs. 2021-12-23 11:43:56 -08:00
Russell Jones cf7696cad6 Fixed IsInternal issue in Check workflow.
Fixed issue where IsInternal was returning false for docs reviewers in
the Check workflow.
2021-12-14 18:26:20 -08:00
Russell Jones 821e317b3f Updated checking logic for code owners.
Check logic will now approve with two code owner approvals along with
single code owner + code reviewer approval.
2021-12-14 13:51:45 -08:00
quinqu 759f44c1f6 Correct Dismiss function spelling. 2021-12-09 21:58:58 -08:00
Jane Quintero 36e4570db6 Check If HEAD Branch Is A Fork (#9302) 2021-12-09 23:30:48 +00:00
Russell Jones 598e2417ad Update check.yaml 2021-12-08 17:43:59 -08:00
Jane Quintero 9b5fd64431 Check if PR is from a fork before dismissing runs. (#9300) 2021-12-08 16:12:50 -08:00
Jane Quintero 78b273f19e Trigger Assign workflow on opened and ready_for_review events. (#9272) 2021-12-08 10:17:40 -08:00
Russell Jones 32423dd231 Added more log lines to dismiss workflow. 2021-12-07 20:11:10 -08:00
Russell Jones 675fb3dc09 Fixed error in assignment logic.
Fixed error in assignment logic where some admin reviewers were omitted.
2021-12-03 14:22:12 -08:00
Russell Jones 0e96258067 Added extra logging to bot assignment. 2021-12-03 12:29:06 -08:00
Russell Jones edcfccea43 Updated logic to find workflow by path. 2021-12-02 14:14:26 -08:00
Russell Jones bfbf021197 Updated code review assignment logic.
Code reviewers are split into code owners and code reviewers. Each PR is
now randomly assigned a reviewers from the code owner and reviewer set.
Review checking makes sure that a reviewer from each set has approved
the PR.
2021-12-02 13:54:24 -08:00
Zac Bergquist 53562aadb0 Use t.Setenv in tests (#9154)
This new feature in Go 1.17 automatically restores the environment
variable to its previous value when a test ends, making it simpler
to set up the environment for tests and less likely that we accidentally
leave behind global state.

Also convert some of the remaining uses of check to standard Go tests.
2021-12-01 10:43:12 -07:00
Jane Quintero 3dbbd1be2c Don't Dismiss Dismissed Reviews (#9094) 2021-11-23 13:39:53 -08:00
Jane Quintero 65e8ff64e7 Add Bot Logging (#9099) 2021-11-23 09:36:50 -08:00