ci: stop the docs sync from cancelling the observer firmware build
build-observer-firmwares.yml and sync-flasher-content.yml shared the
`flasher-publish` concurrency group. A mixed code+docs commit queues both, and
GitHub cancels any run left *pending* in an occupied group — cancel-in-progress:
false only shields runs already in progress. On 8fc96f68 the build lost that
race and was cancelled in 1s with zero jobs, so nothing was published.
Give each workflow its own group, and make the flasher push tolerate the
concurrent writes the shared group was guarding against: rebase onto the
sibling's commit and retry, up to 3 attempts. Both workflows generate
byte-identical docs and changelog content, so the loser's commit normally
rebases away to nothing and the push reports up-to-date.
This commit is contained in:
1 parent
8fc96f68f2
commit
5313aa01b1
2 files changed
+49
-8
No files matched your search
@@ -26,10 +26,13 @@ on:
|
||||
- '.vscode/**'
|
||||
- '.claude/**'
|
||||
|
||||
# Serialize with sync-flasher-content.yml so the two workflows never push to the
|
||||
# flasher repo at the same time (shared group name across both workflows).
|
||||
# Own group: serialize builds against each other only. Do NOT share this group
|
||||
# with sync-flasher-content.yml — a mixed code+docs commit triggers both, and a
|
||||
# run that is still pending when its sibling is queued gets cancelled, which
|
||||
# silently skipped the firmware build. Concurrent flasher pushes are instead made
|
||||
# safe by the rebase-retry in "Commit & Push Flasher Config".
|
||||
concurrency:
|
||||
group: flasher-publish
|
||||
group: observer-firmware-build
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
@@ -306,4 +309,22 @@ jobs:
|
||||
git config user.name "meshcore-bot"
|
||||
git config user.email "noreply@gessaman.com"
|
||||
git commit -m "Update observer firmware to ${{ steps.sha.outputs.short }} (build ${FIRMWARE_VERSION}.${{ needs.enumerate.outputs.build_number }})"
|
||||
git push
|
||||
# sync-flasher-content.yml can be pushing the same docs/changelog right
|
||||
# now (a mixed code+docs commit triggers both), so a non-fast-forward is
|
||||
# expected rather than fatal: rebase onto the sibling's commit and retry.
|
||||
# If the rebase leaves nothing, git reports up-to-date and we exit clean.
|
||||
br=$(git rev-parse --abbrev-ref HEAD)
|
||||
for attempt in 1 2 3; do
|
||||
if git push origin "HEAD:$br"; then
|
||||
exit 0
|
||||
fi
|
||||
echo "push rejected (attempt $attempt); rebasing onto origin/$br"
|
||||
git fetch origin "$br"
|
||||
git rebase "origin/$br" || {
|
||||
git rebase --abort || true
|
||||
echo "::error::flasher rebase conflicted; re-run this workflow to republish"
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
echo "::error::could not push flasher changes after 3 attempts"
|
||||
exit 1
|
||||
@@ -20,10 +20,12 @@ on:
|
||||
- 'docs/**'
|
||||
- 'scripts/gen_changelog.py'
|
||||
|
||||
# Shared with build-observer-firmwares.yml so the two never push to the flasher
|
||||
# repo concurrently (a mixed code+docs commit can trigger both).
|
||||
# Own group: serialize doc syncs against each other only. Deliberately NOT shared
|
||||
# with build-observer-firmwares.yml — a shared group let one workflow cancel the
|
||||
# other's pending run (a mixed code+docs commit triggers both). Concurrent flasher
|
||||
# pushes are handled by the rebase-retry in "Commit & Push Flasher Content".
|
||||
concurrency:
|
||||
group: flasher-publish
|
||||
group: flasher-docs-sync
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
@@ -73,4 +75,22 @@ jobs:
|
||||
git config user.name "meshcore-bot"
|
||||
git config user.email "noreply@gessaman.com"
|
||||
git commit -am "Sync docs & changelog from MeshCore ${GITHUB_SHA::7}"
|
||||
git push
|
||||
# build-observer-firmwares.yml can be pushing the same docs/changelog
|
||||
# right now (a mixed code+docs commit triggers both), so a non-fast-forward
|
||||
# is expected rather than fatal: rebase onto its commit and retry. If the
|
||||
# rebase leaves nothing, git reports up-to-date and we exit clean.
|
||||
br=$(git rev-parse --abbrev-ref HEAD)
|
||||
for attempt in 1 2 3; do
|
||||
if git push origin "HEAD:$br"; then
|
||||
exit 0
|
||||
fi
|
||||
echo "push rejected (attempt $attempt); rebasing onto origin/$br"
|
||||
git fetch origin "$br"
|
||||
git rebase "origin/$br" || {
|
||||
git rebase --abort || true
|
||||
echo "::error::flasher rebase conflicted; re-run this workflow to resync"
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
echo "::error::could not push flasher changes after 3 attempts"
|
||||
exit 1
|
||||
Reference in new issue
Block a user