Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d041e3f26 | ||
|
|
1c389210e6 | ||
|
|
9438ab0762 | ||
|
|
7fed7eee82 | ||
|
|
ed880fcb77 | ||
|
|
50fa564006 |
No files matched your search
+248
-238
@@ -1,238 +1,248 @@
|
|||||||
# Standardized QQQ pipelines
|
# Standardized QQQ pipelines
|
||||||
|
|
||||||
The orb owns workflow selection and job configuration. A consumer declares a
|
The orb owns workflow selection and job configuration. A consumer declares a
|
||||||
small manifest; it does not copy pipeline jobs. The initial supported profile is
|
small manifest; it does not copy pipeline jobs. The initial supported profile is
|
||||||
`qbit`; `core` owns the framework's complete acceptance/release graph. Frontend
|
`qbit`; `core` owns the framework's complete acceptance/release graph. Frontend
|
||||||
and CLI profiles described below retain their own publication contracts. Additional
|
and CLI profiles described below retain their own publication contracts. Additional
|
||||||
profiles belong in reviewed `PROFILE_TEMPLATES` renderers in
|
profiles belong in reviewed `PROFILE_TEMPLATES` renderers in
|
||||||
`src/scripts/generate_pipeline.py`, with profile-specific schema and tests. There
|
`src/scripts/generate_pipeline.py`, with profile-specific schema and tests. There
|
||||||
is no arbitrary script or job-YAML passthrough.
|
is no arbitrary script or job-YAML passthrough.
|
||||||
|
|
||||||
Use the same **published** orb version in all three positions below. `0.7.0` is
|
Use the same **published** orb version in all three positions below. `0.7.0` is
|
||||||
an illustrative version, not a claim that this change is published. A development
|
an illustrative version, not a claim that this change is published. A development
|
||||||
orb version can be used for a controlled canary.
|
orb version can be used for a controlled canary.
|
||||||
|
|
||||||
`.circleci/config.yml`:
|
`.circleci/config.yml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: 2.1
|
version: 2.1
|
||||||
setup: true
|
setup: true
|
||||||
orbs:
|
orbs:
|
||||||
qqq-orb: kingsrook/qqq-orb@0.7.0
|
qqq-orb: kingsrook/qqq-orb@0.7.0
|
||||||
workflows:
|
workflows:
|
||||||
setup:
|
setup:
|
||||||
jobs:
|
jobs:
|
||||||
- qqq-orb/generate_pipeline:
|
- qqq-orb/generate_pipeline:
|
||||||
orb_version: "0.7.0"
|
orb_version: "0.7.0"
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
ignore: automation/qbit-rc-pending
|
ignore: automation/qbit-rc-pending
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
```
|
```
|
||||||
|
|
||||||
`.qqq-ci.yml`:
|
`.qqq-ci.yml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
profile: qbit
|
profile: qbit
|
||||||
orb_version: "0.7.0"
|
orb_version: "0.7.0"
|
||||||
default_branch: develop
|
default_branch: develop
|
||||||
java_version: "21"
|
java_version: "21"
|
||||||
browsers: false
|
browsers: false
|
||||||
api_checks: false
|
api_checks: false
|
||||||
docs_only: false
|
docs_only: false
|
||||||
publish:
|
publish:
|
||||||
snapshot: true
|
snapshot: true
|
||||||
release_candidate: true
|
release_candidate: true
|
||||||
release: true
|
release: true
|
||||||
asciidoc: false
|
asciidoc: false
|
||||||
```
|
```
|
||||||
|
|
||||||
Only `profile`, `orb_version` and `default_branch` are required. `default_branch`
|
Only `profile`, `orb_version` and `default_branch` are required. `default_branch`
|
||||||
must be `develop` or `main`; Java must be the string `17` or `21`. Browsers default
|
must be `develop` or `main`; Java must be the string `17` or `21`. Browsers default
|
||||||
to **true** for compatibility: opt out only after verifying that the consumer has
|
to **true** for compatibility: opt out only after verifying that the consumer has
|
||||||
no browser tests. API checks and docs-only default to false. Publication defaults
|
no browser tests. API checks and docs-only default to false. Publication defaults
|
||||||
to true for snapshots, RCs and tagged releases; AsciiDoc publication defaults to
|
to true for snapshots, RCs and tagged releases; AsciiDoc publication defaults to
|
||||||
false. Unknown/duplicate keys, unexpected types, unsupported profiles and a setup
|
false. Unknown/duplicate keys, unexpected types, unsupported profiles and a setup
|
||||||
parameter/manifest version mismatch fail before continuation. The canonical-caller
|
parameter/manifest version mismatch fail before continuation. The canonical-caller
|
||||||
validator also verifies the setup import, filters and profile-specific parameter
|
validator also verifies the setup import, filters and profile-specific parameter
|
||||||
declarations; additional jobs, commands, workflows or orbs fail validation. The
|
declarations; additional jobs, commands, workflows or orbs fail validation. The
|
||||||
parser is pinned to PyYAML 6.0.3 and uses its safe loader.
|
parser is pinned to PyYAML 6.0.3 and uses its safe loader.
|
||||||
|
|
||||||
| Event | Workflow | Job contract |
|
| Event | Workflow | Job contract |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| develop | verify | existing mvn_publish, snapshot |
|
| develop | verify | existing mvn_publish, snapshot |
|
||||||
| release/* | verify | existing mvn_publish, release_candidate |
|
| release/* | verify | existing mvn_publish, release_candidate |
|
||||||
| vX.Y.Z tag resolving to the checkout | verify | existing mvn_publish, release |
|
| vX.Y.Z tag resolving to the checkout | verify | existing mvn_publish, release |
|
||||||
| main, feature/*, hotfix/*, other/unknown branch | verify | existing mvn_test_only |
|
| main, feature/*, hotfix/*, other/unknown branch | verify | existing mvn_test_only |
|
||||||
| Disabled publication or unrecognized/unproven tag | verify | full verification, no publication |
|
| Disabled publication or unrecognized/unproven tag | verify | full verification, no publication |
|
||||||
|
|
||||||
Generated `qbit`, `core`, `frontend-core`, and `frontend-material` pipelines use
|
Generated `qbit`, `core`, `frontend-core`, and `frontend-material` pipelines use
|
||||||
the stable workflow name `verify`. All selected jobs, dependencies and filters
|
the stable workflow name `verify`. All selected jobs, dependencies and filters
|
||||||
remain intact; this adds no executor or duplicate build. Other profiles retain
|
remain intact; this adds no executor or duplicate build. Other profiles retain
|
||||||
their existing workflow names and native checks.
|
their existing workflow names and native checks.
|
||||||
|
|
||||||
When upgrading from legacy workflow names, upgrade the immutable RC worker pin
|
When upgrading from legacy workflow names, upgrade the immutable RC worker pin
|
||||||
alongside the orb so finalization recognizes both names. Confirm the CircleCI
|
alongside the orb so finalization recognizes both names. Confirm the CircleCI
|
||||||
app's successful `verify` check on the exact migration commit before replacing
|
app's successful `verify` check on the exact migration commit before replacing
|
||||||
legacy required contexts. Require `setup` and `verify` on managed branches,
|
legacy required contexts. Require `setup` and `verify` on managed branches,
|
||||||
preserving other required checks and controls. Human approval is not required;
|
preserving other required checks and controls. Human approval is not required;
|
||||||
automated checks authorize the migration.
|
automated checks authorize the migration.
|
||||||
|
|
||||||
The pipeline SHA must match the checkout when Circle supplies it. A tagged release
|
The pipeline SHA must match the checkout when Circle supplies it. A tagged release
|
||||||
must resolve to that checkout; missing local tags are fetched individually. A main
|
must resolve to that checkout; missing local tags are fetched individually. A main
|
||||||
push does **not** publish a release. Migrating a legacy main-publishing consumer
|
push does **not** publish a release. Migrating a legacy main-publishing consumer
|
||||||
therefore requires explicit review of its release contract. Existing direct orb
|
therefore requires explicit review of its release contract. Existing direct orb
|
||||||
callers remain supported.
|
callers remain supported.
|
||||||
|
|
||||||
The setup filter and generated jobs exclude `automation/qbit-rc-pending`, the
|
The setup filter and generated jobs exclude `automation/qbit-rc-pending`, the
|
||||||
shared RC orchestrator's persistent release lock. Lock updates must not trigger
|
shared RC orchestrator's persistent release lock. Lock updates must not trigger
|
||||||
Maven test or publication work.
|
Maven test or publication work.
|
||||||
|
|
||||||
The shared jobs keep the `qqq-maven-registry-credentials` context, complete verify,
|
The shared jobs keep the `qqq-maven-registry-credentials` context, complete verify,
|
||||||
coverage and configured API checks. Publishing retains version management, signed
|
coverage and configured API checks. Publishing retains version management, signed
|
||||||
artifact deployment, Git operations and release handling. Generated calls disable
|
artifact deployment, Git operations and release handling. Generated calls disable
|
||||||
the redundant preliminary compile; they do not skip tests or verification. Existing
|
the redundant preliminary compile; they do not skip tests or verification. Existing
|
||||||
callers retain the compatibility defaults in the jobs.
|
callers retain the compatibility defaults in the jobs.
|
||||||
|
|
||||||
## Core profile
|
## Core profile
|
||||||
|
|
||||||
QBit alone accepts `release_completion: true` (default false). It enables the
|
QBit alone accepts `release_completion: true` (default false). It enables the
|
||||||
shared Maven RC job's `notify_rc_published` only for RC publication, including
|
shared Maven RC job's `notify_rc_published` only for RC publication, including
|
||||||
fail-closed verification that the bumped version was pushed before dispatching
|
fail-closed verification that the bumped version was pushed before dispatching
|
||||||
the completion event. Enable this on a consumer only after its default branch
|
the completion event. Enable this on a consumer only after its default branch
|
||||||
contains the shared completion caller. Snapshot and GA jobs never receive this
|
contains the shared completion caller. Snapshot and GA jobs never receive this
|
||||||
opt-in; other profiles reject the key.
|
opt-in; other profiles reject the key.
|
||||||
|
|
||||||
Use `profile: core` for the QQQ framework. The orb owns the complete baseline
|
Use `profile: core` for the QQQ framework. The orb owns the complete baseline
|
||||||
acceptance, broker conformance, cold bootstrap, coverage, diagnostics, static
|
acceptance, broker conformance, cold bootstrap, coverage, diagnostics, static
|
||||||
analysis and publication graph. Core scripts remain in the core source repository.
|
analysis and publication graph. Core scripts remain in the core source repository.
|
||||||
The independent baseline fixture pins job sets, dependency edges, contexts,
|
The independent baseline fixture pins job sets, dependency edges, contexts,
|
||||||
coverage requirements and actual verification commands across all six workflows.
|
coverage requirements and actual verification commands across all six workflows.
|
||||||
|
|
||||||
Core additionally supports `publish.feature` and `publish.hotfix` (both true by
|
Core additionally supports `publish.feature` and `publish.hotfix` (both true by
|
||||||
default), preserving `publish*` tag and hotfix branch publication. QBit supports
|
default), preserving `publish*` tag and hotfix branch publication. QBit supports
|
||||||
both keys as explicit opt-ins (false by default). QBit feature publishing requires
|
both keys as explicit opt-ins (false by default). QBit feature publishing requires
|
||||||
a `publish*` tag resolving to the checked-out commit; feature branch pushes remain
|
a `publish*` tag resolving to the checked-out commit; feature branch pushes remain
|
||||||
test-only. Snapshot, RC and GA behavior remains distinct; RC/GA/hotfix
|
test-only. Snapshot, RC and GA behavior remains distinct; RC/GA/hotfix
|
||||||
publication still requires the complete source coverage gate. Cold bootstrap and
|
publication still requires the complete source coverage gate. Cold bootstrap and
|
||||||
fresh consumer Maven repositories remain uncached. Shared installer policy replaces
|
fresh consumer Maven repositories remain uncached. Shared installer policy replaces
|
||||||
local package preparation; preliminary compilation is disabled before clean
|
local package preparation; preliminary compilation is disabled before clean
|
||||||
lifecycles and the dependency cache is saved after successful verification.
|
lifecycles and the dependency cache is saved after successful verification.
|
||||||
|
|
||||||
Lambda XML copies remain in sample coverage evidence. The sample JUnit collector
|
Lambda XML copies remain in sample coverage evidence. The sample JUnit collector
|
||||||
excludes those two copied reports because their original module directories are
|
excludes those two copied reports because their original module directories are
|
||||||
already uploaded, avoiding duplicate test identities without dropping evidence.
|
already uploaded, avoiding duplicate test identities without dropping evidence.
|
||||||
|
|
||||||
External core API triggers require these declarations in the tiny **setup** config:
|
External core API triggers require these declarations in the tiny **setup** config:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
parameters:
|
parameters:
|
||||||
mongo_bind_diagnostics:
|
mongo_bind_diagnostics:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
next_acceptance_bundle_url:
|
next_acceptance_bundle_url:
|
||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
next_acceptance_bundle_sha256:
|
next_acceptance_bundle_sha256:
|
||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
next_acceptance_receipt_sha256:
|
next_acceptance_receipt_sha256:
|
||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
```
|
```
|
||||||
|
|
||||||
Forward each value on `qqq-orb/generate_pipeline`, for example
|
Forward each value on `qqq-orb/generate_pipeline`, for example
|
||||||
`mongo_bind_diagnostics: << pipeline.parameters.mongo_bind_diagnostics >>`, and
|
`mongo_bind_diagnostics: << pipeline.parameters.mongo_bind_diagnostics >>`, and
|
||||||
likewise for the three bundle parameters. Requested values become defaults in the
|
likewise for the three bundle parameters. Requested values become defaults in the
|
||||||
continued configuration; the continuation POST deliberately omits `parameters` to
|
continued configuration; the continuation POST deliberately omits `parameters` to
|
||||||
avoid CircleCI's setup/continuation/API parameter conflict. Verify both default and
|
avoid CircleCI's setup/continuation/API parameter conflict. Verify both default and
|
||||||
explicit API-triggered parameter values in the hosted canary before migrating
|
explicit API-triggered parameter values in the hosted canary before migrating
|
||||||
triggering consumers. Other profiles reject non-default core parameters.
|
triggering consumers. Other profiles reject non-default core parameters.
|
||||||
|
|
||||||
## Frontend profiles
|
## Frontend profiles
|
||||||
|
|
||||||
`frontend-material` preserves the Maven frontend build/test/package/publication
|
`frontend-material` preserves the Maven frontend build/test/package/publication
|
||||||
jobs, Java21/Node20 defaults, registry context, feature-tag, RC, GA and hotfix
|
jobs, Java21/Node20 defaults, registry context, feature-tag, RC, GA and hotfix
|
||||||
contracts. Declare setup pipeline parameter `run_playwright` (boolean, default
|
contracts. Declare setup pipeline parameter `run_playwright` (boolean, default
|
||||||
false) and forward `run_playwright: << pipeline.parameters.run_playwright >>` on
|
false) and forward `run_playwright: << pipeline.parameters.run_playwright >>` on
|
||||||
the generator job. Test/snapshot events select exactly one base or Playwright graph,
|
the generator job. Test/snapshot events select exactly one base or Playwright graph,
|
||||||
so enabling visual tests cannot publish twice. Visual testing retains the pinned
|
so enabling visual tests cannot publish twice. Visual testing retains the pinned
|
||||||
Playwright image, npm ci with legacy peer dependencies and report uploads; only
|
Playwright image, npm ci with legacy peer dependencies and report uploads; only
|
||||||
npm downloads (`~/.npm`) are cached, never node_modules.
|
npm downloads (`~/.npm`) are cached, never node_modules.
|
||||||
|
|
||||||
`frontend-core` preserves Node24.21, npm trusted publishing and both existing
|
`frontend-core` preserves Node24.21, npm trusted publishing and both existing
|
||||||
registry/build-sample contexts. Unlike QBit, its existing main-push **and v-tag**
|
registry/build-sample contexts. Unlike QBit, its existing main-push **and v-tag**
|
||||||
release contract remains intentional. Both frontend profiles support explicit
|
release contract remains intentional. Both frontend profiles support explicit
|
||||||
numeric-string `node_version` and publication toggles including feature/hotfix.
|
numeric-string `node_version` and publication toggles including feature/hotfix.
|
||||||
Material also supports `java_version`. Browser/API/AsciiDoc flags are rejected
|
Material also supports `java_version`. Browser/API/AsciiDoc flags are rejected
|
||||||
rather than silently ignored on these profiles. Existing direct jobs remain usable.
|
rather than silently ignored on these profiles. Existing direct jobs remain usable.
|
||||||
|
|
||||||
## CLI profile
|
## CLI profile
|
||||||
|
|
||||||
`cli` owns npm install, generated-client drift, build, unit tests and the real
|
`cli` owns npm install, generated-client drift, build, unit tests and the real
|
||||||
Prism smoke contract through `cli_verify_publish`. Publication is **disabled by
|
Prism smoke contract through `cli_verify_publish`. Publication is **disabled by
|
||||||
default**. To enable the existing v-tag publication, declare `publish.release:
|
default**. To enable the existing v-tag publication, declare `publish.release:
|
||||||
true` plus `publish_context: VERIFIED_CONTEXT_NAME`, after verifying that an
|
true` plus `publish_context: VERIFIED_CONTEXT_NAME`, after verifying that an
|
||||||
existing trusted CircleCI context grants the required GitHub Packages permission.
|
existing trusted CircleCI context grants the required GitHub Packages permission.
|
||||||
No context name or credential availability is inferred from the former Actions
|
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
|
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
|
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
|
existing rc dist-tag. Main pushes never publish. CLI docs-only is currently
|
||||||
rejected because generated-client verification remains mandatory.
|
rejected because generated-client verification remains mandatory.
|
||||||
|
|
||||||
## Conservative documentation routing
|
## Conservative documentation routing
|
||||||
|
|
||||||
With `docs_only: true`, only feature/hotfix and main changes can take the light
|
With `docs_only: true`, only feature/hotfix and main changes can take the light
|
||||||
route. Feature/hotfix branches fetch the declared default branch without tags and
|
route. Feature/hotfix branches fetch the declared default branch without tags and
|
||||||
compare its merge base with HEAD, covering the whole branch. Main compares its first
|
compare its merge base with HEAD, covering the whole branch. Main compares its first
|
||||||
parent. Develop, release branches and all tags remain full. Shallow repositories,
|
parent. Develop, release branches and all tags remain full. Shallow repositories,
|
||||||
missing ancestry, fetch/diff errors, empty diffs and unknown paths remain full.
|
missing ancestry, fetch/diff errors, empty diffs and unknown paths remain full.
|
||||||
|
|
||||||
Only root README.md, CHANGELOG.md, CONTRIBUTING.md and Markdown files below docs/
|
Only root README.md, CHANGELOG.md, CONTRIBUTING.md and Markdown files below docs/
|
||||||
are eligible. Renames are treated as deletion plus addition, so moving code into
|
are eligible. Renames are treated as deletion plus addition, so moving code into
|
||||||
docs cannot hide it. The lightweight job checks whitespace over the proven diff;
|
docs cannot hide it. The lightweight job checks whitespace over the proven diff;
|
||||||
manifest validation already ran in setup. It adds no new security scanner and
|
manifest validation already ran in setup. It adds no new security scanner and
|
||||||
makes no security-scanning claim. Keep docs-only disabled if those paths are build
|
makes no security-scanning claim. Keep docs-only disabled if those paths are build
|
||||||
inputs or packaged application content.
|
inputs or packaged application content.
|
||||||
|
|
||||||
The light route keeps workflow `verify` and names its job
|
The light route keeps workflow `verify` and names its job
|
||||||
`qqq-orb/mvn_test_only`. Verify actual CircleCI/GitHub status contexts on the canary
|
`qqq-orb/mvn_test_only`. Verify actual CircleCI/GitHub status contexts on the canary
|
||||||
before changing any protection rule; workflow/job identity alone is not proof of
|
before changing any protection rule; workflow/job identity alone is not proof of
|
||||||
the hosted context name. Current protections must not be removed speculatively.
|
the hosted context name. Current protections must not be removed speculatively.
|
||||||
|
|
||||||
## Implementation and verification
|
## Implementation and verification
|
||||||
|
|
||||||
The setup job checks out source, installs the pinned parser, runs the embedded
|
The setup job checks out source, installs the pinned parser, runs the embedded
|
||||||
Python resource and invokes CircleCI's native continuation API once. JSON output
|
Python resource and invokes CircleCI's native continuation API once. JSON output
|
||||||
is valid CircleCI configuration YAML; it is saved at
|
is valid CircleCI configuration YAML; it is saved at
|
||||||
`/tmp/qqq-generated-config.json`. No external framework or per-consumer generator
|
`/tmp/qqq-generated-config.json`. No external framework or per-consumer generator
|
||||||
installation is required. Readable templates live in src/scripts/templates. scripts/pack_pipeline.py embeds
|
installation is required. Readable templates live in src/scripts/templates. scripts/pack_pipeline.py embeds
|
||||||
them as base64 into packed_generate_pipeline.py before orb packing, preventing
|
them as base64 into packed_generate_pipeline.py before orb packing, preventing
|
||||||
CircleCI from interpolating template expressions during setup. The orb includes
|
CircleCI from interpolating template expressions during setup. The orb includes
|
||||||
the complete generated resource; no runtime source-tree template access is needed.
|
the complete generated resource; no runtime source-tree template access is needed.
|
||||||
make pack regenerates it and CI rejects a stale generated resource.
|
make pack regenerates it and CI rejects a stale generated resource.
|
||||||
Continuation credentials and response bodies are never printed.
|
Continuation credentials and response bodies are never printed.
|
||||||
|
|
||||||
Run `make test-pipelines` with CircleCI CLI, Python3/PyYAML and Bash available.
|
Run `make test-pipelines` with CircleCI CLI, Python3/PyYAML and Bash available.
|
||||||
Tests use offline temporary Git repositories and a bare origin to cover selection,
|
Tests use offline temporary Git repositories and a bare origin to cover selection,
|
||||||
whole-branch changes, tags, errors, defaults and source/packed parity. The hosted
|
whole-branch changes, tags, errors, defaults and source/packed parity. The hosted
|
||||||
pipeline-contract-test runs the source suite and shared Maven behavioral tests;
|
pipeline-contract-test runs the source suite and shared Maven behavioral tests;
|
||||||
the full local target additionally extracts and executes the actual packed command.
|
the full local target additionally extracts and executes the actual packed command.
|
||||||
|
|
||||||
## Android and MCP policy profiles
|
## Node snapshot versions
|
||||||
|
|
||||||
`android` and `mcp-policy` accept only profile, orb_version and default_branch.
|
The shared Node publisher calculates develop snapshots as
|
||||||
Android retains the audited Android/GCP orb versions and every active unit,
|
`MAJOR.MINOR.NEXT_PATCH-SNAPSHOT.CIRCLE_BUILD_NUM`. A positive CircleCI job number
|
||||||
emulator and Maven-publication step. The emulator now runs on main as well as
|
is required, so independent publication jobs receive distinct npm coordinates.
|
||||||
feature branches so main publication cannot omit its required instrumentation
|
The package version is changed only in the build workspace and published under
|
||||||
gate. Dormant Firebase benchmark and release-build definitions referencing absent
|
the `snapshot` dist-tag. No snapshot version commit is pushed: the branch remains
|
||||||
app/macrobenchmark modules are not scheduled or copied into the profile.
|
at the source revision whose required checks ran, avoiding unchecked `[skip ci]`
|
||||||
|
heads and recursive publication. Stable, RC and hotfix version policies are unchanged.
|
||||||
MCP policy validation remains a small Python container validating all visible YAML
|
|
||||||
and required pattern fields. Its existing PyYAML dependency is pinned to 6.0.3.
|
## Android and MCP policy profiles
|
||||||
Neither profile introduces Maven/JUnit stand-ins for its actual tests.
|
|
||||||
|
`android` and `mcp-policy` accept only profile, orb_version and default_branch.
|
||||||
`tests/test_mobile_policy_profiles.py` protects Android steps and dependency edges
|
Android retains the audited Android/GCP orb versions and every active unit,
|
||||||
and executes the policy validator with valid, incomplete and malformed documents.
|
emulator and Maven-publication step. The emulator now runs on main as well as
|
||||||
The generator suite verifies source/packed parity for both profiles.
|
feature branches so main publication cannot omit its required instrumentation
|
||||||
|
gate. Dormant Firebase benchmark and release-build definitions referencing absent
|
||||||
|
app/macrobenchmark modules are not scheduled or copied into the profile.
|
||||||
|
|
||||||
|
MCP policy validation remains a small Python container validating all visible YAML
|
||||||
|
and required pattern fields. Its existing PyYAML dependency is pinned to 6.0.3.
|
||||||
|
Neither profile introduces Maven/JUnit stand-ins for its actual tests.
|
||||||
|
|
||||||
|
`tests/test_mobile_policy_profiles.py` protects Android steps and dependency edges
|
||||||
|
and executes the policy validator with valid, incomplete and malformed documents.
|
||||||
|
The generator suite verifies source/packed parity for both profiles.
|
||||||
@@ -3,7 +3,7 @@ description: >
|
|||||||
- Adds SSH keys for Git operations
|
- Adds SSH keys for Git operations
|
||||||
- Sets up Git identity for version commits
|
- Sets up Git identity for version commits
|
||||||
- Synchronizes NPM version
|
- Synchronizes NPM version
|
||||||
- Commits version changes if modified (skipped for feature branches)
|
- Commits version changes if modified (skipped for feature and snapshot builds)
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
branch_type:
|
branch_type:
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ def node_artifact_template(config, branch, tag):
|
|||||||
lines = ["registry=https://registry.npmjs.org/"]
|
lines = ["registry=https://registry.npmjs.org/"]
|
||||||
lines += [scope + ":registry=https://npm.pkg.github.com/" for scope in config["npm_scopes"]]
|
lines += [scope + ":registry=https://npm.pkg.github.com/" for scope in config["npm_scopes"]]
|
||||||
if config["npm_scopes"]:
|
if config["npm_scopes"]:
|
||||||
lines.append("//npm.pkg.github.com/:_authToken=${NPM_TOKEN}")
|
lines.append("//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}")
|
||||||
npmrc = "printf '%s\\n' " + " ".join("'" + line + "'" for line in lines) + " >> .npmrc"
|
npmrc = "printf '%s\\n' " + " ".join("'" + line + "'" for line in lines) + " >> .npmrc"
|
||||||
steps = ["checkout", {"run": {"name": "Configure npm registries", "command": npmrc}},
|
steps = ["checkout", {"run": {"name": "Configure npm registries", "command": npmrc}},
|
||||||
{"restore_cache": {"keys": ['node-artifact-npm-v1-{{ checksum "package-lock.json" }}', 'node-artifact-npm-v1-']}},
|
{"restore_cache": {"keys": ['node-artifact-npm-v1-{{ checksum "package-lock.json" }}', 'node-artifact-npm-v1-']}},
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ echo "Publishing version: $VERSION"
|
|||||||
if [[ "$VERSION" =~ -RC\.[0-9]+$ ]]; then
|
if [[ "$VERSION" =~ -RC\.[0-9]+$ ]]; then
|
||||||
NPM_TAG="rc"
|
NPM_TAG="rc"
|
||||||
echo "Detected RC version - using tag: $NPM_TAG"
|
echo "Detected RC version - using tag: $NPM_TAG"
|
||||||
elif [[ "$VERSION" =~ -SNAPSHOT$ ]]; then
|
elif [[ "$VERSION" =~ -SNAPSHOT(\.[1-9][0-9]*)?$ ]]; then
|
||||||
NPM_TAG="snapshot"
|
NPM_TAG="snapshot"
|
||||||
echo "Detected SNAPSHOT version - using tag: $NPM_TAG"
|
echo "Detected SNAPSHOT version - using tag: $NPM_TAG"
|
||||||
elif [[ "$VERSION" =~ -(alpha|beta) ]]; then
|
elif [[ "$VERSION" =~ -(alpha|beta) ]]; then
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
## It also pushes the changes back to the current branch.
|
## It also pushes the changes back to the current branch.
|
||||||
##
|
##
|
||||||
## Process:
|
## Process:
|
||||||
## 1. Skips for feature branches (ephemeral versions)
|
## 1. Skips for feature and snapshot builds (ephemeral versions)
|
||||||
## 2. Checks if package.json has been modified
|
## 2. Checks if package.json has been modified
|
||||||
## 3. Extracts the new version from package.json
|
## 3. Extracts the new version from package.json
|
||||||
## 4. Commits the changes with skip ci flag
|
## 4. Commits the changes with skip ci flag
|
||||||
@@ -22,12 +22,12 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
## Skip version commit for feature branches ##
|
## Skip version commit for feature and snapshot builds ##
|
||||||
## Feature versions are ephemeral and don't need to be ##
|
## These versions are ephemeral and don't need to be ##
|
||||||
## persisted back to the repository ##
|
## persisted back to the repository ##
|
||||||
################################################################
|
################################################################
|
||||||
if [[ "$BRANCH_TYPE" == "feature" ]]; then
|
if [[ "$BRANCH_TYPE" == "feature" || "$BRANCH_TYPE" == "snapshot" ]]; then
|
||||||
echo "Skipping version commit for feature branch (ephemeral versions)"
|
echo "Skipping version commit for $BRANCH_TYPE build (ephemeral version)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import base64
|
|||||||
import zlib
|
import zlib
|
||||||
CORE_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNrtPdl22ziy7/0VuOrM2M6YpPclifvcxHbfeCar48z0nChXByJBiW1uJig7Ponn26cKACmKIilSluUlTr/IJFAo1F6FAvv7L4S0zlnEncBvPSNr+uoyPglpRD0Ww3N4+B2ewDMv8HtBp+v4VsdyaM8PeOyYw/cwIr4MGfzd6gaBy6jfWk5eWMymAzeGdzZ1OROPr+Tbls++xR1qmiyMqW+yTnfgWy7rDCK3CDSPI8fvFUFuteqA5X26trk1U8gRM5kTxtcC/YsC3wqibobkZ2dnGjzBgacAgUdBcGqoh/+7om/pu610phl4HvWtzGwe0yjWBNs0ZJsWR9RkWQR5zEKc8E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bdpROtG5FLab8zmYg1dHe5ZNKbL5PXJyQdRJFInYiQTJ9aoKL/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+pI0IoHEEEb6yjK1JjAENlwatvK7OdH2IYTY3IwWLks4+QIdflpeIZYJoqYWMlhTXObH0sjFqOB64OT/HLa/zM9lypig77m/5rE51WzaKl25uvq2CJB+fdFO/UR0swaWBxyjsPpZvRU7EDkZswFp11ZFHDWEgEx8qJVp/OoZof2Md1qViKYqyuSSfhgiJrWnKRo0OsQB/jvTN6TUnTTLTPt9NZZjNZNaNvt9CDvgTWXHUX9Kad50VBUAV0ClpIcGccFK9NcZ225QhEhCSMFZBxUbESwHaE9CEkxw/3rOyV/uwcVvnd9fswKSTKpKEA92+efgRN3oexIwfpAi+IhQyHyEmjye/A3nP5SMa57cof9LebVW693HIxexsTg+avg1kojfXLc6wUxaXmHrmvbvgLWNtQgmaE4h5bW8X6quUNmctfRdREPykCLqM=")))
|
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+tz2zYS/56/AqPJXJKeSUqqHzndqBNbdm1NGzsnObneVDkNREISLBKgAVCWYuv+9lvwpQepV2K1TpoPsUhggV38drEPgLl/hlBhSISknBUqqGyW9nTLDe9IeL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XKRlo3BgHE8IVqqMe6Y5iTLgPSUgfVsjqaXOSDVwJAiw7t8gA6GS5ZQ3ebfWUI52dRZcujqF1VefE69m8CjhFWU2y4CN88sXp6CFWtf3xp365uP63imznAp1d2CHK5O3t7da9tHza1iuEdM6LqXv+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=")))
|
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==")))
|
STARTER_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNp1UMGKwkAMvc9XlDmKtejR0yJ42MsKCl5EQnUzZbbTiZ0ZqiL9d1OpWqt7y3t5eS/JRUSRrNB5TVZOo8loPGwYcjvP8MI1o7IsY2aYkLm2mXdEedKSXwCL5QzW8+Xqe/EDIHmkvnkcyeXK0LFjFNAHIGvOD4rJP7plbVocPTrd7KSoLHwab2V7Kg7aIOxQkUPgi7RqZCo1Hod9rQ14Ci+ZnbQirdDGDjPtgzvHe4e/aINmI/ki3/ZslTaBH/m2W3N3mn3iuaMzy/s2n01Gg0T2BLX4Dz3re7UVd1SLWlwByepyJQ==")))
|
||||||
@@ -533,7 +533,7 @@ def node_artifact_template(config, branch, tag):
|
|||||||
lines = ["registry=https://registry.npmjs.org/"]
|
lines = ["registry=https://registry.npmjs.org/"]
|
||||||
lines += [scope + ":registry=https://npm.pkg.github.com/" for scope in config["npm_scopes"]]
|
lines += [scope + ":registry=https://npm.pkg.github.com/" for scope in config["npm_scopes"]]
|
||||||
if config["npm_scopes"]:
|
if config["npm_scopes"]:
|
||||||
lines.append("//npm.pkg.github.com/:_authToken=${NPM_TOKEN}")
|
lines.append("//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}")
|
||||||
npmrc = "printf '%s\\n' " + " ".join("'" + line + "'" for line in lines) + " >> .npmrc"
|
npmrc = "printf '%s\\n' " + " ".join("'" + line + "'" for line in lines) + " >> .npmrc"
|
||||||
steps = ["checkout", {"run": {"name": "Configure npm registries", "command": npmrc}},
|
steps = ["checkout", {"run": {"name": "Configure npm registries", "command": npmrc}},
|
||||||
{"restore_cache": {"keys": ['node-artifact-npm-v1-{{ checksum "package-lock.json" }}', 'node-artifact-npm-v1-']}},
|
{"restore_cache": {"keys": ['node-artifact-npm-v1-{{ checksum "package-lock.json" }}', 'node-artifact-npm-v1-']}},
|
||||||
|
|||||||
@@ -28,13 +28,17 @@ if [[ "$CURRENT_BRANCH" == "main" ]]; then
|
|||||||
TARGET_VERSION="$MAJOR_MINOR.0"
|
TARGET_VERSION="$MAJOR_MINOR.0"
|
||||||
echo "Main branch detected - targeting release version: $TARGET_VERSION"
|
echo "Main branch detected - targeting release version: $TARGET_VERSION"
|
||||||
elif [[ "$CURRENT_BRANCH" == "develop" ]]; then
|
elif [[ "$CURRENT_BRANCH" == "develop" ]]; then
|
||||||
# Develop branch - should be a snapshot version (e.g., 1.0.127-SNAPSHOT)
|
# Snapshot coordinates are unique per CI job without pushing a version commit.
|
||||||
# Increment patch version for develop
|
# The source head stays the head whose required checks are being reported.
|
||||||
|
if [[ ! "${CIRCLE_BUILD_NUM:-}" =~ ^[1-9][0-9]*$ ]]; then
|
||||||
|
echo "ERROR: Snapshot publication requires a positive CIRCLE_BUILD_NUM" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
MAJOR_MINOR_PATCH="${NPM_VERSION%-*}"
|
MAJOR_MINOR_PATCH="${NPM_VERSION%-*}"
|
||||||
MAJOR_MINOR="${MAJOR_MINOR_PATCH%.*}"
|
MAJOR_MINOR="${MAJOR_MINOR_PATCH%.*}"
|
||||||
PATCH="${MAJOR_MINOR_PATCH##*.}"
|
PATCH="${MAJOR_MINOR_PATCH##*.}"
|
||||||
NEW_PATCH=$((PATCH + 1))
|
NEW_PATCH=$((PATCH + 1))
|
||||||
TARGET_VERSION="$MAJOR_MINOR.$NEW_PATCH-SNAPSHOT"
|
TARGET_VERSION="$MAJOR_MINOR.$NEW_PATCH-SNAPSHOT.$CIRCLE_BUILD_NUM"
|
||||||
echo "Develop branch detected - targeting snapshot version: $TARGET_VERSION"
|
echo "Develop branch detected - targeting snapshot version: $TARGET_VERSION"
|
||||||
elif [[ "$CURRENT_BRANCH" == release/* ]]; then
|
elif [[ "$CURRENT_BRANCH" == release/* ]]; then
|
||||||
# Release branch - should be a release candidate (e.g., 1.0.0-RC.1, 1.0.0-RC.2, etc.)
|
# Release branch - should be a release candidate (e.g., 1.0.0-RC.1, 1.0.0-RC.2, etc.)
|
||||||
|
|||||||
+574
-585
File diff suppressed because it is too large.
Load diff
@@ -254,7 +254,7 @@ class PipelineTests(unittest.TestCase):
|
|||||||
artifacts = [step["store_artifacts"] for step in steps if isinstance(step, dict) and "store_artifacts" in step]
|
artifacts = [step["store_artifacts"] for step in steps if isinstance(step, dict) and "store_artifacts" in step]
|
||||||
self.assertEqual(int(branch in ("main", "feature/initial-dev")), len(artifacts))
|
self.assertEqual(int(branch in ("main", "feature/initial-dev")), len(artifacts))
|
||||||
self.assertNotIn("npm publish", str(output))
|
self.assertNotIn("npm publish", str(output))
|
||||||
self.assertIn("${NPM_TOKEN}", commands[0])
|
self.assertIn("${GITHUB_TOKEN}", commands[0])
|
||||||
self.assertEqual({"ignore": "/.*/"}, output["workflows"]["verify"]["jobs"][0]["node_artifact"]["filters"]["tags"])
|
self.assertEqual({"ignore": "/.*/"}, output["workflows"]["verify"]["jobs"][0]["node_artifact"]["filters"]["tags"])
|
||||||
|
|
||||||
def test_node_artifact_requires_explicit_minor_or_patch_image(self):
|
def test_node_artifact_requires_explicit_minor_or_patch_image(self):
|
||||||
@@ -777,7 +777,7 @@ class PipelineTests(unittest.TestCase):
|
|||||||
expected = copy.deepcopy(template)
|
expected = copy.deepcopy(template)
|
||||||
expected["workflows"] = {"verify": expected["workflows"][selected]}
|
expected["workflows"] = {"verify": expected["workflows"][selected]}
|
||||||
self.assertEqual(expected, result)
|
self.assertEqual(expected, result)
|
||||||
jobs = {next(iter(job)): next(iter(job.values())) for job in result["workflows"]["verify"]["jobs"]}
|
jobs = {next(iter(job.values())).get("name", next(iter(job))): next(iter(job.values())) for job in result["workflows"]["verify"]["jobs"]}
|
||||||
if selected == "release":
|
if selected == "release":
|
||||||
for name in ("update-cd-repo", "release-please"):
|
for name in ("update-cd-repo", "release-please"):
|
||||||
self.assertEqual({"branches": {"only": "main"}}, jobs[name]["filters"])
|
self.assertEqual({"branches": {"only": "main"}}, jobs[name]["filters"])
|
||||||
@@ -788,7 +788,7 @@ class PipelineTests(unittest.TestCase):
|
|||||||
def test_voyage_owns_complete_template(self):
|
def test_voyage_owns_complete_template(self):
|
||||||
self.write_manifest(profile="voyage")
|
self.write_manifest(profile="voyage")
|
||||||
result = self.render(CIRCLE_BRANCH="release/1")
|
result = self.render(CIRCLE_BRANCH="release/1")
|
||||||
self.assertEqual(len(result["jobs"]), 9)
|
self.assertEqual(len(result["jobs"]), 8)
|
||||||
self.assertEqual(list(result["workflows"]), ["verify"])
|
self.assertEqual(list(result["workflows"]), ["verify"])
|
||||||
self.assertNotIn("__ORB_VERSION__", json.dumps(result))
|
self.assertNotIn("__ORB_VERSION__", json.dumps(result))
|
||||||
self.assertEqual(result["orbs"]["qqq-orb"], "kingsrook/qqq-orb@0.7.0")
|
self.assertEqual(result["orbs"]["qqq-orb"], "kingsrook/qqq-orb@0.7.0")
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
"""GitHub Packages auth stays a literal, host-scoped runtime reference."""
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
spec = importlib.util.spec_from_file_location('pipeline', ROOT / 'src/scripts/generate_pipeline.py')
|
||||||
|
pipeline = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(pipeline)
|
||||||
|
|
||||||
|
|
||||||
|
class NodeArtifactAuth(unittest.TestCase):
|
||||||
|
def test_registry_configuration_uses_github_credential_without_embedding_it(self):
|
||||||
|
config = {'node_version': '20.19', 'context': 'packages', 'npm_scopes': ['@nocode-js', '@qrunio'],
|
||||||
|
'artifact_path': 'dist/component.js', 'build_branches': ['develop']}
|
||||||
|
command = pipeline.node_artifact_template(config, 'develop', '')['jobs']['node_artifact']['steps'][1]['run']['command']
|
||||||
|
with tempfile.TemporaryDirectory() as directory:
|
||||||
|
env = {**os.environ, 'GITHUB_TOKEN': 'github-fixture-secret', 'NPM_TOKEN': 'npm-fixture-secret'}
|
||||||
|
result = subprocess.run(['bash', '-c', command], cwd=directory, env=env, capture_output=True, text=True)
|
||||||
|
self.assertEqual(result.returncode, 0, result.stderr)
|
||||||
|
contents = (Path(directory) / '.npmrc').read_text()
|
||||||
|
self.assertEqual(contents.splitlines(), ['registry=https://registry.npmjs.org/',
|
||||||
|
'@nocode-js:registry=https://npm.pkg.github.com/', '@qrunio:registry=https://npm.pkg.github.com/',
|
||||||
|
'//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}'])
|
||||||
|
for value in ('github-fixture-secret', 'npm-fixture-secret'):
|
||||||
|
self.assertNotIn(value, contents + result.stdout + result.stderr)
|
||||||
@@ -76,6 +76,7 @@ sys.exit(subprocess.run([os.environ['TEST_REAL_NODE'], *sys.argv[1:]], input=sou
|
|||||||
def test_tags_and_legacy_authentication(self):
|
def test_tags_and_legacy_authentication(self):
|
||||||
for trusted in [True, False]:
|
for trusted in [True, False]:
|
||||||
for version, tag in [('1.0.0-RC.1', 'rc'), ('1.0.0-SNAPSHOT', 'snapshot'),
|
for version, tag in [('1.0.0-RC.1', 'rc'), ('1.0.0-SNAPSHOT', 'snapshot'),
|
||||||
|
('1.0.0-SNAPSHOT.101', 'snapshot'),
|
||||||
('1.0.0-alpha.1', 'next'), ('1.0.0-beta.1', 'next'), ('1.0.0', 'latest')]:
|
('1.0.0-alpha.1', 'next'), ('1.0.0-beta.1', 'next'), ('1.0.0', 'latest')]:
|
||||||
with self.subTest(trusted=trusted, version=version):
|
with self.subTest(trusted=trusted, version=version):
|
||||||
result, args, oidc = self.run_publish(version, trusted)
|
result, args, oidc = self.run_publish(version, trusted)
|
||||||
@@ -133,5 +134,38 @@ sys.exit(subprocess.run([os.environ['TEST_REAL_NODE'], *sys.argv[1:]], input=sou
|
|||||||
self.assertNotIn('Successfully published', result.stdout)
|
self.assertNotIn('Successfully published', result.stdout)
|
||||||
|
|
||||||
|
|
||||||
|
class SnapshotVersionTests(unittest.TestCase):
|
||||||
|
def test_snapshot_jobs_keep_source_head_and_publish_distinct_versions(self):
|
||||||
|
with tempfile.TemporaryDirectory() as directory:
|
||||||
|
root = Path(directory)
|
||||||
|
def git(*args):
|
||||||
|
return subprocess.check_output(['git', *args], cwd=root, text=True).strip()
|
||||||
|
git('init', '-q', '-b', 'develop')
|
||||||
|
source = '{"name": "snapshot-test", "version": "0.40.27-SNAPSHOT"}\n'
|
||||||
|
package = root / 'package.json'
|
||||||
|
package.write_text(source)
|
||||||
|
git('add', 'package.json')
|
||||||
|
git('-c', 'user.name=Test', '-c', 'user.email=test@example.invalid',
|
||||||
|
'-c', 'commit.gpgsign=false', 'commit', '-qm', 'initial source')
|
||||||
|
head = git('rev-parse', 'HEAD')
|
||||||
|
for number in ('101', '102'):
|
||||||
|
package.write_text(source)
|
||||||
|
env = dict(os.environ, CIRCLE_BUILD_NUM=number, BRANCH_TYPE='snapshot')
|
||||||
|
subprocess.run(['bash', str(SCRIPT.parent / 'sync-npm-version.sh')],
|
||||||
|
cwd=root, env=env, check=True, capture_output=True)
|
||||||
|
self.assertEqual(json.loads(package.read_text())['version'], '0.40.28-SNAPSHOT.' + number)
|
||||||
|
subprocess.run(['bash', str(SCRIPT.parent / 'node_version_commit.sh')],
|
||||||
|
cwd=root, env=env, check=True, capture_output=True)
|
||||||
|
self.assertEqual(git('rev-parse', 'HEAD'), head)
|
||||||
|
self.assertEqual(git('diff', '--cached', '--name-only'), '')
|
||||||
|
for number in ('', '0', '01', '-1', 'abc'):
|
||||||
|
package.write_text(source)
|
||||||
|
result = subprocess.run(['bash', str(SCRIPT.parent / 'sync-npm-version.sh')],
|
||||||
|
cwd=root, env=dict(os.environ, CIRCLE_BUILD_NUM=number),
|
||||||
|
capture_output=True)
|
||||||
|
self.assertNotEqual(result.returncode, 0)
|
||||||
|
self.assertEqual(package.read_text(), source)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
"""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
-130
@@ -1,130 +1,131 @@
|
|||||||
"""Voyage's authoritative CI contracts, extracted from source 9f598cc105ef."""
|
"""Voyage's authoritative CI contracts, extracted from source 9f598cc105ef."""
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
TEMPLATE = json.loads((Path(__file__).resolve().parents[1] / "src/scripts/templates/voyage.json").read_text())
|
TEMPLATE = json.loads((Path(__file__).resolve().parents[1] / "src/scripts/templates/voyage.json").read_text())
|
||||||
|
|
||||||
|
|
||||||
def matches(pattern, branch):
|
def matches(pattern, branch):
|
||||||
if isinstance(pattern, list):
|
if isinstance(pattern, list):
|
||||||
return any(matches(p, branch) for p in pattern)
|
return any(matches(p, branch) for p in pattern)
|
||||||
if pattern.startswith("/") and pattern.endswith("/"):
|
if pattern.startswith("/") and pattern.endswith("/"):
|
||||||
return re.fullmatch(pattern[1:-1], branch) is not None
|
return re.fullmatch(pattern[1:-1], branch) is not None
|
||||||
return pattern == branch
|
return pattern == branch
|
||||||
|
|
||||||
|
|
||||||
def selected(branch):
|
def selected(branch):
|
||||||
found = []
|
found = []
|
||||||
for workflow, body in TEMPLATE["workflows"].items():
|
for workflow, body in TEMPLATE["workflows"].items():
|
||||||
for invocation in body["jobs"]:
|
for invocation in body["jobs"]:
|
||||||
name, options = next(iter(invocation.items()))
|
name, options = next(iter(invocation.items()))
|
||||||
filters = options.get("filters", {}).get("branches", {})
|
filters = options.get("filters", {}).get("branches", {})
|
||||||
if "only" in filters and not matches(filters["only"], branch):
|
if "only" in filters and not matches(filters["only"], branch):
|
||||||
continue
|
continue
|
||||||
if "ignore" in filters and matches(filters["ignore"], branch):
|
if "ignore" in filters and matches(filters["ignore"], branch):
|
||||||
continue
|
continue
|
||||||
found.append((workflow, name, options))
|
found.append((workflow, options.get("name", name), options))
|
||||||
return found
|
return found
|
||||||
|
|
||||||
|
|
||||||
class VoyageContract(unittest.TestCase):
|
class VoyageContract(unittest.TestCase):
|
||||||
def test_each_supported_branch_has_one_validation_owner(self):
|
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")):
|
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):
|
with self.subTest(branch=branch):
|
||||||
jobs = selected(branch)
|
jobs = selected(branch)
|
||||||
self.assertEqual({w for w, _, _ in jobs}, {workflow})
|
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 jobs].count("build-and-test"), 1)
|
||||||
self.assertEqual(selected("release-please--branches--main"), [])
|
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"]
|
def test_verify_owns_tests_quality_and_coverage_without_skips(self):
|
||||||
self.assertNotIn("coverage", jobs)
|
jobs = TEMPLATE["jobs"]
|
||||||
self.assertNotIn("code-quality", jobs)
|
self.assertNotIn("coverage", jobs)
|
||||||
steps = jobs["build-and-test"]["steps"]
|
self.assertNotIn("code-quality", jobs)
|
||||||
commands = [s["run"]["command"] for s in steps if isinstance(s, dict) and "run" in s]
|
steps = jobs["build-and-test"]["steps"]
|
||||||
self.assertEqual(commands, ["mvn clean verify -B -T4 --update-snapshots --no-transfer-progress"])
|
commands = [s["run"]["command"] for s in steps if isinstance(s, dict) and "run" in s]
|
||||||
full = json.dumps(jobs)
|
self.assertEqual(commands, ["mvn clean verify -B -T4 --update-snapshots --no-transfer-progress"])
|
||||||
self.assertNotIn("mvn test", full)
|
full = json.dumps(jobs)
|
||||||
self.assertNotIn("jacoco.skip", full)
|
self.assertNotIn("mvn test", full)
|
||||||
self.assertNotIn("skipTests", full)
|
self.assertNotIn("jacoco.skip", full)
|
||||||
self.assertLess(steps.index("qqq-orb/mvn_cache_restore"), steps.index("qqq-orb/mvn_cache_save"))
|
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"]
|
def test_unit_integration_and_coverage_evidence_retained(self):
|
||||||
results = [s["store_test_results"]["path"] for s in steps if isinstance(s, dict) and "store_test_results" in s]
|
steps = TEMPLATE["jobs"]["build-and-test"]["steps"]
|
||||||
self.assertEqual(results, ["target/surefire-reports", "target/failsafe-reports"])
|
results = [s["store_test_results"]["path"] for s in steps if isinstance(s, dict) and "store_test_results" in s]
|
||||||
paths = next(s["persist_to_workspace"]["paths"] for s in steps if isinstance(s, dict) and "persist_to_workspace" in s)
|
self.assertEqual(results, ["target/surefire-reports", "target/failsafe-reports"])
|
||||||
for path in ("target/site", "target/jacoco.exec", "target/voyage.jar", "target/classes", "target/test-classes"):
|
paths = next(s["persist_to_workspace"]["paths"] for s in steps if isinstance(s, dict) and "persist_to_workspace" in s)
|
||||||
self.assertIn(path, paths)
|
for path in ("target/site", "target/jacoco.exec", "target/voyage.jar", "target/classes", "target/test-classes"):
|
||||||
sonar = json.dumps(TEMPLATE["jobs"]["sonar-scan"])
|
self.assertIn(path, paths)
|
||||||
self.assertIn("target/site/jacoco/jacoco.xml", sonar)
|
sonar = json.dumps(TEMPLATE["jobs"]["sonar-scan"])
|
||||||
self.assertIn("attach_workspace", sonar)
|
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():
|
def test_all_workflow_dependencies_exist_and_preserve_release_boundaries(self):
|
||||||
names = {next(iter(entry)) for entry in body["jobs"]}
|
for workflow, body in TEMPLATE["workflows"].items():
|
||||||
for entry in body["jobs"]:
|
names = {next(iter(entry.values())).get("name", next(iter(entry))) for entry in body["jobs"]}
|
||||||
name, options = next(iter(entry.items()))
|
for entry in body["jobs"]:
|
||||||
self.assertIn(name, TEMPLATE["jobs"])
|
name, options = next(iter(entry.items()))
|
||||||
self.assertTrue(set(options.get("requires", [])).issubset(names))
|
self.assertTrue(name in TEMPLATE["jobs"] or name == "munitor/update_cd_repo")
|
||||||
for branch in ("feature/example", "release/1.0", "develop"):
|
self.assertTrue(set(options.get("requires", [])).issubset(names))
|
||||||
self.assertNotIn("update-cd-repo", [n for _, n, _ in selected(branch)])
|
for branch in ("feature/example", "release/1.0", "develop"):
|
||||||
self.assertNotIn("release-please", [n for _, n, _ in selected(branch)])
|
self.assertNotIn("update-cd-repo", [n for _, n, _ in selected(branch)])
|
||||||
main = {n: o for _, n, o in selected("main")}
|
self.assertNotIn("release-please", [n for _, n, _ in selected(branch)])
|
||||||
self.assertEqual(main["update-cd-repo"]["requires"], ["docker-build"])
|
main = {n: o for _, n, o in selected("main")}
|
||||||
self.assertEqual(main["release-please"]["requires"], ["docker-build"])
|
self.assertEqual(main["update-cd-repo"]["requires"], ["docker-build"])
|
||||||
self.assertEqual(main["docker-build"]["requires"], ["build-and-test", "secrets-scan", "sast-scan", "security-scan"])
|
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"]
|
def test_dependency_scan_propagates_findings_and_operational_errors(self):
|
||||||
if isinstance(s, dict) and "run" in s)
|
command = next(s["run"]["command"] for s in TEMPLATE["jobs"]["security-scan"]["steps"]
|
||||||
with tempfile.TemporaryDirectory() as directory:
|
if isinstance(s, dict) and "run" in s)
|
||||||
root = Path(directory)
|
with tempfile.TemporaryDirectory() as directory:
|
||||||
(root / "bin").mkdir()
|
root = Path(directory)
|
||||||
docker = root / "bin/docker"
|
(root / "bin").mkdir()
|
||||||
docker.write_text('#!/bin/sh\nexit "$SCANNER_RESULT"\n')
|
docker = root / "bin/docker"
|
||||||
docker.chmod(0o755)
|
docker.write_text('#!/bin/sh\nexit "$SCANNER_RESULT"\n')
|
||||||
(root / "target").mkdir()
|
docker.chmod(0o755)
|
||||||
(root / "target/voyage.jar").write_bytes(b"artifact")
|
(root / "target").mkdir()
|
||||||
env = {**os.environ, "HOME": directory, "PATH": str(root / "bin") + os.pathsep + os.environ["PATH"],
|
(root / "target/voyage.jar").write_bytes(b"artifact")
|
||||||
"CIRCLE_BRANCH": "develop"}
|
env = {**os.environ, "HOME": directory, "PATH": str(root / "bin") + os.pathsep + os.environ["PATH"],
|
||||||
for code in (0, 1, 2):
|
"CIRCLE_BRANCH": "develop"}
|
||||||
result = subprocess.run(["bash", "-c", command], cwd=root,
|
for code in (0, 1, 2):
|
||||||
env={**env, "SCANNER_RESULT": str(code)}, capture_output=True)
|
result = subprocess.run(["bash", "-c", command], cwd=root,
|
||||||
self.assertEqual(result.returncode, code)
|
env={**env, "SCANNER_RESULT": str(code)}, capture_output=True)
|
||||||
(root / "target/voyage.jar").unlink()
|
self.assertEqual(result.returncode, code)
|
||||||
result = subprocess.run(["bash", "-c", command], cwd=root,
|
(root / "target/voyage.jar").unlink()
|
||||||
env={**env, "SCANNER_RESULT": "0"}, capture_output=True)
|
result = subprocess.run(["bash", "-c", command], cwd=root,
|
||||||
self.assertNotEqual(result.returncode, 0)
|
env={**env, "SCANNER_RESULT": "0"}, capture_output=True)
|
||||||
|
self.assertNotEqual(result.returncode, 0)
|
||||||
def test_security_policies_and_destinations_preserved(self):
|
|
||||||
jobs = TEMPLATE["jobs"]
|
def test_security_policies_and_destinations_preserved(self):
|
||||||
self.assertIn('--exit-code 1', json.dumps(jobs["docker-build"]))
|
jobs = TEMPLATE["jobs"]
|
||||||
self.assertIn('--severity CRITICAL,HIGH', json.dumps(jobs["docker-build"]))
|
self.assertIn('--exit-code 1', json.dumps(jobs["docker-build"]))
|
||||||
self.assertIn('ghcr.io/qrun-io/voyage', json.dumps(jobs["docker-build"]))
|
self.assertIn('--severity CRITICAL,HIGH', json.dumps(jobs["docker-build"]))
|
||||||
self.assertIn('overlays/production/kustomization.yaml', json.dumps(jobs["update-cd-repo"]))
|
self.assertIn('ghcr.io/qrun-io/voyage', json.dumps(jobs["docker-build"]))
|
||||||
owasp = '\n'.join(s["run"]["command"] for s in jobs["security-scan"]["steps"] if isinstance(s, dict) and "run" in s)
|
self.assertNotIn('update-cd-repo', jobs)
|
||||||
self.assertIn('--severity HIGH,CRITICAL --exit-code 1', owasp)
|
owasp = '\n'.join(s["run"]["command"] for s in jobs["security-scan"]["steps"] if isinstance(s, dict) and "run" in s)
|
||||||
self.assertIn('target/voyage.jar:/scan/voyage.jar:ro', owasp)
|
self.assertIn('--severity HIGH,CRITICAL --exit-code 1', owasp)
|
||||||
self.assertIn('aquasec/trivy:0.76.0@sha256:', owasp)
|
self.assertIn('target/voyage.jar:/scan/voyage.jar:ro', owasp)
|
||||||
self.assertNotIn('--ignore-unfixed', owasp)
|
self.assertIn('aquasec/trivy:0.76.0@sha256:', owasp)
|
||||||
self.assertNotIn('NVD_API_KEY', owasp)
|
self.assertNotIn('--ignore-unfixed', owasp)
|
||||||
self.assertNotIn('mvn ', owasp)
|
self.assertNotIn('NVD_API_KEY', owasp)
|
||||||
self.assertIn('set -euo pipefail', owasp)
|
self.assertNotIn('mvn ', owasp)
|
||||||
self.assertEqual(jobs["security-scan"]["resource_class"], "medium")
|
self.assertIn('set -euo pipefail', owasp)
|
||||||
for workflow in TEMPLATE["workflows"].values():
|
self.assertEqual(jobs["security-scan"]["resource_class"], "medium")
|
||||||
for invocation in workflow["jobs"]:
|
for workflow in TEMPLATE["workflows"].values():
|
||||||
if "security-scan" in invocation:
|
for invocation in workflow["jobs"]:
|
||||||
self.assertNotIn("context", invocation["security-scan"])
|
if "security-scan" in invocation:
|
||||||
self.assertIn('./gitleaks detect', json.dumps(jobs["secrets-scan"]))
|
self.assertNotIn("context", invocation["security-scan"])
|
||||||
self.assertIn('|| true', json.dumps(jobs["sast-scan"]))
|
self.assertIn('./gitleaks detect', json.dumps(jobs["secrets-scan"]))
|
||||||
self.assertIn('makeAggregateBom', json.dumps(jobs["sbom"]))
|
self.assertIn('|| true', json.dumps(jobs["sast-scan"]))
|
||||||
|
self.assertIn('makeAggregateBom', json.dumps(jobs["sbom"]))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
unittest.main()
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
"""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)
|
||||||
|
self.assertEqual(len(rows), 1)
|
||||||
Reference in new issue
Block a user