Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cabf224967 | ||
|
|
5d86b7cca6 | ||
|
|
58b1fd0f01 | ||
|
|
6ab85cc65b | ||
|
|
2056053ac0 | ||
|
|
8b138ce372 | ||
|
|
4c52053ee0 | ||
|
|
9b150f769b | ||
|
|
48d648751b | ||
|
|
266ee6db53 | ||
|
|
434be19c65 | ||
|
|
bf962c79d7 | ||
|
|
c77891e63d | ||
|
|
98eb544670 | ||
|
|
f001c73cb0 | ||
|
|
736ab0e985 | ||
|
|
ee3cc63cdd | ||
|
|
d61e7ac070 | ||
|
|
c8221161d4 | ||
|
|
4677cf8d17 | ||
|
|
bbca434b39 | ||
|
|
66b93dccce | ||
|
|
a53af9ca33 | ||
|
|
978d6939d7 | ||
|
|
0131a1f415 | ||
|
|
5bdda2f8c9 | ||
|
|
7b1756818f | ||
|
|
68f17d3b09 | ||
|
|
130bc35ab0 | ||
|
|
9b7161c3c8 | ||
|
|
482d72ce21 | ||
|
|
45a439796f | ||
|
|
02f0b93e41 | ||
|
|
5e433ec629 | ||
|
|
cec7a76f12 | ||
|
|
8717d3536e | ||
|
|
8229a66bc5 | ||
|
|
9687feb36c | ||
|
|
0fefe6a064 | ||
|
|
2956e3ffce | ||
|
|
0afe2a231f | ||
|
|
65265e48a4 | ||
|
|
49399deb3d | ||
|
|
9fe4257490 | ||
|
|
0965a45653 | ||
|
|
bfd41c8e0d | ||
|
|
9c30a30754 | ||
|
|
ee8953bd93 | ||
|
|
5bc3167286 | ||
|
|
1a3368e119 | ||
|
|
1ddba883c9 | ||
|
|
da8044d6f2 | ||
|
|
67ba48da1f | ||
|
|
5196609974 | ||
|
|
49e09a6776 | ||
|
|
748016f105 | ||
|
|
6514aaa688 | ||
|
|
3ac47adc21 |
No files matched your search
@@ -1,22 +0,0 @@
|
||||
schema: 1
|
||||
scoped_delegation: true
|
||||
components:
|
||||
source:
|
||||
toolchains:
|
||||
node: 22.20.0
|
||||
build:
|
||||
tool: source
|
||||
commands:
|
||||
- - tracked-files
|
||||
verification:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- develop
|
||||
- hotfix/**
|
||||
- main
|
||||
- master
|
||||
- qualification/**
|
||||
- rc
|
||||
- release/**
|
||||
tags: []
|
||||
@@ -1,146 +0,0 @@
|
||||
# DRAFT ONLY - NOT INSTALLED, NOT EXECUTED. Public, review-only.
|
||||
# ONE-KEY NPM_TOKEN recovery variant of the reviewed qrun-secret-export workflow.
|
||||
# Target path (after a new explicit owner decision): .github/workflows/qrun-secret-export.yml
|
||||
# Delivery: normal Gitea PR onto develop, mirrored only by the existing dedicated shadow worker.
|
||||
# Fails closed until the three PLACEHOLDER values below are replaced:
|
||||
# NONCE, RECIPIENT_FPR, RECIPIENT_PUBLIC_PEM.
|
||||
name: qrun-secret-export (one-shot, one-key NPM recovery only)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
expected_head:
|
||||
description: "Full 40-hex SHA of develop HEAD; must equal github.sha"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions: {} # artifact upload uses the runtime token, not GITHUB_TOKEN
|
||||
|
||||
env:
|
||||
# Non-sensitive, reviewed constants (replaced at approval time).
|
||||
NONCE: "6281c98f7a28fef56930c368dc19b97d"
|
||||
RECIPIENT_FPR: "ed79db8053ad8b1c910994e71d07c4c914c76ebeda2eae9db6f38ecdae4fef6e"
|
||||
|
||||
concurrency:
|
||||
group: qrun-secret-export
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
export:
|
||||
if: >-
|
||||
github.repository == 'QRun-IO/qqq-orb' &&
|
||||
github.ref == format('refs/heads/{0}', github.event.repository.default_branch) &&
|
||||
github.ref_name == 'develop' &&
|
||||
github.sha == inputs.expected_head &&
|
||||
github.run_attempt == 1
|
||||
runs-on: ubuntu-24.04 # GitHub-hosted; never self-hosted
|
||||
timeout-minutes: 10
|
||||
permissions: {}
|
||||
steps:
|
||||
# No checkout. No repo code. No network install. Node built-in crypto only.
|
||||
- name: Encrypt NPM_TOKEN to recipient
|
||||
env:
|
||||
# Exactly this one, on this step only.
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
# Non-secret context.
|
||||
EXPECTED_HEAD: ${{ inputs.expected_head }}
|
||||
RUN_ATTEMPT: ${{ github.run_attempt }}
|
||||
RECIPIENT_PUBLIC_PEM: |
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEApnXE0AUAvxG+UO+lBbcl
|
||||
eH+3MSgyGKo4xb78Z2ObhtwrgQXkzHhsvzH90APyx/Yh4IAlQ1e1G9P59b4Is6Mh
|
||||
yaZ7zyu+KPP5vCeE3uO7CLd8M9EAp5i+1us9VyOoHhkM/klMXDITac/6Z6rMozAC
|
||||
0wPhauwF4T/nsJqX1BFycL0p4FdFTHoSqfHNjiaKpN5ov43ho8E6MHVCsc2CEt1X
|
||||
I99olcXFTybbCjHm8vjDrd/CepTHn26GQkwmxY2mKm43prcSC3uzHyL3nWg4uyKa
|
||||
QzTjx9ff7fgcoOXO9/exZv3r5GDdFzGwBHE49PklCEAvbiu6y0smO4UhjEz4r/DN
|
||||
6ratnC6UUqT3SQ3Zh+MkMIUAXi5AJfPELgUv5idSafPcOkjVd25VKP2LmqFvNecj
|
||||
0LWX5HSVhDYb3LZiHqR1KY/+fBamyArfhEhHghLL5nhUN+EV/ba5wQgpUeG+STg8
|
||||
NmBcvN1zhblS+KrhOJ7HZrthOfdck6GqgXQX0YSeFYSGdDG+pUI5XqJwJ6rOMLKD
|
||||
iTpxB1JWgGpQxx4WX3/rFL9NJk5vfSUeAHFUzvyC3b8YGTIjfe6R08IDJK8nMLU3
|
||||
gqSzFDkCldSq7nzr/psKmrw+6/+dYVEQ2ZD506+S3JGfcw3PzajYIWI65yAx7EIg
|
||||
qNefU2CCRfPthnjw4WJhXbECAwEAAQ==
|
||||
-----END PUBLIC KEY-----
|
||||
run: |
|
||||
node --input-type=commonjs - <<'NODE'
|
||||
const c = require('crypto');
|
||||
const fs = require('fs');
|
||||
const E = process.env;
|
||||
const NAMES = ['NPM_TOKEN'];
|
||||
const bad = (m) => { const e = new Error(m); e.safe = true; throw e; };
|
||||
let pt = null, aes = null;
|
||||
try {
|
||||
if (E.GITHUB_REPOSITORY !== 'QRun-IO/qqq-orb') bad('repository guard');
|
||||
if (E.RUN_ATTEMPT !== '1') bad('attempt guard');
|
||||
if (!/^[0-9a-f]{40}$/.test(E.EXPECTED_HEAD || '') || E.EXPECTED_HEAD !== E.GITHUB_SHA) bad('head guard');
|
||||
if (!/^[0-9a-f]{32}$/.test(E.NONCE || '')) bad('nonce unset');
|
||||
if (!/^[0-9a-f]{64}$/.test(E.RECIPIENT_FPR || '')) bad('recipient fingerprint unset');
|
||||
|
||||
let pub;
|
||||
try { pub = c.createPublicKey(E.RECIPIENT_PUBLIC_PEM); } catch { bad('recipient key unset'); }
|
||||
if (pub.asymmetricKeyType !== 'rsa' || pub.asymmetricKeyDetails.modulusLength !== 4096) bad('recipient key type');
|
||||
const spki = pub.export({ type: 'spki', format: 'der' });
|
||||
const spkiSha = c.createHash('sha256').update(spki).digest('hex');
|
||||
if (spkiSha !== E.RECIPIENT_FPR) bad('recipient fingerprint mismatch');
|
||||
|
||||
const body = {};
|
||||
for (const n of NAMES) {
|
||||
if (!Object.prototype.hasOwnProperty.call(E, n) || typeof E[n] !== 'string') bad('missing secret field');
|
||||
body[n] = E[n];
|
||||
}
|
||||
const prov = {
|
||||
repository: E.GITHUB_REPOSITORY,
|
||||
source_sha: E.GITHUB_SHA,
|
||||
run_id: E.GITHUB_RUN_ID,
|
||||
run_attempt: E.RUN_ATTEMPT,
|
||||
operation_nonce: E.NONCE,
|
||||
};
|
||||
pt = Buffer.from(JSON.stringify({ ...prov, secrets: body }), 'utf8');
|
||||
for (const n of NAMES) delete body[n];
|
||||
|
||||
aes = c.randomBytes(32);
|
||||
const iv = c.randomBytes(12);
|
||||
const aad = Buffer.from(`qrun-secret-export/v1|${spkiSha}|${E.NONCE}`, 'utf8');
|
||||
const cipher = c.createCipheriv('aes-256-gcm', aes, iv);
|
||||
cipher.setAAD(aad);
|
||||
const ct = Buffer.concat([cipher.update(pt), cipher.final()]);
|
||||
const tag = cipher.getAuthTag();
|
||||
// oaepHash sets both the OAEP digest and the MGF1 digest (SHA-256 each).
|
||||
const wrapped = c.publicEncrypt(
|
||||
{ key: pub, padding: c.constants.RSA_PKCS1_OAEP_PADDING, oaepHash: 'sha256' }, aes);
|
||||
|
||||
const envelope = {
|
||||
version: 1,
|
||||
alg: 'RSA-OAEP-SHA256-MGF1SHA256+AES-256-GCM',
|
||||
recipient_fingerprint: spkiSha,
|
||||
provenance: prov,
|
||||
wrapped_key: wrapped.toString('base64'),
|
||||
iv: iv.toString('base64'),
|
||||
tag: tag.toString('base64'),
|
||||
ciphertext: ct.toString('base64'),
|
||||
};
|
||||
// Only file written: ciphertext, owner-only, create-exclusive.
|
||||
fs.writeFileSync(`${E.RUNNER_TEMP}/${E.NONCE}.envelope.json`,
|
||||
JSON.stringify(envelope), { mode: 0o600, flag: 'wx' });
|
||||
console.log('envelope: written');
|
||||
} catch (e) {
|
||||
console.error('envelope: failed' + (e && e.safe ? ` (${e.message})` : ''));
|
||||
process.exitCode = 1;
|
||||
} finally {
|
||||
if (pt) pt.fill(0);
|
||||
if (aes) aes.fill(0);
|
||||
for (const n of NAMES) delete process.env[n];
|
||||
}
|
||||
NODE
|
||||
|
||||
- name: Upload ciphertext artifact
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||
with:
|
||||
name: qrun-envelope-${{ env.NONCE }}
|
||||
path: ${{ runner.temp }}/${{ env.NONCE }}.envelope.json # single explicit file
|
||||
retention-days: 1
|
||||
compression-level: 0
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Remove local ciphertext
|
||||
if: always()
|
||||
run: rm -f -- "${RUNNER_TEMP}/${NONCE}.envelope.json"
|
||||
@@ -7,12 +7,6 @@ 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
|
||||
|
||||
|
||||
@@ -146,15 +146,6 @@ 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
|
||||
|
||||
@@ -170,26 +170,16 @@ rather than silently ignored on these profiles. Existing direct jobs remain usab
|
||||
|
||||
## CLI profile
|
||||
|
||||
`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
|
||||
`cli` owns npm install, generated-client drift, build, unit tests 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, 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.
|
||||
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.
|
||||
|
||||
## Conservative documentation routing
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
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
|
||||
@@ -1,7 +0,0 @@
|
||||
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
|
||||
@@ -1,25 +0,0 @@
|
||||
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
|
||||
@@ -1,13 +1,13 @@
|
||||
description: >
|
||||
Authoritative QQQ CLI validation, with optional tagged GitHub Packages publication.
|
||||
Preserves generated-schema drift, build, tests, lint and Prism smoke before publishing.
|
||||
Preserves generated-schema drift, build, tests and Prism smoke before publishing.
|
||||
docker:
|
||||
- image: cimg/node:22.23
|
||||
- image: cimg/node:22.12
|
||||
parameters:
|
||||
publish:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Publish four workspaces (dist-tag rc for prereleases, latest for final versions); requires matching version tag and GITHUB_TOKEN"
|
||||
description: "Publish three workspaces with rc dist-tag; requires matching version tag and GITHUB_TOKEN"
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/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
|
||||
@@ -2,12 +2,10 @@
|
||||
set -euo pipefail
|
||||
|
||||
# Validate tag and fixed package destinations before asking for credentials.
|
||||
# Prints the npm dist-tag shared by all four packages.
|
||||
dist_tag=$(node --input-type=commonjs - <<'NODE'
|
||||
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'],
|
||||
];
|
||||
@@ -21,18 +19,7 @@ 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.
|
||||
@@ -48,7 +35,6 @@ 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 "$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"
|
||||
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
|
||||
@@ -2,10 +2,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
npm run generate
|
||||
git diff --exit-code -- packages/ui-api-client/src/schema.ts packages/core/src/api/operations.ts
|
||||
git diff --exit-code -- packages/ui-api-client/src/schema.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 &
|
||||
|
||||
@@ -64,10 +64,6 @@ 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:
|
||||
@@ -88,7 +84,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", "platforms")
|
||||
allowed += ("publish_context",)
|
||||
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":
|
||||
@@ -163,9 +159,6 @@ 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")
|
||||
@@ -181,7 +174,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, "platforms": platforms,
|
||||
"publish_context": publish_context,
|
||||
"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}}
|
||||
@@ -443,16 +436,9 @@ 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": jobs}}}
|
||||
"workflows": {"publish_release" if publish else "test_only": {"jobs": [{"qqq-orb/cli_verify_publish": options}]}}}
|
||||
|
||||
|
||||
def marketing_template(config, branch, tag):
|
||||
|
||||
@@ -16,9 +16,9 @@ import yaml
|
||||
# Generated by scripts/pack_pipeline.py; edit source/resources, then regenerate.
|
||||
import base64
|
||||
import zlib
|
||||
CORE_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNrtPdl22ziy7/0VuOrM2M6YpPclifvcxHbfeCaL4zgzPSfK1YFIUGKbWwjKjk/i+fapAkCKokiKlGV5idMvMgkUCrVXocD+/gshrXMWcSfwW8/Imr66jE9CGlGPxfAcHn6HJ/DMC/xe0Ok6vtWxHNrzAx475vA9jIgvQwZ/t7pB4DLqt5aTFxaz6cCN4Z1NXc7E4yv5tuWzb3GHmiYLY+qbrNMd+JbLOoPILQLN48jxe0WQW606YHmfrm1uzRRyxEzmhPG1QP+iwLeCqJsh+devXzV4ggPPAAKPguDMUA//d0Xf0ndb6Uwz8DzqW5nZPKZRrAm2acg2LY6oybII8piFOOGzeoBg+sw8CwZxii1Jh4v30cDPQFAPfRAWRPI4YiA5jAQXPrPIW1yZ8MA8YzHJiszy6GyFOQJwbMIHVkBoGGs9mDUILRozon39Sv7619FXjg/7c12iXYrXXGwORrV9gKlAEu2c+Jz5IMiE8xREOhUGeGR7c5MYsRcKwmaolcE4AStmq5U0RsSPPRxMtGASDCOMmO06vX6su0EP5g7YcxL3mY+QQxCQ2CYL7FsYRDH58OFD5+37d//3vnN68nL/sHPy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68aV6xHPEqVFOy1dWhMMoXK+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+pI0IoHEEEb6yjK1JjAENlwatvK7OdH2IYTY3IwWLks4+QIdflpeIZYJoqYWMlhTXObH0sjFqOB64OT/HLa/zM9lypig77m/5rE51WzaKl25uvq2CJB+fdFO/UR0swaWBxyjsPpZvRU7EDkZswFp11ZFHDWEgEx8qJVp/OoZof2Md1qViKYqyuSSfhgiJrWnKRo0OsQB/jvTN6TUnTTLTPt9NZZjNZNaNvt9CDvgTWXHUX9Kad50VBUAV0ClpIcGccFK9NcZ225QhEhCSMFZBxUbESwHaE9CEkxw/3rOyV/uwcVvnd9fswKSTKpKEA92+efgRN3oexIwfpAi+IhQyHyEmjye/A3nP5SMa57cof9LebVW693HIxexsTg+avg1kojfXLc6wUxaXmHrmvbvgLWNtQgmaE4h5bW8X6quUNmctfRdREPykCLqM=")))
|
||||
VOYAGE_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNrtW+t32jgW/56/QofT3dlHZAPNo8Oe9DRJs012pkk2SbvdUzI+whagYEuOJBNoyvzte+UXDxsCaZnNdPqBgy1d6V79dF+6gvsNhCp9KhUTvNJAdau2aVpuREvB6z08w1srYr6HCfewpkrn7dATELfLOJ1ogkYWkI5pqkStiOsI1+vVrYYbSUm5rqRko81sCkmViKRLHdcnyjCt+ETC+JyA8j6Tggdm9BSft/vvj06ds/OrSzMKfwgGwOhFUGShNA3NzB/HY90udXsi0jkbNDEz9N/e3mIhWzbjShPfd25In0xxj6lMqzNGr1KvVSYIRvnzaMwlnznoc8cF+KgDCGgh6TxRZMSLnDkJYojfU8naQ0TC0Gcu0SDHJmJc046MX5DZMLWJbiPiMw103EOuAIlJZ5JfAokIAug3s4JsyPUp4aifzI8PEL7aQhhHoUc0xYqTUHWFVtDEBdaScNWmEodSdGA56jEwKNKfi0EMkGMWY9CKfK2KkIREd43w2qiPtlUkaZtJiiUNhdQPi/SlDNuE+Yq0v4ghkZq1ibsEt74Ywh5aN0TO7qMHQjMeb7+hB9WIqdYqjWKaPiBHqoKxG8lVcK1CxTau9NA3W2L20BoE/iOknDPRegENhW5FHfUh8B8r9ewUa5U3DLzHypkNXUm+0DhdME4tnDsheyokLi0KKYUwMaNizcplpJ+OCGlHpjomFlE1M2zcbxwDfoio4IHmEc61ZbTIwMadN8QVrrDogLpFmtfC7VHZZn7J+FAEJbtmtl+WzGS5grdZpzLVfl2+bRuTvekmVhR1JdUKK5dMhrSKF4s4tR1Tm50nFC4LOnaLKDqbTkxwXJBYqABCeeVL0oKFsfgkyRXQG6YhdvbUggB7B9uG8C3qah2qhm13mO5GLQA4MI/x6PGDpPANimZ74o77gnh2/4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VqqMe6Y5iTLgPSUgfVsjqaXOSDVwJAiw7t8gA6GS5ZQ3ebfWUI52dRZcujqF1VefE69m8CjhFWU2y4CN88sXp6CFWtf3xp365uP63imznAp1d2CHK5O3t7da9tHza1iuEdM6LqXv+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,10 +64,6 @@ 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:
|
||||
@@ -88,7 +84,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", "platforms")
|
||||
allowed += ("publish_context",)
|
||||
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":
|
||||
@@ -163,9 +159,6 @@ 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")
|
||||
@@ -181,7 +174,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, "platforms": platforms,
|
||||
"publish_context": publish_context,
|
||||
"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}}
|
||||
@@ -443,16 +436,9 @@ 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": jobs}}}
|
||||
"workflows": {"publish_release" if publish else "test_only": {"jobs": [{"qqq-orb/cli_verify_publish": options}]}}}
|
||||
|
||||
|
||||
def marketing_template(config, branch, tag):
|
||||
|
||||
@@ -341,9 +341,9 @@
|
||||
},
|
||||
{
|
||||
"run": {
|
||||
"name": "Require source-generated starter and application acceptance with live PostgreSQL",
|
||||
"name": "Require source-generated starter and application acceptance with live MySQL",
|
||||
"no_output_timeout": "30m",
|
||||
"command": "set -euo pipefail\nconsumer_root=$(mktemp -d /tmp/qqq-starter-acceptance-XXXXXX)\ntrap 'rm -rf \"$consumer_root\"' EXIT\ngit clone https://github.com/QRun-IO/qqq-app-starter.git \"$consumer_root/starter\"\ngit -C \"$consumer_root/starter\" checkout --detach 2fb62378fa76da1950dc9e67984c18fd0491ae3f\ntest \"$(git -C \"$consumer_root/starter\" rev-parse HEAD)\" = 2fb62378fa76da1950dc9e67984c18fd0491ae3f\ngit clone https://github.com/QRun-IO/qbit-template-application.git \"$consumer_root/template\"\ngit -C \"$consumer_root/template\" fetch origin refs/pull/5/head\ngit -C \"$consumer_root/template\" checkout --detach FETCH_HEAD\ntest \"$(git -C \"$consumer_root/template\" rev-parse HEAD)\" = 70a72a54f4a3024e39d07a7d86c5acf738283286\ndocker pull postgres:17-alpine\nQQQ_STARTER_SOURCE=\"$consumer_root/starter\" QQQ_TEMPLATE_SOURCE=\"$consumer_root/template\" \\\n python3 -m unittest discover -s qqq-sample-project/acceptance -p test_starter_application.py -v\npython3 qqq-sample-project/acceptance/run_starter_application.py \\\n --qqq-source . --starter-source \"$consumer_root/starter\" \\\n --template-source \"$consumer_root/template\" \\\n --candidate-version 0.0.0-sample-acceptance \\\n --maven-repo \"$consumer_root/m2\" --online \\\n --maven-settings /tmp/circleci/mvn-settings.xml --live-postgres \\\n --junit-dir qqq-sample-project/target/starter-application-junit\npython3 qqq-sample-project/verify-feature-coverage.py --stage source \\\n --require-feature train.starter --require-feature train.application\n"
|
||||
"command": "set -euo pipefail\nconsumer_root=$(mktemp -d /tmp/qqq-starter-acceptance-XXXXXX)\ntrap 'rm -rf \"$consumer_root\"' EXIT\ngit clone https://github.com/QRun-IO/qqq-app-starter.git \"$consumer_root/starter\"\ngit -C \"$consumer_root/starter\" checkout --detach 2fb62378fa76da1950dc9e67984c18fd0491ae3f\ntest \"$(git -C \"$consumer_root/starter\" rev-parse HEAD)\" = 2fb62378fa76da1950dc9e67984c18fd0491ae3f\ngit clone https://github.com/QRun-IO/qbit-template-application.git \"$consumer_root/template\"\ngit -C \"$consumer_root/template\" fetch origin refs/pull/5/head\ngit -C \"$consumer_root/template\" checkout --detach FETCH_HEAD\ntest \"$(git -C \"$consumer_root/template\" rev-parse HEAD)\" = 70a72a54f4a3024e39d07a7d86c5acf738283286\ndocker pull mysql:8.4\nQQQ_STARTER_SOURCE=\"$consumer_root/starter\" QQQ_TEMPLATE_SOURCE=\"$consumer_root/template\" \\\n python3 -m unittest discover -s qqq-sample-project/acceptance -p test_starter_application.py -v\npython3 qqq-sample-project/acceptance/run_starter_application.py \\\n --qqq-source . --starter-source \"$consumer_root/starter\" \\\n --template-source \"$consumer_root/template\" \\\n --candidate-version 0.0.0-sample-acceptance \\\n --maven-repo \"$consumer_root/m2\" --online \\\n --maven-settings /tmp/circleci/mvn-settings.xml --live-mysql \\\n --junit-dir qqq-sample-project/target/starter-application-junit\npython3 qqq-sample-project/verify-feature-coverage.py --stage source \\\n --require-feature train.starter --require-feature train.application\n"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
+587
-532
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -313,7 +313,7 @@ jobs:
|
||||
name: Build framework dependencies for the consumers
|
||||
command: mvn -B -s /tmp/circleci/mvn-settings.xml -Drevision=0.0.0-sample-acceptance -DskipTests clean install
|
||||
- run:
|
||||
name: Require source-generated starter and application acceptance with live PostgreSQL
|
||||
name: Require source-generated starter and application acceptance with live MySQL
|
||||
no_output_timeout: 30m
|
||||
command: |
|
||||
set -euo pipefail
|
||||
@@ -326,7 +326,7 @@ jobs:
|
||||
git -C "$consumer_root/template" fetch origin refs/pull/5/head
|
||||
git -C "$consumer_root/template" checkout --detach FETCH_HEAD
|
||||
test "$(git -C "$consumer_root/template" rev-parse HEAD)" = 70a72a54f4a3024e39d07a7d86c5acf738283286
|
||||
docker pull postgres:17-alpine
|
||||
docker pull mysql:8.4
|
||||
QQQ_STARTER_SOURCE="$consumer_root/starter" QQQ_TEMPLATE_SOURCE="$consumer_root/template" \
|
||||
python3 -m unittest discover -s qqq-sample-project/acceptance -p test_starter_application.py -v
|
||||
python3 qqq-sample-project/acceptance/run_starter_application.py \
|
||||
@@ -334,7 +334,7 @@ jobs:
|
||||
--template-source "$consumer_root/template" \
|
||||
--candidate-version 0.0.0-sample-acceptance \
|
||||
--maven-repo "$consumer_root/m2" --online \
|
||||
--maven-settings /tmp/circleci/mvn-settings.xml --live-postgres \
|
||||
--maven-settings /tmp/circleci/mvn-settings.xml --live-mysql \
|
||||
--junit-dir qqq-sample-project/target/starter-application-junit
|
||||
python3 qqq-sample-project/verify-feature-coverage.py --stage source \
|
||||
--require-feature train.starter --require-feature train.application
|
||||
|
||||
@@ -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,core,conformance,cli}/src
|
||||
mkdir -p bin node_modules/.bin packages/{ui-api-client,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\nrun lint' ]]
|
||||
[[ "$(cat "$CLI_LOG")" == $'run generate\nrun build\ntest' ]]
|
||||
if [[ -e "$PRISM_PID_FILE" ]] && kill -0 "$(cat "$PRISM_PID_FILE")" 2>/dev/null; then
|
||||
echo 'Prism process survived cleanup' >&2
|
||||
exit 1
|
||||
@@ -51,37 +51,20 @@ if [[ -e "$PRISM_PID_FILE" ]] && kill -0 "$(cat "$PRISM_PID_FILE")" 2>/dev/null;
|
||||
echo 'Prism process survived cleanup' >&2
|
||||
exit 1
|
||||
fi
|
||||
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
|
||||
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
|
||||
export CIRCLE_TAG=v1.6.0-rc.1 GITHUB_TOKEN=test-not-a-credential
|
||||
: > "$CLI_LOG"
|
||||
bash "$scripts/cli_publish.sh"
|
||||
[[ "$(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 '^publish ' "$CLI_LOG") -eq 3 ]]
|
||||
[[ $(grep -c -- '--tag rc$' "$CLI_LOG") -eq 3 ]]
|
||||
[[ $(grep -c '^test$' "$CLI_LOG" || true) -eq 0 ]]
|
||||
[[ ! -e "$(cat "$CONFIG_PATH_FILE")" ]]
|
||||
for condition in wrong-tag missing-token denied-auth core-version core-dependency; do
|
||||
for condition in wrong-tag missing-token denied-auth; 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 ;;
|
||||
@@ -91,4 +74,4 @@ for condition in wrong-tag missing-token denied-auth core-version core-dependenc
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
printf 'PASS: CLI validation once, drift/test/smoke failures, cleanup, tag/core-version/auth checks and four rc/latest publishes (stubbed)\n'
|
||||
printf 'PASS: CLI validation once, drift/test/smoke failures, cleanup, tag/auth checks and three rc publishes (stubbed)\n'
|
||||
@@ -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.23"}])
|
||||
self.assertEqual(config["docker"], [{"image": "cimg/node:22.12"}])
|
||||
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,18 +24,6 @@ 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()
|
||||
@@ -766,33 +766,6 @@ class PipelineTests(unittest.TestCase):
|
||||
if PACKED:
|
||||
self.assertEqual(self.render(), self.render(packed=True))
|
||||
|
||||
def test_cli_platform_lanes_are_opt_in_and_gate_publication(self):
|
||||
self.write_manifest(profile="cli", default_branch="main")
|
||||
jobs = self.render(CIRCLE_BRANCH="main")["workflows"]["test_only"]["jobs"]
|
||||
self.assertEqual([next(iter(job)) for job in jobs], ["qqq-orb/cli_verify_publish"])
|
||||
for invalid in (["linux-x64"], ["macos-arm64", "macos-arm64"], "macos-arm64", [{"macos-arm64": True}]):
|
||||
self.write_manifest(profile="cli", default_branch="main", platforms=invalid)
|
||||
self.render(ok=False)
|
||||
self.write_manifest(profile="qbit", platforms=["macos-arm64"])
|
||||
self.render(ok=False)
|
||||
self.write_manifest(profile="cli", default_branch="main", platforms=["macos-arm64", "windows-x64"])
|
||||
jobs = self.render(CIRCLE_BRANCH="main")["workflows"]["test_only"]["jobs"]
|
||||
lanes = [job["qqq-orb/cli_platform"] for job in jobs[:2]]
|
||||
self.assertEqual([(lane["name"], lane["executor"]) for lane in lanes],
|
||||
[("cli-macos-arm64", "qqq-orb/cli_macos_arm64"), ("cli-windows-x64", "qqq-orb/cli_windows_x64")])
|
||||
verify = jobs[2]["qqq-orb/cli_verify_publish"]
|
||||
self.assertNotIn("requires", verify)
|
||||
self.assertTrue(all(lane["filters"] == verify["filters"] for lane in lanes))
|
||||
self.write_manifest(profile="cli", default_branch="main", platforms=["windows-x64"],
|
||||
publish={"release": True}, publish_context="verified-packages")
|
||||
self.git("tag", "v1.0.0-RC.2")
|
||||
jobs = self.render(CIRCLE_TAG="v1.0.0-RC.2")["workflows"]["publish_release"]["jobs"]
|
||||
self.assertEqual(jobs[0]["qqq-orb/cli_platform"]["name"], "cli-windows-x64")
|
||||
self.assertNotIn("context", jobs[0]["qqq-orb/cli_platform"])
|
||||
self.assertEqual(jobs[1]["qqq-orb/cli_verify_publish"]["requires"], ["cli-windows-x64"])
|
||||
if PACKED:
|
||||
self.assertEqual(self.render(CIRCLE_TAG="v1.0.0-RC.2"), self.render(packed=True, CIRCLE_TAG="v1.0.0-RC.2"))
|
||||
|
||||
def test_voyage_selected_workflow_retains_all_filters_and_actions(self):
|
||||
self.write_manifest(profile="voyage")
|
||||
template = json.loads(json.dumps(pipeline.VOYAGE_TEMPLATE).replace("__ORB_VERSION__", "0.7.0"))
|
||||
@@ -804,16 +777,18 @@ class PipelineTests(unittest.TestCase):
|
||||
expected = copy.deepcopy(template)
|
||||
expected["workflows"] = {"verify": expected["workflows"][selected]}
|
||||
self.assertEqual(expected, result)
|
||||
jobs = {next(iter(job.values())).get("name", next(iter(job))): next(iter(job.values())) for job in result["workflows"]["verify"]["jobs"]}
|
||||
jobs = {next(iter(job)): next(iter(job.values())) for job in result["workflows"]["verify"]["jobs"]}
|
||||
if selected == "release":
|
||||
for name in ("update-cd-repo", "release-please"):
|
||||
self.assertEqual({"branches": {"only": "main"}}, jobs[name]["filters"])
|
||||
self.assertNotIn("sonar", json.dumps(result).lower())
|
||||
if selected in ("release", "develop"):
|
||||
self.assertIn("sonar-scan", jobs)
|
||||
self.assertEqual(["sonarcloud"], jobs["sonar-scan"]["context"])
|
||||
|
||||
def test_voyage_owns_complete_template(self):
|
||||
self.write_manifest(profile="voyage")
|
||||
result = self.render(CIRCLE_BRANCH="release/1")
|
||||
self.assertEqual(len(result["jobs"]), 7)
|
||||
self.assertEqual(len(result["jobs"]), 9)
|
||||
self.assertEqual(list(result["workflows"]), ["verify"])
|
||||
self.assertNotIn("__ORB_VERSION__", json.dumps(result))
|
||||
self.assertEqual(result["orbs"]["qqq-orb"], "kingsrook/qqq-orb@0.7.0")
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
"""Voyage delegates live GitOps updates to the existing shared updater."""
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
TEMPLATE = json.loads((Path(__file__).resolve().parents[1] / "src/scripts/templates/voyage.json").read_text())
|
||||
|
||||
|
||||
class VoyageGitOps(unittest.TestCase):
|
||||
def test_live_target_uses_shared_updater_only_after_main_image_publication(self):
|
||||
self.assertNotIn('update-cd-repo', TEMPLATE['jobs'])
|
||||
self.assertEqual(TEMPLATE['orbs']['munitor'], 'kof22/munitor@0.3.11')
|
||||
invocations = [(workflow, entry['munitor/update_cd_repo'])
|
||||
for workflow, body in TEMPLATE['workflows'].items() for entry in body['jobs']
|
||||
if 'munitor/update_cd_repo' in entry]
|
||||
self.assertEqual(len(invocations), 1)
|
||||
workflow, options = invocations[0]
|
||||
self.assertEqual(workflow, 'release')
|
||||
self.assertEqual(options['cd_repo'], 'KofTwentyTwo/cluster-gitops')
|
||||
self.assertEqual(options['cd_path'], 'tenants/voyage/kustomization.yaml')
|
||||
self.assertEqual(options['cd_image_name'], 'ghcr.io/qrun-io/voyage')
|
||||
self.assertEqual(options['cd_format'], 'kustomize')
|
||||
self.assertEqual(options['requires'], ['docker-build'])
|
||||
self.assertEqual(options['context'], ['github'])
|
||||
self.assertEqual(options['filters'], {'branches': {'only': 'main'}})
|
||||
|
||||
def test_updater_receives_published_commit_tag_and_rejects_invalid_revision(self):
|
||||
options = next(entry['munitor/update_cd_repo'] for entry in TEMPLATE['workflows']['release']['jobs']
|
||||
if 'munitor/update_cd_repo' in entry)
|
||||
command = options['pre-steps'][0]['run']['command']
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
env_file = Path(directory) / 'bash-env'
|
||||
for revision in ('a' * 40, '', 'main', 'a' * 39):
|
||||
env_file.write_text('')
|
||||
env = {**os.environ, 'BASH_ENV': str(env_file), 'CIRCLE_SHA1': revision}
|
||||
result = subprocess.run(['bash', '-c', command], env=env, capture_output=True)
|
||||
if revision == 'a' * 40:
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(env_file.read_text(), "export PROJECT_VERSION='aaaaaaa'\n")
|
||||
else:
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertEqual(env_file.read_text(), '')
|
||||
+131
-137
@@ -1,137 +1,131 @@
|
||||
"""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()
|
||||
"""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, 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)) for entry in body["jobs"]}
|
||||
for entry in body["jobs"]:
|
||||
name, options = next(iter(entry.items()))
|
||||
self.assertIn(name, TEMPLATE["jobs"])
|
||||
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.assertIn('overlays/production/kustomization.yaml', json.dumps(jobs["update-cd-repo"]))
|
||||
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()
|
||||
+112
-41
@@ -1,42 +1,113 @@
|
||||
"""Execute Voyage release commands; CD implementation belongs to Munitor."""
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
TEMPLATE = json.loads((ROOT / "src/scripts/templates/voyage.json").read_text())
|
||||
COMMAND = next(step["run"]["command"] for step in TEMPLATE["jobs"]["release-please"]["steps"]
|
||||
if isinstance(step, dict) and "run" in step)
|
||||
|
||||
|
||||
class VoyageRelease(unittest.TestCase):
|
||||
def run_release(self, fail=False):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
npx = root / "npx"
|
||||
npx.write_text('''#!/usr/bin/env python3
|
||||
import json, os, sys
|
||||
with open(os.environ['EVENTS'], 'a') as output:
|
||||
output.write(json.dumps(sys.argv[1:])+'\\n')
|
||||
assert '--target-branch=main' in sys.argv
|
||||
if os.environ['FAILURE']=='true' and 'github-release' in sys.argv: sys.exit(25)
|
||||
''')
|
||||
npx.chmod(0o755)
|
||||
events = root / "events.jsonl"
|
||||
env = {**os.environ, "PATH": str(root) + os.pathsep + os.environ["PATH"],
|
||||
"EVENTS": str(events), "FAILURE": str(fail).lower(), "GITHUB_TOKEN": "fixture-token"}
|
||||
result = subprocess.run(["bash", "-c", COMMAND], cwd=root, env=env, capture_output=True, text=True)
|
||||
return result, [json.loads(line) for line in events.read_text().splitlines()]
|
||||
|
||||
def test_release_targets_main_for_both_commands(self):
|
||||
result, rows = self.run_release()
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual([args[1] for args in rows], ['github-release', 'release-pr'])
|
||||
|
||||
def test_release_failure_is_not_hidden_by_second_command(self):
|
||||
result, rows = self.run_release(fail=True)
|
||||
self.assertEqual(result.returncode, 25, result.stderr)
|
||||
"""Execute shared Voyage release commands against isolated service doubles."""
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
import yaml
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
TEMPLATE = json.loads((ROOT / "src/scripts/templates/voyage.json").read_text())
|
||||
|
||||
|
||||
def command(job):
|
||||
return [step["run"]["command"] for step in TEMPLATE["jobs"][job]["steps"]
|
||||
if isinstance(step, dict) and "run" in step][-1]
|
||||
|
||||
|
||||
class VoyageRelease(unittest.TestCase):
|
||||
def run_job(self, job, failure="", manifest=None):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
bin_dir = root / "bin"
|
||||
bin_dir.mkdir()
|
||||
fake = bin_dir / "fake"
|
||||
fake.write_text("""#!/usr/bin/env python3
|
||||
import json, os, pathlib, subprocess, sys
|
||||
name=pathlib.Path(sys.argv[0]).name
|
||||
args=sys.argv[1:]
|
||||
with open(os.environ['EVENTS'], 'a') as output:
|
||||
output.write(json.dumps([name, args])+'\\n')
|
||||
if name=='docker':
|
||||
if args[0]=='login': sys.stdin.read()
|
||||
if args[0]=='manifest': print('{}')
|
||||
elif name=='jq':
|
||||
sys.stdin.read(); print('sha256:'+'a'*64)
|
||||
elif name=='git':
|
||||
if args[0]=='clone':
|
||||
assert args==['clone','--branch','main','https://github.com/QRun-IO/voyage-cd.git']
|
||||
assert os.environ['GIT_TERMINAL_PROMPT']=='0'
|
||||
askpass=os.environ['GIT_ASKPASS']
|
||||
assert subprocess.check_output([askpass, 'Username for https://github.com']).strip()==b'x-access-token'
|
||||
assert subprocess.check_output([askpass, 'Password for https://github.com']).strip()==b'fixture-token'
|
||||
if os.environ['FAILURE']=='clone': sys.exit(23)
|
||||
p=pathlib.Path('voyage-cd/overlays/production'); p.mkdir(parents=True)
|
||||
(p/'kustomization.yaml').write_text(os.environ['MANIFEST_FIXTURE'])
|
||||
elif args[0]=='diff': sys.exit(1)
|
||||
elif args[0]=='push' and os.environ['FAILURE']=='push': sys.exit(24)
|
||||
elif name=='npx':
|
||||
assert '--target-branch=main' in args
|
||||
if os.environ['FAILURE']=='release' and 'github-release' in args: sys.exit(25)
|
||||
""")
|
||||
fake.chmod(0o755)
|
||||
for name in ("docker", "jq", "git", "npx"):
|
||||
(bin_dir / name).symlink_to(fake)
|
||||
events = root / "events.jsonl"
|
||||
env = {**os.environ, "PATH": str(bin_dir) + os.pathsep + os.environ["PATH"],
|
||||
"MANIFEST_FIXTURE": yaml.safe_dump(manifest if manifest is not None else {"images": [{"name": "ghcr.io/qrun-io/voyage", "newTag": "main"}]}),
|
||||
"EVENTS": str(events), "FAILURE": failure, "GITHUB_TOKEN": "fixture-token",
|
||||
"GHCR_TOKEN": "fixture-ghcr", "GHCR_USERNAME": "fixture-user",
|
||||
"CIRCLE_SHA1": "1" * 40, "CIRCLE_BRANCH": "main"}
|
||||
result = subprocess.run(["bash", "-eo", "pipefail", "-c", command(job)],
|
||||
cwd=root, env=env, capture_output=True, text=True)
|
||||
rows = [json.loads(line) for line in events.read_text().splitlines()] if events.exists() else []
|
||||
content = root / "voyage-cd/overlays/production/kustomization.yaml"
|
||||
return result, rows, content.read_text() if content.exists() else None
|
||||
|
||||
def test_cd_uses_canonical_authenticated_checkout_and_publishes_digest(self):
|
||||
result, rows, content = self.run_job("update-cd-repo")
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(yaml.safe_load(content)['images'], [{'name': 'ghcr.io/qrun-io/voyage', 'digest': 'sha256:' + 'a' * 64}])
|
||||
self.assertIn(['git', ['push', 'origin', 'main']], rows)
|
||||
self.assertNotIn('fixture-token', json.dumps(rows))
|
||||
self.assertNotIn('fixture-token', result.stdout + result.stderr)
|
||||
|
||||
def test_cd_failure_stops_publication(self):
|
||||
for failure, code in (("clone", 23), ("push", 24)):
|
||||
result, rows, _ = self.run_job("update-cd-repo", failure)
|
||||
self.assertEqual(result.returncode, code, result.stderr)
|
||||
if failure == "clone":
|
||||
self.assertFalse(any(name == 'git' and args[0] == 'push' for name, args in rows))
|
||||
|
||||
def test_release_targets_main_for_both_commands(self):
|
||||
result, rows, _ = self.run_job("release-please")
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual([args[1] for name, args in rows if name == 'npx'], ['github-release', 'release-pr'])
|
||||
|
||||
def test_release_failure_is_not_hidden_by_second_command(self):
|
||||
result, rows, _ = self.run_job("release-please", 'release')
|
||||
self.assertEqual(result.returncode, 25, result.stderr)
|
||||
self.assertEqual(len(rows), 1)
|
||||
|
||||
def test_release_commands_do_not_contain_unescaped_circleci_tags(self):
|
||||
# CircleCI parses shell text before execution; bare heredocs are invalid.
|
||||
for job in ("update-cd-repo", "release-please"):
|
||||
self.assertNotRegex(command(job), r"(?<!\\)<<")
|
||||
|
||||
def test_cd_replaces_existing_digest_and_preserves_other_images(self):
|
||||
other = {"name": "other/image", "newTag": "keep"}
|
||||
manifest = {"namespace": "voyage-prod", "images": [other, {"name": "ghcr.io/qrun-io/voyage", "digest": "sha256:" + "b" * 64}]}
|
||||
result, _, content = self.run_job("update-cd-repo", manifest=manifest)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
actual = yaml.safe_load(content)
|
||||
self.assertEqual(actual['namespace'], 'voyage-prod')
|
||||
self.assertEqual(actual['images'][0], other)
|
||||
self.assertEqual(actual['images'][1]['digest'], 'sha256:' + 'a' * 64)
|
||||
|
||||
def test_cd_rejects_missing_or_ambiguous_image_target(self):
|
||||
image = {"name": "ghcr.io/qrun-io/voyage", "newTag": "main"}
|
||||
for images in ([], [image, image]):
|
||||
result, rows, _ = self.run_job("update-cd-repo", manifest={"images": images})
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertFalse(any(name == 'git' and args[0] == 'push' for name, args in rows))
|
||||
Reference in new issue
Block a user