Automatically assign plugin-specific milestones on pull requests.#2593
Automatically assign plugin-specific milestones on pull requests.#2593dilipom13 wants to merge 2 commits into
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2593 +/- ##
=======================================
Coverage 70.35% 70.35%
=======================================
Files 91 91
Lines 7867 7867
=======================================
Hits 5535 5535
Misses 2332 2332
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| - name: JS Unit Tests | ||
| run: npm run test-unit-js |
There was a problem hiding this comment.
What is reasons behind this new script?
There was a problem hiding this comment.
What is reasons behind this new script?
Hello @mukeshpanchal27, good question thanks for asking.
This PR adds bin/plugin/lib/assign-plugin-milestone.js with unit tests in assign-plugin-milestone.test.js.
Those tests use Node’s built-in test runner (node:test), not PHPUnit or Playwright.
The new test-unit-js script in package.json is a small wrapper so contributors and CI can run them the same way:
npm run test-unit-js
Summary
Fixes #2541
Implements automatic assignment of a plugin-specific milestone when a pull request is opened or updated. The workflow counts changed lines under each
plugins/<slug>/path, picks the plugin with a unique highest total, and sets the milestone (preferring<slug> n.e.x.twhen it exists). Related to the existing plugin label automation in.github/workflows/add-pr-labels.yml.Note: PR #2586 addresses the same issue; this branch was prepared locally for testing and to offer help with review or follow-up fixes if maintainers prefer.
Relevant technical choices
pull_request_targetworkflow as plugin labels, usingactions/github-scriptand shared logic inbin/plugin/lib/assign-plugin-milestone.js.npm run test-unit-js(node --test) and runs it in the JS lint workflow.Use of AI Tools
No AI tools were used to author the code changes. AI was not used to write the implementation.