-
Notifications
You must be signed in to change notification settings - Fork 40
Add automatic labelling of turbolift-raised PRs, with opt-out #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Richard North (rnorth)
wants to merge
10
commits into
main
Choose a base branch
from
labels
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9f59109
Update README development tasks
rnorth 1a1c2c4
docs: dedupe agent guidance
rnorth 89f6101
Create initial AGENTS.md
rnorth a956207
Apply a label to PRs raised by Turbolift
rnorth 054cd25
Add opt-out flag for applying PR labels
rnorth dba68c5
Merge branch 'main' into labels
rnorth f1f39e6
Ensure turbolift label exists before PR creation
rnorth ab083a7
Tweak wording
rnorth af17af7
Address review comments: simplify label handling
rnorth 0a42931
Simplify label handling by replacing Labels slice with ApplyLabels bool
rnorth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Repository Guidelines | ||
|
|
||
| `README.md` is the source of truth for installation, usage, and development. Use these anchors: Philosophy, Basic usage, Detailed usage, Caveats, Local development, Available Development Tasks. | ||
|
|
||
| - Tooling: pinned via `.mise.toml` (Go 1.23, golangci-lint v2.1.5, goreleaser v2.12.7). Run `mise install`; `mise run dev` prepares deps + lint; `mise run test` runs lint + race/cover; `mise run fix` applies gofmt/golangci-lint fixes. | ||
| - Project structure: CLI entrypoint `main.go`; commands in `cmd/`; shared logic under `internal/<domain>`; tests co-located as `_test.go`; demo asset `docs/demo.gif`; release artifacts in `dist/` (clean with `mise run clean`); fakes for git/GitHub/filesystem interactions in `internal/testsupport`. | ||
| - Style: standard Go formatting; package names lower_snakecase; include the Apache 2.0 header from `CONTRIBUTING.md` when creating files. | ||
| - Usage workflow: follow README sections noted above; when operating turbolift across many repos, use `repos.txt` subsets and `turbolift foreach --failed/--successful` to reduce blast radius (see Caveats). | ||
| - Operational notes: authenticate GitHub CLI (`gh auth login`; set `GH_HOST` for GHE). Use `mise run build`/`mise run install` for local binaries; `mise run release` drives GoReleaser via the managed binary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,11 +27,14 @@ import ( | |
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. funny, github doesn't show any syntax highlighting on this one? |
||
| var execInstance executor.Executor = executor.NewRealExecutor() | ||
|
|
||
| const TurboliftLabel = "turbolift" | ||
|
|
||
| type PullRequest struct { | ||
| Title string | ||
| Body string | ||
| UpstreamRepo string | ||
| IsDraft bool | ||
| Labels []string | ||
| ReviewDecision string | ||
| } | ||
|
|
||
|
|
@@ -60,6 +63,10 @@ func (r *RealGitHub) CreatePullRequest(output io.Writer, workingDir string, pr P | |
| pr.UpstreamRepo, | ||
| } | ||
|
|
||
| for _, label := range pr.Labels { | ||
| gh_args = append(gh_args, "--label", label) | ||
| } | ||
|
|
||
| if pr.IsDraft { | ||
| gh_args = append(gh_args, "--draft") | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.