Repository navigation
Added automated PR and issue labeling workflow - #3813
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc495fc33d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .map((rule) => rule.label); | ||
|
|
||
| if (toAdd.length) { | ||
| await github.rest.issues.addLabels({ |
There was a problem hiding this comment.
Reconcile labels when PR files change
When a PR is synchronized after removing the files that originally matched a rule, this rerun only calls addLabels and never removes any previously managed labels. For example, a PR that once touched docs but later drops those files keeps the docs label, so the release-note labeling can remain wrong unless a maintainer notices and cleans it up manually.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Ok will work on it good suggestion 👍
| { label: "bug", pattern: /\berror\b|\bbug\b|\bfix\b|\bexception\b|traceback|crash|not working/i }, | ||
| { label: "performance", pattern: /\bslow\b|\bperformance\b|\bbenchmark(ing)?\b/i }, | ||
| { label: "visualization", pattern: /\bsolara\b|\bvisualization\b|\baltair\b|\bmatplotlib\b|space renderer/i }, | ||
| { label: "enhancement", pattern: /\bfeature request\b|\benhancement\b|would be (nice|great) if/i }, |
There was a problem hiding this comment.
Match the existing feature request template
Issues opened with this repo's feature-request template can miss the enhancement label unless the user happens to put the exact phrase feature request, singular enhancement, or would be nice/great if in their own text. The default template body uses feature and plural enhancements, so a normal title like “Add X support” will not be labeled; include the template wording such as features?/enhancements? if these issues should be auto-triaged.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The enhancement feature will still has manual options to assign levels its add on feature that will help the maintainers in their review procedure also new joinee and contributor to navigate through the prs and issue which is initially get hectic for the maintainers to assign each pr and each issues
|
Previously, a commit that touched docs/ (or any other path-rule match) kept that label forever, even after a later push removed those files — addLabels was only ever additive. labelPr now also computes which managed labels no longer match the current diff and removes them via removeLabel, so re-running on synchronize keeps labels in sync with the PR's actual current changes. Issue keyword labels remain add-only: they're heuristics maintainers routinely override by hand after triage, so auto-removing them would fight manual curation instead of assisting it. |
|
I am not. up to speed with the workflow stuff on GitHub, but this seems like a nice quality of life feature. This is modeled on what was done for mesa-examples and it is known to work? |
Yes it is working perfectly fine |
|
Ok, then I'll merge this and see how it works in practice. |
- Apply Oxford comma suggestions and use it consistently across the guide - Clarify what core examples are in decisions.md - Update seeding guidance to Mesa 4.0's rng/Scenario API - Mark manual labeling decision as partly superseded by mesa#3813 - Ask contributors to write PR and issue text themselves - Ask bug reports to explain how the bug affects real models Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Apply Oxford comma suggestions and use it consistently across the guide - Clarify what core examples are in decisions.md - Update seeding guidance to Mesa 4.0's rng/Scenario API - Mark manual labeling decision as partly superseded by mesa#3813 - Ask contributors to write PR and issue text themselves - Ask bug reports to explain how the bug affects real models Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
.github/workflows/label_automation.yml, which auto-labels PRs based on changed file paths and issues based on title/body keyword matching.pull_request_target(opened, reopened, ready_for_review, converted_to_draft, review_requested, review_request_removed, synchronize,closed) so merged/closed PRs still get a final labeling pass.issues(opened, reopened, edited).workflow_dispatchinput (state: open|closed|all) to backfill labels onto PRs/issues that already existed before this workflow was added, since GitHub Actions can't replay past webhook events automatically.pull_request_target(no code checkout) so it's safe to run againstPRs from forks — the script only reads the file list and issue text via the API.