Open CarltonHowell opened 1 year ago
Since the version bump part of publishing commits back to main
, it really shouldn't be run in parallel with itself. So for starters I'd recommend configuring your publish pipeline to run in batched CI mode.
The way my team addresses the scaling issue in house is that we do the version bump, the build, and the actual publishing to the npm feed as three separate jobs; only the first one commits back to main and if there is a conflict it aborts the entire pipeline.
rush install
, just installing Rush itself to be able to run step 4rush version --bump
rush install
rush build
pnpm pack
npm publish
for each tarballMaking changes to Rush to better support this workflow is one of the goals for Rush 6 with respect to reworking publishing.
Summary
We are running into an issue where a merge conflict arises for "CHANGELOGS.{json,md}" when multiple CI pipelines running "rush publish" kick off at one time. Wondering if there is a recommended approach for dealing with parallel or concurrent "rush publish" CI pipelines?
Details
main
branch triggers a CI runRepro steps
Person A
makesCommit A
which changes one application and produces a changelog:Commit A
is merged into themain
branchPIPELINE A
) is kicked off which runsrush build
, tests and finallyrush publish
on "application-A"COMMIT C
) is made byrush publish
into themain
branchbut before the
PIPELINE A
gets to the autocommit stage the following happens:Person B
makesCommit B
which changes one application and produces a changelog:Commit B
is merged into themain
branchPIPELINE B
) is kicked off which runsrush build
, tests and finallyrush publish
on both "application-A" and "application-B"PIPELINE B
is runningPIPELINE A
completes andCOMMIT C
is added to themain
branchPIPELINE B
attempts to runrush publish
but creates a merge conflict due to theCHANGELOG.{json,md}
files having already been changed and committed byCOMMIT C
Screenshot
^^ note in this scenario the conflict is just the date. However if
COMMIT A
andCOMMIT B
both change the same application then this conflict will also include changelog comments, author, etcDetails
The problem is removed if we disable parallel CI runs and force "synchronous" CI runs. However as monorepo activity increases this causes longer and longer build/deploy timelines.
Standard questions
@microsoft/rush
globally installed version?5.55.1
rushVersion
from rush.json?5.55.1
useWorkspaces
from rush.json?true
node -v
)?16.13.12