Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 90 additions & 6 deletions .github/workflows/commit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,88 @@ jobs:
scandir: './scripts'
severity: error

probe_urls:
name: Probe all hardcoded PAServer URLs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check every explicit PASERVER_URL is still reachable
run: |
set +e
fail=0
broken=()
while IFS= read -r url; do
status=$(curl -sI --max-time 15 "$url" 2>/dev/null | awk 'NR==1{print $2}' | tr -d '\r')
if [ "$status" = "200" ]; then
echo "OK ($status): $url"
else
echo "::error::Broken PASERVER_URL (status='$status'): $url"
broken+=("$url (status='$status')")
fail=1
fi
done < <(grep -oP 'PASERVER_URL="\Khttps?://[^"]+' scripts/SetupLinux4Delphi.sh)

if [ "$fail" -ne 0 ]; then
{
echo "### Broken PASERVER_URL(s)"
printf -- '- `%s`\n' "${broken[@]}"
} >> "$GITHUB_STEP_SUMMARY"
fi
exit "$fail"

plan:
name: Plan install tests
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.plan.outputs.versions }}
steps:
- uses: actions/checkout@v5
- name: Determine latest hardcoded version, probe for a newer guessed one
id: plan
run: |
set +e
latest=$(grep -oP 'PRODUCT="\K[0-9]+\.[0-9]+(\.[0-9]+)?' scripts/SetupLinux4Delphi.sh \
| sort -Vu | tail -1)
echo "Latest hardcoded version: $latest"

# Pull in just the guessing function; the full script requires root
# before it's even defined, and we don't want to install anything here.
source <(sed -n '/^try_guess_paserver_url()/,/^}/p' scripts/SetupLinux4Delphi.sh)

major="${latest%%.*}"
rest="${latest#*.}"
minor="${rest%%.*}"
candidates=("${major}.$((minor + 1))" "$((major + 1)).0")

guessed=""
for c in "${candidates[@]}"; do
if try_guess_paserver_url "$c"; then
echo "::warning::URL guessing found a newer, not-yet-listed PAServer version ($c -> $PASERVER_URL). Consider adding it to scripts/SetupLinux4Delphi.sh."
{
echo "### Newer version found by guessing"
echo "- **$c** -> \`$PASERVER_URL\`"
} >> "$GITHUB_STEP_SUMMARY"
guessed="$c"
break
fi
done

if [ -n "$guessed" ]; then
versions=$(printf '%s\n' "$latest" "$guessed" | jq -R . | jq -sc .)
else
versions=$(printf '%s\n' "$latest" | jq -R . | jq -sc .)
fi
echo "versions=$versions" >> "$GITHUB_OUTPUT"
echo "Testing versions: $versions"

ubuntu_test:
name: Ubuntu 26.04
name: Ubuntu 26.04 (${{ matrix.version }})
needs: plan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.plan.outputs.versions) }}
steps:
- uses: actions/checkout@v5
- name: Run Setup and Verify PAServer in Ubuntu 26.04
Expand All @@ -32,25 +111,30 @@ jobs:
bash -c "
set -e
chmod +x /workspace/scripts/SetupLinux4Delphi.sh
/workspace/scripts/SetupLinux4Delphi.sh 13.1
/usr/local/bin/pa13.1.sh &
/workspace/scripts/SetupLinux4Delphi.sh ${{ matrix.version }}
/usr/local/bin/pa${{ matrix.version }}.sh &
Comment thread
jimmckeeth marked this conversation as resolved.
sleep 15
pgrep paserver
"

rhel_test:
name: RHEL 10
name: RHEL 10 (${{ matrix.version }})
needs: plan
runs-on: ubuntu-latest
container:
image: redhat/ubi10:latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.plan.outputs.versions) }}
steps:
- uses: actions/checkout@v5
- name: Run Setup
run: |
chmod +x ./scripts/SetupLinux4Delphi.sh
./scripts/SetupLinux4Delphi.sh 13.1
./scripts/SetupLinux4Delphi.sh ${{ matrix.version }}
- name: Verify PAServer
run: |
/usr/local/bin/pa13.1.sh &
/usr/local/bin/pa${{ matrix.version }}.sh &
sleep 15
pgrep paserver
13 changes: 8 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ Avoid split ownership of version mapping logic long-term. Target owner is pacomm
### A) Add or change PAServer version mapping
Update all of:
1. `scripts/SetupLinux4Delphi.sh` alias map and `PASERVER_URL` entries.
2. Script help text (`--help`).
3. `README.md` version matrix/alias descriptions.
4. `.github/workflows/commit_test.yml` validation target(s) when coverage changes.
2. `scripts/SetupLinux4Delphi.sh`'s `KNOWN_VERSIONS` array — add the new product version string here too. This is the single source of truth `LATEST_VERSION` (`sort -V | tail -1` over it) is computed from, which in turn drives the default `PARAM` value and the help text's `[DEFAULT]` marker (via `version_tag`). Forgetting this step leaves the default pointed at an old version even though the case branch exists.
3. Script help text (`--help`) — add a line with a `$(version_tag X.Y)` call so the `[DEFAULT]` marker can land on it automatically once it's newest.
4. `README.md` version matrix/alias descriptions.
5. No CI edit needed for routine version additions: `.github/workflows/commit_test.yml`'s `probe_urls` job picks up every new `PASERVER_URL` automatically, and `plan` always targets whatever is newest (via its own independent `grep`/`sort -V` over `PRODUCT="..."` lines — it does not read `KNOWN_VERSIONS`). Only touch the workflow file itself if the *mechanism* needs to change (e.g. how many versions get full install tests, or the guess-probing candidates).

Keep compiler aliases (`37.0`, `23.0`, etc.) mapping to latest point release, while explicit product aliases (`13.0`, `12.2`) stay exact.

Expand All @@ -83,8 +84,10 @@ Current automated checks are shell/install focused:
- `shellcheck scripts/SetupLinux4Delphi.sh`
- `bash -n scripts/SetupLinux4Delphi.sh`
- CI in `.github/workflows/commit_test.yml`:
- Ubuntu 26.04 installs 13.1, starts `pa13.1.sh`, verifies `pgrep paserver`
- RHEL 10 does the same
- `probe_urls` does a lightweight `HEAD` check against every hardcoded `PASERVER_URL` and fails if any have gone dead — cheap enough to run for the whole table, independently of the install jobs below.
- `plan` finds the newest `PRODUCT="..."` version and also probes `try_guess_paserver_url` for the next minor/major version; if guessing finds a real, not-yet-listed URL, it's added to the test list and flagged via a workflow warning + summary (a prompt to add it explicitly, not an assertion that it's already covered).
- Ubuntu 26.04 and RHEL 10 each run as a matrix over `plan`'s version list (normally just the latest version; two when guessing finds something newer): install, start `pa<version>.sh`, verify `pgrep paserver`.
- Older explicit versions are covered only by the `probe_urls` reachability check, not a full install — full install/start testing is deliberately limited to the newest version(s) to keep CI light.

For pacommander router work, testing is mandatory before calling behavior stable. Validate at least:
1. **Version identification**: incoming connection metadata is parsed into the correct target PAServer version.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Usage: `sudo SetupLinux4Delphi.sh [version] [pkgmgr]`

Where [version] is one of the following:

* Florence 13.1 = `Florence`, `37.0`, `13.1` or *blank*
* Florence 13.2 = `Florence`, `37.0`, `13.2` or *blank*
* Florence 13.1 = `13.1`
* Florence 13.0 = `13.0`
* Athens 12.3 = `Athens`, `23.0`, `12.3`, or `12`
* Athens 12.2 = `12.2`
Expand Down Expand Up @@ -111,7 +112,7 @@ The installation locations are as follows:
* `SCRIPT_PATH="/usr/local/bin/pa$PRODUCT.sh"`
* `SCRATCH_DIR="$REAL_HOME/.PAServer/$PRODUCT-scratch"`

Where `$PRODUCT` is 13.1, 13.0, 12.2, etc. So you launch the latest *Florence* PAServer with `pa13.1.sh`.
Where `$PRODUCT` is 13.2, 13.1, 12.2, etc. So you launch the latest *Florence* PAServer with `pa13.2.sh`.

## More information

Expand Down
Loading
Loading