From 9cfd2b79ff5103cf7078471878cffb2a15b2c0c2 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 09:48:56 +0000 Subject: [PATCH 1/6] ci: use shared build and lint workflows Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .github/workflows/build.yml | 83 +++++++++++++++++-------------------- .github/workflows/lint.yml | 21 ---------- 2 files changed, 39 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9130ea8..7e914fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,51 +28,46 @@ permissions: contents: read jobs: - linting: - name: Check linting - uses: ./.github/workflows/lint.yml + lint: + uses: reqstool/.github/.github/workflows/java-lint.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - reqstool-source: [pypi, main] - steps: - # Full history and tags: Nisse derives the version from git state, so a - # shallow clone would build the wrong number rather than fail. - - uses: actions/checkout@v7.0.1 - with: - persist-credentials: false - fetch-depth: 0 - fetch-tags: true - ref: ${{ inputs.ref || github.ref }} - - name: Set up JDK - uses: actions/setup-java@v6.3.0 - with: - java-version: "21.0.12+8.0.LTS" - distribution: "temurin" - - name: Build and run tests - run: mvn clean verify - - name: Install plugin into local repository - run: mvn -DskipTests install - - name: Self-apply plugin to assemble dataset zip - run: | - VERSION=$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout) - mvn io.github.reqstool:reqstool-maven-plugin:${VERSION}:assemble-and-attach-zip-artifact \ - -Dreqstool.datasetPath=docs/reqstool \ - -Dreqstool.outputDirectory=target/reqstool - - 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 - if: matrix.reqstool-source == 'main' - uses: reqstool/.github/.github/actions/validate-reqstool@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 - - name: Run reqstool status - uses: reqstool/.github/.github/actions/reqstool-status@6fc8d3e3d4c3fdf7a83cb7b7a274e4761486ca71 # 1.2.1 - with: - fail-if-incomplete: "true" + needs: lint + uses: reqstool/.github/.github/workflows/java-build-maven.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + with: + ref: ${{ inputs.ref }} + artifact-name: ${{ inputs.artifact-name || 'dist' }} + post-test-command: | + mvn --batch-mode -DskipTests install + VERSION=$(mvn --batch-mode -q help:evaluate -Dexpression=project.version -DforceStdout) + mvn --batch-mode io.github.reqstool:reqstool-maven-plugin:${VERSION}:assemble-and-attach-zip-artifact \ + -Dreqstool.datasetPath=docs/reqstool \ + -Dreqstool.outputDirectory=target/reqstool + + reqstool: + needs: build + uses: reqstool/.github/.github/workflows/common-reqstool-verify.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + with: + build-artifact: ${{ inputs.artifact-name || 'dist' }}-build + build-directory: target + + smoke: + needs: build + uses: reqstool/.github/.github/workflows/java-smoke.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + with: + command: mvn --batch-mode verify 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)' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index bd54626..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Lint - -on: - workflow_call: - -jobs: - linting: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v7.0.1 - - - name: Set up JDK - uses: actions/setup-java@v6.3.0 - with: - distribution: "temurin" - java-version: "21.0.12+8.0.LTS" - - - name: Run linting - run: mvn clean validate From 280dbd103f236b5e69c2c5891535524836a1489d Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 09:52:55 +0000 Subject: [PATCH 2/6] fix: make output and tests line-ending and path safe on Windows Write the annotations header with LF like the YAML body, pin test fixtures to LF, and resolve the zip resource through its URI instead of a URL path (invalid on Windows). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- .gitattributes | 2 ++ .../io/github/reqstool/plugins/maven/RequirementsToolMojo.java | 2 +- .../reqstool/plugins/maven/RequirementsToolMojoTests.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c252ff6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Test fixtures are compared byte for byte with generated output (LF), so never CRLF-translate them. +src/test/resources/** text eol=lf diff --git a/src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java b/src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java index 29b7ab6..a6c518c 100644 --- a/src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java +++ b/src/main/java/io/github/reqstool/plugins/maven/RequirementsToolMojo.java @@ -226,7 +226,7 @@ private void writeCombinedOutputToFile(File outputFile, JsonNode combinedOutputN try (Writer writer = new PrintWriter( new OutputStreamWriter(new FileOutputStream(outputFile), StandardCharsets.UTF_8))) { - writer.write(YAML_LANG_SERVER_SCHEMA_ANNOTATIONS + System.lineSeparator()); + writer.write(YAML_LANG_SERVER_SCHEMA_ANNOTATIONS + "\n"); yamlMapper.writeValue(writer, combinedOutputNode); } } diff --git a/src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java b/src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java index 0dba365..60355ea 100644 --- a/src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java +++ b/src/test/java/io/github/reqstool/plugins/maven/RequirementsToolMojoTests.java @@ -91,7 +91,7 @@ void testCombine() throws IOException { void testAssembleZipArtifact() throws Exception { ClassLoader classLoader = getClass().getClassLoader(); URL resourcePath = classLoader.getResource("zip"); - Path zipResourcePath = Paths.get(resourcePath.getFile()); + Path zipResourcePath = Paths.get(resourcePath.toURI()); RequirementsToolMojo mojo = new RequirementsToolMojo(); From 26ee21d3c3d51fee8583a4d9c0d97510cc7ca793 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Sun, 22 Nov 2026 10:09:38 +0000 Subject: [PATCH 3/6] build: compile for Java 25, the latest LTS Compile target now equals the CI JDK. Consumers need Java 25 or newer to run the plugin or processor. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Mt2FAXPoMhrbjtWKhBTwZM Signed-off-by: Jimisola --- CONTRIBUTING.md | 2 +- docs/modules/ROOT/pages/index.adoc | 2 +- pom.xml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cced6c0..5483261 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ For DCO sign-off, commit conventions, and code review process, see the organizat ## Prerequisites -- Java 21+ +- Java 25+ - Maven 3.9+ - [reqstool](https://github.com/reqstool/reqstool-client) (`pipx install reqstool`) - [OpenSpec](https://github.com/Fission-AI/OpenSpec) (`npm install -g @fission-ai/openspec`) diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index bd7e4b0..b28e91a 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -70,7 +70,7 @@ Run `mvn verify` and the ZIP artifact will be created automatically. == Prerequisites * Maven 3.9+ -* Java 21+ +* Java 25+ * A `requirements.yml` file in the dataset directory (default: `reqstool/`) == License diff --git a/pom.xml b/pom.xml index 02c405e..95dd1a4 100644 --- a/pom.xml +++ b/pom.xml @@ -48,9 +48,9 @@ UTF-8 - 21 - 21 - 21 + 25 + 25 + 25 From 10994a0faeacd9d246b23b47dffa780d3307ada8 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 07:44:05 +0000 Subject: [PATCH 4/6] 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 7e914fe..06de9d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,11 +29,11 @@ permissions: jobs: lint: - uses: reqstool/.github/.github/workflows/java-lint.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + uses: reqstool/.github/.github/workflows/java-lint.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 build: needs: lint - uses: reqstool/.github/.github/workflows/java-build-maven.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + uses: reqstool/.github/.github/workflows/java-build-maven.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 with: ref: ${{ inputs.ref }} artifact-name: ${{ inputs.artifact-name || 'dist' }} @@ -46,14 +46,14 @@ 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 build-directory: target smoke: needs: build - uses: reqstool/.github/.github/workflows/java-smoke.yml@ci/385-shared-python-build # SPIKE: pin to release SHA + uses: reqstool/.github/.github/workflows/java-smoke.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 with: command: mvn --batch-mode verify From 38d287efe631f35c30024b8e95c93d9623135adc Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 09:06:44 +0000 Subject: [PATCH 5/6] 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 --- .gitattributes | 1 - .github/workflows/build.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index c252ff6..d0369b7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ -# Test fixtures are compared byte for byte with generated output (LF), so never CRLF-translate them. src/test/resources/** text eol=lf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06de9d0..375b211 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,6 @@ jobs: 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 e2df2bcced778595f1c8c63142adc2a07a4a0bb9 Mon Sep 17 00:00:00 2001 From: Jimisola Date: Mon, 23 Nov 2026 09:21:09 +0000 Subject: [PATCH 6/6] 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 375b211..ce668a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,11 +29,11 @@ permissions: jobs: lint: - uses: reqstool/.github/.github/workflows/java-lint.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 + uses: reqstool/.github/.github/workflows/java-lint.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2 build: needs: lint - uses: reqstool/.github/.github/workflows/java-build-maven.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 + uses: reqstool/.github/.github/workflows/java-build-maven.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2 with: ref: ${{ inputs.ref }} artifact-name: ${{ inputs.artifact-name || 'dist' }} @@ -46,14 +46,14 @@ 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 build-directory: target smoke: needs: build - uses: reqstool/.github/.github/workflows/java-smoke.yml@193abb8e7ad36805d5fe7695f8fa5e0a4b6f8da7 # 1.3.0 + uses: reqstool/.github/.github/workflows/java-smoke.yml@91cd368066d5458b5d46bdf34c4d8ca483f6633f # 1.2.2 with: command: mvn --batch-mode verify