Skip to content

[build] fix parallelization for documentation release#17420

Merged
titusfortner merged 1 commit into
trunkfrom
docs_release
May 8, 2026
Merged

[build] fix parallelization for documentation release#17420
titusfortner merged 1 commit into
trunkfrom
docs_release

Conversation

@titusfortner

Copy link
Copy Markdown
Member

💥 What does this PR do?

Allows docs to run in parallel but makes the commits concurrent so we can remove race condition protection.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s): Claude
    • What was generated:
    • I reviewed all AI output and can explain the change

🔄 Types of changes

  • Bug fix (backwards compatible)

Copilot AI review requested due to automatic review settings May 7, 2026 13:50
@selenium-ci selenium-ci added the B-build Includes scripting, bazel and CI integrations label May 7, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix documentation release parallelization with concurrency control

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Remove max-parallel limit to allow docs jobs to run concurrently
• Add concurrency control to prevent race conditions during commits
• Simplify git push retry logic with shell conditional operator
• Consolidate git setup and commit steps into single operation

Grey Divider

File Changes

1. .github/workflows/release.yml ⚙️ Configuration changes +0/-1

Remove parallelization limit from docs job

• Removed max-parallel: 1 constraint from documentation job matrix
• Allows multiple language documentation builds to execute in parallel

.github/workflows/release.yml


2. .github/workflows/update-documentation.yml 🐞 Bug fix +7/-12

Add concurrency control and simplify commit logic

• Added concurrency group gh-pages-write with cancel-in-progress: false to prevent concurrent
 writes
• Consolidated git setup and commit steps into single step
• Simplified push retry logic by replacing loop with shell conditional operator
• Removed manual retry loop with sleep delays

.github/workflows/update-documentation.yml


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. No rebase before gh-pages push 🐞 Bug ☼ Reliability
Description
commit-docs now does a single git push origin gh-pages without git pull --rebase/retry, so if
gh-pages is updated out-of-band after checkout (e.g., a manual hotfix commit), the push will be
rejected as non-fast-forward and docs won’t publish.
Code

.github/workflows/update-documentation.yml[R102-110]

+      - name: Commit documentation
        run: |
          git config --local user.email "selenium-ci@users.noreply.github.com"
          git config --local user.name "Selenium CI Bot"
-      - name: Commit documentation
-        run: |
          git add docs/api/
-          if git diff --staged --quiet; then
-            echo "No documentation changes to commit"
-          else
+          git diff --staged --quiet || {
            git commit -m "Update ${{ needs.parse.outputs.language }} documentation for Selenium ${{ needs.parse.outputs.version }}"
-            for _ in 1 2; do
-              git pull --rebase origin gh-pages && git push origin gh-pages && exit 0
-              sleep 2
-            done
-            exit 1
-          fi
+            git push origin gh-pages
+          }
Evidence
The updated workflow checks out gh-pages and then pushes directly, but the previous logic that
rebased/pulled and retried pushes was removed. This reduces resilience to any external gh-pages
updates not coordinated by this workflow’s concurrency gate.

.github/workflows/update-documentation.yml[92-110]
.github/workflows/release.yml[141-160]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`commit-docs` pushes to `gh-pages` without rebasing/pulling or retrying. If `gh-pages` advances after the checkout step (e.g., manual commit/hotfix), `git push` can fail with a non-fast-forward error and the docs update will be lost.

### Issue Context
This PR intentionally parallelizes language doc generation and serializes writes via a concurrency group, which prevents *internal* simultaneous writers. However, removing the pull/rebase+retry logic makes the job fragile to any *out-of-band* `gh-pages` updates.

### Fix Focus Areas
- .github/workflows/update-documentation.yml[92-110]

### Suggested change
Reintroduce a pre-push sync step (and optionally a small retry), e.g.:
- `git pull --rebase origin gh-pages` immediately before `git push`
- optionally retry on push failure with a short backoff (similar to the removed loop).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the release documentation update workflow to allow per-language documentation generation to run in parallel while ensuring gh-pages writes are serialized to avoid push races.

Changes:

  • Remove max-parallel: 1 from the release workflow docs matrix so documentation updates can run in parallel.
  • Add a concurrency group to the reusable docs workflow’s commit job to serialize pushes to gh-pages.
  • Simplify the commit step by removing the pull/retry loop and pushing once under the concurrency guard.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/update-documentation.yml Serializes the gh-pages commit/push step via job-level concurrency and simplifies the commit logic.
.github/workflows/release.yml Enables parallel execution of the per-language documentation update matrix.

@titusfortner titusfortner merged commit da5729a into trunk May 8, 2026
31 checks passed
@titusfortner titusfortner deleted the docs_release branch May 8, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants