Skip to content
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

Project Management: Milestone It: Read version from master branch package.json #16511

Merged
merged 3 commits into from Jul 10, 2019

Conversation

@aduth
Copy link
Member

commented Jul 10, 2019

This pull request seeks to improve the Milestone It custom GitHub action to ensure that the version read from package.json is that of the master branch, not the "current" branch of the pull request being merged. Since the branch of a pull request which has been merged may be stale, the version may not reflect the next release. The version should always be derived based on the master branch at the time of the merge.

In the course of implementing this, a few other necessary changes were made:

  • Milestones should only be applied when a pull request is merged to the master branch. This restriction did not exist previously, so it was possible branches merged to other non-master branches would have a milestone applied.
  • Changed "Skip" exits to use a neutral status code (documentation)

@aduth aduth requested a review from youknowriad Jul 10, 2019

@aduth aduth requested review from karmatosed and mapk as code owners Jul 10, 2019

@youknowriad
Copy link
Contributor

left a comment

Looks good. Best way to try is to ship :)

@aduth

This comment has been minimized.

Copy link
Member Author

commented Jul 10, 2019

Oh, I also meant to link to a few resources which led me to this change:

An example pull request which assigned to the wrong milestone: #16242 (assigned 6.0, should have been 6.1)

In the source branch package.json, the 5.9.x version can be seen, hence why it's assumed 6.0 was selected: https://github.com/faazshift/gutenberg/blob/fix/shortcode-replace/package.json

The GitHub Actions "Accessing the runtime environment" documentation appears to confirm that the source will reflect the branch of the pull request being merged:

/github/workspace: The working directory of the Docker container. GitHub Actions execute in this directory. The path to this directory is set in the GITHUB_WORKSPACE environment variable. This directory contains a copy of the repository (with version GITHUB_SHA) that triggered the workflow. [...]

GITHUB_SHA: The commit SHA that triggered the workflow.

@aduth aduth merged commit 8995efd into master Jul 10, 2019

1 of 7 checks passed

Filter merged Filter merged
Details
Filter merged Filter merged
Details
Filter merged Filter merged
Details
Filter merged Filter merged
Details
Filter merged Filter merged
Details
Filter merged Filter merged
Details
Travis CI - Pull Request Build Passed
Details

@aduth aduth deleted the fix/milestone-it-version branch Jul 10, 2019

jg314 added a commit to jg314/gutenberg that referenced this pull request Jul 19, 2019

Project Management: Milestone It: Read version from master branch pac…
…kage.json (WordPress#16511)

* Project Management: Milestone It: Read version from master branch package.json

* Project Management: Milestone It: Exit neutral when skipping milestoned

* Project Management: Milestone It: Apply milestone only on master merges

@youknowriad youknowriad added this to the Gutenberg 6.2 milestone Jul 26, 2019

sbardian added a commit to sbardian/gutenberg that referenced this pull request Jul 29, 2019

Project Management: Milestone It: Read version from master branch pac…
…kage.json (WordPress#16511)

* Project Management: Milestone It: Read version from master branch package.json

* Project Management: Milestone It: Exit neutral when skipping milestoned

* Project Management: Milestone It: Apply milestone only on master merges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.