8000
Skip to content

Add CI job to test install-gh-aw.sh with stable release#23633

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-ci-test-for-gh-aw
Mar 31, 2026
Merged

Add CI job to test install-gh-aw.sh with stable release#23633
pelikhan merged 2 commits intomainfrom
copilot/add-ci-test-for-gh-aw

Conversation

Copy link
Copy Markdown
Contributor
Copilot AI commented Mar 31, 2026

Summary

Adds a CI job (install-script) that validates install-gh-aw.sh works correctly and that stable is a valid, downloadable release.

Changes

  • Added install-gh-aw.sh to the CI paths trigger so the job runs when the install script changes
  • Added new install-script CI job with three steps:
    1. Validate stable alias – reads .github/aw/releases.json and asserts the stable alias is a proper vMAJOR.MINOR.PATCH semver (not missing, not self-referential)
    2. Run install-gh-aw.sh – executes the script end-to-end with stable as the requested version, which downloads the binary from GitHub Releases
    3. Verify installation – confirms the binary exists, runs version, and checks the installed version matches what releases.json resolved stable to

This catches issues like:

  • The stable alias not being set or pointing to an invalid version
  • The download URL being broken for the stable release
  • The installed binary being non-functional

@pelikhan pelikhan marked this pull request as ready for review March 31, 2026 04:01
Copilot AI review requested due to automatic review settings March 31, 2026 04:01
@pelikhan pelikhan merged commit 4dfaeb9 into main Mar 31, 2026
65 of 66 checks passed
@pelikhan pelikhan deleted the copilot/add-ci-test-for-gh-aw branch March 31, 2026 04:05
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

Adds CI coverage to validate the install script against the stable release, and updates the setup action’s copied install script to default to stable with alias resolution via releases.json.

Changes:

  • Add an install-script CI job that validates the stable alias, runs install-gh-aw.sh stable, and verifies the installed binary version.
  • Update actions/setup-cli/install.sh to default to stable and resolve version aliases from .github/aw/releases.json before download.
  • Extend CI path filters so changes to install-gh-aw.sh trigger the workflow.

Reviewed changes

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

File Description
actions/setup-cli/install.sh Switch default version to stable and add alias resolution from releases.json prior to download.
.github/workflows/ci.yml Add install-script job to validate stable and run the install script in CI; include install-gh-aw.sh in path triggers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

8000
if [ -n "$releases_json" ]; then
resolved_version=""
if [ "$HAS_JQ" = true ]; then
resolved_version=$(echo "$releases_json" | jq -r ".aliases[\"$VERSION\"] // empty" 2>/dev/null) || {
Copy link
Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The jq alias lookup is built by string-interpolating $VERSION into the jq program (".aliases["$VERSION"]"), which can break for versions containing quotes/backslashes and makes the parsing behavior depend on shell escaping. Use jq's --arg to pass the key instead (e.g., look up .aliases[$ver]) so alias resolution is robust for any valid input.

Suggested change
resolved_version=$(echo "$releases_json" | jq -r ".aliases[\"$VERSION\"] // empty" 2>/dev/null) || {
resolved_version=$(echo "$releases_json" | jq -r --arg ver "$VERSION" '.aliases[$ver] // empty' 2>/dev/null) || {

Copilot uses AI. Check for mistakes.
print_info "Resolving version alias '$VERSION' from $RELEASES_JSON_URL..."

releases_json=""
releases_json=$(curl -s -f "$RELEASES_JSON_URL" 2>/dev/null) || true
Copy link
Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Alias resolution fetches releases.json via a single curl call (no retry/backoff), even though the script already has fetch_release_data() with retry logic. Consider reusing fetch_release_data for RELEASES_JSON_URL to reduce flaky installs/CI failures due to transient network errors.

Suggested change
releases_json=$(curl -s -f "$RELEASES_JSON_URL" 2>/dev/null) || true
releases_json=$(fetch_release_data "$RELEASES_JSON_URL") || true

Copilot uses AI. Check for mistakes.
echo "✅ 'stable' alias resolves to a valid version: $STABLE"

- name: Run install-gh-aw.sh with stable version
run: bash install-gh-aw.sh stable
Copy link
Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This job validates stable using the checked-out .github/aw/releases.json, but install-gh-aw.sh stable resolves aliases by fetching .../main/.github/aw/releases.json. If a PR updates releases.json (or tests a fork), the expected version can diverge from what the install script actually installs, causing false failures and not testing the PR's updated stable. Consider making the install step use the same releases.json source (e.g., pass the resolved version to the script, or allow the script/workflow to point alias resolution at the checked-out file or the current commit SHA).

Suggested change
run: bash install-gh-aw.sh stable
run: bash install-gh-aw.sh "${{ steps.validate-stable.outputs.stable_version }}"

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +12
# If no version is specified, it will use "stable" (resolved from .github/aw/releases.json)
# Version aliases (e.g. "stable", "latest") are resolved via .github/aw/releases.json before download.
# Note: Checksum validation is currently skipped by default (will be enabled in future releases)
#
# Examples:
# ./install-gh-aw.sh # Install latest version
# ./install-gh-aw.sh # Install stable version
# ./install-gh-aw.sh latest # Install latest version
Copy link
Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

PR title/description focus on adding a CI job, but this change also updates the install script’s default behavior from latest to stable and introduces alias resolution. If intentional, please reflect this in the PR description (or split into a separate PR) so reviewers understand the behavior change.

Copilot uses AI. Check for mistakes.
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.

3 participants

0