Skip to content

[ci] Workflow input to release a specific version#3114

Merged
VietND96 merged 1 commit intotrunkfrom
release-specific-version
Apr 12, 2026
Merged

[ci] Workflow input to release a specific version#3114
VietND96 merged 1 commit intotrunkfrom
release-specific-version

Conversation

@VietND96
Copy link
Copy Markdown
Member

Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Add workflow input for specific Selenium version deployment

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add workflow input to deploy specific Selenium version
• Refactor release fetching logic to support version selection
• Update default grid version from 4.37.0 to 4.41.0
• Add Chrome, Firefox, and Edge browser nodes versions 145-146
Diagram
flowchart LR
  WF["Workflow Dispatch"] -->|version input| ACTION["get-latest-upstream action"]
  ACTION -->|check REQUESTED_VERSION| LOGIC["Version Selection Logic"]
  LOGIC -->|specific version| FETCH1["Fetch Requested Release"]
  LOGIC -->|stable flag| FETCH2["Fetch Latest Stable"]
  LOGIC -->|nightly flag| FETCH3["Fetch Latest Nightly"]
  FETCH1 --> RELEASE["Release Tag"]
  FETCH2 --> RELEASE
  FETCH3 --> RELEASE
  RELEASE --> DEPLOY["Deploy with Selected Version"]
Loading

Grey Divider

File Changes

1. .github/actions/get-latest-upstream/action.yml ✨ Enhancement +17/-4

Add version input parameter to action

• Add new version input parameter for specifying Selenium version or release tag
• Pass version input to the action script via REQUESTED_VERSION environment variable
• Enable users to override automatic version detection with explicit version selection

.github/actions/get-latest-upstream/action.yml


2. .github/workflows/deploy.yml ✨ Enhancement +5/-0

Add version input to deploy workflow

• Add version workflow input for manual version specification
• Pass version input to get-latest-upstream action
• Allow deployment of specific Selenium versions via workflow dispatch

.github/workflows/deploy.yml


3. .github/workflows/release-preparation.yml ⚙️ Configuration changes +2/-2

Update default grid version to 4.41.0

• Update default grid version from 4.37.0 to 4.41.0 in workflow_call inputs
• Update default grid version from 4.37.0 to 4.41.0 in workflow_dispatch inputs

.github/workflows/release-preparation.yml


View more (1)
4. charts/selenium-grid/multiple-nodes-platform-version.yaml ⚙️ Configuration changes +30/-0

Add latest browser node versions to chart

• Add Chrome node versions 145.0 and 146.0 with image tag 20260222
• Add Firefox node versions 148.0 and 149.0 with image tag 20260222
• Add Edge node versions 145.0 and 146.0 with image tag 20260222
• Maintain platform name and browser version configuration for new nodes

charts/selenium-grid/multiple-nodes-platform-version.yaml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Apr 12, 2026

Code Review by Qodo

🐞 Bugs (2)   📘 Rule violations (2)   📎 Requirement gaps (0)   🎨 UX Issues (0)
🐞\ ≡ Correctness (1) ☼ Reliability (1)
📘\ ☼ Reliability (1) ⛨ Security (1)

Grey Divider


Action required

1. Floating RELEASE selection via API 📘
Description
The CI action selects RELEASE by querying GitHub releases and taking the first stable/nightly
entry, which is a floating (non-pinned) upstream version and makes builds non-reproducible. This
violates the requirement to pin external dependency versions in CI scripts.
Code

.github/actions/get-latest-upstream/action.yml[R42-50]

+        elif [ "${{ inputs.release }}" = "true" ]; then
          echo "Getting the latest stable release."
-          RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
+          RELEASE=$(echo "${RELEASES}" | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
        else
          echo "Getting the latest Nightly release."
-          RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases | jq -r '[.[]? | select(.prerelease == true)] | .[0].tag_name' || echo "")
+          RELEASE=$(echo "${RELEASES}" | jq -r '[.[]? | select(.prerelease == true)] | .[0].tag_name' || echo "")
          if [ -z "${RELEASE}" ] || [ "${RELEASE}" = "null" ]; then
            echo "Nightly release not found, getting the latest stable release."
-            RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
+            RELEASE=$(echo "${RELEASES}" | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
Evidence
Compliance requires explicit, pinned dependency versions in CI scripts. The updated action
dynamically picks the "latest" stable/nightly release tag from the GitHub API (.[0].tag_name),
which is a floating reference rather than a pinned version.

.github/actions/get-latest-upstream/action.yml[42-50]
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 action derives `RELEASE` from the upstream GitHub API and selects the latest stable/nightly tag, which is a floating version and makes CI runs non-reproducible.

## Issue Context
Compliance requires CI dependency versions to be explicitly pinned rather than implicitly selecting "latest".

## Fix Focus Areas
- .github/actions/get-latest-upstream/action.yml[42-50]

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


2. Requested version lookup incomplete 🐞
Description
get-latest-upstream derives the requested release only from the single JSON payload stored in
RELEASES, so any requested version/tag not present in that payload will hard-fail even if it
exists upstream. This breaks the new “release a specific version” workflow path by making version
selection dependent on what the first fetch happened to include.
Code

.github/actions/get-latest-upstream/action.yml[R34-41]

+        RELEASES=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases)
+        if [ -n "${REQUESTED_VERSION}" ]; then
+          echo "Getting the requested Selenium release: ${REQUESTED_VERSION}"
+          RELEASE=$(echo "${RELEASES}" | jq -r --arg requested "${REQUESTED_VERSION}" '[.[]? | select(.tag_name == $requested or .tag_name == ("selenium-" + $requested) or ([.assets[]?.name] | index("selenium-server-" + $requested + ".jar")))] | .[0].tag_name')
+          if [ -z "${RELEASE}" ] || [ "${RELEASE}" = "null" ]; then
+            echo "Requested Selenium release not found: ${REQUESTED_VERSION}"
+            exit 1
+          fi
Evidence
The action fetches releases once into RELEASES and then searches only within that variable when
REQUESTED_VERSION is set; if not found, it exits 1 with no fallback query by tag or additional
fetches.

.github/actions/get-latest-upstream/action.yml[34-41]

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

### Issue description
When `inputs.version` is provided, the composite action only searches within a single `RELEASES=$(curl ... /releases)` response. If the requested release isn’t present in that response, the workflow exits even though the release may exist upstream.

### Issue Context
The action already uses `/releases/tags/${RELEASE}` later to fetch assets, but it doesn’t leverage that endpoint to resolve the requested release tag/version.

### Fix Focus Areas
- .github/actions/get-latest-upstream/action.yml[30-53]

### Implementation notes
- Prefer a direct lookup when a specific version is requested:
 - Try `/releases/tags/$REQUESTED_VERSION` first.
 - If that fails and the input looks like a plain version (e.g. `4.42.1`), try `/releases/tags/selenium-$REQUESTED_VERSION`.
- Only fall back to listing releases (and if you do, loop through pages / handle multiple fetches) if direct tag lookup fails.
- Ensure failures distinguish “not found” vs “API error/rate limit” (e.g., check curl exit code / HTTP status).

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


3. Build-test ignores requested version 🐞
Description
deploy.yml introduces a version input and uses it only in the deploy job, but the gating
build-test reusable workflow is still invoked without version, so its Docker/Helm tests build
against the latest stable/nightly base instead of the requested one. Since the Makefile uses
BASE_VERSION/BASE_RELEASE to build images, this can validate one upstream Selenium base and then
publish images for a different base.
Code

.github/workflows/deploy.yml[R86-90]

        uses: ./.github/actions/get-latest-upstream
        with:
          release: ${{ github.event.inputs.stable || true }}
+          version: ${{ github.event.inputs.version || '' }}
          gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
Evidence
deploy.yml passes version only to get-latest-upstream in the deploy job, while build-test is
called with only release. build-test.yml forwards only release into docker-test.yml and
helm-chart-test.yml, and those workflows call get-latest-upstream without a version input. The
build system then uses BASE_VERSION/BASE_RELEASE (set by that action) as build args for the base
image, so the tested base can differ from the released base when version is set for deploy.

.github/workflows/deploy.yml[44-52]
.github/workflows/deploy.yml[85-92]
.github/workflows/build-test.yml[10-15]
.github/workflows/build-test.yml[72-88]
.github/workflows/docker-test.yml[220-226]
.github/workflows/helm-chart-test.yml[179-185]
Makefile[4-9]
Makefile[158-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
The deploy workflow supports `github.event.inputs.version`, but the gating `build-test` job (and its downstream docker/helm test workflows) doesn’t receive this value. As a result, tests can run against a different Selenium base version than the one being released.

### Issue Context
- `deploy.yml` passes `version` only in the `deploy` job.
- `build-test.yml` only accepts/forwards `release`.
- `docker-test.yml` and `helm-chart-test.yml` call `get-latest-upstream` without `version`.
- The Makefile uses `BASE_VERSION`/`BASE_RELEASE` for base image build args, so this mismatch is meaningful.

### Fix Focus Areas
- .github/workflows/deploy.yml[44-52]
- .github/workflows/build-test.yml[10-20]
- .github/workflows/build-test.yml[72-88]
- .github/workflows/docker-test.yml[220-226]
- .github/workflows/helm-chart-test.yml[179-185]

### Implementation notes
- Add a `version` input to `.github/workflows/build-test.yml` (`workflow_call.inputs`).
- Pass `version: ${{ github.event.inputs.version || '' }}` from `deploy.yml` into the `build-test` job’s `with:`.
- Add a `version` input to the reusable workflows `.github/workflows/docker-test.yml` and `.github/workflows/helm-chart-test.yml` (their `workflow_call.inputs`).
- Forward that `version` into the `get-latest-upstream` step in those workflows (`with: version: ${{ inputs.version || '' }}`).
- Keep the default empty so existing callers remain unaffected.

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



Remediation recommended

4. curl response not validated 📘
Description
The script captures API output with curl -s but does not fail or validate the HTTP response before
later parsing, which can lead to incorrect behavior (e.g., rate limits/404s returning non-release
JSON). This violates robust shell scripting practices for defensive correctness.
Code

.github/actions/get-latest-upstream/action.yml[34]

+        RELEASES=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases)
Evidence
The compliance checklist requires defensive shell practices and strict command behavior. The added
curl -s call does not use failure flags (e.g., --fail) or validate the response before
subsequent parsing logic depends on it.

.github/actions/get-latest-upstream/action.yml[34-34]
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
`curl -s` is used without failing on HTTP errors or validating the API response, which can cause downstream parsing to behave incorrectly.

## Issue Context
This composite action depends on GitHub API responses for release selection; failures should stop the step early and clearly.

## Fix Focus Areas
- .github/actions/get-latest-upstream/action.yml[34-34]

ⓘ 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

Comment on lines +42 to +50
elif [ "${{ inputs.release }}" = "true" ]; then
echo "Getting the latest stable release."
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
RELEASE=$(echo "${RELEASES}" | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
else
echo "Getting the latest Nightly release."
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases | jq -r '[.[]? | select(.prerelease == true)] | .[0].tag_name' || echo "")
RELEASE=$(echo "${RELEASES}" | jq -r '[.[]? | select(.prerelease == true)] | .[0].tag_name' || echo "")
if [ -z "${RELEASE}" ] || [ "${RELEASE}" = "null" ]; then
echo "Nightly release not found, getting the latest stable release."
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
RELEASE=$(echo "${RELEASES}" | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
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.

Action required

1. Floating release selection via api 📘 Rule violation ⛨ Security

The CI action selects RELEASE by querying GitHub releases and taking the first stable/nightly
entry, which is a floating (non-pinned) upstream version and makes builds non-reproducible. This
violates the requirement to pin external dependency versions in CI scripts.
Agent Prompt
## Issue description
The action derives `RELEASE` from the upstream GitHub API and selects the latest stable/nightly tag, which is a floating version and makes CI runs non-reproducible.

## Issue Context
Compliance requires CI dependency versions to be explicitly pinned rather than implicitly selecting "latest".

## Fix Focus Areas
- .github/actions/get-latest-upstream/action.yml[42-50]

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

Comment on lines +34 to +41
RELEASES=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases)
if [ -n "${REQUESTED_VERSION}" ]; then
echo "Getting the requested Selenium release: ${REQUESTED_VERSION}"
RELEASE=$(echo "${RELEASES}" | jq -r --arg requested "${REQUESTED_VERSION}" '[.[]? | select(.tag_name == $requested or .tag_name == ("selenium-" + $requested) or ([.assets[]?.name] | index("selenium-server-" + $requested + ".jar")))] | .[0].tag_name')
if [ -z "${RELEASE}" ] || [ "${RELEASE}" = "null" ]; then
echo "Requested Selenium release not found: ${REQUESTED_VERSION}"
exit 1
fi
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.

Action required

2. Requested version lookup incomplete 🐞 Bug ☼ Reliability

get-latest-upstream derives the requested release only from the single JSON payload stored in
RELEASES, so any requested version/tag not present in that payload will hard-fail even if it
exists upstream. This breaks the new “release a specific version” workflow path by making version
selection dependent on what the first fetch happened to include.
Agent Prompt
### Issue description
When `inputs.version` is provided, the composite action only searches within a single `RELEASES=$(curl ... /releases)` response. If the requested release isn’t present in that response, the workflow exits even though the release may exist upstream.

### Issue Context
The action already uses `/releases/tags/${RELEASE}` later to fetch assets, but it doesn’t leverage that endpoint to resolve the requested release tag/version.

### Fix Focus Areas
- .github/actions/get-latest-upstream/action.yml[30-53]

### Implementation notes
- Prefer a direct lookup when a specific version is requested:
  - Try `/releases/tags/$REQUESTED_VERSION` first.
  - If that fails and the input looks like a plain version (e.g. `4.42.1`), try `/releases/tags/selenium-$REQUESTED_VERSION`.
- Only fall back to listing releases (and if you do, loop through pages / handle multiple fetches) if direct tag lookup fails.
- Ensure failures distinguish “not found” vs “API error/rate limit” (e.g., check curl exit code / HTTP status).

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

Comment on lines 86 to 90
uses: ./.github/actions/get-latest-upstream
with:
release: ${{ github.event.inputs.stable || true }}
version: ${{ github.event.inputs.version || '' }}
gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
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.

Action required

3. Build-test ignores requested version 🐞 Bug ≡ Correctness

deploy.yml introduces a version input and uses it only in the deploy job, but the gating
build-test reusable workflow is still invoked without version, so its Docker/Helm tests build
against the latest stable/nightly base instead of the requested one. Since the Makefile uses
BASE_VERSION/BASE_RELEASE to build images, this can validate one upstream Selenium base and then
publish images for a different base.
Agent Prompt
### Issue description
The deploy workflow supports `github.event.inputs.version`, but the gating `build-test` job (and its downstream docker/helm test workflows) doesn’t receive this value. As a result, tests can run against a different Selenium base version than the one being released.

### Issue Context
- `deploy.yml` passes `version` only in the `deploy` job.
- `build-test.yml` only accepts/forwards `release`.
- `docker-test.yml` and `helm-chart-test.yml` call `get-latest-upstream` without `version`.
- The Makefile uses `BASE_VERSION`/`BASE_RELEASE` for base image build args, so this mismatch is meaningful.

### Fix Focus Areas
- .github/workflows/deploy.yml[44-52]
- .github/workflows/build-test.yml[10-20]
- .github/workflows/build-test.yml[72-88]
- .github/workflows/docker-test.yml[220-226]
- .github/workflows/helm-chart-test.yml[179-185]

### Implementation notes
- Add a `version` input to `.github/workflows/build-test.yml` (`workflow_call.inputs`).
- Pass `version: ${{ github.event.inputs.version || '' }}` from `deploy.yml` into the `build-test` job’s `with:`.
- Add a `version` input to the reusable workflows `.github/workflows/docker-test.yml` and `.github/workflows/helm-chart-test.yml` (their `workflow_call.inputs`).
- Forward that `version` into the `get-latest-upstream` step in those workflows (`with: version: ${{ inputs.version || '' }}`).
- Keep the default empty so existing callers remain unaffected.

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

@VietND96 VietND96 merged commit 3bccc5b into trunk Apr 12, 2026
55 of 57 checks passed
@VietND96 VietND96 deleted the release-specific-version branch April 12, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant