Skip to content

Automatically assign plugin-specific milestones#2586

Open
zerlinpi wants to merge 1 commit into
WordPress:trunkfrom
zerlinpi:maintenance/auto-plugin-milestone
Open

Automatically assign plugin-specific milestones#2586
zerlinpi wants to merge 1 commit into
WordPress:trunkfrom
zerlinpi:maintenance/auto-plugin-milestone

Conversation

@zerlinpi

Copy link
Copy Markdown

Summary

Fixes #2541.

Automatically assigns a plugin-specific milestone when a pull request is opened or synchronized. The workflow counts additions and deletions under each known plugins/<slug>/ directory, selects the plugin with the unique highest total, and updates the pull request to that plugin's milestone.

It also adds focused unit tests to the existing JavaScript CI job.

Relevant technical choices

  • The workflow runs from pull_request_target and checks out only the trusted base branch. It reads pull request file metadata through the GitHub API and never executes code from the contributor branch.
  • Cross-plugin renames count additions for the destination plugin and deletions for the source plugin.
  • An existing milestone is preserved when it already belongs to the selected plugin, allowing maintainers to choose a specific release manually.
  • The generic <plugin> n.e.x.t milestone is preferred. A versioned milestone is assigned only when it is the plugin's sole open candidate.
  • Ties and ambiguous milestone candidates leave the current milestone unchanged and emit an explanatory workflow message.
  • The optional changelog-label enhancement described as a bonus in the issue is intentionally left for a separate change.

Use of AI Tools

I used OpenAI Codex to assist with repository research, implementation, and test drafting. I reviewed the resulting changes and validation output and take responsibility for the contribution.

Testing

  • npm run test-unit-js
  • npm run lint-js
  • npm run tsc
  • npm run lint-json

@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @zerlinpi.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: zerlinpi.

Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.35%. Comparing base (01a50eb) to head (4f11ba0).

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #2586   +/-   ##
=======================================
  Coverage   70.35%   70.35%           
=======================================
  Files          91       91           
  Lines        7867     7867           
=======================================
  Hits         5535     5535           
  Misses       2332     2332           
Flag Coverage Δ
multisite 70.35% <ø> (ø)
single 35.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add workflow to automatically assign milestone

1 participant