Repository navigation
test(iso): add artifact-backed stable installer E2E #68
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9cf3fbe
chore: ignore local worktrees
castrojo 2f25066
fix(ci): pin titanoboa legacy input support
castrojo f05f799
docs(ci): record titanoboa compatibility workaround
castrojo 6866aad
test(iso): run stable installer e2e from build artifacts
castrojo 87d8faf
fix(iso): correct E2E artifact download environment
castrojo 57ad381
feat(ci): publish immutable ISO candidate manifests
castrojo 13a30bf
feat(ci): dispatch ISO candidates to lab
castrojo 71b9278
refactor(iso): integrate validation with testsuite
castrojo 9b2b6b0
fix(iso): allow local builder overrides
castrojo 4e46a18
fix(iso): patch Titanoboa for current just
castrojo 8e786a6
fix(ci): pin testsuite workflow to merged revision
castrojo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| name: ISO E2E Test | ||
|
|
||
| run-name: >- | ||
| ISO E2E validation for ${{ github.event.client_payload.release_tag || inputs.release_tag || 'manual' }} | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| iso_url: | ||
| description: 'HTTPS URL for the ISO to test' | ||
| required: false | ||
| type: string | ||
| source_run_id: | ||
| description: 'Workflow run ID containing an ISO artifact' | ||
| required: false | ||
| type: string | ||
| artifact_name: | ||
| description: 'Optional ISO artifact name from source_run_id' | ||
| required: false | ||
| type: string | ||
| iso_path: | ||
| description: 'Path to a checked-in ISO in this repository' | ||
| required: false | ||
| type: string | ||
| release_tag: | ||
| description: 'Release tag used for this E2E run' | ||
| required: false | ||
| type: string | ||
| variant: | ||
| description: 'Variant being validated' | ||
| required: false | ||
| type: string | ||
| workflow_call: | ||
| inputs: | ||
| iso_url: | ||
| description: 'HTTPS URL for the ISO to test' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| source_run_id: | ||
| description: 'Workflow run ID containing an ISO artifact' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| artifact_name: | ||
| description: 'Optional ISO artifact name from source_run_id' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| iso_path: | ||
| description: 'Path to an ISO available after checkout' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| release_tag: | ||
| description: 'Release tag used for this E2E run' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| variant: | ||
| description: 'Variant being validated' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: read | ||
|
|
||
| jobs: | ||
| e2e-test: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 90 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install QEMU and tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install --yes qemu-system-x86 qemu-utils xorriso ffmpeg | ||
|
|
||
| - name: Resolve ISO input | ||
| id: context | ||
| env: | ||
| INPUT_ISO_URL: ${{ inputs.iso_url }} | ||
| INPUT_SOURCE_RUN_ID: ${{ inputs.source_run_id }} | ||
| INPUT_ISO_PATH: ${{ inputs.iso_path }} | ||
| DISPATCH_ISO_URL: ${{ github.event.client_payload.iso_url }} | ||
| DISPATCH_SOURCE_RUN_ID: ${{ github.event.client_payload.source_run_id }} | ||
| DISPATCH_ISO_PATH: ${{ github.event.client_payload.iso_path }} | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| set -euo pipefail | ||
| iso_url="${DISPATCH_ISO_URL:-${INPUT_ISO_URL}}" | ||
| source_run_id="${DISPATCH_SOURCE_RUN_ID:-${INPUT_SOURCE_RUN_ID}}" | ||
| iso_path="${DISPATCH_ISO_PATH:-${INPUT_ISO_PATH}}" | ||
| if [[ -n "$iso_url" ]]; then | ||
| mkdir -p e2e-input | ||
| curl --fail --location --retry 3 --retry-all-errors --output e2e-input/source.iso "$iso_url" | ||
| iso_path="$PWD/e2e-input/source.iso" | ||
| elif [[ -n "$source_run_id" ]]; then | ||
| mkdir -p e2e-input | ||
| artifact_name="${{ github.event.client_payload.artifact_name || inputs.artifact_name || '' }}" | ||
| if [[ -n "$artifact_name" ]]; then | ||
| gh run download "$source_run_id" --name "$artifact_name" --dir e2e-input | ||
| else | ||
| gh run download "$source_run_id" --pattern "iso-${source_run_id}-*" --dir e2e-input | ||
| fi | ||
| shopt -s nullglob | ||
| matches=(e2e-input/**/*.iso e2e-input/*.iso) | ||
| if [[ ${#matches[@]} -eq 0 ]]; then | ||
| echo "No ISO artifact found in workflow run: $source_run_id" >&2 | ||
| exit 1 | ||
| fi | ||
| iso_path="$(realpath "${matches[0]}")" | ||
| elif [[ -n "$iso_path" ]]; then | ||
| [[ -f "$iso_path" ]] || { echo "ISO path does not exist: $iso_path" >&2; exit 1; } | ||
| iso_path="$(realpath "$iso_path")" | ||
| else | ||
| shopt -s nullglob | ||
| matches=(./*.iso) | ||
| if [[ ${#matches[@]} -eq 0 ]]; then | ||
| echo "No ISO file found in the repository checkout" >&2 | ||
| exit 1 | ||
| fi | ||
| iso_path="$(realpath "${matches[0]}")" | ||
| fi | ||
| echo "iso_path=${iso_path}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Run the e2e harness | ||
| env: | ||
| IMAGE_REF: ghcr.io/ublue-os/bluefin | ||
| IMAGE_TAG: stable | ||
| run: | | ||
| bash tests/iso/e2e.sh "${{ steps.context.outputs.iso_path }}" e2e-output | ||
|
|
||
| - name: Upload e2e proof | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: iso-e2e-proof-${{ github.run_id }} | ||
| if-no-files-found: error | ||
| path: e2e-output/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,213 @@ | ||
| name: ISO Smoke Test | ||
|
|
||
| run-name: >- | ||
| ISO smoke validation for ${{ github.event.client_payload.release_tag || inputs.release_tag || 'manual' }} | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| iso_url: | ||
| description: 'HTTPS URL for the ISO to test' | ||
| required: false | ||
| type: string | ||
| source_run_id: | ||
| description: 'Workflow run ID containing an ISO artifact' | ||
| required: false | ||
| type: string | ||
| artifact_name: | ||
| description: 'Optional ISO artifact name from source_run_id' | ||
| required: false | ||
| type: string | ||
| iso_path: | ||
| description: 'Path to a checked-in ISO in this repository' | ||
| required: false | ||
| type: string | ||
| release_tag: | ||
| description: 'Release tag used for this smoke run' | ||
| required: false | ||
| type: string | ||
| variant: | ||
| description: 'Variant being validated' | ||
| required: false | ||
| type: string | ||
| workflow_call: | ||
| inputs: | ||
| iso_url: | ||
| description: 'HTTPS URL for the ISO to test' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| source_run_id: | ||
| description: 'Workflow run ID containing an ISO artifact' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| artifact_name: | ||
| description: 'Optional ISO artifact name from source_run_id' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| iso_path: | ||
| description: 'Path to an ISO available after checkout' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| release_tag: | ||
| description: 'Release tag used for this smoke run' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| variant: | ||
| description: 'Variant being validated' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| repository_dispatch: | ||
| types: | ||
| - iso-smoke-validation | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: read | ||
|
|
||
| jobs: | ||
| smoke-test: | ||
| name: Boot ISO in QEMU | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
|
|
||
| - name: Resolve smoke inputs | ||
| id: context | ||
| env: | ||
| INPUT_ISO_URL: ${{ inputs.iso_url }} | ||
| INPUT_SOURCE_RUN_ID: ${{ inputs.source_run_id }} | ||
| INPUT_ARTIFACT_NAME: ${{ inputs.artifact_name }} | ||
| INPUT_ISO_PATH: ${{ inputs.iso_path }} | ||
| INPUT_RELEASE_TAG: ${{ inputs.release_tag }} | ||
| INPUT_VARIANT: ${{ inputs.variant }} | ||
| DISPATCH_ISO_URL: ${{ github.event.client_payload.iso_url }} | ||
| DISPATCH_SOURCE_RUN_ID: ${{ github.event.client_payload.source_run_id }} | ||
| DISPATCH_ARTIFACT_NAME: ${{ github.event.client_payload.artifact_name }} | ||
| DISPATCH_ISO_PATH: ${{ github.event.client_payload.iso_path }} | ||
| DISPATCH_RELEASE_TAG: ${{ github.event.client_payload.release_tag }} | ||
| DISPATCH_VARIANT: ${{ github.event.client_payload.variant }} | ||
| run: | | ||
| set -euo pipefail | ||
| iso_url="${DISPATCH_ISO_URL:-${INPUT_ISO_URL}}" | ||
| source_run_id="${DISPATCH_SOURCE_RUN_ID:-${INPUT_SOURCE_RUN_ID}}" | ||
| artifact_name="${DISPATCH_ARTIFACT_NAME:-${INPUT_ARTIFACT_NAME}}" | ||
| iso_path="${DISPATCH_ISO_PATH:-${INPUT_ISO_PATH}}" | ||
| release_tag="${DISPATCH_RELEASE_TAG:-${INPUT_RELEASE_TAG}}" | ||
| variant="${DISPATCH_VARIANT:-${INPUT_VARIANT}}" | ||
| { | ||
| echo "iso_url=${iso_url}" | ||
| echo "source_run_id=${source_run_id}" | ||
| echo "artifact_name=${artifact_name}" | ||
| echo "iso_path=${iso_path}" | ||
| echo "release_tag=${release_tag}" | ||
| echo "variant=${variant}" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Validate ISO source | ||
| env: | ||
| ISO_URL: ${{ steps.context.outputs.iso_url }} | ||
| SOURCE_RUN_ID: ${{ steps.context.outputs.source_run_id }} | ||
| ISO_PATH: ${{ steps.context.outputs.iso_path }} | ||
| run: | | ||
| set -euo pipefail | ||
| source_count=0 | ||
| [[ -n "$ISO_URL" ]] && ((source_count += 1)) | ||
| [[ -n "$SOURCE_RUN_ID" ]] && ((source_count += 1)) | ||
| [[ -n "$ISO_PATH" ]] && ((source_count += 1)) | ||
|
|
||
| if [[ "$source_count" -ne 1 ]]; then | ||
| echo "Provide exactly one of iso_url, source_run_id, or iso_path." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Download named source artifact | ||
| if: steps.context.outputs.source_run_id != '' && steps.context.outputs.artifact_name != '' | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 | ||
| with: | ||
| github-token: ${{ github.token }} | ||
| repository: ${{ github.repository }} | ||
| run-id: ${{ steps.context.outputs.source_run_id }} | ||
| name: ${{ steps.context.outputs.artifact_name }} | ||
| path: downloaded-artifact | ||
|
|
||
| - name: Download source run artifacts | ||
| if: steps.context.outputs.source_run_id != '' && steps.context.outputs.artifact_name == '' | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 | ||
| with: | ||
| github-token: ${{ github.token }} | ||
| repository: ${{ github.repository }} | ||
| run-id: ${{ steps.context.outputs.source_run_id }} | ||
| path: downloaded-artifact | ||
|
|
||
| - name: Resolve ISO list | ||
| id: iso | ||
| env: | ||
| ISO_URL: ${{ steps.context.outputs.iso_url }} | ||
| SOURCE_RUN_ID: ${{ steps.context.outputs.source_run_id }} | ||
| ISO_PATH: ${{ steps.context.outputs.iso_path }} | ||
| run: | | ||
| set -euo pipefail | ||
| iso_paths=() | ||
| if [[ -n "$ISO_URL" ]]; then | ||
| mkdir -p smoke-input | ||
| curl --fail --location --retry 3 --retry-all-errors \ | ||
| --output smoke-input/source.iso "$ISO_URL" | ||
| iso_paths+=("$PWD/smoke-input/source.iso") | ||
| elif [[ -n "$ISO_PATH" ]]; then | ||
| [[ -f "$ISO_PATH" ]] || { echo "ISO path does not exist: $ISO_PATH" >&2; exit 1; } | ||
| iso_paths+=("$(realpath "$ISO_PATH")") | ||
| else | ||
| mapfile -d '' isos < <(find downloaded-artifact -type f -name '*.iso' -print0 | sort -z) | ||
| if [[ "${#isos[@]}" -eq 0 ]]; then | ||
| echo "No ISO files were found in the source artifacts." >&2 | ||
| exit 1 | ||
| fi | ||
| iso_paths=("${isos[@]}") | ||
| fi | ||
|
|
||
| iso_list="$RUNNER_TEMP/iso-list.txt" | ||
| printf '%s\n' "${iso_paths[@]}" > "$iso_list" | ||
| echo "path=$iso_list" >> "$GITHUB_OUTPUT" | ||
| echo "count=${#iso_paths[@]}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install QEMU and ISO inspection tools | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install --yes qemu-system-x86 xorriso | ||
|
|
||
| - name: Run boot smoke test | ||
| id: smoke | ||
| continue-on-error: true | ||
| run: | | ||
| set -euo pipefail | ||
| iso_list="${{ steps.iso.outputs.path }}" | ||
| status=0 | ||
| while IFS= read -r iso_path; do | ||
| [[ -n "$iso_path" ]] || continue | ||
| output_dir="smoke-output/$(basename "${iso_path%.*}")" | ||
| mkdir -p "$output_dir" | ||
| if ! tests/iso/smoke.sh "$iso_path" "$output_dir"; then | ||
| status=1 | ||
| fi | ||
| done < "$iso_list" | ||
| exit "$status" | ||
|
|
||
| - name: Upload smoke proof | ||
| if: always() | ||
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 | ||
| with: | ||
| name: iso-smoke-proof-${{ github.run_id }} | ||
| if-no-files-found: error | ||
| path: smoke-output/ | ||
|
|
||
| - name: Fail when the smoke test failed | ||
| if: steps.smoke.outcome == 'failure' | ||
| run: exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: ISO Validation via Testsuite | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| iso_url: | ||
| description: "HTTPS URL for the ISO to validate" | ||
| required: true | ||
| type: string | ||
| iso_ref: | ||
| description: "Immutable ISO ref containing tests/iso" | ||
| required: true | ||
| type: string | ||
| variant: | ||
| description: "ISO variant" | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| run_e2e: | ||
| description: "Run unattended installation and post-install boot validation" | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: Validate ISO through projectbluefin/testsuite | ||
| uses: projectbluefin/testsuite/.github/workflows/iso-validation.yml@2c1d781353f68f060729f5af02917062f9a7f50b | ||
| with: | ||
| iso_url: ${{ inputs.iso_url }} | ||
| iso_ref: ${{ inputs.iso_ref }} | ||
| variant: ${{ inputs.variant }} | ||
| run_e2e: ${{ inputs.run_e2e }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win
Fix critical script injection vulnerability by passing
artifact_namevia environment variables.Interpolating the user-controllable input
inputs.artifact_namedirectly into the bash script using${{ ... }}exposes the workflow to remote code execution (RCE) via script injection.Add
INPUT_ARTIFACT_NAMEandDISPATCH_ARTIFACT_NAMEto theenvblock, and retrieve the value safely via environment variables, matching the pattern used for other inputs.🔒️ Proposed fix for secure input handling
- name: Resolve ISO input id: context env: INPUT_ISO_URL: ${{ inputs.iso_url }} INPUT_SOURCE_RUN_ID: ${{ inputs.source_run_id }} + INPUT_ARTIFACT_NAME: ${{ inputs.artifact_name }} INPUT_ISO_PATH: ${{ inputs.iso_path }} DISPATCH_ISO_URL: ${{ github.event.client_payload.iso_url }} DISPATCH_SOURCE_RUN_ID: ${{ github.event.client_payload.source_run_id }} + DISPATCH_ARTIFACT_NAME: ${{ github.event.client_payload.artifact_name }} DISPATCH_ISO_PATH: ${{ github.event.client_payload.iso_path }} GH_TOKEN: ${{ github.token }} run: | set -euo pipefail iso_url="${DISPATCH_ISO_URL:-${INPUT_ISO_URL}}" source_run_id="${DISPATCH_SOURCE_RUN_ID:-${INPUT_SOURCE_RUN_ID}}" iso_path="${DISPATCH_ISO_PATH:-${INPUT_ISO_PATH}}" if [[ -n "$iso_url" ]]; then mkdir -p e2e-input curl --fail --location --retry 3 --retry-all-errors --output e2e-input/source.iso "$iso_url" iso_path="$PWD/e2e-input/source.iso" elif [[ -n "$source_run_id" ]]; then mkdir -p e2e-input - artifact_name="${{ github.event.client_payload.artifact_name || inputs.artifact_name || '' }}" + artifact_name="${DISPATCH_ARTIFACT_NAME:-${INPUT_ARTIFACT_NAME}}"📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[error] 104-104: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 104-104: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
🤖 Prompt for AI Agents
Source: Linters/SAST tools