Skip to content

Commit 0708555

Browse files
authored
Beachball Check should actually stop publish (#12523)
## Description This PR fixes the beachball check added in #12293 to actually stop the publish pipeline when errors are detected. Furthermore it adds a parameter to enable this check, default on, but which can be manually disabled when we're trying to promote a release branch (either from latest to legacy, preview to latest, etc). This PR also adds a version of the check to the standard setup task that instead reports warnings when invalid change files are detected - hopefully this will improve our chances of catching these errors before getting to publish, without having to unduly block CI/PRs. ### Type of Change - Bug fix (non-breaking change which fixes an issue) ### Why In publishing 0.73 an (expected) error was detected as the `@office-iss\react-native-win32` package was being promoted. Any error should have caused the publish to bail early - but also highlighted that when we **want** to promote, we'll need a way to turn the check off. ### What See above. ## Screenshots N/A ## Testing Verified by adding bad change files to this PR (now removed) to see that the check happens. ## Changelog Should this change be included in the release notes: no
1 parent 34ae417 commit 0708555

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.ado/jobs/setup.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828

2929
- script: npx lage build --scope @rnw-scripts/beachball-config --no-deps
3030
displayName: Build @rnw-scripts/beachball-config
31+
32+
- pwsh: |
33+
npx beachball check --verbose 2>&1 | Tee-Object -Variable beachballOutput
34+
$beachballErrors = $beachballOutput | Where-Object { $_ -match "ERROR: *"}
35+
$beachballErrors | ForEach { Write-Host "##vso[task.logissue type=warning]POSSIBLE $_" }
36+
displayName: Warn for possible invalid change files
3137
3238
- ${{ if eq(parameters.buildEnvironment, 'PullRequest') }}:
3339
- script: npx beachball check --branch origin/$(BeachBallBranchName) --verbose --changehint "##vso[task.logissue type=error]Run \"yarn change\" from root of repo to generate a change file."

.ado/publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ parameters:
1313
displayName: Stop if latest commit is ***NO_CI***
1414
type: boolean
1515
default: true
16+
- name: performBeachballCheck
17+
displayName: Perform Beachball Check (Disable when promoting)
18+
type: boolean
19+
default: true
1620
- name: AgentPool
1721
type: object
1822
default:
@@ -152,8 +156,11 @@ extends:
152156

153157
- pwsh: |
154158
npx beachball check --verbose 2>&1 | Tee-Object -Variable beachballOutput
155-
$beachballOutput | Where-Object { $_ -match "ERROR: *"} | ForEach { Write-Host "##vso[task.logissue type=error]$_" }
159+
$beachballErrors = $beachballOutput | Where-Object { $_ -match "ERROR: *"}
160+
$beachballErrors | ForEach { Write-Host "##vso[task.logissue type=error]$_" }
161+
if ( $beachballErrors.Count -gt 0) { throw "Beachball check found $($beachballErrors.Count) errors." }
156162
displayName: Beachball Check
163+
condition: ${{ parameters.performBeachballCheck }}
157164
158165
- script: npx beachball publish $(SkipNpmPublishArgs) $(SkipGitPushPublishArgs) --branch origin/$(Build.SourceBranchName) -n $(npmAuthToken) -yes --bump-deps --verbose --access public --message "applying package updates ***NO_CI***"
159166
displayName: Beachball Publish

0 commit comments

Comments
 (0)