Skip to content

Commit eb91262

Browse files
committed
fix(release-script): stage the showcase assets the cut regenerates
git applies an :(exclude) pathspec to the whole `git add` invocation rather than to the pathspecs standing beside it. The generated-page globs carry :(exclude)web/showcase, so that a file planted under the showcase cannot be mistaken for a card page, and they were concatenated into the same add as the showcase assets themselves - which the exclusion then cancelled. Measured on this tree: the release commit's own pathspec list stages 0 paths under web/showcase, and the same list without the exclusion stages 133. So the v2.4.1 cut committed none of the 133 showcase files its own Step 4c had just rewritten, and left them as working-tree churn under a tag that was supposed to carry them - the site on main would have served the previous release's renders, including the barcodes this release redraws. The page globs now stage through an add of their own, where the exclusion reaches only the globs it belongs to. The CI step that owns these pathspecs lifts Get-GeneratedPagePathspecs by AST and runs it alone, where the exclusion behaves correctly, so it passed throughout: it tests the function, not the invocation the function's result ends up in.
1 parent 092a619 commit eb91262

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎scripts/cut-release.ps1‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,8 +1892,13 @@ try {
18921892
)
18931893
# The documentation page and the document pages name the release too — in their guide links
18941894
# and their coordinates — so they ride with the page and the data above, a page per card
1895-
# included, and any page the rebuild deleted.
1896-
$commitFiles += @(Get-GeneratedPagePathspecs)
1895+
# included, and any page the rebuild deleted. They stage through an `add` of their own,
1896+
# because their list carries :(exclude)web/showcase and git applies an exclude to the
1897+
# WHOLE invocation rather than to the pathspecs beside it. Listed in one `add` with the
1898+
# showcase assets below, the exclude cancelled them: the first v2.4.1 cut committed none
1899+
# of the 133 showcase files its own regeneration had just rewritten, and left them as
1900+
# working-tree churn under a tag that was supposed to carry them.
1901+
$pagePathspecs = @(Get-GeneratedPagePathspecs)
18971902
# qa + coverage exist only in the 2.0 aggregator layout; add them to the commit
18981903
# only when present so the script stays layout-agnostic (the 1.x single-artifact
18991904
# tree has neither) — mirroring Update-PomVersion's skip-if-absent guard. On a 2.0
@@ -1961,9 +1966,15 @@ try {
19611966
}
19621967
if ($DryRun) {
19631968
Write-Host " [DRY RUN] git add $($commitFiles -join ' ')" -ForegroundColor Yellow
1969+
if ($pagePathspecs.Count) {
1970+
Write-Host " [DRY RUN] git add $($pagePathspecs -join ' ')" -ForegroundColor Yellow
1971+
}
19641972
Write-Host " [DRY RUN] git commit -m `"$commitMsg`"" -ForegroundColor Yellow
19651973
} else {
19661974
Invoke-Git add @commitFiles
1975+
if ($pagePathspecs.Count) {
1976+
Invoke-Git add @pagePathspecs
1977+
}
19671978
Invoke-Git commit -m $commitMsg
19681979
Note "commit: $commitMsg"
19691980
}

0 commit comments

Comments
 (0)