Skip to content

fix(documentation): update artifact naming for generated docs#17332

Merged
diemol merged 3 commits intotrunkfrom
improve-documentation-workflow
Apr 10, 2026
Merged

fix(documentation): update artifact naming for generated docs#17332
diemol merged 3 commits intotrunkfrom
improve-documentation-workflow

Conversation

@diemol
Copy link
Copy Markdown
Member

@diemol diemol commented Apr 10, 2026

🔗 Related Issues

When the release workflow runs, the artifact name is duplicated, and the whole thing fails.

Copilot AI review requested due to automatic review settings April 10, 2026 08:45
@selenium-ci selenium-ci added the B-build Includes scripting, bazel and CI integrations label Apr 10, 2026
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix documentation workflow artifact naming duplication

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fix artifact naming duplication in documentation workflow
• Include language identifier in artifact name to prevent conflicts
• Update download pattern to match new naming convention

Grey Divider

File Changes

1. .github/workflows/update-documentation.yml ⚙️ Configuration changes +2/-2

Update artifact naming to include language identifier

• Changed artifact name from static documentation to dynamic `documentation-${{
 needs.parse.outputs.language }}` to prevent naming conflicts
• Updated artifact download pattern from name: documentation to pattern: documentation-* to
 match the new naming scheme
• Ensures each language's documentation is stored with a unique artifact name

.github/workflows/update-documentation.yml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Apr 10, 2026

Code Review by Qodo

🐞 Bugs (0)   📘 Rule violations (1)   📎 Requirement gaps (0)   🎨 UX Issues (0)
📘\ ☼ Reliability (1)

Grey Divider


Action required

1. download-artifact missing merge-multiple📘
Description
The updated actions/download-artifact@v4 step uses pattern: documentation-* but does not set
merge-multiple: true or a deterministic extraction path, which can place files under an extra
per-artifact directory. This can prevent the later git add docs/api/ from staging the generated
docs, breaking the workflow.
Code

.github/workflows/update-documentation.yml[R95-101]

      - name: Download documentation
        uses: actions/download-artifact@v4
        with:
-          name: documentation
+          pattern: documentation-*
      - name: Setup git
        run: |
          git config --local user.email "selenium-ci@users.noreply.github.com"
Evidence
PR Compliance ID 16 requires hardening CI/workflow logic to be robust and avoid fragile assumptions.
The change switches from downloading a single named artifact to a pattern download (`pattern:
documentation-*`), but the workflow still assumes generated docs will be available directly under
docs/api/ when staging (git add docs/api/), which is commonly broken by pattern downloads that
extract into per-artifact subdirectories unless merge-multiple/path is set.

.github/workflows/update-documentation.yml[95-99]
.github/workflows/update-documentation.yml[103-105]
Best Practice: Learned patterns

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

## Issue description
The workflow now downloads artifacts via `pattern: documentation-*` without `merge-multiple`/`path`, which can extract files into an unexpected per-artifact directory and cause `git add docs/api/` to miss the generated documentation.

## Issue Context
Previously, the workflow downloaded a single artifact by name. After this PR, artifact names are language-scoped, but the download step should still ensure the extracted files end up where subsequent steps expect them.

## Fix Focus Areas
- .github/workflows/update-documentation.yml[95-105]

## Suggested change
Prefer downloading the single expected artifact explicitly (e.g., `name: documentation-${{ needs.parse.outputs.language }}`), or keep `pattern` but set `merge-multiple: true` and an explicit `path` that matches the later `git add docs/api/` staging expectations.

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



Remediation recommended

2. artifact-name uses unvalidated language 📘
Description
The artifact name is now constructed from needs.parse.outputs.language, but workflow_call allows
inputs.language as a free-form string and the parse step accepts it without validating it against
an allowed set. This can produce invalid/unexpected artifact names and make the workflow fail in
non-actionable ways.
Code

.github/workflows/update-documentation.yml[81]

+      artifact-name: documentation-${{ needs.parse.outputs.language }}
Evidence
PR Compliance ID 13 requires early validation of configuration/external inputs with clear actionable
errors. The PR introduces a new dependency on the language value for artifact naming
(documentation-${{ needs.parse.outputs.language }}), while workflow_call defines
inputs.language as an unconstrained string and the parse step uses it directly if provided,
without validating it against the supported languages.

.github/workflows/update-documentation.yml[23-35]
.github/workflows/update-documentation.yml[62-70]
.github/workflows/update-documentation.yml[81-82]
Best Practice: Learned patterns

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

## Issue description
`needs.parse.outputs.language` is now used to build the artifact name, but `inputs.language` (workflow_call) is a free-form string and is accepted without validation, which can yield invalid/unexpected artifact names.

## Issue Context
This workflow is invoked from other workflows (e.g., release automation) via `workflow_call`, where `inputs.language` is not constrained to the `workflow_dispatch` choice list.

## Fix Focus Areas
- .github/workflows/update-documentation.yml[23-35]
- .github/workflows/update-documentation.yml[62-70]
- .github/workflows/update-documentation.yml[81-82]

## Suggested change
Add an explicit allowlist check in the parse step (e.g., only `all|java|ruby|python|dotnet|javascript`), and `exit 1` with a clear error message when an invalid `inputs.language` is provided.

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


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates the documentation release workflow to avoid artifact name collisions during release runs (especially when documentation updates are executed per-language).

Changes:

  • Make the generated docs artifact name unique per language (documentation-<language>).
  • Switch the download step from a fixed artifact name to a name pattern.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 10, 2026 08:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

@diemol diemol merged commit d512ddc into trunk Apr 10, 2026
29 checks passed
@diemol diemol deleted the improve-documentation-workflow branch April 10, 2026 10:27
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