microsoft / beachball

The Sunniest Semantic Version Bumper

Home Page:https://microsoft.github.io/beachball

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publishing should exit early if only invalid change files are present

ecraig12345 opened this issue · comments

In Fluent UI we've had a few instances when our release build failed because change files existed but were all invalid, which results in no actual changes to publish. The logs for this case are extremely uninformative.

Fix is to update whichever part of the code checks whether to enter the publish step to also verify that at least one valid change file exists.

Additionally/alternatively, it might be good to add an option like failOnInvalidChangeFiles to (mostly) prevent such files from being checked in--right now it's just treated as a warning by beachball check.

expand for full log ``` > fluent-ui-react-repo@1.0.0 publish:beachball /mnt/work/5/s > beachball publish --scope "!packages/fluentui/*" "-b" "origin/master" "-n" "***" "--access" "public" "-y"

Invalid change file detected (non-existent package or private package); delete this file "/mnt/work/5/s/change/@fluentui-react-examples-292153ef-66f4-43d3-b6e7-8817fdcf814c.json"
Invalid change file detected (non-existent package or private package); delete this file "/mnt/work/5/s/change/@fluentui-react-examples-407aa3fb-fb16-444c-b15f-3e491cd2d8ba.json"
Invalid change file detected (non-existent package or private package); delete this file "/mnt/work/5/s/change/@fluentui-react-examples-5f8fef9b-5486-4d10-8ed5-527cbd34ff54.json"
Validating no private package among package dependencies OK!
Publishing with the following configuration:

registry: https://registry.npmjs.org/

current branch: HEAD
current hash: 1e5b888607626cae4ff69b5b9055bf8b9537c45b
target branch: origin/master
tag: latest

bumps versions: yes
publishes to npm registry: yes
pushes to remote git repo: yes

creating temporary publish branch publish_1631720628491
Bumping version for npm publish
Invalid change file detected (non-existent package or private package); delete this file "/mnt/work/5/s/change/@fluentui-react-examples-292153ef-66f4-43d3-b6e7-8817fdcf814c.json"
Invalid change file detected (non-existent package or private package); delete this file "/mnt/work/5/s/change/@fluentui-react-examples-407aa3fb-fb16-444c-b15f-3e491cd2d8ba.json"
Invalid change file detected (non-existent package or private package); delete this file "/mnt/work/5/s/change/@fluentui-react-examples-5f8fef9b-5486-4d10-8ed5-527cbd34ff54.json"
Validating no private package among package dependencies OK!
Trying to push to git. Attempt 1/5
Reverting
Fetching from remote
Bumping the versions for git push
mergePublishBranch (2 / 4) - trying to run "git commit -m applying package updates"
On branch publish_1631720628491
nothing to commit, working tree clean
ℹ No staged files found.
[WARN 1/5]: merging to target has failed!
Trying to push to git. Attempt 2/5
Reverting
Fetching from remote
Bumping the versions for git push
mergePublishBranch (2 / 4) - trying to run "git commit -m applying package updates"
On branch publish_1631720628491
nothing to commit, working tree clean
ℹ No staged files found.
[WARN 2/5]: merging to target has failed!
Trying to push to git. Attempt 3/5
Reverting
Fetching from remote
Bumping the versions for git push
mergePublishBranch (2 / 4) - trying to run "git commit -m applying package updates"
On branch publish_1631720628491
nothing to commit, working tree clean
ℹ No staged files found.
[WARN 3/5]: merging to target has failed!
Trying to push to git. Attempt 4/5
Reverting
Fetching from remote
Bumping the versions for git push
mergePublishBranch (2 / 4) - trying to run "git commit -m applying package updates"
On branch publish_1631720628491
nothing to commit, working tree clean
ℹ No staged files found.
[WARN 4/5]: merging to target has failed!
Trying to push to git. Attempt 5/5
Reverting
Fetching from remote
Bumping the versions for git push
mergePublishBranch (2 / 4) - trying to run "git commit -m applying package updates"
On branch publish_1631720628491
nothing to commit, working tree clean
ℹ No staged files found.
[WARN 5/5]: merging to target has failed!
Something went wrong with the publish! Manually update these package and versions:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fluent-ui-react-repo@1.0.0 publish:beachball: beachball publish --scope "!packages/fluentui/*" "-b" "origin/master" "-n" "***" "--access" "public" "-y"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fluent-ui-react-repo@1.0.0 publish:beachball script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/devops/.npm/_logs/##[error]Bash exited with code '1'.
##[section]Finishing: Publish changes and bump versions

</details>

In MADS we also had a failure due to change files being left over for a package that was recently marked private. The error didn't help us debug but having more information would have really helped as all that needed to be done was removing the change file for that private package.