From a704eefbb0c5562b70332dad497e55a7a19cdfdb Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 09:26:03 +0000 Subject: [PATCH 1/5] ci: call shared Python workflows (#385) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 76 +++++++++++++++++++++---------------- .github/workflows/lint.yml | 32 ---------------- 2 files changed, 43 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8a0a7b..16f0d4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,50 +29,47 @@ permissions: contents: read jobs: - linting: - name: Reuse linting job - uses: ./.github/workflows/lint.yml + lint: + uses: reqstool/.github/.github/workflows/python-lint.yml@ci/385-shared-python-build # SPIKE: pin to release SHA - build: - needs: linting + # Client-specific checks that are not part of the shared Python lint. + schema-checks: + name: Schema and codegen checks runs-on: ubuntu-latest - outputs: - python-minor: ${{ steps.python-minor.outputs.version }} steps: - # Full history and tags: hatch-vcs derives the version from git state, so a - # shallow clone would build the wrong number rather than fail. - name: Check out source repository uses: actions/checkout@v7.0.1 with: persist-credentials: false - fetch-depth: 0 - fetch-tags: true - ref: ${{ inputs.ref || github.ref }} - name: Set up Python uses: actions/setup-python@v7.1.0 with: python-version: "3.13.18" - - name: Export Python minor version - id: python-minor - run: echo "version=$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])')" >> "$GITHUB_OUTPUT" - - name: Install dependencies + - name: Install pip package(s) # renovate: datasource=pypi depName=hatch run: pip install hatch==1.18.2 - - name: Run unit tests - run: hatch run dev:pytest --junitxml=build/junit.xml --cov=reqstool --cov-report=html -o junit_family=xunit2 - - name: Build project - run: hatch build - - name: Test reqstool-client from build by installing and running - run: | - WHL_FILE=$(ls dist/*.whl) - pip install $WHL_FILE - reqstool status local -p docs/reqstool - # Upload artifacts for later use - - name: Upload Artifacts - uses: actions/upload-artifact@v7.0.2 - with: - name: ${{ inputs.artifact-name || 'dist' }} - path: dist/ + - name: Install pip package check-jsonschema + # renovate: datasource=pypi depName=check-jsonschema + run: pip install check-jsonschema==0.39.0 + - name: Validate JSON Schemas + run: check-jsonschema --verbose --schemafile "https://json-schema.org/draft/2020-12/schema" src/reqstool/resources/schemas/*/* + - name: Validate generated Pydantic models are up to date + run: hatch run dev:codegen-check + + build: + needs: [lint, schema-checks] + uses: reqstool/.github/.github/workflows/python-build-hatch.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + with: + coverage-source: reqstool + ref: ${{ inputs.ref }} + artifact-name: ${{ inputs.artifact-name || 'dist' }} + + reqstool: + needs: build + uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + with: + ref: ${{ inputs.ref }} + build-artifact: ${{ inputs.artifact-name || 'dist' }}-build # Installs the wheel built above (on Linux) on every supported OS and runs the CLI over the # reqstool-regression fixtures, so platform-specific breakage (e.g. #457 on Windows) turns CI red. @@ -102,8 +99,9 @@ jobs: - name: Set up Python uses: actions/setup-python@v7.1.0 with: - # major.minor of the build job's Python: a patch version may be missing on macOS/Windows runners - python-version: ${{ needs.build.outputs.python-minor }} + # major.minor of the shared build's Python (python-build-hatch.yml `python-version`, 3.15.x): a patch + # version may be missing on macOS/Windows runners. The shared workflow exposes no output for it. + python-version: "3.15" - name: Download built wheel uses: actions/download-artifact@v8.0.2 with: @@ -144,3 +142,15 @@ jobs: echo "::endgroup::" done exit $status + + # Single stable required check: survives job renames and matrix changes. + ci: + if: ${{ always() }} + needs: [lint, schema-checks, build, reqstool, smoke, smoke-compare] + runs-on: ubuntu-latest + steps: + - name: Fail unless every needed job succeeded + env: + NEEDS: ${{ toJSON(needs) }} + run: | + echo "$NEEDS" | python3 -c 'import json,sys; r={k:v["result"] for k,v in json.load(sys.stdin).items()}; print(r); sys.exit(0 if all(v=="success" for v in r.values()) else 1)' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 4aefc33..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Lint (black and flake8) -on: - workflow_dispatch: - workflow_call: - -permissions: - contents: read - -jobs: - linting: - runs-on: ubuntu-latest - steps: - - name: Check out source repository - uses: actions/checkout@v7.0.1 - - name: Set up Python - uses: actions/setup-python@v7.1.0 - with: - python-version: "3.13.18" - - name: Install pip package(s) - # renovate: datasource=pypi depName=hatch - run: pip install hatch==1.18.2 - - name: Run black formatter check - run: hatch run dev:black --check --verbose src tests - - name: Run flake8 linter - run: hatch run dev:flake8 - - name: Install pip package check-jsonschema - # renovate: datasource=pypi depName=check-jsonschema - run: pip install check-jsonschema==0.39.0 - - name: Validate JSON Schemas - run: check-jsonschema --verbose --schemafile "https://json-schema.org/draft/2020-12/schema" src/reqstool/resources/schemas/*/* - - name: Validate generated Pydantic models are up to date - run: hatch run dev:codegen-check From 4bf5bed55f02f7a053ec8cdf26666a566d21134c Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 09:32:33 +0000 Subject: [PATCH 2/5] ci: drop ref input from shared verify call (#385) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16f0d4e..cb64a15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,6 @@ jobs: needs: build uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@ci/385-shared-python-build # SPIKE: pin to release SHA with: - ref: ${{ inputs.ref }} build-artifact: ${{ inputs.artifact-name || 'dist' }}-build # Installs the wheel built above (on Linux) on every supported OS and runs the CLI over the From 63fcd03846381ac6af4fa375a8d64872a6ac0105 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 07:44:01 +0000 Subject: [PATCH 3/5] ci: pin shared workflows to the .github 1.3.0 SHA Pin to 193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 (# 1.3.0). The 1.3.0 tag is pending; Renovate resolves it once it exists. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb64a15..8d3d2e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ permissions: jobs: lint: - uses: reqstool/.github/.github/workflows/python-lint.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + uses: reqstool/.github/.github/workflows/python-lint.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 # Client-specific checks that are not part of the shared Python lint. schema-checks: @@ -58,7 +58,7 @@ jobs: build: needs: [lint, schema-checks] - uses: reqstool/.github/.github/workflows/python-build-hatch.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + uses: reqstool/.github/.github/workflows/python-build-hatch.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 with: coverage-source: reqstool ref: ${{ inputs.ref }} @@ -66,7 +66,7 @@ jobs: reqstool: needs: build - uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 with: build-artifact: ${{ inputs.artifact-name || 'dist' }}-build From 8e5620ace832d4f784c185936f02be902eec0bb5 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 09:06:40 +0000 Subject: [PATCH 4/5] chore: drop explanatory comments The PR description and commits carry the rationale. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d3d2e4..acc0fda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,6 @@ jobs: lint: uses: reqstool/.github/.github/workflows/python-lint.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 - # Client-specific checks that are not part of the shared Python lint. schema-checks: name: Schema and codegen checks runs-on: ubuntu-latest @@ -98,8 +97,6 @@ jobs: - name: Set up Python uses: actions/setup-python@v7.1.0 with: - # major.minor of the shared build's Python (python-build-hatch.yml `python-version`, 3.15.x): a patch - # version may be missing on macOS/Windows runners. The shared workflow exposes no output for it. python-version: "3.15" - name: Download built wheel uses: actions/download-artifact@v8.0.2 @@ -142,7 +139,6 @@ jobs: done exit $status - # Single stable required check: survives job renames and matrix changes. ci: if: ${{ always() }} needs: [lint, schema-checks, build, reqstool, smoke, smoke-compare] From 233b74ad63f754936fe45a087ef3c14e43ba7e1a Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 09:21:05 +0000 Subject: [PATCH 5/5] ci: pin shared workflows to .github 1.2.2 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acc0fda..25ac3c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ permissions: jobs: lint: - uses: reqstool/.github/.github/workflows/python-lint.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 + uses: reqstool/.github/.github/workflows/python-lint.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2 schema-checks: name: Schema and codegen checks @@ -57,7 +57,7 @@ jobs: build: needs: [lint, schema-checks] - uses: reqstool/.github/.github/workflows/python-build-hatch.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 + uses: reqstool/.github/.github/workflows/python-build-hatch.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2 with: coverage-source: reqstool ref: ${{ inputs.ref }} @@ -65,7 +65,7 @@ jobs: reqstool: needs: build - uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 + uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2 with: build-artifact: ${{ inputs.artifact-name || 'dist' }}-build