Compare commits

..
Author SHA1 Message Date
james.maesandClaude Fable 5.1 53e9dfd7fc feat: publish qqq-core, the shared dist-tag and CLI platform lanes (#166)
QRun-IO/ci-policy: ci / fork-guard (push) Skipped
QRun-IO/ci-policy: ci / gradle-0 (push) Skipped
QRun-IO/ci-policy: ci / java-docker-1 (push) Skipped
QRun-IO/ci-policy: ci / java-maven-2 (push) Skipped
QRun-IO/ci-policy: ci / node-3 (push) Skipped
QRun-IO/ci-policy: ci / node-4 (push) Skipped
QRun-IO/ci-policy: ci / not-enrolled (push) Skipped
QRun-IO/ci-policy: Shared source and config CI / verify (push) Successful in 15s
QRun-IO/ci-policy: Shared source and config CI / secrets (push) Successful in 15s
QRun-IO/ci-policy: Shared source and config CI / gate (push) Successful in 11s
QRun-IO/ci-policy: ci / source-config-5 (push) Successful in 23m13s
QRun-IO/ci-policy: ci / ci-result (push) Successful in 6s
Promotes develop to main. The cli profile publishes @qrun-io/qqq-core, shares one npm dist-tag across the four qqq-cli packages (latest only when every version is final), accepts the opt-in platforms manifest key for macOS arm64 and Windows x64 lanes, runs npm run lint in verify, and moves the Node image to cimg/node:22.23; plus the 83 other develop commits since v0.8.32. The tree equals develop's; main's divergent squash history is reconciled by the merge in the release branch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 04:25:58 -06:00
james.maesandCodex a7c3b2a662 fix: publish shared Voyage live GitOps integration (#158)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 13:36:27 -05:00
james.maesandCodex cabf224967 fix: publish Voyage digest and release validation (#156)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 13:06:03 -05:00
james.maesandCodex 5d86b7cca6 fix: publish Voyage configuration parsing correction (#154)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 12:48:57 -05:00
james.maesandCodex 58b1fd0f01 fix: publish Voyage CD and release target fixes (#152)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 12:33:52 -05:00
james.maesandCodex 6ab85cc65b fix: publish verified source-head and boolean fixes (#150)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 05:12:10 -05:00
james.maesandCodex 2056053ac0 perf: publish verified Maven analysis reuse (#147)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 04:36:45 -05:00
james.maesandCodex 8b138ce372 perf: publish lean Core dependency assembly (#145)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 03:31:02 -05:00
james.maesandCodex 4c52053ee0 fix: publish repository-wide cancellation eligibility (#143)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 02:05:04 -05:00
james.maesandCodex 9b150f769b fix: publish reliable coordinator tool installation (#141)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 01:42:12 -05:00
james.maesandCodex 48d648751b feat: publish central CircleCI cost settings (#139)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 01:30:50 -05:00
james.maesandCodex 266ee6db53 feat: publish shared native consumer recognition (#137)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 00:38:38 -05:00
james.maesandCodex 434be19c65 feat: publish shared template renderer working-directory fix (#135)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 00:15:49 -05:00
james.maesandCodex bf962c79d7 feat: publish shared application-template verification (#133)
Co-authored-by: Codex <noreply@openai.com>
2026-10-22 00:00:01 -05:00
james.maesandCodex c77891e63d feat: publish shared Homebrew validation (#131)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 23:35:27 -05:00
james.maesandCodex 98eb544670 feat: publish shared shell automation validation (#129)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 23:13:22 -05:00
james.maesandCodex f001c73cb0 feat: publish native GitOps enrollment support (#126)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 22:56:15 -05:00
james.maesandCodex 736ab0e985 feat: publish complete centralized marketing validation (#124)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 22:26:07 -05:00
james.maesandCodex ee3cc63cdd feat: publish the shared Voyage verification gate (#122)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 22:09:03 -05:00
james.maesandCodex d61e7ac070 fix: verify marketing branches and concrete Node images (#120)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 21:54:11 -05:00
james.maesandCodex c8221161d4 fix: remove fabricated marketing coverage jobs (#118)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 21:38:54 -05:00
james.maesandCodex 4677cf8d17 feat: publish shared Node artifacts and native gate recognition (#116)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 21:32:55 -05:00
james.maesandCodex bbca434b39 feat: enforce five additional shared pipeline profiles (#113)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 21:12:28 -05:00
james.maesandCodex 66b93dccce feat: support combined QBit hotfix and integration filter (#111)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 21:03:57 -05:00
james.maesandCodex a53af9ca33 fix: use compatible CLI for fleet reconciliation (#109)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 20:41:17 -05:00
james.maesandCodex 978d6939d7 feat: run central fleet reconciliation (#107)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 20:30:33 -05:00
james.maesandCodex 0131a1f415 feat: centralize consumer enrollment and enforcement (#103)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 20:02:39 -05:00
james.maesandCodex 5bdda2f8c9 fix: propagate Maven analysis failures (#96)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 19:10:29 -05:00
james.maesandCodex 7b1756818f fix: avoid package publication for frontend CI maintenance (#93)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 17:33:45 -05:00
james.maesandCodex 68f17d3b09 fix: promote core snapshot publication gate (#91)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 17:18:35 -05:00
james.maesandCodex 130bc35ab0 fix: promote maintenance branch verification (#88)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 16:49:21 -05:00
james.maesandCodex 9b7161c3c8 fix: promote frontend build reuse (#86)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 16:25:10 -05:00
james.maesandCodex 482d72ce21 fix: promote scoped browser bootstrap (#83)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 15:47:32 -05:00
james.maesandCodex 45a439796f feat: promote managed patch tracks [minor] (#81)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 15:12:16 -05:00
james.maesandCodex 02f0b93e41 fix: promote Ubuntu-only Java bootstrap (#79)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 14:31:55 -05:00
james.maesandCodex 5e433ec629 fix: refresh only the newly added Temurin repository (#77)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 13:59:00 -05:00
james.maesandCodex cec7a76f12 feat: promote central QBit publication and workflow contracts (#74)
* ci: promote shared QBit publication and maintenance

Co-Authored-By: Codex <noreply@openai.com>

* fix: include verified Maven publication coordinates

Co-Authored-By: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
2026-10-21 13:19:23 -05:00
james.maesandCodex 8717d3536e release: promote central CI maintenance verification (#69)
* release: promote central CI maintenance verification

Co-Authored-By: Codex <noreply@openai.com>

* release: include central RC caller maintenance

Co-Authored-By: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
2026-10-21 12:01:39 -05:00
james.maesandCodex 8229a66bc5 release: promote policy profiles and CI resilience (#67)
Promote the exact tested develop tree bd5ee3bec5.

Co-authored-by: Codex <noreply@openai.com>
2026-10-21 11:32:55 -05:00
james.maesandCodex 9687feb36c release: promote shared branch policies and source scanning (#64)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 10:00:33 -05:00
james.maesandCodex 0fefe6a064 release: promote stable verification gates and RC completion (#60)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 03:21:14 -05:00
james.maesandCodex 2956e3ffce release: promote Android continuation fix and GitOps validation (#52)
Promote the exact checked develop tree on linear main history.

Co-authored-by: Codex <noreply@openai.com>
2026-10-20 22:03:14 -05:00
james.maesandCodex 0afe2a231f release: promote tested Android package authentication (#49)
* release: promote tested Android publisher and All regression coverage

Promote the exact tested develop tree while preserving the existing linear main history after earlier squash promotions.

Co-Authored-By: Codex <noreply@openai.com>

* ci: trigger scans for newly protected release target

The original promotion PR was created before main protection, so default CodeQL did not run. Reopening did not register a scan. Trigger the documented push event without changing the tested source tree.

Co-Authored-By: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
2026-10-20 21:48:10 -05:00
james.maesandCodex 65265e48a4 release: promote public All smoke evidence (#45)
* fix: build marketing site before browser checks (#40)

Run lint and one production build in every shared marketing workflow before Playwright and Lighthouse. Preserve the delegated delivery contracts.

Co-authored-by: Codex <noreply@openai.com>

* fix: use shared Maven credentials for Android publication (#42)

Use the existing organization context and Gradle environment properties. Fail before publishing if either credential is absent and avoid writing secrets to gradle.properties.

Co-authored-by: Codex <noreply@openai.com>

* fix: verify public All smoke evidence without secret export (#44)

Allow unauthenticated Circle API reads for public projects, preserve optional authentication and all fail-closed provenance checks.

Co-authored-by: Codex <noreply@openai.com>

* fix: default All releases to shared Circle smoke evidence (#35)

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
2026-10-20 21:15:15 -05:00
james.maesandCodex 49399deb3d release: promote shared Android publisher (#43)
* fix: build marketing site before browser checks (#40)

Run lint and one production build in every shared marketing workflow before Playwright and Lighthouse. Preserve the delegated delivery contracts.

Co-authored-by: Codex <noreply@openai.com>

* fix: use shared Maven credentials for Android publication (#42)

Use the existing organization context and Gradle environment properties. Fail before publishing if either credential is absent and avoid writing secrets to gradle.properties.

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
2026-10-20 21:09:48 -05:00
james.maesandCodex 9fe4257490 fix: build marketing site before browser checks (#40) (#41)
Run lint and one production build in every shared marketing workflow before Playwright and Lighthouse. Preserve the delegated delivery contracts.

Co-authored-by: Codex <noreply@openai.com>
2026-10-20 20:58:58 -05:00
james.maes 0965a45653 Merge pull request #39 from QRun-IO/develop
release: gate Voyage publication on artifact security scan
2026-10-20 20:42:00 -05:00
james.maes bfd41c8e0d Merge pull request #37 from QRun-IO/develop
release: ship shared policy continuation fix
2026-10-20 20:08:21 -05:00
james.maes 9c30a30754 Merge pull request #33 from QRun-IO/develop
release: promote Maven reporting and publication fixes
2026-10-20 19:23:39 -05:00
james.maes ee8953bd93 Merge pull request #31 from QRun-IO/develop
fix: release confirmed Central publication checks
2026-10-20 18:48:38 -05:00
james.maes 5bc3167286 Merge pull request #29 from QRun-IO/develop
fix: release resolved Maven publication POMs
2026-10-20 18:39:47 -05:00
james.maes 1a3368e119 Merge pull request #27 from QRun-IO/develop
release: fail closed on GitHub publication errors
2026-10-20 07:39:37 -05:00
james.maes 1ddba883c9 Merge pull request #25 from QRun-IO/develop
release: central QQQ CI and release workers [minor]
2026-10-20 07:17:29 -05:00
james.maes da8044d6f2 Merge pull request #23 from QRun-IO/develop
release: qqq-orb 0.6.9 (snapshot refresh)
2026-10-14 10:04:52 -05:00
james.maes 67ba48da1f Merge pull request #18 from QRun-IO/develop
release: publish orb 0.6.8 with CircleCI npm OIDC correction
2026-09-29 15:17:00 -05:00
james.maes 5196609974 Merge pull request #16 from QRun-IO/develop
release: publish npm Trusted Publishing support in orb 0.6.7
2026-09-29 14:18:44 -05:00
james.maes 49e09a6776 Merge pull request #14 from QRun-IO/develop
release: publish orb log-safety fix as 0.6.6
2026-09-29 13:38:22 -05:00
james.maes 748016f105 Merge pull request #10 from QRun-IO/develop
[minor] feat: add node_app_* job family
2026-02-27 12:59:51 -06:00
james.maes 6514aaa688 Merge pull request #8 from QRun-IO/develop
fix(ci): remove legacy tag-based publish workflow
2026-01-31 18:46:54 -06:00
james.maes 3ac47adc21 Merge pull request #7 from QRun-IO/develop
Release: auto-publish pipelines and security scanning
2026-01-31 18:40:34 -06:00
19 changed files with 1741 additions and 1616 deletions

No files matched your search

-2
View File
@@ -31,8 +31,6 @@ jobs:
languages.append('javascript-typescript')
if '.py' in extensions:
languages.append('python')
if '.rb' in extensions:
languages.append('ruby')
if any((name.startswith('.github/workflows/') and PurePosixPath(name).suffix in {'.yml', '.yaml'})
or PurePosixPath(name).name in {'action.yml', 'action.yaml'} for name in files if name):
languages.append('actions')
+6
View File
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- `cli` profile: publishes `@qrun-io/qqq-core` between the client and the conformance package on tag publishes, and refuses to publish when core's version differs from the CLI's or from the CLI's exact core dependency
- `cli` profile: one shared npm dist-tag for the four packages, `latest` when every version is final and `rc` when any has a prerelease part
- `cli` profile: optional `platforms: [macos-arm64, windows-x64]` manifest key that adds `cli_platform` lanes (new `cli_macos_arm64` and `cli_windows_x64` executors); a publishing tag's `cli_verify_publish` requires them. Off by default; other profiles reject the key
- `cli_verify.sh` runs `npm run lint` and diffs `packages/core/src/api/operations.ts` in the drift check; Node image `cimg/node:22.23`
### Fixed
- Maven compile, verify and frontend test steps pass `--update-snapshots`, so SNAPSHOT dependencies restored from the pom-checksum-keyed `~/.m2` cache are re-checked against the remote on every build instead of going stale
+9
View File
@@ -146,6 +146,15 @@ The orb auto-publishes via CircleCI:
Version bumps on main default to patch. Include `[minor]` or `[major]` in a commit message to bump accordingly.
## Voyage quality checks
The Voyage profile requires no Sonar service, account or token. Its existing
`mvn clean verify` runs the application's Checkstyle, PMD, SpotBugs and JaCoCo
checks alongside unit and integration tests. The profile retains those failures
as build failures and publishes their XML reports and `target/site` as artifacts.
The separate secret, SAST, dependency and image scans remain unchanged, as do
the dependencies that gate image publication and production GitOps updates.
## Project Status
**Maturity:** Stable, used across all QQQ repositories
+15 -5
View File
@@ -170,16 +170,26 @@ rather than silently ignored on these profiles. Existing direct jobs remain usab
## CLI profile
`cli` owns npm install, generated-client drift, build, unit tests and the real
Prism smoke contract through `cli_verify_publish`. Publication is **disabled by
`cli` owns npm install, generated-client and operations drift, build, unit tests,
lint and the real Prism smoke contract through `cli_verify_publish`. Publication is **disabled by
default**. To enable the existing v-tag publication, declare `publish.release:
true` plus `publish_context: VERIFIED_CONTEXT_NAME`, after verifying that an
existing trusted CircleCI context grants the required GitHub Packages permission.
No context name or credential availability is inferred from the former Actions
GITHUB_TOKEN. A tag must resolve to the current checkout; the job additionally
checks the client version before publishing its three fixed workspaces with the
existing rc dist-tag. Main pushes never publish. CLI docs-only is currently
rejected because generated-client verification remains mandatory.
checks the client version, and that core shares the CLI version and matches the
CLI's exact core dependency, before publishing its four fixed workspaces (client,
core, conformance, CLI) under one dist-tag: `rc` if any of the four versions has
a prerelease part, otherwise `latest`. Main pushes never publish.
CLI docs-only is currently rejected because generated-client verification remains
mandatory.
Optional platform lanes are **off by default**. `platforms: [macos-arm64,
windows-x64]` (either or both) adds one `cli_platform` job per entry (`npm ci`,
build, tests and lint on Node 20 via the image's nvm), named `cli-macos-arm64` /
`cli-windows-x64`. On a publishing tag `cli_verify_publish` requires them. The
lanes use the `m4pro.medium` macOS and `windows.medium` resource classes, which
the CircleCI plan must include.
## Conservative documentation routing
+6
View File
@@ -0,0 +1,6 @@
description: >
macOS arm64 executor for the opt-in CLI platform lane.
Requires the CircleCI plan to include the m4pro.medium resource class.
macos:
xcode: 16.4.0
resource_class: m4pro.medium
+7
View File
@@ -0,0 +1,7 @@
description: >
Windows x64 executor for the opt-in CLI platform lane. Steps run in Git Bash.
Requires the CircleCI plan to include the windows.medium resource class.
machine:
image: windows-server-2022-gui:current
resource_class: windows.medium
shell: bash.exe
+25
View File
@@ -0,0 +1,25 @@
description: >
Opt-in CLI platform lane: install, build, unit tests and lint on a non-Linux
executor. Rendered by the cli profile only for manifest platforms entries.
executor: << parameters.executor >>
parameters:
executor:
type: executor
description: "qqq-orb/cli_macos_arm64 or qqq-orb/cli_windows_x64"
node_version:
type: string
default: "20.20.2"
description: "Exact Node.js version installed with the image's nvm (the packages' engines floor)"
steps:
- checkout
- run:
name: Install Node.js << parameters.node_version >>
environment:
PARAM_NODE_VERSION: << parameters.node_version >>
command: <<include(scripts/cli_platform_node.sh)>>
- run:
name: Install locked CLI dependencies
command: npm ci
- run:
name: Build, tests and lint
command: npm run build && npm test && npm run lint
+3 -3
View File
@@ -1,13 +1,13 @@
description: >
Authoritative QQQ CLI validation, with optional tagged GitHub Packages publication.
Preserves generated-schema drift, build, tests and Prism smoke before publishing.
Preserves generated-schema drift, build, tests, lint and Prism smoke before publishing.
docker:
- image: cimg/node:22.12
- image: cimg/node:22.23
parameters:
publish:
type: boolean
default: false
description: "Publish three workspaces with rc dist-tag; requires matching version tag and GITHUB_TOKEN"
description: "Publish four workspaces (dist-tag rc for prereleases, latest for final versions); requires matching version tag and GITHUB_TOKEN"
steps:
- checkout
- restore_cache:
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# nvm is a shell function on macOS and not nounset-safe, so no -u here.
set -eo pipefail
# Install the exact Node.js version with the image's nvm (macOS login shell, nvm-windows in Git Bash).
nvm install "$PARAM_NODE_VERSION"
if [[ "$OSTYPE" == darwin* ]]; then
# Later steps start new login shells: make the version their default.
nvm alias default "$PARAM_NODE_VERSION"
else
# nvm-windows switches the global symlink, which later steps inherit.
nvm use "$PARAM_NODE_VERSION"
fi
node --version
npm --version
+18 -4
View File
@@ -2,10 +2,12 @@
set -euo pipefail
# Validate tag and fixed package destinations before asking for credentials.
node --input-type=commonjs - <<'NODE'
# Prints the npm dist-tag shared by all four packages.
dist_tag=$(node --input-type=commonjs - <<'NODE'
const fs = require('node:fs');
const packages = [
['packages/ui-api-client/package.json', '@qrun-io/qqq-ui-api-client'],
['packages/core/package.json', '@qrun-io/qqq-core'],
['packages/conformance/package.json', '@qrun-io/qqq-ui-api-conformance'],
['packages/cli/package.json', '@qrun-io/qqq-cli'],
];
@@ -19,7 +21,18 @@ const client = JSON.parse(fs.readFileSync(packages[0][0], 'utf8'));
if (!process.env.CIRCLE_TAG || process.env.CIRCLE_TAG !== 'v' + client.version) {
throw new Error('Version tag must match the client package version');
}
// The CLI pins core exactly and shares its version: publish only that pair.
const core = JSON.parse(fs.readFileSync(packages[1][0], 'utf8'));
const cli = JSON.parse(fs.readFileSync(packages[3][0], 'utf8'));
if (core.version !== cli.version || cli.dependencies?.['@qrun-io/qqq-core'] !== core.version) {
throw new Error('Core package version must match the CLI version and its exact core dependency');
}
// Final releases become latest; any prerelease part (e.g. -rc.1, -beta.2) in
// any of the four keeps every package on rc, so latest never points at an rc.
const versions = packages.map(([path]) => JSON.parse(fs.readFileSync(path, 'utf8')).version);
console.log(versions.some((version) => version.includes('-')) ? 'rc' : 'latest');
NODE
)
: "${GITHUB_TOKEN:?GitHub Packages write credential GITHUB_TOKEN is required}"
export NODE_AUTH_TOKEN="$GITHUB_TOKEN"
# Store only an environment substitution, never the token itself.
@@ -35,6 +48,7 @@ export NPM_CONFIG_USERCONFIG="$npm_config"
# Authentication alone is not proof of package write permission; hosted publish
# migration remains gated on verifying the actual context's package access.
npm whoami --registry https://npm.pkg.github.com >/dev/null
npm publish -w @qrun-io/qqq-ui-api-client --registry https://npm.pkg.github.com --tag rc
npm publish -w @qrun-io/qqq-ui-api-conformance --registry https://npm.pkg.github.com --tag rc
npm publish -w @qrun-io/qqq-cli --registry https://npm.pkg.github.com --tag rc
npm publish -w @qrun-io/qqq-ui-api-client --registry https://npm.pkg.github.com --tag "$dist_tag"
npm publish -w @qrun-io/qqq-core --registry https://npm.pkg.github.com --tag "$dist_tag"
npm publish -w @qrun-io/qqq-ui-api-conformance --registry https://npm.pkg.github.com --tag "$dist_tag"
npm publish -w @qrun-io/qqq-cli --registry https://npm.pkg.github.com --tag "$dist_tag"
+2 -1
View File
@@ -2,9 +2,10 @@
set -euo pipefail
npm run generate
git diff --exit-code -- packages/ui-api-client/src/schema.ts
git diff --exit-code -- packages/ui-api-client/src/schema.ts packages/core/src/api/operations.ts
npm run build
npm test
npm run lint
# Use the locked local executable; never download an unpinned npx fallback.
./node_modules/.bin/prism mock --port 4010 packages/ui-api-client/openapi/qqq-v1.json > prism.log 2>&1 &
+17 -3
View File
@@ -64,6 +64,10 @@ def boolean(data, key, default):
return value
# Opt-in CLI platform lanes: manifest entry -> orb executor.
CLI_PLATFORMS = {"macos-arm64": "qqq-orb/cli_macos_arm64", "windows-x64": "qqq-orb/cli_windows_x64"}
def load_manifest(path, setup_version):
raw = Path(path).read_text(encoding="utf-8")
if len(raw) > 65536:
@@ -84,7 +88,7 @@ def load_manifest(path, setup_version):
if profile == "qbit":
allowed += ("release_completion", "release_on_main", "release_tag_policy", "test_branch_policy")
elif profile == "cli":
allowed += ("publish_context",)
allowed += ("publish_context", "platforms")
elif profile in ("voyage", "frontend-next", "app-starter", "android", "mcp-policy", "repository-policy", "marketing", "application-template"):
allowed = ("profile", "orb_version", "default_branch")
elif profile == "all":
@@ -159,6 +163,9 @@ def load_manifest(path, setup_version):
raise ManifestError("CLI publication requires an explicitly verified context")
if profile == "cli" and boolean(data, "docs_only", False):
raise ManifestError("CLI currently requires full generated-client verification")
platforms = data.get("platforms", [])
if not isinstance(platforms, list) or any(not isinstance(x, str) or x not in CLI_PLATFORMS for x in platforms) or len(platforms) != len(set(platforms)):
raise ManifestError("platforms must be distinct entries of " + ", ".join(CLI_PLATFORMS))
tag_policy = data.get("release_tag_policy", "stable")
if tag_policy not in ("stable", "v-prefix", "none"):
raise ManifestError("Unsupported QBit release tag policy")
@@ -174,7 +181,7 @@ def load_manifest(path, setup_version):
"release_on_main": boolean(data, "release_on_main", False),
"release_tag_policy": tag_policy, "test_branch_policy": test_policy,
"docs_only": boolean(data, "docs_only", False),
"publish_context": publish_context,
"publish_context": publish_context, "platforms": platforms,
"publish": {key: boolean(publishing, key, key != "asciidoc" and profile not in ("cli", "all", "repository-policy", "application-template")
and not (profile == "qbit" and key in ("hotfix", "feature")))
for key in publish_keys}}
@@ -436,9 +443,16 @@ def cli_template(config, branch, tag):
options = {"publish": publish, "filters": filters}
if publish:
options["context"] = [config["publish_context"]]
platforms = config.get("platforms", [])
jobs = [{"qqq-orb/cli_platform": {"name": "cli-" + p, "executor": CLI_PLATFORMS[p], "filters": copy.deepcopy(filters)}}
for p in platforms]
if publish and platforms:
# Every opted-in platform must pass before packages are published.
options["requires"] = ["cli-" + p for p in platforms]
jobs.append({"qqq-orb/cli_verify_publish": options})
# CLI docs are still verified until its generated-client inputs get a dedicated policy.
return {"version": 2.1, "orbs": {"qqq-orb": "kingsrook/qqq-orb@" + config["orb_version"]},
"workflows": {"publish_release" if publish else "test_only": {"jobs": [{"qqq-orb/cli_verify_publish": options}]}}}
"workflows": {"publish_release" if publish else "test_only": {"jobs": jobs}}}
def marketing_template(config, branch, tag):
+18 -4
View File
@@ -18,7 +18,7 @@ import base64
import zlib
CORE_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNrtPdl22ziy7/0VuOrM2M6YpPclifvcxHbfeCar48z0nChXByJBiW1uJig7Ponn26cKACmKIilSluUlTr/IJFAo1F6FAvv7L4S0zlnEncBvPSNr+uoyPglpRD0Ww3N4+B2ewDMv8HtBp+v4VsdyaM8PeOyYw/cwIr4MGfzd6gaBy6jfWk5eWMymAzeGdzZ1OROPr+Tbls++xR1qmiyMqW+yTnfgWy7rDCK3CDSPI8fvFUFuteqA5X26trk1U8gRM5kTxtcC/YsC3wqibobkZ2dnGjzBgacAgUdBcGqoh/+7om/pu610phl4HvWtzGwe0yjWBNs0ZJsWR9RkWQR5zEKc8EU9QDB9Zp4GgzjFlqTDxfto4GcgqIc+CAsi+SFiIDmMBBc+s8hbXJnwwDxlMcmKzPLobIU5AnBswgdWQGgYaz2YNQgtGjOinZ2Rv/519JXjw/5cl2iX4jUXm4NRbR9gKpBEOyc+Zz4IMuE8BZFOhQEe2d7cJEbshYKwGWplME7AitlqJY0R8WMPBxMtmATDCCNmu06vH+tu0IO5A/acxH3mI+QQBCS2yQL7FgZRTD5+/Nh5+/7d/73vnBy/3D/sHH9+t/eXs3bbXyDt1pP9o+P9N4edf70//sfvb97/q/P39686RwftFvntN3z96uWn153Dd/9st9o+A21D+MzsB2RBMgSxBmEiKT5k4NNz6ri06wJKZuDHjj8AJkZOz/GpS97Sc+YTI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Kyu8Uw0H1gt7Gf+0oB0g+ntP0actjLqrxvUkSOwrrKrwxbdpROtG5FLab8zmYg1dHe5ZNKbL5PXJyQdRJFInYiQTJ9aoKL/CvlqM1KUcOlxEqyhU44Et6saCSAueQjK1kMryx1fgpLGmnyigEFvVBbqcEWcQ+mCkbzQwQQME05vJc7NQy87uBammnXWd2FD2Oy+2s0WjnubhqCRS0gsipYkQ7KJEONmg9iFzGo7848spFbJQsmcgM63sodC+oV7XSiSknpACtYnGBgGEFyHDksOMmaPOhzzHslwGDgJ0XiC5jE8HseM68aV6xHPEqVFOy1dWhMMoXK+6FjN6ViLXomGofxK/JFkPHB4KP5ruDkV/QhFnbLkUw9zer4PfpzP+WUK7Lm4T5bG4n25GNY7aTLvZU5SanJmqaFXR6pJrbFElCWB9xKaoZHiwTweLBPOuadzi6fwdqUakpL87xQgR0QDigJ1ATF25ki0CAl/5fPH1y6V6fmOWVGroWEm7jcVvFRcrEyg29w7AHaitnYjs5yDRWh1925H9LvgUApq2wyzBliQjOnBiPQPuLSKH0I5O4F1a3e5TN37v/w6QAGpBU8NsHXrS1hDEfRRlN7jEQ3jiAVqcQJDXh2gec6v5NjVIazja01DoX9JuBmkvl4nn+I4H2QG2NeCR+jSerpDNskKwTLaWluUxftE/WLH4RKV6xYwkJMusri4lzRflDRKKTIba/VivRARCs4fB+qLsjJC9D0K+sQ4AHMu/G7YgLI00KyCk3/YS6sq2BLnoFcgWvL0iUm3g5zLk8SD/mOJ/VxOucr0P+WVtKe0Sq709siJsRn4Uw3sMwzHLats1mx6Ko4oq92aq4tSjdxv1bgld+M9Wbk+spcqOe8wHk41yrtpbhdRmWlwzXk7UMYmL93HeXn76+CZPOj/oAEPDQdyJHY8hb2G99RWvWVaVSixagb0ni94pXrLine truncated
MATERIAL_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNq1lMtugzAQRfd8heV1TNRKlar8QXdVt02EXDMhDthGfqRBiH/vQAmPvKRU6g7PjH3PXI+pI0IoHEEEb6yj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KFkDslS5a4BkYZwW3nIpXVMiLgkHOxgEFVnpUoBs87k0NtF+Ez81yZ6ekq3AJvme/OEDpPL/Wcly/xz9BYMn66JmwPhWZY7NhFADAhgFkj9aEtQorKMydRfr5C1vLOIdh8uroYX3y/jn1++vSk2EY3k1CjpQKYNqnvsayKBJhEyrHJu4PioH2qWLNkM+gur5NFJv0JH9CSSGStAbt3PCkmCcxKsyByEHkDBRM4cUn6Fe23AljBt1AISVxNhcqpMAjcuxa4hqQPrUEG3rS+i5MzHW8X5UuorO3qewf/DTp3nXKRlo3BgHE8IVqqMe6Y5iTLgPSUgfVsjqaXOSDVwJAiw7t8gA6GS5ZQ3ebfWUI52dRZcujqF1VefE69m8CjhFWU2y4CN88sXp6CFWtf3xp365uP63imznAp1d2CHK5O3t7da9tHza1iuEdM6LqXv+4wWOGzcXgJTE8MkWnIo5zd4JtFob3jYfxvSFmDTa7M5NnuCSUmx3ilkKxcWB8hr5w653z69PH4v/SabCcM1uHcHhJZel6sRGJhx68w6SAykIB1nwu6qH/f+V/9p+KsYvQ8+jt9FUb/1cRwML5rDyafu/nuvacD+2Hc2nT/snNGl")))
ALL_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNq1T7EOgjAU3PmKpjNIdHQyJg4ukmDiYkwDUkxt4UkLEkP4dwsSUojootu7u/fu7lUWQvhOpWKQ4iVazOZ2w4AMlYaVnjXKsszRjCYwZ+lFSQDuduSKEM9fk8PG32+9HSFYn9StRwmSxwJKw0gHsfjhBGnkqAQ47RWtXaGNPHYY9YpZwQ2EIC8X47bbSYOkccRhwUTUhuRU5dhYqvu5rfglZ1xxFHMGSbE91G4SYiYmZUmzgkk6/LPTplsjdPrXD3EhxIcf3sk//sEy1QbVVm09Ad15mhY=")))
STARTER_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNp1UMGKwkAMvc9XlDmKtejR0yJ42MsKCl5EQnUzZbbTiZ0ZqiL9d1OpWqt7y3t5eS/JRUSRrNB5TVZOo8loPGwYcjvP8MI1o7IsY2aYkLm2mXdEedKSXwCL5QzW8+Xqe/EDIHmkvnkcyeXK0LFjFNAHIGvOD4rJP7plbVocPTrd7KSoLHwab2V7Kg7aIOxQkUPgi7RqZCo1Hod9rQ14Ci+ZnbQirdDGDjPtgzvHe4e/aINmI/ki3/ZslTaBH/m2W3N3mn3iuaMzy/s2n01Gg0T2BLX4Dz3re7UVd1SLWlwByepyJQ==")))
@@ -64,6 +64,10 @@ def boolean(data, key, default):
return value
# Opt-in CLI platform lanes: manifest entry -> orb executor.
CLI_PLATFORMS = {"macos-arm64": "qqq-orb/cli_macos_arm64", "windows-x64": "qqq-orb/cli_windows_x64"}
def load_manifest(path, setup_version):
raw = Path(path).read_text(encoding="utf-8")
if len(raw) > 65536:
@@ -84,7 +88,7 @@ def load_manifest(path, setup_version):
if profile == "qbit":
allowed += ("release_completion", "release_on_main", "release_tag_policy", "test_branch_policy")
elif profile == "cli":
allowed += ("publish_context",)
allowed += ("publish_context", "platforms")
elif profile in ("voyage", "frontend-next", "app-starter", "android", "mcp-policy", "repository-policy", "marketing", "application-template"):
allowed = ("profile", "orb_version", "default_branch")
elif profile == "all":
@@ -159,6 +163,9 @@ def load_manifest(path, setup_version):
raise ManifestError("CLI publication requires an explicitly verified context")
if profile == "cli" and boolean(data, "docs_only", False):
raise ManifestError("CLI currently requires full generated-client verification")
platforms = data.get("platforms", [])
if not isinstance(platforms, list) or any(not isinstance(x, str) or x not in CLI_PLATFORMS for x in platforms) or len(platforms) != len(set(platforms)):
raise ManifestError("platforms must be distinct entries of " + ", ".join(CLI_PLATFORMS))
tag_policy = data.get("release_tag_policy", "stable")
if tag_policy not in ("stable", "v-prefix", "none"):
raise ManifestError("Unsupported QBit release tag policy")
@@ -174,7 +181,7 @@ def load_manifest(path, setup_version):
"release_on_main": boolean(data, "release_on_main", False),
"release_tag_policy": tag_policy, "test_branch_policy": test_policy,
"docs_only": boolean(data, "docs_only", False),
"publish_context": publish_context,
"publish_context": publish_context, "platforms": platforms,
"publish": {key: boolean(publishing, key, key != "asciidoc" and profile not in ("cli", "all", "repository-policy", "application-template")
and not (profile == "qbit" and key in ("hotfix", "feature")))
for key in publish_keys}}
@@ -436,9 +443,16 @@ def cli_template(config, branch, tag):
options = {"publish": publish, "filters": filters}
if publish:
options["context"] = [config["publish_context"]]
platforms = config.get("platforms", [])
jobs = [{"qqq-orb/cli_platform": {"name": "cli-" + p, "executor": CLI_PLATFORMS[p], "filters": copy.deepcopy(filters)}}
for p in platforms]
if publish and platforms:
# Every opted-in platform must pass before packages are published.
options["requires"] = ["cli-" + p for p in platforms]
jobs.append({"qqq-orb/cli_verify_publish": options})
# CLI docs are still verified until its generated-client inputs get a dedicated policy.
return {"version": 2.1, "orbs": {"qqq-orb": "kingsrook/qqq-orb@" + config["orb_version"]},
"workflows": {"publish_release" if publish else "test_only": {"jobs": [{"qqq-orb/cli_verify_publish": options}]}}}
"workflows": {"publish_release" if publish else "test_only": {"jobs": jobs}}}
def marketing_template(config, branch, tag):
File diff suppressed because it is too large. Load diff
+27 -10
View File
@@ -5,7 +5,7 @@ scripts=$(cd "$(dirname "${BASH_SOURCE[0]}")/../src/scripts" && pwd)
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
cd "$scratch"
mkdir -p bin node_modules/.bin packages/{ui-api-client,conformance,cli}/src
mkdir -p bin node_modules/.bin packages/{ui-api-client,core,conformance,cli}/src
export CLI_LOG="$scratch/commands" PRISM_PID_FILE="$scratch/prism-pid" CONFIG_PATH_FILE="$scratch/npm-config-path"
cat > bin/npm <<'STUB'
#!/bin/bash
@@ -35,7 +35,7 @@ chmod +x bin/* node_modules/.bin/prism
export PATH="$scratch/bin:$PATH"
: > "$CLI_LOG"
bash "$scripts/cli_verify.sh"
[[ "$(cat "$CLI_LOG")" == $'run generate\nrun build\ntest' ]]
[[ "$(cat "$CLI_LOG")" == $'run generate\nrun build\ntest\nrun lint' ]]
if [[ -e "$PRISM_PID_FILE" ]] && kill -0 "$(cat "$PRISM_PID_FILE")" 2>/dev/null; then
echo 'Prism process survived cleanup' >&2
exit 1
@@ -51,20 +51,37 @@ if [[ -e "$PRISM_PID_FILE" ]] && kill -0 "$(cat "$PRISM_PID_FILE")" 2>/dev/null;
echo 'Prism process survived cleanup' >&2
exit 1
fi
for item in 'ui-api-client qqq-ui-api-client 1.6.0-rc.1' 'conformance qqq-ui-api-conformance 1.6.0-rc.1' 'cli qqq-cli 0.1.0-rc.1'; do
read -r dir name version <<< "$item"
printf '{"name":"@qrun-io/%s","version":"%s","publishConfig":{"registry":"https://npm.pkg.github.com"}}\n' "$name" "$version" > "packages/$dir/package.json"
done
write_packages() {
local core_version=$1 core_dependency=$2 client_version=${3:-1.6.0-rc.1} cli_version=${4:-0.1.0-rc.1} item dir name version
for item in "ui-api-client qqq-ui-api-client $client_version" "core qqq-core $core_version" "conformance qqq-ui-api-conformance $client_version" "cli qqq-cli $cli_version"; do
read -r dir name version <<< "$item"
printf '{"name":"@qrun-io/%s","version":"%s","publishConfig":{"registry":"https://npm.pkg.github.com"},"dependencies":{"@qrun-io/qqq-core":"%s"}}\n' "$name" "$version" "$core_dependency" > "packages/$dir/package.json"
done
}
write_packages 0.1.0-rc.1 0.1.0-rc.1
export CIRCLE_TAG=v1.6.0-rc.1 GITHUB_TOKEN=test-not-a-credential
: > "$CLI_LOG"
bash "$scripts/cli_publish.sh"
[[ $(grep -c '^publish ' "$CLI_LOG") -eq 3 ]]
[[ $(grep -c -- '--tag rc$' "$CLI_LOG") -eq 3 ]]
[[ "$(grep '^publish ' "$CLI_LOG" | cut -d' ' -f3)" == $'@qrun-io/qqq-ui-api-client\n@qrun-io/qqq-core\n@qrun-io/qqq-ui-api-conformance\n@qrun-io/qqq-cli' ]]
[[ $(grep -c -- '--tag rc$' "$CLI_LOG") -eq 4 ]]
# Final versions publish as latest; any prerelease among the four keeps rc.
write_packages 1.0.0 1.0.0 1.6.0 1.0.0
: > "$CLI_LOG"
CIRCLE_TAG=v1.6.0 bash "$scripts/cli_publish.sh"
[[ $(grep -c -- '--tag latest$' "$CLI_LOG") -eq 4 ]]
[[ $(grep -c '^publish ' "$CLI_LOG") -eq 4 ]]
write_packages 1.0.0 1.0.0 1.6.0-rc.3 1.0.0
: > "$CLI_LOG"
CIRCLE_TAG=v1.6.0-rc.3 bash "$scripts/cli_publish.sh"
[[ $(grep -c -- '--tag rc$' "$CLI_LOG") -eq 4 ]]
[[ $(grep -c '^test$' "$CLI_LOG" || true) -eq 0 ]]
[[ ! -e "$(cat "$CONFIG_PATH_FILE")" ]]
for condition in wrong-tag missing-token denied-auth; do
for condition in wrong-tag missing-token denied-auth core-version core-dependency; do
: > "$CLI_LOG"
write_packages 0.1.0-rc.1 0.1.0-rc.1
case "$condition" in
core-version) write_packages 0.1.0-rc.2 0.1.0-rc.2; if bash "$scripts/cli_publish.sh" >/dev/null 2>&1; then exit 1; fi ;;
core-dependency) write_packages 0.1.0-rc.1 0.1.0-rc.0; if bash "$scripts/cli_publish.sh" >/dev/null 2>&1; then exit 1; fi ;;
wrong-tag) if CIRCLE_TAG=v0.1.0 bash "$scripts/cli_publish.sh" >/dev/null 2>&1; then exit 1; fi ;;
missing-token) if GITHUB_TOKEN='' bash "$scripts/cli_publish.sh" >/dev/null 2>&1; then exit 1; fi ;;
denied-auth) if FAIL_AUTH=true bash "$scripts/cli_publish.sh" >/dev/null 2>&1; then exit 1; fi ;;
@@ -74,4 +91,4 @@ for condition in wrong-tag missing-token denied-auth; do
exit 1
fi
done
printf 'PASS: CLI validation once, drift/test/smoke failures, cleanup, tag/auth checks and three rc publishes (stubbed)\n'
printf 'PASS: CLI validation once, drift/test/smoke failures, cleanup, tag/core-version/auth checks and four rc/latest publishes (stubbed)\n'
+13 -1
View File
@@ -10,7 +10,7 @@ class CliContract(unittest.TestCase):
def test_single_full_validation_and_opt_in_publication(self):
config = yaml.safe_load((ROOT / "src/jobs/cli_verify_publish.yml").read_text())
self.assertIs(config["parameters"]["publish"]["default"], False)
self.assertEqual(config["docker"], [{"image": "cimg/node:22.12"}])
self.assertEqual(config["docker"], [{"image": "cimg/node:22.23"}])
steps = config["steps"]
ci = [i for i, s in enumerate(steps) if isinstance(s, dict) and s.get("run", {}).get("command") == "npm ci"]
verify = [i for i, s in enumerate(steps) if "scripts/cli_verify.sh" in str(s)]
@@ -24,6 +24,18 @@ class CliContract(unittest.TestCase):
cache = next(s["save_cache"] for s in steps if isinstance(s, dict) and "save_cache" in s)
self.assertEqual(cache["paths"], ["~/.npm"])
def test_platform_lane_runs_install_build_test_and_lint(self):
config = yaml.safe_load((ROOT / "src/jobs/cli_platform.yml").read_text())
self.assertEqual(config["executor"], "<< parameters.executor >>")
self.assertEqual(config["parameters"]["executor"]["type"], "executor")
commands = [s["run"]["command"] if isinstance(s["run"], dict) else s["run"]
for s in config["steps"] if isinstance(s, dict) and "run" in s]
self.assertIn("npm ci", commands)
self.assertEqual(commands[-1], "npm run build && npm test && npm run lint")
self.assertNotIn("publish", str(config))
for name in ("cli_macos_arm64", "cli_windows_x64"):
self.assertTrue((ROOT / "src/executors" / (name + ".yml")).exists())
if __name__ == "__main__":
unittest.main()
File diff suppressed because it is too large. Load diff
+1 -13
View File
@@ -44,20 +44,8 @@ class BranchLanguages(unittest.TestCase):
self.assertEqual(0, result.returncode, result.stderr)
self.assertIn('build-mode=autobuild\n', output)
def test_java_cli_preserves_homebrew_ruby_coverage(self):
result, output = self.select(['src/Main.java', 'packaging/homebrew/qctl.rb', '.github/workflows/build.yml'])
self.assertEqual(0, result.returncode, result.stderr)
self.assertIn('languages=java-kotlin,ruby,actions\n', output)
self.assertIn('build-mode=none\n', output)
def test_ruby_only_source_is_supported(self):
result, output = self.select(['Formula/qctl.rb'])
self.assertEqual(0, result.returncode, result.stderr)
self.assertIn('languages=ruby\n', output)
self.assertIn('build-mode=none\n', output)
def test_untracked_files_do_not_select_languages(self):
result, output = self.select(['src/Example.java'], ['web/generated.js', 'generated/formula.rb', '.github/workflows/untracked.yml'])
result, output = self.select(['src/Example.java'], ['web/generated.js', '.github/workflows/untracked.yml'])
self.assertEqual(0, result.returncode, result.stderr)
self.assertIn('languages=java-kotlin\n', output)
+137 -131
View File
@@ -1,131 +1,137 @@
"""Voyage's authoritative CI contracts, extracted from source 9f598cc105ef."""
import json
import os
import subprocess
import tempfile
from pathlib import Path
import re
import unittest
TEMPLATE = json.loads((Path(__file__).resolve().parents[1] / "src/scripts/templates/voyage.json").read_text())
def matches(pattern, branch):
if isinstance(pattern, list):
return any(matches(p, branch) for p in pattern)
if pattern.startswith("/") and pattern.endswith("/"):
return re.fullmatch(pattern[1:-1], branch) is not None
return pattern == branch
def selected(branch):
found = []
for workflow, body in TEMPLATE["workflows"].items():
for invocation in body["jobs"]:
name, options = next(iter(invocation.items()))
filters = options.get("filters", {}).get("branches", {})
if "only" in filters and not matches(filters["only"], branch):
continue
if "ignore" in filters and matches(filters["ignore"], branch):
continue
found.append((workflow, options.get("name", name), options))
return found
class VoyageContract(unittest.TestCase):
def test_each_supported_branch_has_one_validation_owner(self):
for branch, workflow in (("feature/example", "pull-request"), ("hotfix/example", "pull-request"), ("develop", "develop"), ("main", "release"), ("release/1.0", "release")):
with self.subTest(branch=branch):
jobs = selected(branch)
self.assertEqual({w for w, _, _ in jobs}, {workflow})
self.assertEqual([n for _, n, _ in jobs].count("build-and-test"), 1)
self.assertEqual({n for _, n, _ in selected("release-please--branches--main")},
{"build-and-test", "secrets-scan", "sast-scan", "security-scan"})
def test_verify_owns_tests_quality_and_coverage_without_skips(self):
jobs = TEMPLATE["jobs"]
self.assertNotIn("coverage", jobs)
self.assertNotIn("code-quality", jobs)
steps = jobs["build-and-test"]["steps"]
commands = [s["run"]["command"] for s in steps if isinstance(s, dict) and "run" in s]
self.assertEqual(commands, ["mvn clean verify -B -T4 --update-snapshots --no-transfer-progress"])
full = json.dumps(jobs)
self.assertNotIn("mvn test", full)
self.assertNotIn("jacoco.skip", full)
self.assertNotIn("skipTests", full)
self.assertLess(steps.index("qqq-orb/mvn_cache_restore"), steps.index("qqq-orb/mvn_cache_save"))
def test_unit_integration_and_coverage_evidence_retained(self):
steps = TEMPLATE["jobs"]["build-and-test"]["steps"]
results = [s["store_test_results"]["path"] for s in steps if isinstance(s, dict) and "store_test_results" in s]
self.assertEqual(results, ["target/surefire-reports", "target/failsafe-reports"])
paths = next(s["persist_to_workspace"]["paths"] for s in steps if isinstance(s, dict) and "persist_to_workspace" in s)
for path in ("target/site", "target/jacoco.exec", "target/voyage.jar", "target/classes", "target/test-classes"):
self.assertIn(path, paths)
sonar = json.dumps(TEMPLATE["jobs"]["sonar-scan"])
self.assertIn("target/site/jacoco/jacoco.xml", sonar)
self.assertIn("attach_workspace", sonar)
def test_all_workflow_dependencies_exist_and_preserve_release_boundaries(self):
for workflow, body in TEMPLATE["workflows"].items():
names = {next(iter(entry.values())).get("name", next(iter(entry))) for entry in body["jobs"]}
for entry in body["jobs"]:
name, options = next(iter(entry.items()))
self.assertTrue(name in TEMPLATE["jobs"] or name == "munitor/update_cd_repo")
self.assertTrue(set(options.get("requires", [])).issubset(names))
for branch in ("feature/example", "release/1.0", "develop"):
self.assertNotIn("update-cd-repo", [n for _, n, _ in selected(branch)])
self.assertNotIn("release-please", [n for _, n, _ in selected(branch)])
main = {n: o for _, n, o in selected("main")}
self.assertEqual(main["update-cd-repo"]["requires"], ["docker-build"])
self.assertEqual(main["release-please"]["requires"], ["docker-build"])
self.assertEqual(main["docker-build"]["requires"], ["build-and-test", "secrets-scan", "sast-scan", "security-scan"])
def test_dependency_scan_propagates_findings_and_operational_errors(self):
command = next(s["run"]["command"] for s in TEMPLATE["jobs"]["security-scan"]["steps"]
if isinstance(s, dict) and "run" in s)
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
(root / "bin").mkdir()
docker = root / "bin/docker"
docker.write_text('#!/bin/sh\nexit "$SCANNER_RESULT"\n')
docker.chmod(0o755)
(root / "target").mkdir()
(root / "target/voyage.jar").write_bytes(b"artifact")
env = {**os.environ, "HOME": directory, "PATH": str(root / "bin") + os.pathsep + os.environ["PATH"],
"CIRCLE_BRANCH": "develop"}
for code in (0, 1, 2):
result = subprocess.run(["bash", "-c", command], cwd=root,
env={**env, "SCANNER_RESULT": str(code)}, capture_output=True)
self.assertEqual(result.returncode, code)
(root / "target/voyage.jar").unlink()
result = subprocess.run(["bash", "-c", command], cwd=root,
env={**env, "SCANNER_RESULT": "0"}, capture_output=True)
self.assertNotEqual(result.returncode, 0)
def test_security_policies_and_destinations_preserved(self):
jobs = TEMPLATE["jobs"]
self.assertIn('--exit-code 1', json.dumps(jobs["docker-build"]))
self.assertIn('--severity CRITICAL,HIGH', json.dumps(jobs["docker-build"]))
self.assertIn('ghcr.io/qrun-io/voyage', json.dumps(jobs["docker-build"]))
self.assertNotIn('update-cd-repo', jobs)
owasp = '\n'.join(s["run"]["command"] for s in jobs["security-scan"]["steps"] if isinstance(s, dict) and "run" in s)
self.assertIn('--severity HIGH,CRITICAL --exit-code 1', owasp)
self.assertIn('target/voyage.jar:/scan/voyage.jar:ro', owasp)
self.assertIn('aquasec/trivy:0.76.0@sha256:', owasp)
self.assertNotIn('--ignore-unfixed', owasp)
self.assertNotIn('NVD_API_KEY', owasp)
self.assertNotIn('mvn ', owasp)
self.assertIn('set -euo pipefail', owasp)
self.assertEqual(jobs["security-scan"]["resource_class"], "medium")
for workflow in TEMPLATE["workflows"].values():
for invocation in workflow["jobs"]:
if "security-scan" in invocation:
self.assertNotIn("context", invocation["security-scan"])
self.assertIn('./gitleaks detect', json.dumps(jobs["secrets-scan"]))
self.assertIn('|| true', json.dumps(jobs["sast-scan"]))
self.assertIn('makeAggregateBom', json.dumps(jobs["sbom"]))
if __name__ == "__main__":
unittest.main()
"""Voyage's authoritative CI contracts, extracted from source 9f598cc105ef."""
import json
import os
import subprocess
import tempfile
from pathlib import Path
import re
import unittest
TEMPLATE = json.loads((Path(__file__).resolve().parents[1] / "src/scripts/templates/voyage.json").read_text())
def matches(pattern, branch):
if isinstance(pattern, list):
return any(matches(p, branch) for p in pattern)
if pattern.startswith("/") and pattern.endswith("/"):
return re.fullmatch(pattern[1:-1], branch) is not None
return pattern == branch
def selected(branch):
found = []
for workflow, body in TEMPLATE["workflows"].items():
for invocation in body["jobs"]:
name, options = next(iter(invocation.items()))
filters = options.get("filters", {}).get("branches", {})
if "only" in filters and not matches(filters["only"], branch):
continue
if "ignore" in filters and matches(filters["ignore"], branch):
continue
found.append((workflow, options.get("name", name), options))
return found
class VoyageContract(unittest.TestCase):
def test_each_supported_branch_has_one_validation_owner(self):
for branch, workflow in (("feature/example", "pull-request"), ("hotfix/example", "pull-request"), ("develop", "develop"), ("main", "release"), ("release/1.0", "release")):
with self.subTest(branch=branch):
jobs = selected(branch)
self.assertEqual({w for w, _, _ in jobs}, {workflow})
self.assertEqual([n for _, n, _ in jobs].count("build-and-test"), 1)
self.assertEqual({n for _, n, _ in selected("release-please--branches--main")},
{"build-and-test", "secrets-scan", "sast-scan", "security-scan"})
def test_verify_owns_tests_quality_and_coverage_without_skips(self):
jobs = TEMPLATE["jobs"]
self.assertNotIn("coverage", jobs)
self.assertNotIn("code-quality", jobs)
steps = jobs["build-and-test"]["steps"]
commands = [s["run"]["command"] for s in steps if isinstance(s, dict) and "run" in s]
self.assertEqual(commands, ["mvn clean verify -B -T4 --update-snapshots --no-transfer-progress"])
full = json.dumps(jobs)
self.assertNotIn("mvn test", full)
self.assertNotIn("jacoco.skip", full)
self.assertNotIn("skipTests", full)
self.assertLess(steps.index("qqq-orb/mvn_cache_restore"), steps.index("qqq-orb/mvn_cache_save"))
def test_unit_integration_and_coverage_evidence_retained(self):
steps = TEMPLATE["jobs"]["build-and-test"]["steps"]
results = [s["store_test_results"]["path"] for s in steps if isinstance(s, dict) and "store_test_results" in s]
self.assertEqual(results, ["target/surefire-reports", "target/failsafe-reports"])
paths = next(s["persist_to_workspace"]["paths"] for s in steps if isinstance(s, dict) and "persist_to_workspace" in s)
for path in ("target/site", "target/jacoco.exec", "target/voyage.jar", "target/classes", "target/test-classes"):
self.assertIn(path, paths)
artifacts = [s["store_artifacts"]["path"] for s in steps if isinstance(s, dict) and "store_artifacts" in s]
for path in ("target/site", "target/checkstyle-result.xml", "target/spotbugsXml.xml", "target/pmd.xml"):
self.assertIn(path, artifacts)
def test_quality_requires_no_sonar_service_or_credentials(self):
self.assertNotIn("sonar", json.dumps(TEMPLATE).lower())
for branch in ("main", "develop", "release/1.0", "feature/example"):
names = {name for _, name, _ in selected(branch)}
self.assertTrue({"build-and-test", "secrets-scan", "sast-scan", "security-scan"}.issubset(names))
def test_all_workflow_dependencies_exist_and_preserve_release_boundaries(self):
for workflow, body in TEMPLATE["workflows"].items():
names = {next(iter(entry.values())).get("name", next(iter(entry))) for entry in body["jobs"]}
for entry in body["jobs"]:
name, options = next(iter(entry.items()))
self.assertTrue(name in TEMPLATE["jobs"] or name == "munitor/update_cd_repo")
self.assertTrue(set(options.get("requires", [])).issubset(names))
for branch in ("feature/example", "release/1.0", "develop"):
self.assertNotIn("update-cd-repo", [n for _, n, _ in selected(branch)])
self.assertNotIn("release-please", [n for _, n, _ in selected(branch)])
main = {n: o for _, n, o in selected("main")}
self.assertEqual(main["update-cd-repo"]["requires"], ["docker-build"])
self.assertEqual(main["release-please"]["requires"], ["docker-build"])
self.assertEqual(main["docker-build"]["requires"], ["build-and-test", "secrets-scan", "sast-scan", "security-scan"])
def test_dependency_scan_propagates_findings_and_operational_errors(self):
command = next(s["run"]["command"] for s in TEMPLATE["jobs"]["security-scan"]["steps"]
if isinstance(s, dict) and "run" in s)
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
(root / "bin").mkdir()
docker = root / "bin/docker"
docker.write_text('#!/bin/sh\nexit "$SCANNER_RESULT"\n')
docker.chmod(0o755)
(root / "target").mkdir()
(root / "target/voyage.jar").write_bytes(b"artifact")
env = {**os.environ, "HOME": directory, "PATH": str(root / "bin") + os.pathsep + os.environ["PATH"],
"CIRCLE_BRANCH": "develop"}
for code in (0, 1, 2):
result = subprocess.run(["bash", "-c", command], cwd=root,
env={**env, "SCANNER_RESULT": str(code)}, capture_output=True)
self.assertEqual(result.returncode, code)
(root / "target/voyage.jar").unlink()
result = subprocess.run(["bash", "-c", command], cwd=root,
env={**env, "SCANNER_RESULT": "0"}, capture_output=True)
self.assertNotEqual(result.returncode, 0)
def test_security_policies_and_destinations_preserved(self):
jobs = TEMPLATE["jobs"]
self.assertIn('--exit-code 1', json.dumps(jobs["docker-build"]))
self.assertIn('--severity CRITICAL,HIGH', json.dumps(jobs["docker-build"]))
self.assertIn('ghcr.io/qrun-io/voyage', json.dumps(jobs["docker-build"]))
self.assertNotIn('update-cd-repo', jobs)
owasp = '\n'.join(s["run"]["command"] for s in jobs["security-scan"]["steps"] if isinstance(s, dict) and "run" in s)
self.assertIn('--severity HIGH,CRITICAL --exit-code 1', owasp)
self.assertIn('target/voyage.jar:/scan/voyage.jar:ro', owasp)
self.assertIn('aquasec/trivy:0.76.0@sha256:', owasp)
self.assertNotIn('--ignore-unfixed', owasp)
self.assertNotIn('NVD_API_KEY', owasp)
self.assertNotIn('mvn ', owasp)
self.assertIn('set -euo pipefail', owasp)
self.assertEqual(jobs["security-scan"]["resource_class"], "medium")
for workflow in TEMPLATE["workflows"].values():
for invocation in workflow["jobs"]:
if "security-scan" in invocation:
self.assertNotIn("context", invocation["security-scan"])
self.assertIn('./gitleaks detect', json.dumps(jobs["secrets-scan"]))
self.assertIn('|| true', json.dumps(jobs["sast-scan"]))
self.assertIn('makeAggregateBom', json.dumps(jobs["sbom"]))
if __name__ == "__main__":
unittest.main()