From 0c6308a7d76a886806a6b55f421a862f684b2efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Thu, 26 Nov 2026 11:23:04 +0100 Subject: [PATCH 01/15] ci(client-python): migrate ci pipeline from circleci to github actions --- .github/actions/checkout/action.yml | 9 ++ .github/actions/setup-python/action.yml | 27 ++++ .github/workflows/ci-lint-format.yml | 47 ++++++ .github/workflows/ci-pipeline.yml | 186 ++++++++++++++++++++++++ 4 files changed, 269 insertions(+) create mode 100644 .github/actions/checkout/action.yml create mode 100644 .github/actions/setup-python/action.yml create mode 100644 .github/workflows/ci-lint-format.yml create mode 100644 .github/workflows/ci-pipeline.yml diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml new file mode 100644 index 00000000..20e74b1a --- /dev/null +++ b/.github/actions/checkout/action.yml @@ -0,0 +1,9 @@ +name: Checkout Repository +description: Checkout the repository using a pinned version of actions/checkout + +runs: + using: composite + steps: + # https://github.com/actions/checkout/releases/#release-v7.0.1 + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 \ No newline at end of file diff --git a/.github/actions/setup-python/action.yml b/.github/actions/setup-python/action.yml new file mode 100644 index 00000000..0e393fb0 --- /dev/null +++ b/.github/actions/setup-python/action.yml @@ -0,0 +1,27 @@ +name: Setup Python Environment +description: Configure Python and install project development dependencies + +inputs: + python-version: + description: Python version to use + required: false + default: "3.13" + +runs: + using: composite + steps: + # https://github.com/actions/setup-python/releases#release-v7.1.0 + - name: Set up Python + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: ${{ inputs.python-version }} + cache: pip + cache-dependency-path: pyproject.toml + + - name: Update pip + shell: bash + run: python -m pip install --upgrade pip certifi + + - name: Install development dependencies + shell: bash + run: python -m pip install ".[dev]" diff --git a/.github/workflows/ci-lint-format.yml b/.github/workflows/ci-lint-format.yml new file mode 100644 index 00000000..77753742 --- /dev/null +++ b/.github/workflows/ci-lint-format.yml @@ -0,0 +1,47 @@ +name: Lint & Format + +on: + workflow_call: + +permissions: + contents: read + +jobs: + ensure_formatting: + name: Ensure Formatting + runs-on: ubuntu-24.04 + timeout-minutes: 5 + + steps: + - name: Checkout Repository + uses: $/.github/actions/checkout + + - name: Setup Python Environment + uses: $/.github/actions/setup-python + + - name: Confirm Black version + run: black --version + + - name: Check isort + run: isort --check-only --diff . + + - name: Check Black + run: black --check --diff . + + linter: + name: Linter + runs-on: ubuntu-24.04 + timeout-minutes: 5 + + steps: + - name: Checkout Repository + uses: $/.github/actions/checkout + + - name: Setup Python Environment + uses: $/.github/actions/setup-python + + - name: Install flake8 + run: python -m pip install flake8 + + - name: Run Flake8 + run: flake8 --ignore=E,W . diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml new file mode 100644 index 00000000..c4440993 --- /dev/null +++ b/.github/workflows/ci-pipeline.yml @@ -0,0 +1,186 @@ +name: OpenAEV Client-Python CI + +on: + push: + branches: + - "**" + tags: + - "*" + + pull_request: + + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # ────────────────────────────────────────────────────────────────── + # Lint & Format ( + # ────────────────────────────────────────────────────────────────── + lint-format: + name: Lint & Format + uses: $/.github/workflows/lint-format.yml + + # ────────────────────────────────────────────────────────────────── + # Tests + # ────────────────────────────────────────────────────────────────── + tests: + name: Tests + runs-on: ubuntu-24.04 + timeout-minutes: 10 + + steps: + - name: Checkout Repository + uses: $/.github/actions/checkout + + - name: Setup Python Environment + uses: $/.github/actions/setup-python + + - name: Run Tests + run: python -m pytest + + # ────────────────────────────────────────────────────────────────── + # Build + # ────────────────────────────────────────────────────────────────── + build: + name: Build + runs-on: ubuntu-24.04 + timeout-minutes: 10 + + needs: + - lint-format + - tests + + steps: + - name: Checkout Repository + uses: $/.github/actions/checkout + + - name: Setup Python Environment + uses: $/.github/actions/setup-python + + - name: Check Version + if: startsWith(github.ref, 'refs/tags/') + shell: bash + run: | + package_version="$( + python -c 'import pyoaev; print(pyoaev.__version__)' + )" + + tag_version="${GITHUB_REF_NAME}" + if [ "${tag_version}" != "${package_version}" ]; then + echo "::error::Version mismatch: Git tag version '${tag_version}' does not match package version '${package_version}'." + exit 1 + fi + + - name: Build Package + run: | + SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)" \ + python -m build + + # ────────────────────────────────────────────────────────────────── + # Pipeline Gate + # Required branch-protection check: "Pipeline Gate" + # Fails if any mandatory upstream job did not succeed. + # ────────────────────────────────────────────────────────────────── + pipeline-gate: + name: "Pipeline Gate" + needs: + - lint-format + - tests + - build + if: ${{ !cancelled() }} + runs-on: ubuntu-24.04 + timeout-minutes: 15 + permissions: {} + + steps: + - name: Check all upstream job results + env: + NEEDS_JSON: ${{ toJSON(needs) }} + run: | + set -euo pipefail + + FAILED=0 + TOTAL=0 + + echo "══════════════════════════════════════════════════" + echo " 🔎 Upstream Job Results" + echo "══════════════════════════════════════════════════" + echo "" + + # Initialize GitHub Actions Summary + { + echo "## Upstream Job Results" + echo "" + echo "| Job | Status |" + echo "|---|---|" + } >> "$GITHUB_STEP_SUMMARY" + + # Dynamically iterate over all jobs declared in needs + for job in $(echo "$NEEDS_JSON" | jq -r 'keys[]'); do + result=$(echo "$NEEDS_JSON" | jq -r --arg j "$job" '.[$j].result') + TOTAL=$((TOTAL + 1)) + + case "$result" in + success) + icon="✅" + status="Passed" + ;; + skipped) + icon="⏭️" + status="Skipped" + FAILED=$((FAILED + 1)) + ;; + failure) + icon="❌" + status="Failed" + FAILED=$((FAILED + 1)) + ;; + cancelled) + icon="🚫" + status="Cancelled" + FAILED=$((FAILED + 1)) + ;; + *) + icon="❓" + status="Unknown" + FAILED=$((FAILED + 1)) + ;; + esac + + # Display result in workflow logs + printf " %s %-30s %s\n" "$icon" "$job" "$result" + + # Add result to GitHub Actions Summary + printf "| %s `%s` | %s |\n" \ + "$icon" "$job" "$status" >> "$GITHUB_STEP_SUMMARY" + done + + echo "" + echo "══════════════════════════════════════════════════" + + if [[ "$FAILED" -gt 0 ]]; then + echo "❌ Gate failed: $FAILED/$TOTAL job(s) did not succeed." + + { + echo "" + echo "**❌ Gate failed: $FAILED/$TOTAL required job(s) did not succeed.**" + } >> "$GITHUB_STEP_SUMMARY" + + exit 1 + fi + + echo "✅ All $TOTAL upstream jobs succeeded." + echo "✅ Pipeline Gate passed." + + { + echo "" + echo "**✅ All $TOTAL upstream jobs succeeded.**" + echo "" + echo "### Pipeline Gate: Passed" + } >> "$GITHUB_STEP_SUMMARY" \ No newline at end of file From 14527285fc229b41f8fefbde77c5108146be2101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Thu, 26 Nov 2026 11:54:58 +0100 Subject: [PATCH 02/15] fix(workflow): update lint-format path --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index c4440993..9e9a13cf 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -24,7 +24,7 @@ jobs: # ────────────────────────────────────────────────────────────────── lint-format: name: Lint & Format - uses: $/.github/workflows/lint-format.yml + uses: $/.github/workflows/ci-lint-format.yml # ────────────────────────────────────────────────────────────────── # Tests From e84f5fa651519785afb9b593ed4be39aee449dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Thu, 26 Nov 2026 12:04:26 +0100 Subject: [PATCH 03/15] =?UTF-8?q?ci(workflow):=20update=20select=20only=20?= =?UTF-8?q?main=C3=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 9e9a13cf..3b6045ec 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -3,7 +3,7 @@ name: OpenAEV Client-Python CI on: push: branches: - - "**" + - "main" tags: - "*" From 6a85272012018c2c16e4b1df4faec76d9ab68e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Thu, 26 Nov 2026 12:10:24 +0100 Subject: [PATCH 04/15] fix(workflow): update pipeline gate summary formatting --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 3b6045ec..8575b0f6 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -157,7 +157,7 @@ jobs: printf " %s %-30s %s\n" "$icon" "$job" "$result" # Add result to GitHub Actions Summary - printf "| %s `%s` | %s |\n" \ + printf "| %s %s | %s |\n" \ "$icon" "$job" "$status" >> "$GITHUB_STEP_SUMMARY" done From 76165c6c1920d7fa98036f13c20bfb72e4c2a218 Mon Sep 17 00:00:00 2001 From: Guillaume Paris Date: Thu, 26 Nov 2026 13:37:58 +0100 Subject: [PATCH 05/15] ci(workflow): upload the built package and retry failed runs Rename the CI to [Client Python] CI, upload dist/ as the pyoaev-dist artifact, and retry failed runs up to the third attempt. Push runs of this branch are enabled for now. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci-pipeline.yml | 13 ++++- .github/workflows/ci-retry.yml | 80 +++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-retry.yml diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 8575b0f6..6d62ea7b 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1,9 +1,11 @@ -name: OpenAEV Client-Python CI +name: "[Client Python] CI" on: push: branches: - "main" + # Temporary + - "ci/391-migrate-ci-pipeline-from-circleci-to-github-actions" tags: - "*" @@ -82,6 +84,15 @@ jobs: SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)" \ python -m build + # https://github.com/actions/upload-artifact/releases/tag/v7.0.2 + - name: Upload Package + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: pyoaev-dist + path: dist/ + if-no-files-found: error + retention-days: 14 + # ────────────────────────────────────────────────────────────────── # Pipeline Gate # Required branch-protection check: "Pipeline Gate" diff --git a/.github/workflows/ci-retry.yml b/.github/workflows/ci-retry.yml new file mode 100644 index 00000000..aeb69532 --- /dev/null +++ b/.github/workflows/ci-retry.yml @@ -0,0 +1,80 @@ +name: "[Client Python] Auto-Retry Failed CI" + +# Triggers when the CI workflow completes unsuccessfully. +# Retries failed jobs up to twice, so back-to-back infra flakes are still covered. +# +# A job killed by its timeout-minutes limit does not make the run "failure": GitHub reports +# the run as "cancelled", like a manual cancel or a superseded run. A cancelled run is retried +# only when all its cancelled jobs hit their timeout, so a deliberate cancel is never undone. +# A run is not retried either once a newer run of the same workflow exists for its branch: +# the CI concurrency group cancels in progress, so the re-run would cancel the newer run. + +on: + workflow_run: + # Workflow names are glob patterns, so literal brackets must be escaped. + # https://github.com/github/docs/issues/12572#issuecomment-1014035978 + workflows: ['\[Client Python\] CI'] + types: [completed] + +permissions: + actions: write + checks: read + +jobs: + retry: + name: "🔄 Retry Failed Jobs" + if: >- + ${{ + (github.event.workflow_run.conclusion == 'failure' || + github.event.workflow_run.conclusion == 'cancelled') && + github.event.workflow_run.run_attempt <= 2 + }} + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - name: Re-run failed jobs + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + RUN_ID: ${{ github.event.workflow_run.id }} + RUN_NAME: ${{ github.event.workflow_run.name }} + ATTEMPT: ${{ github.event.workflow_run.run_attempt }} + CONCLUSION: ${{ github.event.workflow_run.conclusion }} + WORKFLOW_ID: ${{ github.event.workflow_run.workflow_id }} + HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} + EVENT: ${{ github.event.workflow_run.event }} + run: | + set -euo pipefail + latest_run_id=$(gh api --method GET "repos/${REPO}/actions/workflows/${WORKFLOW_ID}/runs" \ + -f branch="${HEAD_BRANCH}" -f event="${EVENT}" -F per_page=1 \ + --jq '.workflow_runs[0].id') + if [ "${latest_run_id}" != "${RUN_ID}" ]; then + echo "⏭️ ${RUN_NAME} run #${RUN_ID} was superseded by run #${latest_run_id} — not retrying." + exit 0 + fi + if [ "${CONCLUSION}" = "cancelled" ]; then + # A run counts as timed out only when every cancelled job carries GitHub's + # timeout annotation. A manual cancel or a superseded run never does, so if GitHub + # rewords the message, timeouts stop being retried instead of cancels being undone. + # Fetched into variables first so an API error fails the step instead of + # reading as "no timeout". + job_ids=$(gh api --paginate \ + "repos/${REPO}/actions/runs/${RUN_ID}/attempts/${ATTEMPT}/jobs" \ + --jq '.jobs[] | select(.conclusion == "cancelled") | .id') + if [ -z "${job_ids}" ]; then + echo "⏭️ ${RUN_NAME} run #${RUN_ID} was cancelled before any job ran — not retrying." + exit 0 + fi + for job_id in ${job_ids}; do + messages=$(gh api --paginate "repos/${REPO}/check-runs/${job_id}/annotations" \ + --jq '.[].message') + if ! grep -q 'exceeded the maximum execution time' <<< "${messages}"; then + echo "⏭️ ${RUN_NAME} run #${RUN_ID} was cancelled (job ${job_id} did not time out) — not retrying." + exit 0 + fi + done + echo "⏱️ ${RUN_NAME} run #${RUN_ID} was cancelled by a job timeout." + fi + echo "🔄 ${RUN_NAME} run #${RUN_ID} failed on attempt ${ATTEMPT} — retrying failed jobs..." + gh api "repos/${REPO}/actions/runs/${RUN_ID}/rerun-failed-jobs" --method POST + echo "✅ Re-run triggered (attempt $((ATTEMPT + 1)))" From 3df67ccff58307af62358a25985787b386b7e54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Thu, 26 Nov 2026 14:13:24 +0100 Subject: [PATCH 06/15] test(ci): verify pipeline failure handling --- pyoaev/apis/collector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyoaev/apis/collector.py b/pyoaev/apis/collector.py index 7c02ff9d..bd4668da 100644 --- a/pyoaev/apis/collector.py +++ b/pyoaev/apis/collector.py @@ -1,9 +1,9 @@ from typing import Any, Dict - +from pyoaev.utils import RequiredOptional from pyoaev import exceptions as exc from pyoaev.base import RESTManager, RESTObject from pyoaev.mixins import CreateMixin, GetMixin, ListMixin, UpdateMixin -from pyoaev.utils import RequiredOptional + class Collector(RESTObject): From 37df25daf875598af0f0ac1e38a02e767f9eef3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Fri, 27 Nov 2026 10:48:26 +0100 Subject: [PATCH 07/15] ci(workflow): update summary report --- .github/workflows/ci-pipeline.yml | 73 ++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 6d62ea7b..195bd65e 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -22,7 +22,7 @@ concurrency: jobs: # ────────────────────────────────────────────────────────────────── - # Lint & Format ( + # Lint & Format # ────────────────────────────────────────────────────────────────── lint-format: name: Lint & Format @@ -104,15 +104,20 @@ jobs: - lint-format - tests - build - if: ${{ !cancelled() }} + if: ${{ always() }} runs-on: ubuntu-24.04 timeout-minutes: 15 - permissions: {} + permissions: + actions: read steps: - name: Check all upstream job results env: NEEDS_JSON: ${{ toJSON(needs) }} + GH_TOKEN: ${{ github.token }} + GH_REPOSITORY: ${{ github.repository }} + GH_RUN_ID: ${{ github.run_id }} + GH_API_URL: ${{ github.api_url }} run: | set -euo pipefail @@ -124,17 +129,23 @@ jobs: echo "══════════════════════════════════════════════════" echo "" + # Retrieve actual job timestamps from GitHub API + JOBS_JSON=$(curl -fsSL \ + -H "Authorization: Bearer $GH_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "$GH_API_URL/repos/$GH_REPOSITORY/actions/runs/$GH_RUN_ID/jobs?per_page=100") + # Initialize GitHub Actions Summary { echo "## Upstream Job Results" echo "" - echo "| Job | Status |" - echo "|---|---|" + echo "| Job | Started | Finished | Duration | Status |" + echo "|---|---|---|---|---|" } >> "$GITHUB_STEP_SUMMARY" # Dynamically iterate over all jobs declared in needs - for job in $(echo "$NEEDS_JSON" | jq -r 'keys[]'); do - result=$(echo "$NEEDS_JSON" | jq -r --arg j "$job" '.[$j].result') + for job in $(jq -r 'keys[]' <<< "$NEEDS_JSON"); do + result=$(jq -r --arg j "$job" '.[$j].result' <<< "$NEEDS_JSON") TOTAL=$((TOTAL + 1)) case "$result" in @@ -163,13 +174,53 @@ jobs: FAILED=$((FAILED + 1)) ;; esac - + + started_at="" + finished_at="" + started="—" + finished="—" + duration="—" + + # Find corresponding job in GitHub API response + job_data=$(jq -c \ + --arg name "$job" \ + '.jobs | map(select(.name == $name)) | first // empty' \ + <<< "$JOBS_JSON") + + if [[ -n "$job_data" ]]; then + started_at=$(jq -r '.started_at // empty' <<< "$job_data") + finished_at=$(jq -r '.completed_at // empty' <<< "$job_data") + fi + + # Format start timestamp + if [[ -n "$started_at" ]]; then + started=$(date -u -d "$started_at" '+%Y-%m-%d %H:%M:%S UTC') + fi + + # Format finish timestamp + if [[ -n "$finished_at" ]]; then + finished=$(date -u -d "$finished_at" '+%Y-%m-%d %H:%M:%S UTC') + fi + + # Calculate job duration + if [[ -n "$started_at" && -n "$finished_at" ]]; then + start_epoch=$(date -u -d "$started_at" +%s) + finish_epoch=$(date -u -d "$finished_at" +%s) + duration_seconds=$((finish_epoch - start_epoch)) + + duration=$(printf '%02dm %02ds' \ + $((duration_seconds / 60)) \ + $((duration_seconds % 60))) + fi + # Display result in workflow logs printf " %s %-30s %s\n" "$icon" "$job" "$result" - + # Add result to GitHub Actions Summary - printf "| %s %s | %s |\n" \ - "$icon" "$job" "$status" >> "$GITHUB_STEP_SUMMARY" + printf "| %s %s | %s | %s | %s | %s |\n" \ + "$icon" "$job" "$started" "$finished" "$duration" "$status" \ + >> "$GITHUB_STEP_SUMMARY" + done echo "" From 6df3b58a1d7333b1e7a250ab966272c9616e398c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Fri, 27 Nov 2026 11:00:15 +0100 Subject: [PATCH 08/15] ci(worflow): update summary report --- .github/workflows/ci-pipeline.yml | 11 +++++++++-- pyoaev/apis/collector.py | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 195bd65e..65c8e79a 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -184,8 +184,15 @@ jobs: # Find corresponding job in GitHub API response job_data=$(jq -c \ --arg name "$job" \ - '.jobs | map(select(.name == $name)) | first // empty' \ - <<< "$JOBS_JSON") + ' + def normalize: + ascii_downcase + | gsub("[^a-z0-9]+"; "-") + | gsub("(^-+|-+$)"; ""); + + [.jobs[] | select((.name | normalize) == ($name | normalize))] + | first // empty + ' <<< "$JOBS_JSON") if [[ -n "$job_data" ]]; then started_at=$(jq -r '.started_at // empty' <<< "$job_data") diff --git a/pyoaev/apis/collector.py b/pyoaev/apis/collector.py index bd4668da..7c02ff9d 100644 --- a/pyoaev/apis/collector.py +++ b/pyoaev/apis/collector.py @@ -1,9 +1,9 @@ from typing import Any, Dict -from pyoaev.utils import RequiredOptional + from pyoaev import exceptions as exc from pyoaev.base import RESTManager, RESTObject from pyoaev.mixins import CreateMixin, GetMixin, ListMixin, UpdateMixin - +from pyoaev.utils import RequiredOptional class Collector(RESTObject): From 38da7fbba8282fe17dd965c2a49cfed737ece052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Fri, 27 Nov 2026 11:09:41 +0100 Subject: [PATCH 09/15] ci(workflow): update summary reoport --- .github/workflows/ci-pipeline.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 65c8e79a..43bb41de 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -25,7 +25,7 @@ jobs: # Lint & Format # ────────────────────────────────────────────────────────────────── lint-format: - name: Lint & Format + name: Lint - Format uses: $/.github/workflows/ci-lint-format.yml # ────────────────────────────────────────────────────────────────── @@ -187,7 +187,8 @@ jobs: ' def normalize: ascii_downcase - | gsub("[^a-z0-9]+"; "-") + | gsub("[[:space:]]*-[[:space:]]*"; "-") + | gsub("[[:space:]]+"; "-") | gsub("(^-+|-+$)"; ""); [.jobs[] | select((.name | normalize) == ($name | normalize))] From 7403308a861104d8af9381788dce231f6f0a95b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Fri, 27 Nov 2026 11:16:15 +0100 Subject: [PATCH 10/15] ci(workflow): update summary report --- .github/workflows/ci-pipeline.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 43bb41de..2488a201 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -182,17 +182,15 @@ jobs: duration="—" # Find corresponding job in GitHub API response - job_data=$(jq -c \ - --arg name "$job" \ - ' - def normalize: - ascii_downcase - | gsub("[[:space:]]*-[[:space:]]*"; "-") - | gsub("[[:space:]]+"; "-") - | gsub("(^-+|-+$)"; ""); + job_data=$(jq -r ' + def normalize: + ascii_downcase + | gsub("[[:space:]]*-[[:space:]]*"; "-") + | gsub("[[:space:]]+"; "-") + | gsub("(^-+|-+$)"; ""); - [.jobs[] | select((.name | normalize) == ($name | normalize))] - | first // empty + .jobs[] | + "API: [\(.name)] -> [\(.name | normalize)]" ' <<< "$JOBS_JSON") if [[ -n "$job_data" ]]; then From 4147dcf17970ecb0c9f7c361d927d0d96915947e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Fri, 27 Nov 2026 11:23:04 +0100 Subject: [PATCH 11/15] ci(workflow): update summary report --- .github/workflows/ci-pipeline.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 2488a201..42ff0be1 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -180,17 +180,28 @@ jobs: started="—" finished="—" duration="—" - - # Find corresponding job in GitHub API response - job_data=$(jq -r ' + + jq -r ' def normalize: ascii_downcase - | gsub("[[:space:]]*-[[:space:]]*"; "-") - | gsub("[[:space:]]+"; "-") + | gsub("[^a-z0-9]+"; "-") | gsub("(^-+|-+$)"; ""); + + .jobs[] | + "API: [\(.name)] -> [\(.name | normalize)]" + ' <<< "$JOBS_JSON" + + # Find corresponding job in GitHub API response + job_data=$(jq -c \ + --arg name "$job" \ + ' + def normalize: + ascii_downcase + | gsub("[^a-z0-9]+"; "-") + | gsub("(^-+|-+$)"; ""); - .jobs[] | - "API: [\(.name)] -> [\(.name | normalize)]" + [.jobs[] | select((.name | normalize) == ($name | normalize))] + | first // empty ' <<< "$JOBS_JSON") if [[ -n "$job_data" ]]; then From 07eca568126cd8ce5fe84091c343bb0659be73bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Fri, 27 Nov 2026 11:43:27 +0100 Subject: [PATCH 12/15] ci(workflow): update summary report --- .github/workflows/ci-pipeline.yml | 46 ++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 42ff0be1..a46789e6 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -131,9 +131,9 @@ jobs: # Retrieve actual job timestamps from GitHub API JOBS_JSON=$(curl -fsSL \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - "$GH_API_URL/repos/$GH_REPOSITORY/actions/runs/$GH_RUN_ID/jobs?per_page=100") + -H "Authorization: Bearer $GH_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "$GH_API_URL/repos/$GH_REPOSITORY/actions/runs/$GH_RUN_ID/jobs?per_page=100") # Initialize GitHub Actions Summary { @@ -181,17 +181,6 @@ jobs: finished="—" duration="—" - jq -r ' - def normalize: - ascii_downcase - | gsub("[^a-z0-9]+"; "-") - | gsub("(^-+|-+$)"; ""); - - .jobs[] | - "API: [\(.name)] -> [\(.name | normalize)]" - ' <<< "$JOBS_JSON" - - # Find corresponding job in GitHub API response job_data=$(jq -c \ --arg name "$job" \ ' @@ -200,8 +189,33 @@ jobs: | gsub("[^a-z0-9]+"; "-") | gsub("(^-+|-+$)"; ""); - [.jobs[] | select((.name | normalize) == ($name | normalize))] - | first // empty + ($name | normalize) as $target | + + [ + .jobs[] + | select( + (.name | normalize) == $target + or + (.name | normalize | startswith($target + "-")) + ) + ] as $matches | + + if ($matches | length) == 0 then + empty + else + { + started_at: ( + [$matches[].started_at | select(. != null)] + | sort + | first // null + ), + completed_at: ( + [$matches[].completed_at | select(. != null)] + | sort + | last // null + ) + } + end ' <<< "$JOBS_JSON") if [[ -n "$job_data" ]]; then From 4e66ea7f208dcdab58e6f6ec79e4fcc0ca4c239b Mon Sep 17 00:00:00 2001 From: Guillaume Paris Date: Fri, 27 Nov 2026 14:47:50 +0100 Subject: [PATCH 13/15] ci(workflow): trigger the pipeline Co-Authored-By: Claude Opus 5.5 From 7e501288267ba2655a700a204fd97483486f378e Mon Sep 17 00:00:00 2001 From: Guillaume Paris Date: Fri, 27 Nov 2026 15:34:10 +0100 Subject: [PATCH 14/15] ci(circleci): upload to PyPI only after a manual approval Co-Authored-By: Claude Opus 5.5 --- .circleci/config.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e628aad5..2ca137ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,7 +162,9 @@ workflows: - ensure_formatting - linter - test - - deploy: + # Manual only: the upload to PyPI waits for an approval in CircleCI + - approve_deploy: + type: approval requires: - build filters: @@ -170,6 +172,14 @@ workflows: only: /[0-9]+(\.[0-9]+)+(\.[0-9]+)?\.?(\w)*/ branches: ignore: /.*/ + - deploy: + requires: + - approve_deploy + filters: + tags: + only: /[0-9]+(\.[0-9]+)+(\.[0-9]+)?\.?(\w)*/ + branches: + ignore: /.*/ - notify_rolling: requires: - build From 187b5c7b19f3926e717ba37a005d5a3832804d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Basler?= Date: Fri, 27 Nov 2026 16:25:58 +0100 Subject: [PATCH 15/15] ci(workflow): remove listener on temporary branch --- .github/workflows/ci-pipeline.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index a46789e6..7c31a3b4 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -4,8 +4,6 @@ on: push: branches: - "main" - # Temporary - - "ci/391-migrate-ci-pipeline-from-circleci-to-github-actions" tags: - "*"