From 2e3ad91269b9e43ad4aadc480bde67c4feacd263 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 04:14:23 +0000 Subject: [PATCH 1/7] ci: call shared python workflows (spike for reqstool/.github#385) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 99 +++++++++++++++---------------------- 1 file changed, 40 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08510b8..b85be16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,67 +29,48 @@ 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 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - reqstool-source: [pypi, main] - 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: Install dependencies - # renovate: datasource=pypi depName=hatch - run: pip install hatch==1.18.2 - - name: Run tests - run: hatch run dev:pytest --junitxml=build/junit.xml --cov=reqstool_python_decorators --cov-report=xml:build/coverage.xml - - name: Build project - run: hatch build - - name: Self-apply own decorator processor to own src/tests - # Relies on `hatch build` (above) not cleaning build/ -- annotations.yml lands - # alongside the junit/coverage output from the "Run tests" step, and - # reqstool_config.yml expects to find both there. If hatch build ever starts - # cleaning build/, move the pytest output dir outside of it. - run: hatch run dev:python scripts/generate_annotations.py - - name: Install reqstool - uses: reqstool/.github/.github/actions/install-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 - with: - reqstool-source: ${{ matrix.reqstool-source }} - - name: Validate reqstool spec completeness - # not yet available in the latest PyPI release; supplementary to (not a - # replacement for) the `reqstool status --fail-if-incomplete` gate below, which - # is the actual required check on the pypi leg - if: matrix.reqstool-source == 'main' - uses: reqstool/.github/.github/actions/validate-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 - - name: Run reqstool status - # Required gate on both matrix legs -- fails the build unless every - # requirement is implemented and verified. - uses: reqstool/.github/.github/actions/reqstool-status@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 - with: - fail-if-incomplete: "true" - # Upload artifacts for later use - - name: Upload Artifacts - if: matrix.reqstool-source == 'pypi' - uses: actions/upload-artifact@v7.0.2 - with: - name: ${{ inputs.artifact-name || 'dist' }} - path: dist/ + needs: lint + uses: reqstool/.github/.github/workflows/python-build-hatch.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + with: + coverage-source: reqstool_python_decorators + ref: ${{ inputs.ref }} + artifact-name: ${{ inputs.artifact-name || 'dist' }} + # Relies on build/ surviving `hatch build`: annotations.yml lands next to + # the junit/coverage output, and reqstool_config.yml expects them there. + post-test-command: hatch run dev:python scripts/generate_annotations.py + + 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 + + smoke: + needs: build + uses: reqstool/.github/.github/workflows/python-smoke.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + with: + ref: ${{ inputs.ref }} + dist-artifact: ${{ inputs.artifact-name || 'dist' }} + # Same self-apply run as the build job, but from the installed wheel on + # Windows/macOS: reads every src/tests file, writes annotations.yml (#109). + command: python scripts/generate_annotations.py validate-openspec: uses: reqstool/.github/.github/workflows/common-validate-openspec.yml@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 + + # Single stable required check: survives job renames and matrix changes. + ci: + if: ${{ always() }} + needs: [lint, build, reqstool, smoke, validate-openspec] + 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)' From 95c5926de72adf4b36158904b826961fb8575669 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 04:30:11 +0000 Subject: [PATCH 2/7] ci: run unit tests in the smoke job Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b85be16..d593155 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,9 +56,11 @@ jobs: with: ref: ${{ inputs.ref }} dist-artifact: ${{ inputs.artifact-name || 'dist' }} - # Same self-apply run as the build job, but from the installed wheel on - # Windows/macOS: reads every src/tests file, writes annotations.yml (#109). - command: python scripts/generate_annotations.py + # The unit tests on Windows/macOS: the #109 class of bug (platform default + # encoding) only shows with fixture files holding bytes undefined in cp1252, + # which the repo's own sources do not. + requirements: pytest==8.4.1 + command: pytest tests/unit tests/e2e validate-openspec: uses: reqstool/.github/.github/workflows/common-validate-openspec.yml@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 From 6d55610060ac2b6a85305587be73b5a307b000cf Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 09:24:10 +0000 Subject: [PATCH 3/7] ci: drop inline lint workflow in favour of the shared one (#385) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/lint.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 5a3020b..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,25 +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 From 034228ffc6499ebc816482fca26a8ae5ab5a4489 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 09:32:08 +0000 Subject: [PATCH 4/7] ci: stop passing ref to smoke and verify (#385) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d593155..fe7097c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,14 +47,12 @@ 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 smoke: needs: build uses: reqstool/.github/.github/workflows/python-smoke.yml@ci/385-shared-python-build # SPIKE: pin to release SHA with: - ref: ${{ inputs.ref }} dist-artifact: ${{ inputs.artifact-name || 'dist' }} # The unit tests on Windows/macOS: the #109 class of bug (platform default # encoding) only shows with fixture files holding bytes undefined in cp1252, From 83f6fd2902f1cc3d9baf0652d8f0602ed9b43dde Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 07:43:56 +0000 Subject: [PATCH 5/7] 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe7097c..fffc602 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,11 +30,11 @@ 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 build: needs: lint - 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_python_decorators ref: ${{ inputs.ref }} @@ -45,13 +45,13 @@ 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 smoke: needs: build - uses: reqstool/.github/.github/workflows/python-smoke.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + uses: reqstool/.github/.github/workflows/python-smoke.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 with: dist-artifact: ${{ inputs.artifact-name || 'dist' }} # The unit tests on Windows/macOS: the #109 class of bug (platform default From 521131ad086830cda0f2010df34e5666d7b819ff Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 09:06:34 +0000 Subject: [PATCH 6/7] 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 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fffc602..019c543 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,8 +39,6 @@ jobs: coverage-source: reqstool_python_decorators ref: ${{ inputs.ref }} artifact-name: ${{ inputs.artifact-name || 'dist' }} - # Relies on build/ surviving `hatch build`: annotations.yml lands next to - # the junit/coverage output, and reqstool_config.yml expects them there. post-test-command: hatch run dev:python scripts/generate_annotations.py reqstool: @@ -54,16 +52,12 @@ jobs: uses: reqstool/.github/.github/workflows/python-smoke.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 with: dist-artifact: ${{ inputs.artifact-name || 'dist' }} - # The unit tests on Windows/macOS: the #109 class of bug (platform default - # encoding) only shows with fixture files holding bytes undefined in cp1252, - # which the repo's own sources do not. requirements: pytest==8.4.1 command: pytest tests/unit tests/e2e validate-openspec: uses: reqstool/.github/.github/workflows/common-validate-openspec.yml@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 - # Single stable required check: survives job renames and matrix changes. ci: if: ${{ always() }} needs: [lint, build, reqstool, smoke, validate-openspec] From b4076cb08d5ce852a6cc4c1475b8ed603c83d65f Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 09:20:58 +0000 Subject: [PATCH 7/7] 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 019c543..862695a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,11 +30,11 @@ 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 build: needs: lint - 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_python_decorators ref: ${{ inputs.ref }} @@ -43,13 +43,13 @@ 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 smoke: needs: build - uses: reqstool/.github/.github/workflows/python-smoke.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 + uses: reqstool/.github/.github/workflows/python-smoke.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2 with: dist-artifact: ${{ inputs.artifact-name || 'dist' }} requirements: pytest==8.4.1