Skip to content

Added automated PR and issue labeling workflow - #3813

Merged
quaquel merged 5 commits into
mesa:mainfrom
dietcoke-17:label_automation
Aug 26, 2026
Merged

quaquel merged 5 commits into
mesa:mainfrom
dietcoke-17:label_automation

Conversation

@dietcoke-17

Copy link
Copy Markdown
Contributor

Summary

  • Added .github/workflows/label_automation.yml, which auto-labels PRs based on changed file paths and issues based on title/body keyword matching.
  • PR labeling runs on 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.
  • Issue labeling runs on issues (opened, reopened, edited).
  • Adds a workflow_dispatch input (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.
  • Uses 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@dietcoke-17

Copy link
Copy Markdown
Contributor Author

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.

@quaquel quaquel added ci Release notes label ignore-for-release PRs that aren't included in the release notes labels Aug 26, 2026
@quaquel

quaquel commented Aug 26, 2026

Copy link
Copy Markdown
Member

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?

@dietcoke-17

Copy link
Copy Markdown
Contributor Author

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

@quaquel

quaquel commented Aug 26, 2026

Copy link
Copy Markdown
Member

Ok, then I'll merge this and see how it works in practice.

@quaquel
quaquel merged commit 592bfc4 into mesa:main Aug 26, 2026
11 checks passed
EwoutH added a commit to EwoutH/mesa that referenced this pull request Oct 28, 2026
- 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]>
EwoutH added a commit to EwoutH/mesa that referenced this pull request Oct 28, 2026
- 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Release notes label ignore-for-release PRs that aren't included in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants