-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[ci] Workflow input to release a specific version #3114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,10 @@ inputs: | |
| required: false | ||
| type: boolean | ||
| default: false | ||
| version: | ||
| description: 'Specific Selenium version or release tag to use, e.g 4.42.1' | ||
| required: false | ||
| default: '' | ||
| gh_cli_token: | ||
| description: 'GitHub CLI authentication token' | ||
| required: true | ||
|
|
@@ -22,19 +26,28 @@ runs: | |
| shell: bash | ||
| env: | ||
| AUTHORS: ${{ inputs.authors }} | ||
| REQUESTED_VERSION: ${{ inputs.version }} | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install jq | ||
| AUTH_HEADER="Authorization: token ${{ inputs.gh_cli_token }}" | ||
| if [ "${{ inputs.release }}" = "true" ]; then | ||
| 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 | ||
| 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') | ||
|
Comment on lines
+42
to
+50
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Floating release selection via api 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
|
||
| fi | ||
| fi | ||
| jar_file=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/${AUTHORS}/selenium/releases/tags/${RELEASE} | jq -r '.assets[] | select(.name | endswith(".jar")) | .name' | tail -n 1) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,10 @@ on: | |
| required: true | ||
| type: string | ||
| default: 'true' | ||
| version: | ||
| description: 'Specific Selenium version or release tag to use, e.g 4.42.1' | ||
| required: false | ||
| default: '' | ||
| release: | ||
| description: 'Deploy a new release' | ||
| required: false | ||
|
|
@@ -82,6 +86,7 @@ jobs: | |
| uses: ./.github/actions/get-latest-upstream | ||
| with: | ||
| release: ${{ github.event.inputs.stable || true }} | ||
| version: ${{ github.event.inputs.version || '' }} | ||
| gh_cli_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
Comment on lines
86
to
90
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Build-test ignores requested version 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
|
||
| authors: ${{ vars.AUTHORS || github.repository_owner }} | ||
| - name: Sets build date | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Requested version lookup incomplete
🐞 Bug☼ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools