You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(bootstrap): address Reviewer findings on PR #74 (RAN-47)
All 8 review findings on the bootstrap PR addressed in one commit on the
same branch — squash-merge stays clean.
Findings → fixes:
1. pom.xml: dependency-check:check was configured (failBuildOnCVSS=7) but
not bound to a Maven phase, so `mvn verify` never ran the gate.
Added an `<execution>` binding `check` to `verify` (RAN-46 AC #5).
2. shared/runbooks/release.md §3: the runbook said "push v* tag → workflow
runs", but `release-java.yml` is `workflow_dispatch` only and the
workflow itself creates and pushes the tag. Rewrote §3 to use
`gh workflow run release-java.yml -f version=X.Y.Z` and to describe the
actual deploy → tag → GH Release order. Direct tag-push without the
workflow does not publish.
3. scripts/setup-git-signed.sh: removed the hard-coded "Amit Kumar" /
"ak.nitrr13@gmail.com" defaults. Identity now resolves from env vars,
then `git config --global` (user.name / user.email / user.signingkey),
and the script errors out (rc=4) with a clear remediation message if
neither is set. No more silent maintainer-misattribution.
4. shared/runbooks/first-time-setup.md §2: replaced the invalid
`git verify-commit --raw -` (which expects a commit id, not stdin) with
a working two-step pattern that captures the signed object and verifies
it via `git verify-commit "$sig_commit"` + `git log -1 --pretty=%G?`.
5. shared/runbooks/first-time-setup.md §3 quick-loop: dropped the
contradictory `-DskipTests test` (which skipped every test). Now uses
`-Dspotbugs.skip=true -Ddependency-check.skip=true` to keep the inner
loop fast WITHOUT skipping tests, and adds a note explaining the prior
draft was wrong.
6. shared/runbooks/first-time-setup.md §5: removed Scorecard from the
"required PR-green check" list — Scorecard runs on push-to-main + weekly
cron, never on pull_request, and is intentionally non-gating per
engineering-standards.md §1. Replaced "signed-commits status check"
with the correct framing (branch-protection rejects unsigned commits,
not a separate status check).
7. SECURITY.md: replaced the stale `.github/workflows/codeql.yml` link
(workflow removed in 35762b1) with a description of the repo-level
CodeQL default setup that supersedes it. Also clarified that the
workflow-driven codeql.yml was attempted and removed because of the
default-setup SARIF-upload conflict.
8. shared/runbooks/release.md §2 pre-release checklist: dropped the
"OSV-Scanner workflow latest run green" line (no such workflow). The
dependency audit gate is now the bound `mvn verify` from fix#1, with
a Dependabot security-tab cross-check.
Refs RAN-47 (Reviewer findings comment 5a572640).
-GitHub repo-level **CodeQL default setup** (java-kotlin + javascript-typescript + actions) — code scanning, SARIF in the Security tab. Configured under repo Settings → Code security → Code scanning, not via a workflow file (a workflow-driven `codeql.yml` was tried and removed because GitHub rejects duplicate SARIF uploads when default setup is on for the same language).
`git verify-commit` operates on a commit object id, not stdin — capturing the
71
+
output of `git commit-tree -S` first and then verifying that id is the right
72
+
shape. If the verification line errors with "no principal matched", point git
73
+
at an `allowed_signers` file: see `scripts/setup-git-signed.sh` output for the
74
+
canonical template.
75
+
67
76
---
68
77
69
78
## 3. Build, test, run
@@ -79,11 +88,14 @@ This runs the full pipeline: unit tests, integration tests, jacoco coverage gate
79
88
For a faster inner loop while iterating:
80
89
81
90
```bash
82
-
mvn -B -ntp -DskipTests test# unit + integration, no plugins
83
-
mvn -B -ntp -Dtest=SomeDetectorTest test# single test
84
-
mvn -B -ntp -DskipTests=true package # JAR only
91
+
mvn -B -ntp test \
92
+
-Dspotbugs.skip=true -Ddependency-check.skip=true # unit + integration, no static analysis / CVE plugins
93
+
mvn -B -ntp -Dtest=SomeDetectorTest test# single test class
94
+
mvn -B -ntp -DskipTests=true package # JAR only, no tests
85
95
```
86
96
97
+
The first command **does run tests** — earlier drafts incorrectly passed `-DskipTests` here, which would have skipped them. Use `-Dspotbugs.skip` / `-Ddependency-check.skip` to keep the inner loop fast without dropping test coverage.
98
+
87
99
Smoke-test the CLI end-to-end against this repo:
88
100
89
101
```bash
@@ -129,8 +141,9 @@ gh pr create --fill --base main
129
141
130
142
Branch protection on `main` requires:
131
143
- A Codex review approval from TechLead (or delegate).
132
-
- CI green: `ci-java.yml`, Sonar Quality Gate, Scorecard workflow, signed-commits status check.
133
-
- All commits in the PR signed.
144
+
- CI green on the PR: `ci-java.yml` (build + jacoco 85% + dependency-check + Sonar), the repo-level CodeQL default-setup checks (`Analyze (java-kotlin)`, `Analyze (javascript-typescript)`, `Analyze (actions)`), Socket Security, SonarCloud Code Analysis.
145
+
- All commits in the PR signed (branch protection rejects unsigned commits — there is no separate "signed-commits" status check).
146
+
- OpenSSF Scorecard runs on push-to-`main` and a weekly cron, **not** on PRs, and is intentionally non-gating per [`engineering-standards.md`](engineering-standards.md) §1.
134
147
135
148
Force-push to `main` is disabled. Direct pushes are disabled. Squash-merge is the default and only path.
Copy file name to clipboardExpand all lines: shared/runbooks/release.md
+15-18Lines changed: 15 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Run BEFORE creating the tag:
29
29
1.`main` is green: `gh run list --branch main --workflow ci-java.yml --limit 1` → `success`.
30
30
2. SonarCloud Quality Gate: `gh api /repos/RandomCodeSpace/codeiq/actions/runs?branch=main --jq '.workflow_runs[0].conclusion'` and SonarCloud project page both green.
4. Dependency audit clean: `mvn -B -ntp clean verify` exits 0 (the OWASP `dependency-check:check` goal is bound to `verify` and fails the build on CVSS ≥ 7 — see `pom.xml`). Cross-check with the Dependabot security tab for any open advisories.
33
33
5. SpotBugs clean: `mvn spotbugs:check` exits 0.
34
34
6. CHANGELOG entry drafted under `[Unreleased]` and ready to promote.
35
35
7. Working copy of `main` is clean (`git status --porcelain` empty).
@@ -39,33 +39,30 @@ Run BEFORE creating the tag:
39
39
40
40
## 3. Cut a release (canonical path)
41
41
42
-
Driven by `release-java.yml`triggered on a `v*`tag push.
42
+
Driven by `release-java.yml`via **manual `workflow_dispatch`** with a `version` input. The workflow itself bumps `pom.xml`, deploys to Maven Central, then creates and pushes the `vX.Y.Z`tag and the GitHub Release.
# 2. Trigger the release workflow with the target version
52
+
gh workflow run release-java.yml --ref main -f version=X.Y.Z
53
+
54
+
# 3. Watch it run (workflow handles versions:set, deploy, tag, GH Release)
55
+
gh run watch $(gh run list --workflow release-java.yml --limit 1 --json databaseId --jq '.[0].databaseId')
59
56
```
60
57
61
58
`release-java.yml` then:
62
-
1.Builds with `mvn -B -ntp clean verify` (full test suite + jacoco gate).
63
-
2.Signs artifacts with `MAVEN_GPG_*` secrets.
64
-
3.Publishes to Maven Central via `central-publishing-maven-plugin`.
65
-
4.Uploads `code-iq-X.Y.Z-cli.jar` to a new GitHub Release.
66
-
5.Records SBOM (CycloneDX) and provenance (SLSA) as Release assets.
59
+
1.Sets the pom version to `X.Y.Z` via `mvn versions:set`.
60
+
2.Deploys to Sonatype Central with the `release` profile (`mvn -P release -B clean deploy`) — runs the full quality gate on the way (jacoco 85% + SpotBugs + dependency-check).
61
+
3.Signs artifacts with `MAVEN_GPG_*` secrets.
62
+
4.Creates the annotated tag `vX.Y.Z` and pushes it (the workflow has `contents: write`).
63
+
5.Cuts a GitHub Release from the tag and uploads `code-iq-X.Y.Z-cli.jar`, with auto-generated release notes.
67
64
68
-
Track it: `gh run watch $(gh run list --workflow release-java.yml --limit 1 --json databaseId --jq '.[0].databaseId')`.
65
+
If you prefer to drive the tag yourself (fork or downstream cut), `release-java.yml`'s `workflow_dispatch` is still the canonical entrypoint — push the tag manually only after the deploy succeeds. Direct tag-push without the workflow does **not** publish.
0 commit comments