Compare commits
167
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04a929aae9 | ||
|
|
1c389210e6 | ||
|
|
9438ab0762 | ||
|
|
7fed7eee82 | ||
|
|
ed880fcb77 | ||
|
|
50fa564006 | ||
|
|
35e5312fc7 | ||
|
|
99ac8dec53 | ||
|
|
859eb4badb | ||
|
|
357aba57bc | ||
|
|
fb86d1a4a7 | ||
|
|
e9eb225480 | ||
|
|
09dac40a1e | ||
|
|
07a8f5cec2 | ||
|
|
c4f7b5ba76 | ||
|
|
3fd8baeda9 | ||
|
|
1334ababf1 | ||
|
|
3ca2b71ffa | ||
|
|
df9113296e | ||
|
|
9b73a4ed5f | ||
|
|
aa865fefd5 | ||
|
|
a5d10e8c1c | ||
|
|
4f1e5e663d | ||
|
|
898862a095 | ||
|
|
21403d2287 | ||
|
|
2675bb7a36 | ||
|
|
12eccc9e7d | ||
|
|
9e2652d735 | ||
|
|
c4e41dea6b | ||
|
|
4562d5c2d2 | ||
|
|
322a194c05 | ||
|
|
a92d6d13bb | ||
|
|
9772090684
|
||
|
|
ab666bb785 | ||
|
|
fc39293b9d
|
||
|
|
e83b8481b9 | ||
|
|
e4ecae6294
|
||
|
|
37b91db07b | ||
|
|
c30d821f7e
|
||
|
|
6ae688dcf4 | ||
|
|
78207c16be
|
||
|
|
efd50aee2f | ||
|
|
6dd473be25
|
||
|
|
1c8a7c57e5 | ||
|
|
abaebf50ff
|
||
|
|
c56e52d4cb | ||
|
|
09046d45b0
|
||
|
|
9e9e6c1fa5 | ||
|
|
45aaccd2a9 | ||
|
|
ab77962b6a | ||
|
|
d0792d60d6 | ||
|
|
72f5f4d4e7 | ||
|
|
00af9aae31 | ||
|
|
7e60372948 | ||
|
|
45bab9d960 | ||
|
|
f304afb0be | ||
|
|
f76b9f7a7c | ||
|
|
fdf62a2f5a | ||
|
|
94341ef481 | ||
|
|
2debeada5d | ||
|
|
6febeff590 | ||
|
|
8b58a45f35 | ||
|
|
fbe36d683d | ||
|
|
bd5ee3bec5 | ||
|
|
d4d6e97df0 | ||
|
|
c288a8864f | ||
|
|
9906c8f120 | ||
|
|
4dcf2c1891 | ||
|
|
cc30f599e6 | ||
|
|
05a2a5217a | ||
|
|
7d73ac90b6 | ||
|
|
edc1365ac9 | ||
|
|
0f33ddadf8 | ||
|
|
5e9bbb54ec | ||
|
|
5bcec90e33 | ||
|
|
a50b07d927 | ||
|
|
6318d90e96 | ||
|
|
a6fea661ff | ||
|
|
2894bae29a | ||
|
|
a14e8f9b24 | ||
|
|
83611872a3 | ||
|
|
30c4e0e85c | ||
|
|
f429d9f3c4 | ||
|
|
8c994aa824 | ||
|
|
344a3f7665
|
||
|
|
cec106ce30 | ||
|
|
ba6a3c6f92
|
||
|
|
43144c974b | ||
|
|
6806de4892
|
||
|
|
a9d51ebd47 | ||
|
|
284c69aa3e
|
||
|
|
fb30d9acc5
|
||
|
|
563f88bdad | ||
|
|
4cb662f076
|
||
|
|
a2cdd818f6 | ||
|
|
42e0be02c9
|
||
|
|
b71c9ca4d7
|
||
|
|
7dd5f38d35 | ||
|
|
02c14d7237
|
||
|
|
8121e69565 | ||
|
|
bcab95daa8
|
||
|
|
33a35a0dfa
|
||
|
|
68ff0e2b37
|
||
|
|
071dc3ae29
|
||
|
|
64e8d68cb3
|
||
|
|
58b064d51d
|
||
|
|
848210d9f6
|
||
|
|
f2749a71f9
|
||
|
|
dd2ee0fbb0
|
||
|
|
aaba1d9c5d
|
||
|
|
26b0a3a18b
|
||
|
|
9ea11d511b | ||
|
|
81c5086ee4
|
||
|
|
30a49c9c97 | ||
|
|
93ee1b4752 | ||
|
|
988401023a | ||
|
|
e23bd4588d | ||
|
|
51e9bba5b0 | ||
|
|
dae3f4b677 | ||
|
|
20d324957d | ||
|
|
bdff16ff95 | ||
|
|
dbd158e5eb | ||
|
|
1297ba10f0 | ||
|
|
62ae2f7d29 | ||
|
|
99fa73a581 | ||
|
|
c561e4d290 | ||
|
|
8d7f645c0e | ||
|
|
9285f2d842 | ||
|
|
f4e1536d77 | ||
|
|
8d1b353fe2 | ||
|
|
d24b7d131f | ||
|
|
184b7c54e9 | ||
|
|
2471f5adff | ||
|
|
546bf38a0b | ||
|
|
ab841b2ddd | ||
|
|
3b3d80188d | ||
|
|
5271b5bfa5 | ||
|
|
d3e1891725 | ||
|
|
0eab936d85 | ||
|
|
04888150fd | ||
|
|
43fcfe1213 | ||
|
|
fec302d58d | ||
|
|
dabfcce4ad | ||
|
|
3ffe371af2 | ||
|
|
34688a1a53 | ||
|
|
6d181f361b | ||
|
|
d4ba7722c7 | ||
|
|
43ccb6ced0 | ||
|
|
b34cde9d19 | ||
|
|
19deffb20e | ||
|
|
a50948c1af | ||
|
|
7c79a57a8a | ||
|
|
aa4442618b | ||
|
|
825937776c | ||
|
|
41702b0a30 | ||
|
|
b3c6f237ee | ||
|
|
6649766a51 | ||
|
|
342646a856 | ||
|
|
c43666fb4c | ||
|
|
eff82e0ffd | ||
|
|
a1c797d897 | ||
|
|
76f37ad23a | ||
|
|
b1523223d0 | ||
|
|
09db303b9b | ||
|
|
eedc21aeff | ||
|
|
f23015ff1e | ||
|
|
b4a6aa0d4c |
No files matched your search
@@ -1,5 +1,12 @@
|
||||
version: 2.1
|
||||
setup: true
|
||||
parameters:
|
||||
run_rc_finalize_sweep:
|
||||
type: boolean
|
||||
default: false
|
||||
run_enrollment_reconcile:
|
||||
type: boolean
|
||||
default: false
|
||||
orbs:
|
||||
orb-tools: circleci/orb-tools@12.3
|
||||
shellcheck: circleci/shellcheck@3.2
|
||||
@@ -8,8 +15,43 @@ filters: &filters
|
||||
tags:
|
||||
only: /.*/
|
||||
|
||||
jobs:
|
||||
enrollment-reconcile:
|
||||
docker:
|
||||
- image: cimg/python:3.12
|
||||
resource_class: small
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Install reconciliation tools
|
||||
command: |
|
||||
bash tools/install_reconcile_gh.sh
|
||||
python3 -m pip install --disable-pip-version-check PyYAML==6.0.3
|
||||
- run:
|
||||
name: Reconcile current QQQ branches
|
||||
no_output_timeout: 21m
|
||||
command: python3 tools/run_enrollment.py
|
||||
- store_artifacts:
|
||||
path: artifacts/enrollment
|
||||
rc-finalize-sweep:
|
||||
docker:
|
||||
- image: cimg/python:3.12
|
||||
resource_class: small
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Reconcile pending QBit releases
|
||||
command: |
|
||||
RC_REPOSITORIES_JSON="$(cat tools/rc-repositories.json)" \
|
||||
python3 src/scripts/rc_finalize_sweep.py
|
||||
|
||||
workflows:
|
||||
lint-pack:
|
||||
when:
|
||||
not:
|
||||
or:
|
||||
- << pipeline.parameters.run_rc_finalize_sweep >>
|
||||
- << pipeline.parameters.run_enrollment_reconcile >>
|
||||
jobs:
|
||||
- orb-tools/lint:
|
||||
filters: *filters
|
||||
@@ -27,3 +69,23 @@ workflows:
|
||||
orb_name: qqq-orb
|
||||
requires: [orb-tools/lint, orb-tools/pack, orb-tools/review, shellcheck/check]
|
||||
filters: *filters
|
||||
reconcile-releases:
|
||||
when: << pipeline.parameters.run_rc_finalize_sweep >>
|
||||
jobs:
|
||||
- rc-finalize-sweep:
|
||||
context: qqq-maven-registry-credentials
|
||||
filters:
|
||||
branches:
|
||||
only: main
|
||||
tags:
|
||||
ignore: /.*/
|
||||
reconcile-enrollment:
|
||||
when: << pipeline.parameters.run_enrollment_reconcile >>
|
||||
jobs:
|
||||
- enrollment-reconcile:
|
||||
context: [qqq-maven-registry-credentials, orb-publishing]
|
||||
filters:
|
||||
branches:
|
||||
only: main
|
||||
tags:
|
||||
ignore: /.*/
|
||||
+166
-18
@@ -12,23 +12,170 @@ filters: &filters
|
||||
tags:
|
||||
only: /.*/
|
||||
|
||||
# Filter for release tags.
|
||||
release-filters: &release-filters
|
||||
# Auto-publish filters.
|
||||
develop-filters: &develop-filters
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
|
||||
only: [develop]
|
||||
|
||||
main-filters: &main-filters
|
||||
branches:
|
||||
only: [main]
|
||||
|
||||
jobs:
|
||||
maven-publication-contract:
|
||||
resource_class: small
|
||||
docker:
|
||||
- image: cimg/openjdk:21.0
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Verify resolved multi-module publication POMs
|
||||
command: python3 tests/test_maven_publication_poms.py
|
||||
- run:
|
||||
name: Verify calculated versions match installed Maven coordinates
|
||||
command: python3 tests/test_effective_publication_version.py
|
||||
pipeline-contract-test:
|
||||
resource_class: small
|
||||
docker:
|
||||
- image: cimg/python:3.12-node
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Install the setup manifest parser
|
||||
command: python3 -m pip install --disable-pip-version-check PyYAML==6.0.3
|
||||
- run:
|
||||
name: Verify pipeline selection and Maven compatibility contracts
|
||||
command: |
|
||||
python3 tests/test_generate_pipeline.py
|
||||
python3 tests/test_marketing_link_check.py
|
||||
python3 scripts/pack_pipeline.py --check
|
||||
bash tests/test_cli_ci_behavior.sh
|
||||
python3 tests/test_cli_ci_contract.py
|
||||
python3 tests/test_maven_ci_contract.py
|
||||
python3 tests/test_standardize_qbit.py
|
||||
python3 tests/test_qbit_hotfix_profile.py
|
||||
python3 tests/test_qbit_feature_profile.py
|
||||
python3 tests/test_ci_maintenance.py
|
||||
python3 tests/test_rollout_version.py
|
||||
python3 tests/test_enforce_orb_checks.py
|
||||
python3 tests/test_native_next_gates.py
|
||||
python3 tests/test_native_gitops_gates.py
|
||||
python3 tests/test_native_specialist_gates.py
|
||||
python3 tests/test_enroll_consumers.py
|
||||
python3 tests/test_reconcile_enrollment.py
|
||||
python3 tests/test_discover_enrollment.py
|
||||
python3 tests/test_finish_enrollment.py
|
||||
python3 tests/test_run_enrollment.py
|
||||
python3 tests/test_install_reconcile_gh.py
|
||||
python3 tests/test_circle_project_settings.py
|
||||
python3 tests/test_static_analysis_exit.py
|
||||
python3 tests/test_validate_standard.py
|
||||
python3 tests/test_voyage_profile.py
|
||||
python3 tests/test_next_native.py
|
||||
python3 tests/test_auxiliary_workflows.py
|
||||
python3 tests/test_qbit_codeql.py
|
||||
sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends shellcheck
|
||||
python3 tests/test_repository_policy.py
|
||||
python3 tests/test_intellij_plugin.py
|
||||
python3 tests/test_workflow_lint.py
|
||||
python3 tests/test_business_e2e.py
|
||||
python3 tests/test_qctl_native.py
|
||||
python3 -m unittest discover -s tests -p test_generate_qctl_workflow.py
|
||||
python3 tests/test_rc_finalize_sweep.py
|
||||
python3 tests/test_rc_guard.py
|
||||
python3 -m unittest discover -s tests -p test_rc_timeout_recovery.py
|
||||
python3 -m unittest discover -s tests -p test_rc_ref_lookup.py
|
||||
python3 -m unittest discover -s tests -p test_generate_rc_workflow.py
|
||||
python3 -m unittest discover -s tests -p test_audit_estate.py
|
||||
python3 tests/test_all_profiles.py
|
||||
python3 tests/test_generate_all_release.py
|
||||
python3 -m unittest discover -s tests -p 'test_qqq_all_release*.py'
|
||||
python3 tests/test_verify_all_circle_smoke.py
|
||||
python3 tests/test_mobile_policy_profiles.py
|
||||
bash tests/test_all_artifact.sh
|
||||
python3 tests/test_maven_ci_rc_completion.py
|
||||
bash tests/test_maven_ci_push.sh
|
||||
bash tests/test_create_github_release.sh
|
||||
bash tests/test_maven_ci_cache.sh
|
||||
bash tests/test_maven_test_results.sh
|
||||
bash tests/test_maven_ci_install.sh
|
||||
bash tests/test_browser_install.sh
|
||||
bash tests/test_frontend_build_reuse.sh
|
||||
bash tests/test_snapshot_refresh.sh
|
||||
bash tests/test_maven_settings_output.sh
|
||||
# Create jobs to test the commands of your orbs.
|
||||
# You may want to add additional validation steps to ensure the commands are working as expected.
|
||||
command-test:
|
||||
docker:
|
||||
- image: cimg/base:current
|
||||
- image: cimg/node:24.21
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Verify Maven settings stay out of build logs
|
||||
command: bash tests/test_maven_settings_output.sh
|
||||
- run:
|
||||
name: Verify npm publisher authentication and dist-tags
|
||||
command: python3 tests/test_node_npm_publish.py
|
||||
# Run your orb's commands to validate them.
|
||||
- qqq-orb/install_asciidoctor
|
||||
|
||||
publish-dev-snapshot:
|
||||
docker:
|
||||
- image: circleci/circleci-cli:latest
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Pack and Publish Dev Snapshot
|
||||
command: |
|
||||
circleci orb pack src > /tmp/orb.yml
|
||||
circleci orb validate /tmp/orb.yml
|
||||
circleci orb publish --token "${CIRCLE_TOKEN}" /tmp/orb.yml kingsrook/qqq-orb@dev:snapshot
|
||||
echo "Published kingsrook/qqq-orb@dev:snapshot"
|
||||
|
||||
publish-production:
|
||||
docker:
|
||||
- image: circleci/circleci-cli:latest
|
||||
steps:
|
||||
- checkout
|
||||
- add_ssh_keys
|
||||
- run:
|
||||
name: Calculate Next Version and Publish
|
||||
command: |
|
||||
git fetch --tags
|
||||
LATEST=$(git tag -l 'v*' | sort -V | tail -1)
|
||||
LATEST=${LATEST:-v0.0.0}
|
||||
LATEST_CLEAN=${LATEST#v}
|
||||
|
||||
# Check recent commit messages for bump keywords
|
||||
BUMP="patch"
|
||||
COMMITS=$(git log "${LATEST}..HEAD" --pretty=%s 2>/dev/null || git log --pretty=%s -10)
|
||||
if echo "${COMMITS}" | grep -qi '\[major\]'; then
|
||||
BUMP="major"
|
||||
elif echo "${COMMITS}" | grep -qi '\[minor\]'; then
|
||||
BUMP="minor"
|
||||
fi
|
||||
|
||||
IFS='.' read -r MAJOR MINOR PATCH \<<< "${LATEST_CLEAN}"
|
||||
case "${BUMP}" in
|
||||
major) MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;;
|
||||
minor) MINOR=$((MINOR + 1)); PATCH=0 ;;
|
||||
patch) PATCH=$((PATCH + 1)) ;;
|
||||
esac
|
||||
VERSION="${MAJOR}.${MINOR}.${PATCH}"
|
||||
|
||||
echo "Latest: ${LATEST} | Bump: ${BUMP} | Next: ${VERSION}"
|
||||
|
||||
circleci orb pack src > /tmp/orb.yml
|
||||
circleci orb validate /tmp/orb.yml
|
||||
circleci orb publish --token "${CIRCLE_TOKEN}" /tmp/orb.yml "kingsrook/qqq-orb@${VERSION}"
|
||||
|
||||
git config user.email "ci@qrun.io"
|
||||
git config user.name "CircleCI"
|
||||
git tag -a "v${VERSION}" -m "Release v${VERSION}"
|
||||
git push origin "v${VERSION}"
|
||||
|
||||
echo "Published kingsrook/qqq-orb@${VERSION}"
|
||||
|
||||
workflows:
|
||||
test-deploy:
|
||||
jobs:
|
||||
@@ -36,16 +183,17 @@ workflows:
|
||||
# Test your orb's commands in a custom job and test your orb's jobs directly as a part of this workflow.
|
||||
- command-test:
|
||||
filters: *filters
|
||||
# The orb must be re-packed for publishing, and saved to the workspace.
|
||||
- orb-tools/pack:
|
||||
filters: *release-filters
|
||||
- orb-tools/publish:
|
||||
orb_name: kingsrook/qqq-orb
|
||||
vcs_type: << pipeline.project.type >>
|
||||
pub_type: production
|
||||
# Ensure this job requires all test jobs and the pack job.
|
||||
requires:
|
||||
- orb-tools/pack
|
||||
- command-test
|
||||
- pipeline-contract-test:
|
||||
filters: *filters
|
||||
- maven-publication-contract:
|
||||
filters: *filters
|
||||
# Auto-publish dev snapshot on develop
|
||||
- publish-dev-snapshot:
|
||||
context: orb-publishing
|
||||
filters: *release-filters
|
||||
filters: *develop-filters
|
||||
requires: [command-test, pipeline-contract-test, maven-publication-contract]
|
||||
# Auto-publish production release on main
|
||||
- publish-production:
|
||||
context: orb-publishing
|
||||
filters: *main-filters
|
||||
requires: [command-test, pipeline-contract-test, maven-publication-contract]
|
||||
@@ -0,0 +1,6 @@
|
||||
# Packed scripts execute on Linux regardless of the contributor's checkout OS.
|
||||
*.sh text eol=lf
|
||||
*.py text eol=lf
|
||||
*.yml text eol=lf
|
||||
*.yaml text eol=lf
|
||||
*.json text eol=lf
|
||||
@@ -0,0 +1 @@
|
||||
* @KofTwentyTwo
|
||||
@@ -0,0 +1,18 @@
|
||||
name: Database migrations
|
||||
jobs:
|
||||
empty-database-migration:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
cache: maven
|
||||
- name: Empty PostgreSQL -> migrate -> validate, demo determinism, forward-only
|
||||
policy
|
||||
run: mvn -B -pl db verify
|
||||
'on':
|
||||
workflow_call: {}
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -0,0 +1,83 @@
|
||||
name: Required E2E validation
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
e2e:
|
||||
name: E2E / live services
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
CI: 'true'
|
||||
E2E_BASE_URL: http://localhost:3004
|
||||
E2E_API_URL: http://localhost:18080
|
||||
E2E_KEYCLOAK_URL: http://localhost:18081
|
||||
NEXTAUTH_URL: http://localhost:3004
|
||||
NEXTAUTH_SECRET: ci-only-e2e-secret-not-for-production
|
||||
KEYCLOAK_ISSUER: http://localhost:18081/realms/qqq-platform
|
||||
KEYCLOAK_CLIENT_ID: platform-web
|
||||
KEYCLOAK_CLIENT_SECRET: platform-web-secret
|
||||
API_BASE_URL_INTERNAL: http://localhost:18080
|
||||
E2E_ALERT_WEBHOOK_URL: ${{ secrets.E2E_ALERT_WEBHOOK_URL }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: web/package-lock.json
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
cache: maven
|
||||
- name: Install web dependencies and Chromium
|
||||
working-directory: web
|
||||
run: 'npm ci
|
||||
|
||||
npx playwright install --with-deps chromium
|
||||
|
||||
'
|
||||
- name: Start actual platform dependencies and API
|
||||
run: docker compose -f deploy/compose/docker-compose.yml up -d --build postgres migrate keycloak minio minio-setup mailpit qqq-server
|
||||
- name: Wait for actual services
|
||||
shell: bash
|
||||
run: "set -euo pipefail\nwait_for() {\n local name=\"$1\" url=\"$2\"\n for _attempt in {1..90}; do\n if curl --fail --silent --show-error \"$url\" >/dev/null; then\n echo \"$name is ready\"\n return 0\n fi\n sleep 2\n done\n echo \"::error::$name did not become ready at $url\"\n docker compose -f deploy/compose/docker-compose.yml ps\n return 1\n}\nwait_for Keycloak \"$E2E_KEYCLOAK_URL/realms/qqq-platform/.well-known/openid-configuration\"\nwait_for API \"$E2E_API_URL/api/public/v1/health\"\n"
|
||||
- name: Run blocking E2E suite
|
||||
working-directory: web
|
||||
run: npm run test:e2e:ci
|
||||
- name: Publish test summary
|
||||
if: always()
|
||||
working-directory: web
|
||||
run: node scripts/report-e2e-results.mjs
|
||||
- name: Upload Playwright evidence
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: playwright-results-${{ github.run_id }}
|
||||
path: 'web/playwright-report/
|
||||
|
||||
web/test-results/
|
||||
|
||||
'
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
- name: Notify configured alert webhook
|
||||
if: failure() && env.E2E_ALERT_WEBHOOK_URL != ''
|
||||
run: "curl --fail-with-body -X POST -H 'Content-Type: application/json' \\\n --data \"{\\\"text\\\":\\\"E2E validation failed for $GITHUB_REPOSITORY ($GITHUB_REF_NAME): $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\\\"}\" \\\n \"$E2E_ALERT_WEBHOOK_URL\"\n"
|
||||
- name: Show service logs after failure
|
||||
if: failure()
|
||||
run: docker compose -f deploy/compose/docker-compose.yml logs --no-color --tail=300
|
||||
- name: Stop services
|
||||
if: always()
|
||||
run: docker compose -f deploy/compose/docker-compose.yml down -v
|
||||
deployment-gate:
|
||||
name: Deployment gate / E2E passed
|
||||
needs: e2e
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Deployment is permitted only because the live-service E2E job passed."
|
||||
'on':
|
||||
workflow_call:
|
||||
secrets:
|
||||
E2E_ALERT_WEBHOOK_URL:
|
||||
required: false
|
||||
@@ -0,0 +1,42 @@
|
||||
name: CodeQL Advanced
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
permissions:
|
||||
security-events: write
|
||||
packages: read
|
||||
actions: read
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: java-kotlin
|
||||
build-mode: none
|
||||
- language: javascript-typescript
|
||||
build-mode: none
|
||||
- language: actions
|
||||
build-mode: none
|
||||
- language: python
|
||||
build-mode: none
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
- name: Run manual build steps
|
||||
if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: "echo 'If you are using a \"manual\" build mode for one or more of the' \\\n 'languages you are analyzing, replace\
|
||||
\ this with the commands to build' \\\n 'your code, for example:'\necho ' make bootstrap'\necho ' make release'\n\
|
||||
exit 1\n"
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v4
|
||||
with:
|
||||
category: /language:${{matrix.language}}
|
||||
'on':
|
||||
workflow_call: {}
|
||||
@@ -0,0 +1,51 @@
|
||||
name: Published BOM consumer
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
verify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
- name: Check source and release version
|
||||
env:
|
||||
CANDIDATE_VERSION: ${{ inputs.version }}
|
||||
SOURCE_REF: ${{ github.ref }}
|
||||
run: "python3 - <<'PY'\nimport os\nimport re\nimport xml.etree.ElementTree as ET\n\nversion = os.environ[\"CANDIDATE_VERSION\"\
|
||||
]\nsource_ref = os.environ[\"SOURCE_REF\"]\nif not re.fullmatch(r\"4\\.1\\.0(?:-RC\\.[1-9][0-9]*)?\", version):\n\
|
||||
\ raise SystemExit(\"Version must be 4.1.0 or a 4.1.0-RC.N candidate\")\nexpected_ref = \"refs/heads/release/4.1\"\
|
||||
\ if \"-RC.\" in version else \"refs/tags/v4.1.0\"\nif source_ref != expected_ref:\n raise SystemExit(f\"Select\
|
||||
\ {expected_ref} for {version}; received {source_ref}\")\nroot = ET.parse(\"pom.xml\").getroot()\nns = {\"m\": \"\
|
||||
http://maven.apache.org/POM/4.0.0\"}\nrevision = root.findtext(\"m:properties/m:revision\", namespaces=ns)\nif revision\
|
||||
\ != version:\n raise SystemExit(f\"Source revision {revision} differs from {version}\")\nPY\n"
|
||||
- name: Resolve the public BOM from a fresh consumer
|
||||
env:
|
||||
CANDIDATE_VERSION: ${{ inputs.version }}
|
||||
run: python3 qqq-sample-project/verify-published-bom.py "$CANDIDATE_VERSION"
|
||||
- name: Retain resolution evidence
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: published-bom-evidence
|
||||
if-no-files-found: warn
|
||||
path: 'qqq-sample-project/target/published-bom-*/evidence.json
|
||||
|
||||
qqq-sample-project/target/published-bom-*/pom.xml
|
||||
|
||||
qqq-sample-project/target/published-bom-*/maven.log
|
||||
|
||||
qqq-sample-project/target/published-bom-*/dependency-tree.json
|
||||
|
||||
'
|
||||
'on':
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: Published QQQ release or candidate version
|
||||
required: true
|
||||
type: string
|
||||
@@ -0,0 +1,109 @@
|
||||
name: Public quickstart lifecycle
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
lifecycle:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(inputs.boundary_capture && '{"os":["macos-15"],"browser":["webkit"]}' || '{"os":["ubuntu-24.04","macos-14"],"browser":["chromium","firefox","webkit"],"exclude":[{"os":"macos-14","browser":"webkit"}],"include":[{"os":"macos-15","browser":"webkit"}]}')
|
||||
}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: QRun-IO/qqq-frontend-next
|
||||
ref: 2853b9b148282ae0e6d454adab6d0f534ba48280
|
||||
path: acceptance-tools
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
- name: Install acceptance tools only
|
||||
working-directory: acceptance-tools
|
||||
run: 'corepack enable
|
||||
|
||||
corepack prepare pnpm@9.15.9 --activate
|
||||
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
pnpm exec playwright install --with-deps "$BROWSER"
|
||||
|
||||
'
|
||||
env:
|
||||
BROWSER: ${{ matrix.browser }}
|
||||
- name: Diagnostic boundary preflight
|
||||
if: ${{ inputs.boundary_capture }}
|
||||
env:
|
||||
EXPECTED_SHA: ${{ inputs.source_sha }}
|
||||
QQQ_QUICKSTART_PREFLIGHT_OUTPUT: ${{ runner.temp }}/qqq-quickstart-diagnostic
|
||||
run: 'umask 077
|
||||
|
||||
mkdir -p "$QQQ_QUICKSTART_PREFLIGHT_OUTPUT"
|
||||
|
||||
node --test qqq-sample-project/acceptance/quickstart/*.test.mjs > "$QQQ_QUICKSTART_PREFLIGHT_OUTPUT/pure-tests.log"
|
||||
2>&1
|
||||
|
||||
node qqq-sample-project/acceptance/quickstart/boundary-preflight.mjs
|
||||
|
||||
'
|
||||
- name: Run the public launcher lifecycle
|
||||
env:
|
||||
QQQ_QUICKSTART_BOUNDARY_CAPTURE: ${{ inputs.boundary_capture && '1' || '0' }}
|
||||
CANDIDATE_VERSION: ${{ inputs.version }}
|
||||
EXPECTED_SHA: ${{ inputs.source_sha }}
|
||||
BROWSER: ${{ matrix.browser }}
|
||||
run: "umask 077\nif [[ \"$GITHUB_EVENT_NAME\" == \"push\" ]]; then\n CANDIDATE_VERSION=\"${GITHUB_REF_NAME#quickstart-}\"\
|
||||
\n EXPECTED_SHA=\"$(git rev-parse HEAD)\"\nfi\nrun_lifecycle() {\n node qqq-sample-project/acceptance/quickstart/run-public.mjs\
|
||||
\ \\\n --playwright-project acceptance-tools \\\n --output \"$RUNNER_TEMP/qqq-public-lifecycle\" \\\n --version\
|
||||
\ \"$CANDIDATE_VERSION\" --expected-sha \"$EXPECTED_SHA\" \\\n --browser \"$BROWSER\"\n}\nif [[ \"$QQQ_QUICKSTART_BOUNDARY_CAPTURE\"\
|
||||
\ == \"1\" ]]; then\n set -o pipefail\n mkdir -p \"$RUNNER_TEMP/qqq-quickstart-private-protocol\"\n DEBUG=pw:browser,pw:protocol\
|
||||
\ DEBUG_FILE=\"$RUNNER_TEMP/qqq-quickstart-private-protocol/protocol.raw\" run_lifecycle 2>&1 | tee \"$RUNNER_TEMP/qqq-quickstart-diagnostic/native.log\"\
|
||||
\nelse\n run_lifecycle\nfi\n"
|
||||
- name: Summarize private first-page protocol
|
||||
if: ${{ always() && inputs.boundary_capture }}
|
||||
run: "umask 077\nnode qqq-sample-project/acceptance/quickstart/protocol-files.mjs \\\n \"$RUNNER_TEMP/qqq-quickstart-private-protocol/protocol.raw\"\
|
||||
\ \\\n \"$RUNNER_TEMP/qqq-public-lifecycle/phase-journal.json\" \\\n \"$RUNNER_TEMP/qqq-quickstart-diagnostic/first-page-protocol.json\"\
|
||||
\n"
|
||||
- name: Retain lifecycle results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: quickstart-${{ matrix.os }}-${{ matrix.browser }}
|
||||
if-no-files-found: error
|
||||
path: '${{ runner.temp }}/qqq-public-lifecycle/*.json
|
||||
|
||||
${{ runner.temp }}/qqq-public-lifecycle/*.log
|
||||
|
||||
${{ runner.temp }}/qqq-public-lifecycle/*.png
|
||||
|
||||
${{ runner.temp }}/qqq-quickstart-diagnostic/*.json
|
||||
|
||||
${{ runner.temp }}/qqq-quickstart-diagnostic/*.log
|
||||
|
||||
'
|
||||
'on':
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: Exact public candidate to verify
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
source_sha:
|
||||
description: Full reviewed commit of the immutable quickstart tag
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
boundary_capture:
|
||||
description: Diagnose one macOS15 WebKit lifecycle with private boundary evidence
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -0,0 +1,38 @@
|
||||
name: GitOps validation
|
||||
'on':
|
||||
workflow_call:
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install verified Kustomize
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tool_dir="$RUNNER_TEMP/qqq-kustomize"
|
||||
mkdir -p "$tool_dir"
|
||||
curl --fail --silent --show-error --location --retry 2 --max-time 60 \
|
||||
https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.7.1/kustomize_v5.7.1_linux_amd64.tar.gz \
|
||||
--output "$tool_dir/kustomize.tar.gz"
|
||||
echo "ea375e7372f9aa029129d4b2d16c66b7750b7f1213c4f66f910d981c895818d8 $tool_dir/kustomize.tar.gz" | sha256sum --check --status
|
||||
tar -xzf "$tool_dir/kustomize.tar.gz" -C "$tool_dir" kustomize
|
||||
echo "$tool_dir" >> "$GITHUB_PATH"
|
||||
- name: Render every Kustomization
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mapfile -d '' manifests < <(find . -path './.git' -prune -o -type f \( -name kustomization.yaml -o -name kustomization.yml -o -name Kustomization \) -print0)
|
||||
if (( ${#manifests[@]} == 0 )); then
|
||||
echo 'No Kustomization found' >&2
|
||||
exit 1
|
||||
fi
|
||||
for manifest in "${manifests[@]}"; do
|
||||
directory=$(dirname "$manifest")
|
||||
# Rendered Secrets must never enter logs or uploaded artifacts.
|
||||
kustomize build "$directory" >/dev/null
|
||||
printf 'Validated %s\n' "$directory"
|
||||
done
|
||||
@@ -0,0 +1,109 @@
|
||||
name: IntelliJ plugin
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
publish:
|
||||
type: boolean
|
||||
default: false
|
||||
version:
|
||||
type: string
|
||||
default: ''
|
||||
secrets:
|
||||
CERTIFICATE_CHAIN:
|
||||
required: false
|
||||
PRIVATE_KEY:
|
||||
required: false
|
||||
PRIVATE_KEY_PASSWORD:
|
||||
required: false
|
||||
PUBLISH_TOKEN:
|
||||
required: false
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: intellij-${{ runner.os }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle.kts', 'settings.gradle.kts', 'gradle.properties') }}
|
||||
- name: Check and package resource plugin
|
||||
run: ./gradlew --no-daemon check buildPlugin
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: intellij-plugin-${{ github.sha }}
|
||||
path: build/distributions/*.zip
|
||||
if-no-files-found: error
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: intellij-gradle-reports
|
||||
path: build/reports/
|
||||
if-no-files-found: warn
|
||||
publish:
|
||||
needs: build
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.publish
|
||||
runs-on: ubuntu-latest
|
||||
environment: intellij-marketplace
|
||||
concurrency:
|
||||
group: intellij-marketplace-${{ github.repository }}
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
- name: Verify exact reviewed version and tag
|
||||
env:
|
||||
RELEASE_VERSION: ${{ inputs.version }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
python3 - <<'PY'
|
||||
import os, re
|
||||
from pathlib import Path
|
||||
version = os.environ['RELEASE_VERSION']
|
||||
if not re.fullmatch(r'[0-9]+\.[0-9]+\.[0-9]+', version):
|
||||
raise SystemExit('Explicit immutable plugin version required')
|
||||
versions = re.findall(r'^version\s*=\s*"([^"\n]+)"\s*$', Path('build.gradle.kts').read_text(), re.M)
|
||||
if versions != [version] or os.environ['GITHUB_REF'] != 'refs/tags/v' + version:
|
||||
raise SystemExit('Source version and selected vVERSION tag must match')
|
||||
PY
|
||||
test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
|
||||
test "$(git rev-parse "refs/tags/v$RELEASE_VERSION^{commit}")" = "$GITHUB_SHA"
|
||||
remote="$(git ls-remote origin "refs/tags/v$RELEASE_VERSION" "refs/tags/v$RELEASE_VERSION^{}")"
|
||||
resolved="$(printf '%s\n' "$remote" | awk '$2 ~ /\^\{\}$/ {print $1}')"
|
||||
if [[ -z "$resolved" ]]; then resolved="$(printf '%s\n' "$remote" | awk 'NR==1 {print $1}')"; fi
|
||||
test "$resolved" = "$GITHUB_SHA"
|
||||
- name: Sign and publish verified plugin
|
||||
env:
|
||||
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
|
||||
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
|
||||
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
|
||||
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
test -n "$CERTIFICATE_CHAIN"
|
||||
test -n "$PRIVATE_KEY"
|
||||
test -n "$PRIVATE_KEY_PASSWORD"
|
||||
test -n "$PUBLISH_TOKEN"
|
||||
./gradlew --no-daemon signPlugin publishPlugin
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: signed-intellij-plugin-${{ inputs.version }}
|
||||
path: build/distributions/*.zip
|
||||
if-no-files-found: error
|
||||
@@ -0,0 +1,77 @@
|
||||
name: Build and Publish
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: Build and Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Java 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: temurin
|
||||
cache: maven
|
||||
- name: Build, test, and verify
|
||||
env:
|
||||
QQQ_MCP_VOYAGE_API_KEY: ${{ secrets.QQQ_MCP_VOYAGE_API_KEY }}
|
||||
run: mvn -B -ntp clean verify
|
||||
- name: Upload JAR
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: jar
|
||||
path: target/qqq-mcp-rag-*.jar
|
||||
retention-days: 1
|
||||
- name: Preserve unit and integration test evidence
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-reports
|
||||
path: 'target/surefire-reports/
|
||||
|
||||
target/failsafe-reports/'
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
publish:
|
||||
name: Publish Container
|
||||
needs: build-and-test
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Download JAR
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: jar
|
||||
path: target/
|
||||
- name: Log in to Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Set image name
|
||||
run: printf 'IMAGE_NAME=%s\n' "${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
|
||||
'
|
||||
'on':
|
||||
workflow_call:
|
||||
secrets:
|
||||
QQQ_MCP_VOYAGE_API_KEY:
|
||||
required: false
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -0,0 +1,278 @@
|
||||
# Orb-owned native worker extracted from frontend-next ada9946eea643eed6e2c6edb42e2446a185761b4.
|
||||
name: Real-backend acceptance
|
||||
|
||||
# One production build feeds independent, serial-worker backends. Require "acceptance gate".
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
qqq_ref:
|
||||
type: string
|
||||
default: ""
|
||||
description: QQQ source ref; empty preserves the repository variable/default.
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: acceptance-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
QQQ_REF: ${{ inputs.qqq_ref || vars.QQQ_ACCEPTANCE_REF || 'develop' }}
|
||||
NEXT_TELEMETRY_DISABLED: '1'
|
||||
MAVEN_ARGS: -Dmaven.wagon.http.retryHandler.count=5 -Daether.transport.http.retryHandler.count=5 -Daether.connector.http.retryHandler.count=5
|
||||
|
||||
jobs:
|
||||
plan:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
mode: ${{ steps.select.outputs.mode }}
|
||||
matrix: ${{ steps.select.outputs.matrix }}
|
||||
specs: ${{ steps.select.outputs.specs }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Select projects, shards and changed areas
|
||||
id: select
|
||||
run: node scripts/acceptance-select.mjs
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
repository: QRun-IO/qqq
|
||||
ref: ${{ env.QQQ_REF }}
|
||||
path: qqq-backend
|
||||
- name: Resolve QQQ source revision
|
||||
id: qqq
|
||||
run: echo "sha=$(git -C qqq-backend rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
cache: maven
|
||||
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
id: qqq-cache
|
||||
with:
|
||||
path: ~/.m2/repository/com/kingsrook
|
||||
key: qqq-source-${{ runner.os }}-java21-v1-${{ steps.qqq.outputs.sha }}
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Bundled UI API document matches the server's (src/lib/api/openapi/qqq-v1.json)
|
||||
run: node scripts/check-ui-api-spec.mjs --server-spec qqq-backend/qqq-middleware-javalin/src/main/resources/openapi/v1/openapi.yaml
|
||||
- name: Build QQQ from source
|
||||
if: steps.qqq-cache.outputs.cache-hit != 'true'
|
||||
run: bash scripts/ci/retry.sh 4 mvn -B -q -f qqq-backend/pom.xml install -DskipTests -Dspotbugs.skip=true -Dpmd.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
|
||||
- name: Build and install the dashboard jar (static export)
|
||||
run: |
|
||||
# Equivalent to build:jar, with retries around its Maven invocation too.
|
||||
pnpm build:export
|
||||
bash scripts/ci/retry.sh 4 mvn -B -q clean package
|
||||
bash scripts/ci/retry.sh 4 mvn -B -q install
|
||||
# Failed-attempt Maven stdout must not become part of the version value.
|
||||
bash scripts/ci/retry.sh 4 mvn -B -q help:evaluate -Dexpression=project.version -Doutput="$RUNNER_TEMP/acceptance-next-version"
|
||||
next_version=$(cat "$RUNNER_TEMP/acceptance-next-version")
|
||||
echo "NEXT_JAR_VERSION=$next_version" >> "$GITHUB_ENV"
|
||||
- name: Build the sample application jar
|
||||
working-directory: qqq-backend
|
||||
run: |
|
||||
# QQQ checkstyle/pmd paths are relative to this checkout.
|
||||
bash "$GITHUB_WORKSPACE/scripts/ci/retry.sh" 4 mvn -B -q -f qqq-sample-project/pom.xml package -DskipTests -Djacoco.skip=true \
|
||||
-Dqqq.frontend.next.version="$NEXT_JAR_VERSION"
|
||||
- name: Stage runtime artifacts
|
||||
run: |
|
||||
sample_jars=(qqq-backend/qqq-sample-project/target/*-jar-with-dependencies.jar)
|
||||
test "${#sample_jars[@]}" -eq 1
|
||||
sample_version="${sample_jars[0]##*/}"
|
||||
sample_version="${sample_version#qqq-sample-project-}"
|
||||
sample_version="${sample_version%-jar-with-dependencies.jar}"
|
||||
mkdir -p test-results/acceptance-jars
|
||||
cp "${sample_jars[0]}" test-results/acceptance-jars/
|
||||
# javac and the security fixture need the API JAR in addition to the fat sample JAR.
|
||||
cp "$HOME/.m2/repository/com/kingsrook/qqq/qqq-middleware-api/$sample_version/qqq-middleware-api-$sample_version.jar" \
|
||||
test-results/acceptance-jars/qqq-middleware-api.jar
|
||||
tar -cf test-results/acceptance-build.tar out test-results/acceptance-jars
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: acceptance-build
|
||||
path: test-results/acceptance-build.tar
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
||||
shards:
|
||||
name: acceptance ${{ matrix.project }} ${{ matrix.shard }}/${{ matrix.total }}
|
||||
needs: [plan, build]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
cache: maven
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Installed Playwright version
|
||||
id: playwright
|
||||
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
id: browser-cache
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}-${{ matrix.browser }}
|
||||
- run: pnpm exec playwright install-deps ${{ matrix.browser }}
|
||||
- if: steps.browser-cache.outputs.cache-hit != 'true'
|
||||
run: pnpm exec playwright install ${{ matrix.browser }}
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: acceptance-build
|
||||
path: test-results
|
||||
- name: Restore runtime artifacts
|
||||
run: |
|
||||
tar -xf test-results/acceptance-build.tar
|
||||
echo "QQQ_SAMPLE_JAR=$(ls "$PWD"/test-results/acceptance-jars/*-jar-with-dependencies.jar)" >> "$GITHUB_ENV"
|
||||
echo "QQQ_MIDDLEWARE_API_JAR=$PWD/test-results/acceptance-jars/qqq-middleware-api.jar" >> "$GITHUB_ENV"
|
||||
- name: Run shard
|
||||
env:
|
||||
QQQ_ACCEPTANCE_BROWSERS: ${{ matrix.project }}
|
||||
QQQ_ACCEPTANCE_SPEC_PATHS: ${{ needs.plan.outputs.specs }}
|
||||
QQQ_ACCEPTANCE_BLOB: '1'
|
||||
# Environment-selected projects must not produce colliding default blob names.
|
||||
QQQ_ACCEPTANCE_BLOB_NAME: report-${{ matrix.project }}-${{ matrix.shard }}.zip
|
||||
QQQ_ACCEPTANCE_TRANSPORT_TRACE: '1'
|
||||
QQQ_ACCEPTANCE_BROWSER_TRACE: ${{ (matrix.project == 'webkit' || matrix.project == 'mobile' || matrix.project == 'tablet') && 'navigation' || '0' }}
|
||||
DEBUG: pw:browser
|
||||
run: node scripts/acceptance.mjs --skip-build --shard=${{ matrix.shard }}/${{ matrix.total }}
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: always()
|
||||
with:
|
||||
name: acceptance-blob-${{ matrix.project }}-${{ matrix.shard }}
|
||||
path: test-results/acceptance/blob-report/
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
||||
gate:
|
||||
name: acceptance gate
|
||||
if: always()
|
||||
needs: [plan, build, shards]
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
pattern: acceptance-blob-*
|
||||
path: test-results/acceptance/blobs
|
||||
merge-multiple: true
|
||||
- name: Merge shard reports
|
||||
env:
|
||||
PLAYWRIGHT_JSON_OUTPUT_NAME: test-results/acceptance/report.json
|
||||
PLAYWRIGHT_HTML_OUTPUT_DIR: test-results/acceptance/html
|
||||
PLAYWRIGHT_HTML_OPEN: never
|
||||
run: npx playwright merge-reports --reporter=json,html test-results/acceptance/blobs
|
||||
- name: Evaluate acceptance matrix
|
||||
if: always()
|
||||
env:
|
||||
ACCEPTANCE_MODE: ${{ needs.plan.outputs.mode }}
|
||||
run: |
|
||||
args=()
|
||||
if [[ "$ACCEPTANCE_MODE" == pr ]]; then args+=(--partial); fi
|
||||
node scripts/acceptance-gate.mjs "${args[@]}"
|
||||
- name: Require every planned shard and successful build
|
||||
if: always()
|
||||
env:
|
||||
PLAN_RESULT: ${{ needs.plan.result }}
|
||||
BUILD_RESULT: ${{ needs.build.result }}
|
||||
SHARDS_RESULT: ${{ needs.shards.result }}
|
||||
PLANNED_MATRIX: ${{ needs.plan.outputs.matrix }}
|
||||
run: |
|
||||
test "$PLAN_RESULT" = success
|
||||
test "$BUILD_RESULT" = success
|
||||
test "$SHARDS_RESULT" = success
|
||||
node --input-type=module -e 'import { existsSync } from "node:fs"; for (const { project, shard } of JSON.parse(process.env.PLANNED_MATRIX).include) { const file = "test-results/acceptance/blobs/report-" + project + "-" + shard + ".zip"; if (!existsSync(file)) throw new Error("Missing shard report: " + file); }'
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: always()
|
||||
with:
|
||||
name: acceptance
|
||||
path: test-results/acceptance/
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
||||
quarantine:
|
||||
name: acceptance quarantine (chromium)
|
||||
needs: [plan, build]
|
||||
if: needs.plan.outputs.mode == 'full'
|
||||
continue-on-error: true
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
cache: maven
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Installed Playwright version
|
||||
id: playwright
|
||||
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
id: browser-cache
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}-chromium
|
||||
- run: pnpm exec playwright install-deps chromium
|
||||
- if: steps.browser-cache.outputs.cache-hit != 'true'
|
||||
run: pnpm exec playwright install chromium
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: acceptance-build
|
||||
path: test-results
|
||||
- name: Restore runtime artifacts
|
||||
run: |
|
||||
tar -xf test-results/acceptance-build.tar
|
||||
echo "QQQ_SAMPLE_JAR=$(ls "$PWD"/test-results/acceptance-jars/*-jar-with-dependencies.jar)" >> "$GITHUB_ENV"
|
||||
echo "QQQ_MIDDLEWARE_API_JAR=$PWD/test-results/acceptance-jars/qqq-middleware-api.jar" >> "$GITHUB_ENV"
|
||||
- name: Run quarantined scenarios
|
||||
env:
|
||||
QQQ_ACCEPTANCE_BROWSERS: chromium
|
||||
QQQ_ACCEPTANCE_QUARANTINE: only
|
||||
QQQ_ACCEPTANCE_TRANSPORT_TRACE: '1'
|
||||
QQQ_ACCEPTANCE_BROWSER_TRACE: '0'
|
||||
DEBUG: pw:browser
|
||||
run: node scripts/acceptance.mjs --skip-build
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: always()
|
||||
with:
|
||||
name: acceptance-quarantine
|
||||
path: test-results/acceptance/
|
||||
retention-days: 30
|
||||
@@ -0,0 +1,157 @@
|
||||
# Orb-owned native worker extracted from frontend-next ada9946eea643eed6e2c6edb42e2446a185761b4.
|
||||
name: CI
|
||||
|
||||
# Fast PR checks (QRun-IO/qqq#709, bundle budget #710). The real-backend gate, including the
|
||||
# runtime performance budgets (specs/performance), runs in acceptance.yml.
|
||||
# Each job installs on its own so they run in parallel; none needs a backend.
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
NEXT_TELEMETRY_DISABLED: '1'
|
||||
STORYBOOK_DISABLE_TELEMETRY: '1'
|
||||
|
||||
jobs:
|
||||
unit:
|
||||
name: Typecheck, lint, unit tests and coverage
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
- run: pnpm typecheck
|
||||
- run: pnpm lint
|
||||
- name: Unit tests with src/lib coverage thresholds (vitest.config.ts)
|
||||
run: pnpm test:coverage
|
||||
|
||||
e2e:
|
||||
name: Mocked e2e (Playwright, chromium)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
- name: Installed Playwright version
|
||||
id: playwright
|
||||
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
id: browser-cache
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}-chromium
|
||||
- run: pnpm exec playwright install-deps chromium
|
||||
- if: steps.browser-cache.outputs.cache-hit != 'true'
|
||||
run: pnpm exec playwright install chromium
|
||||
- name: Production build
|
||||
run: pnpm build
|
||||
- name: Mocked e2e suite
|
||||
env:
|
||||
QQQ_E2E_SERVER: production
|
||||
run: pnpm test:e2e
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: failure()
|
||||
with:
|
||||
name: e2e-report
|
||||
path: |
|
||||
playwright-report/
|
||||
test-results/
|
||||
retention-days: 14
|
||||
|
||||
collaboration-e2e:
|
||||
name: Collaboration e2e (MSW; chromium, firefox, webkit, mobile, tablet)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
- name: Installed Playwright version
|
||||
id: playwright
|
||||
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
id: browser-cache
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ steps.playwright.outputs.version }}-all
|
||||
- run: pnpm exec playwright install-deps chromium firefox webkit
|
||||
- if: steps.browser-cache.outputs.cache-hit != 'true'
|
||||
run: pnpm exec playwright install chromium firefox webkit
|
||||
- name: Collaboration suite (mock API, every browser project)
|
||||
run: pnpm exec playwright test --config playwright.collaboration.config.ts
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: always()
|
||||
with:
|
||||
name: collaboration-e2e
|
||||
path: |
|
||||
test-results/collaboration/
|
||||
test-results/collab-shots/
|
||||
retention-days: 14
|
||||
|
||||
storybook:
|
||||
name: Storybook build
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
- run: pnpm build-storybook --quiet
|
||||
|
||||
performance:
|
||||
name: Bundle budget (static export)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
- name: Static export
|
||||
run: pnpm build:export
|
||||
- name: First-load JS per route, total JS and largest chunk against perf-budget.json
|
||||
run: pnpm perf:budget
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: always()
|
||||
with:
|
||||
name: bundle-budget
|
||||
path: test-results/performance/bundle.json
|
||||
retention-days: 30
|
||||
@@ -0,0 +1,74 @@
|
||||
# Orb-owned native worker extracted from frontend-next ada9946eea643eed6e2c6edb42e2446a185761b4.
|
||||
name: Dashboard image
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/qrun-io/qqq-frontend-next
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
runner: ubuntu-24.04
|
||||
- arch: arm64
|
||||
runner: ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runner }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
|
||||
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
|
||||
if: github.event_name == 'push'
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
|
||||
with:
|
||||
context: .
|
||||
file: docker/quickstart/Dockerfile
|
||||
platforms: linux/${{ matrix.arch }}
|
||||
push: ${{ github.event_name == 'push' }}
|
||||
load: ${{ github.event_name == 'pull_request' }}
|
||||
tags: ${{ env.IMAGE }}:${{ github.sha }}-${{ matrix.arch }}
|
||||
cache-from: type=gha,scope=dashboard-${{ matrix.arch }}
|
||||
cache-to: type=gha,mode=max,scope=dashboard-${{ matrix.arch }}
|
||||
- name: Verify runnable dashboard
|
||||
if: github.event_name == 'pull_request'
|
||||
env:
|
||||
TAG: ${{ env.IMAGE }}:${{ github.sha }}-${{ matrix.arch }}
|
||||
run: |
|
||||
container=$(docker run -d --rm -p 127.0.0.1:3000:3000 "$TAG")
|
||||
trap 'docker rm -f "$container"' EXIT
|
||||
curl -fsS --max-time 3 --retry 30 --retry-delay 1 --retry-all-errors \
|
||||
--retry-max-time 90 http://127.0.0.1:3000/app/person >/dev/null \
|
||||
|| { docker logs "$container"; exit 1; }
|
||||
|
||||
publish:
|
||||
if: github.event_name == 'push'
|
||||
needs: build
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
packages: write
|
||||
steps:
|
||||
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
|
||||
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish versioned multi-architecture image
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
--tag "$IMAGE:${GITHUB_REF_NAME#v}" \
|
||||
"$IMAGE:$GITHUB_SHA-amd64" "$IMAGE:$GITHUB_SHA-arm64"
|
||||
@@ -0,0 +1,60 @@
|
||||
name: QBit CodeQL
|
||||
'on':
|
||||
workflow_call:
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
security-events: write
|
||||
packages: read
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze branch source
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Select languages present in this checkout
|
||||
id: languages
|
||||
run: |
|
||||
python3 <<'PY'
|
||||
import os
|
||||
from pathlib import PurePosixPath
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
files = subprocess.check_output(['git', 'ls-files', '-z']).decode('utf-8').split('\0')
|
||||
extensions = {PurePosixPath(name).suffix.lower() for name in files if name}
|
||||
languages = []
|
||||
if extensions & {'.java', '.kt', '.kts'}:
|
||||
languages.append('java-kotlin')
|
||||
if extensions & {'.js', '.jsx', '.mjs', '.cjs', '.ts', '.tsx', '.mts', '.cts'}:
|
||||
languages.append('javascript-typescript')
|
||||
if '.py' in extensions:
|
||||
languages.append('python')
|
||||
if '.rb' in extensions:
|
||||
languages.append('ruby')
|
||||
if any((name.startswith('.github/workflows/') and PurePosixPath(name).suffix in {'.yml', '.yaml'})
|
||||
or PurePosixPath(name).name in {'action.yml', 'action.yaml'} for name in files if name):
|
||||
languages.append('actions')
|
||||
if not languages:
|
||||
sys.exit('No supported source in this branch; classify placeholders before enabling QBit scanning')
|
||||
build_mode = 'autobuild' if extensions & {'.kt', '.kts'} else 'none'
|
||||
with open(os.environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as output:
|
||||
output.write('languages=' + ','.join(languages) + '\n')
|
||||
output.write('build-mode=' + build_mode + '\n')
|
||||
PY
|
||||
- uses: actions/setup-java@v4
|
||||
if: steps.languages.outputs.build-mode == 'autobuild'
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4
|
||||
with:
|
||||
languages: ${{ steps.languages.outputs.languages }}
|
||||
build-mode: ${{ steps.languages.outputs.build-mode }}
|
||||
- name: Build Kotlin sources
|
||||
if: steps.languages.outputs.build-mode == 'autobuild'
|
||||
uses: github/codeql-action/autobuild@v4
|
||||
- name: Analyze source
|
||||
uses: github/codeql-action/analyze@v4
|
||||
@@ -0,0 +1,590 @@
|
||||
# Cut briefly, then finalize from the Circle publisher completion callback.
|
||||
# The pending ref bridges runs without an allocated waiting runner. See docs/rc-release.md.
|
||||
#
|
||||
# Signing: the tag is signed with the SSH key in the QRUN_TAG_SIGNING_KEY secret (callers pass
|
||||
# `secrets: inherit`). Without it the job fails before tagging; it never creates an unsigned tag.
|
||||
#
|
||||
# Release line: develop's <revision>X.Y.Z-SNAPSHOT</revision> picks release/X.Y.Z if that branch
|
||||
# exists, else release/X.Y (created from develop when missing).
|
||||
name: qbit release candidate
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
dry_run:
|
||||
description: Print the plan without merging or creating branches
|
||||
type: boolean
|
||||
default: false
|
||||
finalize:
|
||||
description: Finalize an existing cut from repository_dispatch or an explicit retry
|
||||
type: boolean
|
||||
default: false
|
||||
recover:
|
||||
description: Verify an already-published upload after a Circle deployment timeout
|
||||
type: boolean
|
||||
default: false
|
||||
circle_build:
|
||||
description: Original Circle publisher build number (recovery only)
|
||||
type: string
|
||||
default: ''
|
||||
merge_sha:
|
||||
type: string
|
||||
default: ''
|
||||
bump_sha:
|
||||
type: string
|
||||
default: ''
|
||||
branch:
|
||||
type: string
|
||||
default: ''
|
||||
version:
|
||||
type: string
|
||||
default: ''
|
||||
secrets:
|
||||
CENTRAL_USERNAME:
|
||||
required: false
|
||||
CENTRAL_PASSWORD:
|
||||
required: false
|
||||
QRUN_TAG_SIGNING_KEY:
|
||||
description: SSH private key that signs release tags
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
checks: read
|
||||
|
||||
# Hold the release lane across BOTH jobs, not just each independent merge/tag job.
|
||||
concurrency:
|
||||
group: qbit-release-rc-${{ github.repository }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
cut-rc:
|
||||
if: ${{ !inputs.finalize && !inputs.recover }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
outputs:
|
||||
branch: ${{ steps.merge.outputs.branch }}
|
||||
merge_sha: ${{ steps.merge.outputs.merge_sha }}
|
||||
merged_at: ${{ steps.merge.outputs.merged_at }}
|
||||
steps:
|
||||
- name: Merge develop into the release line
|
||||
id: merge
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
REPO: ${{ github.repository }}
|
||||
DRY_RUN: ${{ inputs.dry_run }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# An unresolved release owns this ref until verified finalization or explicit recovery.
|
||||
lock=automation/qbit-rc-pending
|
||||
if gh api "repos/$REPO/git/ref/heads/$lock" --silent 2>/dev/null; then
|
||||
echo "::error::An RC is unresolved ($lock); finalize or explicitly recover it before cutting another."
|
||||
exit 1
|
||||
fi
|
||||
develop_sha=$(gh api "repos/$REPO/branches/develop" -q .commit.sha)
|
||||
revision=$(gh api "repos/$REPO/contents/pom.xml?ref=$develop_sha" -q .content | base64 -d \
|
||||
| sed -n 's:.*<revision>\(.*\)</revision>.*:\1:p' | head -n 1)
|
||||
if [[ ! "$revision" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT$ ]]; then
|
||||
echo "::error::develop pom.xml <revision> must be X.Y.Z-SNAPSHOT, found '$revision'"
|
||||
exit 1
|
||||
fi
|
||||
full="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}"
|
||||
line="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
|
||||
branch_exists() { gh api "repos/$REPO/branches/$1" --silent 2>/dev/null; }
|
||||
if branch_exists "release/$full"; then branch="release/$full"
|
||||
elif branch_exists "release/$line"; then branch="release/$line"
|
||||
else branch=""; fi
|
||||
|
||||
if [[ "$DRY_RUN" != true ]]; then
|
||||
# POST is atomic: a concurrent creator gets 422 and cannot steal the lock.
|
||||
gh api "repos/$REPO/git/refs" -f ref="refs/heads/$lock" -f sha="$develop_sha" --silent
|
||||
fi
|
||||
if [[ -z "$branch" ]]; then
|
||||
branch="release/$line"
|
||||
echo "Plan: create $branch from develop $develop_sha (first RC of $full)"
|
||||
[[ "$DRY_RUN" == true ]] && exit 0
|
||||
gh api "repos/$REPO/git/refs" -f ref="refs/heads/$branch" -f sha="$develop_sha" --silent
|
||||
merge_sha="$develop_sha"
|
||||
else
|
||||
echo "Plan: merge develop $develop_sha into $branch"
|
||||
[[ "$DRY_RUN" == true ]] && exit 0
|
||||
# 201 merged, 204 already up to date (nothing new to release), 409 conflict.
|
||||
response=$(gh api --include "repos/$REPO/merges" -f base="$branch" -f head="$develop_sha" \
|
||||
-f commit_message="Merge develop into $branch for the next $full RC" 2>&1) || true
|
||||
status=$(printf '%s\n' "$response" | sed -n 's:^HTTP/[0-9.]* \([0-9][0-9]*\).*:\1:p' | head -n 1)
|
||||
case "$status" in
|
||||
201) merge_sha=$(printf '%s\n' "$response" | sed '1,/^\r\{0,1\}$/d' | jq -er .sha) ;;
|
||||
204)
|
||||
[[ "$(gh api "repos/$REPO/git/ref/heads/$lock" -q .object.sha)" == "$develop_sha" ]]
|
||||
gh api -X DELETE "repos/$REPO/git/refs/heads/$lock"
|
||||
echo "::warning::$branch already contains develop; no new RC"; exit 0 ;;
|
||||
409) echo "::error::Merge conflict between develop and $branch; resolve it in a PR into $branch"; exit 1 ;;
|
||||
*) echo "::error::Merge of develop into $branch failed (HTTP ${status:-unknown})"; exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
[[ "$(gh api "repos/$REPO/git/ref/heads/$lock" -q .object.sha)" == "$develop_sha" ]]
|
||||
gh api -X PATCH "repos/$REPO/git/refs/heads/$lock" -f sha="$merge_sha" -F force=false --silent
|
||||
merged_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
jq -n --arg repo "$REPO" --arg branch "$branch" --arg merge_sha "$merge_sha" \
|
||||
--arg merged_at "$merged_at" --arg run_id "$GITHUB_RUN_ID" --arg attempt "$GITHUB_RUN_ATTEMPT" \
|
||||
'{repo:$repo,branch:$branch,merge_sha:$merge_sha,merged_at:$merged_at,run_id:$run_id,attempt:$attempt}' \
|
||||
> "$RUNNER_TEMP/rc-intent.json"
|
||||
{
|
||||
echo "branch=$branch"
|
||||
echo "merge_sha=$merge_sha"
|
||||
echo "merged_at=$merged_at"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
echo "Pushed $branch; the CircleCI publisher cuts the RC." >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "Release line: $branch. Waiting without a runner for qbit-rc-published." >> "$GITHUB_STEP_SUMMARY"
|
||||
- name: Persist trusted release intent
|
||||
if: steps.merge.outputs.merge_sha != ''
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: qbit-rc-intent-${{ steps.merge.outputs.merge_sha }}
|
||||
path: ${{ runner.temp }}/rc-intent.json
|
||||
if-no-files-found: error
|
||||
retention-days: 90
|
||||
|
||||
tag-and-release:
|
||||
if: inputs.finalize || inputs.recover
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Verify completion against trusted intent, then tag and release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
REPO: ${{ github.repository }}
|
||||
BRANCH: ${{ inputs.branch }}
|
||||
MERGE_SHA: ${{ inputs.merge_sha }}
|
||||
BUMP_SHA: ${{ inputs.bump_sha }}
|
||||
VERSION: ${{ inputs.version }}
|
||||
DRY_RUN: ${{ inputs.dry_run }}
|
||||
RECOVER: ${{ inputs.recover }}
|
||||
CIRCLE_BUILD: ${{ inputs.circle_build }}
|
||||
RECOVERY_EVENT: ${{ github.event_name }}
|
||||
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
|
||||
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
|
||||
SIGNING_KEY: ${{ secrets.QRUN_TAG_SIGNING_KEY }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ -z "$SIGNING_KEY" ]]; then
|
||||
echo "::error::QRUN_TAG_SIGNING_KEY is not available (the caller needs 'secrets: inherit'); not creating an unsigned tag. The release captain tags this RC."
|
||||
exit 1
|
||||
fi
|
||||
workdir=$(mktemp -d)
|
||||
trap 'rm -rf "$workdir"' EXIT
|
||||
# BEGIN RC REF LOOKUP
|
||||
read_ref() {
|
||||
local body sha
|
||||
if body=$(gh api "repos/$REPO/git/ref/$1" 2>"$workdir/ref-error"); then
|
||||
sha=$(jq -er '.object.sha' <<< "$body") || return 1
|
||||
[[ "$sha" =~ ^[0-9a-f]{40}$ ]] || return 1
|
||||
printf '%s\n' "$sha"
|
||||
elif jq -se 'length == 1 and .[0].status == "404"' >/dev/null 2>&1 <<< "$body"; then
|
||||
# gh prints HTTP error JSON on stdout even when --jq was requested.
|
||||
return 0
|
||||
else
|
||||
cat "$workdir/ref-error" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
# END RC REF LOOKUP
|
||||
# The evaluator is inline so a pinned reusable workflow cannot fetch mutable code.
|
||||
cat > "$workdir/rc_guard.py" <<'PY'
|
||||
# BEGIN RC GUARD
|
||||
import re
|
||||
|
||||
class ReleaseFailure(ValueError):
|
||||
pass
|
||||
|
||||
def evaluate(merge_sha, status, commit, recovered_version=""):
|
||||
if status.get("sha") != merge_sha:
|
||||
raise ReleaseFailure("Status response does not identify the exact release merge")
|
||||
# Circle's workflow Check Run is stable even when job statuses receive -1/-2 suffixes.
|
||||
publishers = [x for x in status.get("check_runs", [])
|
||||
if x.get("name") in ("publish_release_candidate", "verify") and x.get("app", {}).get("id") == 18001]
|
||||
if not publishers:
|
||||
return ""
|
||||
publisher = max(publishers, key=lambda x: x["id"])
|
||||
if publisher.get("head_sha") != merge_sha:
|
||||
raise ReleaseFailure("Publisher Check Run identifies a different source")
|
||||
if publisher.get("status") != "completed":
|
||||
return ""
|
||||
if publisher.get("conclusion") != "success" and not recovered_version:
|
||||
raise ReleaseFailure("CircleCI failed for release merge: " + str(publisher.get("conclusion")))
|
||||
message = commit.get("commit", {}).get("message", "").split("\n")[0]
|
||||
match = re.fullmatch(r"Bump version to (\d+\.\d+\.\d+-RC\.\d+) \[skip ci\]", message)
|
||||
if not match:
|
||||
return ""
|
||||
if [x.get("sha") for x in commit.get("parents", [])] != [merge_sha]:
|
||||
raise ReleaseFailure("RC bump is not the direct child of the published merge")
|
||||
if recovered_version and recovered_version != match.group(1):
|
||||
raise ReleaseFailure("Recovery receipt and bump version differ")
|
||||
return match.group(1)
|
||||
|
||||
def validate_intent(run, intent, repo, merge, branch, run_id):
|
||||
if run.get("conclusion") != "success" or run.get("status") != "completed":
|
||||
raise ReleaseFailure("Cut run has not succeeded")
|
||||
if run.get("event") not in ("workflow_dispatch", "pull_request") or run.get("path") != ".github/workflows/release-rc.yml":
|
||||
raise ReleaseFailure("Untrusted cut workflow or trigger")
|
||||
if run.get("repository", {}).get("full_name") != repo or run.get("head_repository", {}).get("full_name") != repo:
|
||||
raise ReleaseFailure("Wrong cut repository")
|
||||
actual = tuple(intent.get(x) for x in ("repo", "merge_sha", "branch", "run_id"))
|
||||
if actual != (repo, merge, branch, run_id) or str(run.get("id")) != run_id:
|
||||
raise ReleaseFailure("Intent mismatch")
|
||||
if str(run.get("run_attempt")) != intent.get("attempt"):
|
||||
raise ReleaseFailure("Intent from an older attempt")
|
||||
|
||||
def tag_action(existing_target, bump, release_exists, lock):
|
||||
if existing_target and existing_target != bump:
|
||||
raise ReleaseFailure("Existing tag points at a different source")
|
||||
if existing_target and release_exists:
|
||||
return "complete"
|
||||
if not lock:
|
||||
raise ReleaseFailure("No matching pending intent lock")
|
||||
return "release" if existing_target else "tag"
|
||||
|
||||
def validate_lock(current, expected, completed=False):
|
||||
if current != expected and not (completed and not current):
|
||||
raise ReleaseFailure("Different release owns pending lock, or lock missing")
|
||||
|
||||
def validate_central(version, artifact, xml, modified, merged):
|
||||
import xml.etree.ElementTree as ET
|
||||
from email.utils import parsedate_to_datetime
|
||||
from datetime import datetime
|
||||
root = ET.fromstring(xml)
|
||||
ns = {"m": "http://maven.apache.org/POM/4.0.0"}
|
||||
if root.findtext("m:artifactId", namespaces=ns) != artifact or root.findtext("m:version", namespaces=ns) != version:
|
||||
raise ReleaseFailure("Central POM does not match the expected artifact/version")
|
||||
if parsedate_to_datetime(modified).timestamp() <= datetime.fromisoformat(merged.replace("Z", "+00:00")).timestamp():
|
||||
raise ReleaseFailure("Central artifact predates the exact release merge")
|
||||
def validate_timeout(job, publisher, repo, merge, branch, build, merged_at):
|
||||
from datetime import datetime
|
||||
if (job.get('username') + '/' + job.get('reponame'), job.get('vcs_revision'),
|
||||
job.get('branch'), str(job.get('build_num'))) != (repo, merge, branch, build):
|
||||
raise ReleaseFailure('Timeout job does not identify the exact cut')
|
||||
workflow = job.get('workflows', {})
|
||||
if workflow.get('workflow_name') not in ('publish_release_candidate', 'verify') or workflow.get('job_name') != 'qqq-orb/mvn_publish':
|
||||
raise ReleaseFailure('Unexpected Circle publication workflow/job')
|
||||
if (publisher.get('head_sha') != merge or publisher.get('app', {}).get('id') != 18001
|
||||
or publisher.get('name') != workflow.get('workflow_name')
|
||||
or publisher.get('status') != 'completed' or publisher.get('conclusion') != 'failure'):
|
||||
raise ReleaseFailure('Recovery requires the failed exact Circle publisher')
|
||||
from urllib.parse import urlsplit
|
||||
link = urlsplit(publisher.get('details_url', ''))
|
||||
if link.scheme != 'https' or link.netloc != 'app.circleci.com' or link.path != '/workflow/' + workflow.get('workflow_id', ''):
|
||||
raise ReleaseFailure('Circle check does not identify the timeout workflow')
|
||||
if job.get('status') != 'failed' or job.get('outcome') != 'failed':
|
||||
raise ReleaseFailure('Recovery requires a terminal failed job')
|
||||
actions = [action for step in job.get('steps', []) for action in step.get('actions', [])]
|
||||
if not actions or actions[-1].get('name') != 'Publish to Sonatype Central (releases and SNAPSHOTs)':
|
||||
raise ReleaseFailure('Deployment must be the last executed action')
|
||||
deploy = actions[-1]
|
||||
if deploy.get('status') != 'timedout' or deploy.get('timedout') is not True:
|
||||
raise ReleaseFailure('Only a deployment timeout can be recovered')
|
||||
if any(action.get('status') != 'success' for action in actions[:-1]):
|
||||
raise ReleaseFailure('Every pre-publication action must have passed')
|
||||
if not any(action.get('name') == 'Run Maven Verify' for action in actions[:-1]):
|
||||
raise ReleaseFailure('Successful Maven verification is missing')
|
||||
if datetime.fromisoformat(job['start_time'].replace('Z', '+00:00')) < datetime.fromisoformat(merged_at.replace('Z', '+00:00')):
|
||||
raise ReleaseFailure('Publisher predates the trusted cut')
|
||||
if any(type(deploy.get(key)) is not int or deploy[key] < 0 for key in ('step', 'index')):
|
||||
raise ReleaseFailure('Invalid deployment log coordinates')
|
||||
return deploy['step'], deploy['index']
|
||||
|
||||
|
||||
def upload_receipt(log, artifact, version):
|
||||
# Only the successful-upload receipt and actual Central staging paths count.
|
||||
deployments = re.findall(r'Uploaded bundle successfully,[^\n]*deploymentId: ([0-9a-f-]{36})\.', log)
|
||||
if len(deployments) != 1 or not re.fullmatch(r'[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}', deployments[0]):
|
||||
raise ReleaseFailure('Expected exactly one successful Central upload receipt')
|
||||
paths = re.findall(r'/target/central-staging/(com/kingsrook/qbits)/(qbit-[a-z0-9-]+)/(\d+\.\d+\.\d+-RC\.\d+)/', log)
|
||||
coordinates = {(group.replace('/', '.'), name, revision) for group, name, revision in paths}
|
||||
if not coordinates or ('com.kingsrook.qbits', artifact, version) not in coordinates:
|
||||
raise ReleaseFailure('Receipt does not include the expected root artifact')
|
||||
if any(revision != version for _, _, revision in coordinates):
|
||||
raise ReleaseFailure('Mixed candidate versions in the uploaded bundle')
|
||||
return deployments[0], sorted('pkg:maven/' + group + '/' + name + '@' + revision for group, name, revision in coordinates)
|
||||
|
||||
|
||||
def validate_deployment(deployment, deployment_id, purls):
|
||||
if deployment.get('deploymentId') != deployment_id or deployment.get('deploymentState') != 'PUBLISHED':
|
||||
raise ReleaseFailure('The original Central deployment is not PUBLISHED')
|
||||
if sorted(deployment.get('purls', [])) != purls:
|
||||
raise ReleaseFailure('Central deployment coordinates differ from the original upload')
|
||||
|
||||
|
||||
def validate_recovery_bump(commit, source, actual, version, merge):
|
||||
if [p.get('sha') for p in commit.get('parents', [])] != [merge]:
|
||||
raise ReleaseFailure('Recovery bump must be a direct child of the cut')
|
||||
files = commit.get('files', [])
|
||||
if len(files) != 1 or files[0].get('filename') != 'pom.xml' or files[0].get('status') != 'modified':
|
||||
raise ReleaseFailure('Recovery bump may change only the root POM')
|
||||
revisions = re.findall(r'<revision>([^<]+)</revision>', source)
|
||||
if len(revisions) != 1 or not re.fullmatch(re.escape(version.split('-RC.')[0]) + r'-(SNAPSHOT|RC\.\d+)', revisions[0]):
|
||||
raise ReleaseFailure('Unexpected source POM revision')
|
||||
expected = source.replace('<revision>' + revisions[0] + '</revision>', '<revision>' + version + '</revision>')
|
||||
if actual != expected:
|
||||
raise ReleaseFailure('Recovery bump changed content beyond the verified version')
|
||||
|
||||
def verify_recovery(directory, repo, merge, branch, build, version):
|
||||
import base64, json, os, pathlib, urllib.request, xml.etree.ElementTree as ET
|
||||
if not re.fullmatch(r'QRun-IO/qbit-[a-z0-9-]+', repo) or not re.fullmatch(r'[1-9][0-9]*', build):
|
||||
raise ReleaseFailure('Invalid recovery repository or Circle build')
|
||||
directory = pathlib.Path(directory)
|
||||
status = json.loads((directory / 'status.json').read_text())
|
||||
intent = json.loads((directory / 'intent.json').read_text())
|
||||
publishers = [p for p in status['check_runs'] if p.get('name') in ('publish_release_candidate', 'verify') and p.get('app', {}).get('id') == 18001]
|
||||
if status.get('sha') != merge or not publishers:
|
||||
raise ReleaseFailure('Exact publisher evidence missing')
|
||||
class NoRedirect(urllib.request.HTTPRedirectHandler):
|
||||
def redirect_request(self, *args, **kwargs):
|
||||
raise ReleaseFailure('Unexpected evidence redirect')
|
||||
opener = urllib.request.build_opener(NoRedirect())
|
||||
def request(url, token=None, post=False):
|
||||
headers = {'Accept': 'application/json'}
|
||||
if token:
|
||||
headers['Authorization'] = 'Bearer ' + token
|
||||
req = urllib.request.Request(url, headers=headers, data=b'' if post else None)
|
||||
with opener.open(req, timeout=30) as response:
|
||||
data = response.read(8_000_001)
|
||||
if len(data) > 8_000_000:
|
||||
raise ReleaseFailure('Oversized recovery evidence')
|
||||
return data, response.headers
|
||||
circle = 'https://circleci.com/api/v1.1/project/github/' + repo + '/' + build
|
||||
job = json.loads(request(circle)[0])
|
||||
step, index = validate_timeout(job, max(publishers, key=lambda p: p['id']), repo, merge, branch, build, intent['merged_at'])
|
||||
log = request(circle + '/output/' + str(step) + '/' + str(index) + '?file=true')[0].decode()
|
||||
# file=true can return either a raw log or JSON-encoded output.
|
||||
try:
|
||||
value = json.loads(log)
|
||||
except json.JSONDecodeError:
|
||||
value = log
|
||||
log = value if isinstance(value, str) else ''.join(part['message'] for part in value)
|
||||
token = os.environ.get('GH_TOKEN', '')
|
||||
source = json.loads(request('https://api.github.com/repos/' + repo + '/contents/pom.xml?ref=' + merge, token)[0])
|
||||
source_pom = base64.b64decode(source['content']).decode()
|
||||
pom = ET.fromstring(source_pom)
|
||||
ns = {'m': 'http://maven.apache.org/POM/4.0.0'}
|
||||
artifact = pom.findtext('m:artifactId', namespaces=ns)
|
||||
deployment_id, purls = upload_receipt(log, artifact, version)
|
||||
username, password = os.environ.get('CENTRAL_USERNAME'), os.environ.get('CENTRAL_PASSWORD')
|
||||
if not username or not password:
|
||||
raise ReleaseFailure('Existing Central publisher credentials are required for receipt verification')
|
||||
authorization = base64.b64encode((username + ':' + password).encode()).decode()
|
||||
deployment = json.loads(request('https://central.sonatype.com/api/v1/publisher/status?id=' + deployment_id, authorization, post=True)[0])
|
||||
validate_deployment(deployment, deployment_id, purls)
|
||||
for purl in purls:
|
||||
coordinate, revision = purl.removeprefix('pkg:maven/').split('@')
|
||||
group, name = coordinate.split('/')
|
||||
url = 'https://repo1.maven.org/maven2/' + group.replace('.', '/') + '/' + name + '/' + revision + '/' + name + '-' + revision + '.pom'
|
||||
xml, headers = request(url)
|
||||
validate_central(revision, name, xml, headers.get('Last-Modified', ''), intent['merged_at'])
|
||||
(directory / 'source-pom.xml').write_text(source_pom)
|
||||
# This receipt is written only after all remote evidence has been verified.
|
||||
(directory / 'recovery.json').write_text(json.dumps({'merge_sha': merge, 'version': version,
|
||||
'circle_build': build, 'deployment_id': deployment_id, 'purls': purls}))
|
||||
|
||||
# END RC GUARD
|
||||
if __name__ == "__main__":
|
||||
import json, sys
|
||||
try:
|
||||
if sys.argv[1] == "recover":
|
||||
verify_recovery(*sys.argv[2:])
|
||||
elif sys.argv[1] == "lock":
|
||||
validate_lock(sys.argv[2], sys.argv[3])
|
||||
elif sys.argv[1] == "tag":
|
||||
print(tag_action(sys.argv[2], sys.argv[3], sys.argv[4] == "true", sys.argv[5]))
|
||||
elif sys.argv[1] == "central":
|
||||
validate_central(*sys.argv[2:4], open(sys.argv[4]).read(), *sys.argv[5:7])
|
||||
else:
|
||||
recovered = ""
|
||||
if len(sys.argv) == 5:
|
||||
receipt = json.load(open(sys.argv[4]))
|
||||
if receipt["merge_sha"] != sys.argv[1]:
|
||||
raise ReleaseFailure("Recovery receipt source mismatch")
|
||||
recovered = receipt["version"]
|
||||
import pathlib
|
||||
directory = pathlib.Path(sys.argv[4]).parent
|
||||
validate_recovery_bump(json.load(open(sys.argv[3])), (directory / 'source-pom.xml').read_text(),
|
||||
(directory / 'bump-pom.xml').read_text(), recovered, sys.argv[1])
|
||||
print(evaluate(sys.argv[1], json.load(open(sys.argv[2])), json.load(open(sys.argv[3])), recovered))
|
||||
except (ValueError, KeyError) as error:
|
||||
sys.exit(str(error))
|
||||
PY
|
||||
|
||||
# Dispatch payload is only a hint. Bind it to immutable successful cut-run evidence.
|
||||
[[ "$MERGE_SHA" =~ ^[0-9a-f]{40}$ ]]
|
||||
if [[ "$RECOVER" == true ]]; then
|
||||
[[ "$RECOVERY_EVENT" == workflow_dispatch && "$CIRCLE_BUILD" =~ ^[1-9][0-9]*$ ]]
|
||||
else
|
||||
[[ "$BUMP_SHA" =~ ^[0-9a-f]{40}$ ]]
|
||||
fi
|
||||
[[ "$BRANCH" =~ ^release/[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]
|
||||
[[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-RC\.[0-9]+$ ]]
|
||||
artifact_name="qbit-rc-intent-$MERGE_SHA"
|
||||
gh api "repos/$REPO/actions/artifacts?name=$artifact_name&per_page=100" > "$workdir/artifacts.json"
|
||||
count=$(jq --arg name "$artifact_name" '[.artifacts[] | select(.name == $name and .expired == false)] | length' "$workdir/artifacts.json")
|
||||
if [[ "$count" == 0 ]]; then
|
||||
[[ "$(gh api "repos/$REPO/git/ref/heads/automation/qbit-rc-pending" -q .object.sha)" == "$MERGE_SHA" ]]
|
||||
echo "::warning::Cut artifact not visible yet; pending lock retained for central sweep."
|
||||
exit 0
|
||||
fi
|
||||
artifact_id=$(jq -er --arg name "$artifact_name" \
|
||||
'[.artifacts[] | select(.name == $name and .expired == false)] | if length == 1 then .[0].id else error("Expected one unexpired cut intent") end' "$workdir/artifacts.json")
|
||||
cut_run=$(jq -er --argjson id "$artifact_id" '.artifacts[] | select(.id == $id) | .workflow_run.id' "$workdir/artifacts.json")
|
||||
gh api "repos/$REPO/actions/runs/$cut_run" > "$workdir/run.json"
|
||||
if [[ "$(jq -r .status "$workdir/run.json")" != completed ]]; then
|
||||
echo "::warning::Cut run still completing; pending lock retained for central sweep."
|
||||
exit 0
|
||||
fi
|
||||
gh api "repos/$REPO/actions/artifacts/$artifact_id/zip" > "$workdir/intent.zip"
|
||||
python3 - "$workdir" "$REPO" "$MERGE_SHA" "$BRANCH" "$cut_run" <<'PY'
|
||||
import json, pathlib, sys, zipfile
|
||||
directory, repo, merge, branch, run_id = sys.argv[1:]
|
||||
directory = pathlib.Path(directory)
|
||||
run = json.loads((directory / "run.json").read_text())
|
||||
with zipfile.ZipFile(directory / "intent.zip") as archive:
|
||||
info = archive.getinfo("rc-intent.json")
|
||||
assert info.file_size < 10000, "Oversized intent"
|
||||
intent = json.loads(archive.read(info))
|
||||
import importlib.util
|
||||
spec = importlib.util.spec_from_file_location("guard", directory / "rc_guard.py")
|
||||
guard = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(guard)
|
||||
guard.validate_intent(run, intent, repo, merge, branch, run_id)
|
||||
(directory / "intent.json").write_text(json.dumps(intent))
|
||||
PY
|
||||
MERGED_AT=$(jq -er .merged_at "$workdir/intent.json")
|
||||
lock=automation/qbit-rc-pending
|
||||
current_lock=$(read_ref "heads/$lock")
|
||||
# A duplicate after completed finalization is safe only after tag/source checks below.
|
||||
[[ -z "$current_lock" || "$current_lock" == "$MERGE_SHA" ]] || { echo "::error::Different release owns pending lock"; exit 1; }
|
||||
gh api "repos/$REPO/commits/$MERGE_SHA/check-runs?filter=latest&per_page=100" \
|
||||
| jq --arg sha "$MERGE_SHA" '{sha:$sha,check_runs:.check_runs}' > "$workdir/status.json"
|
||||
recovered_args=()
|
||||
if [[ "$RECOVER" == true ]]; then
|
||||
python3 "$workdir/rc_guard.py" lock "$current_lock" "$MERGE_SHA"
|
||||
python3 "$workdir/rc_guard.py" recover "$workdir" "$REPO" "$MERGE_SHA" "$BRANCH" "$CIRCLE_BUILD" "$VERSION"
|
||||
if [[ "$DRY_RUN" == true ]]; then
|
||||
echo "Recovery evidence verified; dry run leaves branch, tag, release and lock unchanged." >> "$GITHUB_STEP_SUMMARY"
|
||||
exit 0
|
||||
fi
|
||||
head=$(gh api "repos/$REPO/branches/$BRANCH" -q .commit.sha)
|
||||
if [[ "$head" == "$MERGE_SHA" ]]; then
|
||||
key="$workdir/recovery_key"
|
||||
install -m 600 /dev/null "$key"
|
||||
printf '%s\n' "$SIGNING_KEY" > "$key"
|
||||
git init -q "$workdir/recovery-repo"
|
||||
git -C "$workdir/recovery-repo" fetch -q --depth=1 "https://x-access-token:$GH_TOKEN@github.com/$REPO.git" "$MERGE_SHA"
|
||||
git -C "$workdir/recovery-repo" checkout -q -b "$BRANCH" FETCH_HEAD
|
||||
python3 - "$workdir/recovery-repo/pom.xml" "$VERSION" <<'PY'
|
||||
import pathlib, re, sys
|
||||
path, version = pathlib.Path(sys.argv[1]), sys.argv[2]
|
||||
source = path.read_text()
|
||||
revisions = re.findall(r'<revision>([^<]+)</revision>', source)
|
||||
assert len(revisions) == 1 and re.fullmatch(re.escape(version.split('-RC.')[0]) + r'-(SNAPSHOT|RC\.\d+)', revisions[0]), 'Unexpected source revision'
|
||||
path.write_text(source.replace('<revision>' + revisions[0] + '</revision>', '<revision>' + version + '</revision>'))
|
||||
PY
|
||||
git -C "$workdir/recovery-repo" add pom.xml
|
||||
git -C "$workdir/recovery-repo" -c user.name="James Maes" -c user.email=james@kof22.com -c gpg.format=ssh -c user.signingkey="$key" commit -q -S -m "Bump version to $VERSION [skip ci]"
|
||||
python3 "$workdir/rc_guard.py" lock "$(gh api "repos/$REPO/git/ref/heads/$lock" -q .object.sha)" "$MERGE_SHA"
|
||||
# A normal fast-forward push refuses a competing release-branch change.
|
||||
git -C "$workdir/recovery-repo" push -q "https://x-access-token:$GH_TOKEN@github.com/$REPO.git" "HEAD:$BRANCH"
|
||||
BUMP_SHA=$(git -C "$workdir/recovery-repo" rev-parse HEAD)
|
||||
rm -f "$key"
|
||||
else
|
||||
BUMP_SHA=$head
|
||||
fi
|
||||
recovered_args=("$workdir/recovery.json")
|
||||
echo "Verified original Central upload after Circle timeout; no artifact was uploaded again." >> "$GITHUB_STEP_SUMMARY"
|
||||
fi
|
||||
gh api "repos/$REPO/commits/$BUMP_SHA" > "$workdir/commit.json"
|
||||
if [[ "$RECOVER" == true ]]; then
|
||||
gh api "repos/$REPO/contents/pom.xml?ref=$BUMP_SHA" -q .content | base64 -d > "$workdir/bump-pom.xml"
|
||||
fi
|
||||
version=$(python3 "$workdir/rc_guard.py" "$MERGE_SHA" "$workdir/status.json" "$workdir/commit.json" "${recovered_args[@]}")
|
||||
[[ -n "$version" && "$version" == "$VERSION" ]] || { echo "::error::Publisher not successful or callback version mismatch"; exit 1; }
|
||||
bump_sha=$BUMP_SHA
|
||||
[[ "$(gh api "repos/$REPO/branches/$BRANCH" -q .commit.sha)" == "$bump_sha" ]] || { echo "::error::Release branch moved away from exact bump"; exit 1; }
|
||||
# The project's own artifactId: skip the <parent> block (qbit-build-parent).
|
||||
artifact=$(gh api "repos/$REPO/contents/pom.xml?ref=$MERGE_SHA" -q .content | base64 -d \
|
||||
| sed '/<parent>/,/<\/parent>/d' \
|
||||
| sed -n 's:.*<artifactId>\(qbit-[^<]*\)</artifactId>.*:\1:p' | head -n 1)
|
||||
group_path=com/kingsrook/qbits
|
||||
|
||||
# Central visibility may lag deployment. A retry reuses this intent; it never cuts again.
|
||||
# 2. Provenance: the Central artifact must exist and be newer than this merge.
|
||||
pom="https://repo1.maven.org/maven2/$group_path/$artifact/$version/$artifact-$version.pom"
|
||||
if [[ "$(curl -s -o /dev/null -w '%{http_code}' "$pom")" != 200 ]]; then
|
||||
echo "::warning::Central not visible yet; pending intent retained. Retry finalization with the same payload."
|
||||
echo "Central pending for $artifact $version; no tag created and lock retained." >> "$GITHUB_STEP_SUMMARY"
|
||||
exit 0
|
||||
fi
|
||||
last_modified=$(curl -sI "$pom" | tr -d '\r' | sed -n 's/^[Ll]ast-[Mm]odified: //p')
|
||||
if [[ "$(curl -s -o /dev/null -w '%{http_code}' "$pom")" != 200 || -z "$last_modified" ]]; then
|
||||
echo "::error::$artifact $version is not on Maven Central"
|
||||
exit 1
|
||||
fi
|
||||
if (( $(date -d "$last_modified" +%s) <= $(date -d "$MERGED_AT" +%s) )); then
|
||||
echo "::error::$artifact $version on Central ($last_modified) predates this merge ($MERGED_AT); not tagging."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -fsS "$pom" -o "$workdir/central.pom"
|
||||
python3 "$workdir/rc_guard.py" central "$version" "$artifact" "$workdir/central.pom" "$last_modified" "$MERGED_AT"
|
||||
|
||||
# 3. Signed annotated tag on the exact bump; duplicate runs must not accept a different tag.
|
||||
existing=$(read_ref "tags/v$version")
|
||||
target=""; release_exists=false
|
||||
if [[ -n "$existing" ]]; then
|
||||
target=$(gh api "repos/$REPO/git/tags/$existing" --jq '.object.sha')
|
||||
if gh release view "v$version" -R "$REPO" >/dev/null 2>&1; then release_exists=true; fi
|
||||
fi
|
||||
# Ownership was checked above, so tag_action never authorizes a different pending owner.
|
||||
action=$(python3 "$workdir/rc_guard.py" tag "$target" "$bump_sha" "$release_exists" "$current_lock")
|
||||
if [[ "$action" == complete ]]; then
|
||||
if [[ "$current_lock" == "$MERGE_SHA" ]]; then
|
||||
python3 "$workdir/rc_guard.py" lock "$(gh api "repos/$REPO/git/ref/heads/$lock" -q .object.sha)" "$MERGE_SHA"
|
||||
gh api -X DELETE "repos/$REPO/git/refs/heads/$lock"
|
||||
fi
|
||||
echo "Tag and release already exist for the verified source."
|
||||
exit 0
|
||||
fi
|
||||
if [[ "$action" == tag ]]; then
|
||||
key="$workdir/signing_key"
|
||||
install -m 600 /dev/null "$key"
|
||||
printf '%s\n' "$SIGNING_KEY" > "$key"
|
||||
git init -q "$workdir/repo"
|
||||
git -C "$workdir/repo" fetch -q --depth=1 "https://x-access-token:$GH_TOKEN@github.com/$REPO.git" "$bump_sha"
|
||||
git -C "$workdir/repo" -c user.name="James Maes" -c user.email=james@kof22.com -c gpg.format=ssh \
|
||||
-c user.signingkey="$key" tag -s "v$version" "$bump_sha" -m "$artifact $version"
|
||||
rm -f "$key"
|
||||
git -C "$workdir/repo" push -q "https://x-access-token:$GH_TOKEN@github.com/$REPO.git" "v$version"
|
||||
fi
|
||||
|
||||
[[ "$current_lock" == "$MERGE_SHA" ]] || { echo "::error::No matching pending intent lock"; exit 1; }
|
||||
# 4. GitHub prerelease whose notes list the merged PRs since the previous tag.
|
||||
previous=$(gh api "repos/$REPO/tags?per_page=100" -q '.[].name' | grep -E '^v[0-9]' | grep -vx "v$version" | sort -V | tail -n 1 || true)
|
||||
prs=$(gh api "repos/$REPO/compare/${previous:-$MERGE_SHA}...$bump_sha" \
|
||||
-q '.commits[].commit.message | select(startswith("Merge pull request #")) | split("\n") | (.[0] | capture("#(?<n>[0-9]+)").n) + "\t" + (.[2] // "")')
|
||||
notes="$workdir/notes.md"
|
||||
{
|
||||
echo "$artifact **$version** release candidate (Maven Central, $last_modified)."
|
||||
echo
|
||||
echo "## Changes"
|
||||
if [[ -n "$prs" ]]; then
|
||||
while IFS=$'\t' read -r n title; do echo "- $title ([#$n](https://github.com/$REPO/pull/$n))"; done <<< "$prs"
|
||||
else
|
||||
echo "- See the commits since ${previous:-the previous release}."
|
||||
fi
|
||||
echo
|
||||
echo "The signed annotated tag \`v$version\` fixes source \`${bump_sha:0:7}\` on \`$BRANCH\`."
|
||||
echo
|
||||
echo "No GA approval is implied."
|
||||
} > "$notes"
|
||||
gh release create "v$version" -R "$REPO" --verify-tag --prerelease --title "$artifact $version" --notes-file "$notes"
|
||||
python3 "$workdir/rc_guard.py" lock "$(gh api "repos/$REPO/git/ref/heads/$lock" -q .object.sha)" "$MERGE_SHA"
|
||||
gh api -X DELETE "repos/$REPO/git/refs/heads/$lock"
|
||||
echo "Tagged and released v$version ($artifact) on ${bump_sha:0:7}." >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -0,0 +1,30 @@
|
||||
name: authentik-schema-drift
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
drift:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
cache: maven
|
||||
- name: Resolve version and fetch its schema
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
run: "version=\"${INPUT_VERSION}\"\nif [ -z \"$version\" ]; then\n version=$(gh release view --repo goauthentik/authentik\
|
||||
\ --json tagName -q .tagName | sed 's#^version/##')\nfi\necho \"Authentik $version\"\ncurl -fsSL \"https://raw.githubusercontent.com/goauthentik/authentik/version/${version}/schema.yml\"\
|
||||
\ -o \"$RUNNER_TEMP/schema.yml\"\necho \"SCHEMA=$RUNNER_TEMP/schema.yml\" >> \"$GITHUB_ENV\"\n"
|
||||
- name: Drift test
|
||||
run: ./mvnw -B -q test -Dtest=SchemaDriftTest -Dsurefire.failIfNoSpecifiedTests=false -Dauthentik.schema.file="$SCHEMA"
|
||||
'on':
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: Authentik version (e.g. 2026.10.0); empty = latest release
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
@@ -0,0 +1,325 @@
|
||||
name: Build
|
||||
|
||||
# Native macOS/Windows binaries require GitHub-hosted platforms; the orb generates the tiny caller.
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
full_native:
|
||||
description: Qualify all five native platforms on an explicit manual run
|
||||
type: boolean
|
||||
default: false
|
||||
secrets:
|
||||
HOMEBREW_TAP_TOKEN:
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: qctl-native-${{ github.repository }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up GraalVM
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'graalvm'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-maven-
|
||||
|
||||
- name: Run tests
|
||||
run: mvn clean verify -q
|
||||
|
||||
build-native:
|
||||
needs: test
|
||||
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.full_native)
|
||||
strategy:
|
||||
matrix:
|
||||
include: ${{ fromJSON((startsWith(github.ref, 'refs/tags/v') || inputs.full_native) && '[{"os":"ubuntu-latest","artifact":"qctl-linux-amd64"},{"os":"ubuntu-24.04-arm","artifact":"qctl-linux-arm64"},{"os":"macos-15-intel","artifact":"qctl-macos-amd64"},{"os":"macos-14","artifact":"qctl-macos-arm64"},{"os":"windows-latest","artifact":"qctl-windows-amd64.exe"}]' || '[{"os":"ubuntu-latest","artifact":"qctl-linux-amd64"}]') }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up GraalVM
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'graalvm'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-maven-
|
||||
|
||||
- name: Verify artifact architecture
|
||||
shell: bash
|
||||
env:
|
||||
ARTIFACT: ${{ matrix.artifact }}
|
||||
run: |
|
||||
case "$ARTIFACT" in
|
||||
*arm64) [[ "$(uname -m)" == arm64 || "$(uname -m)" == aarch64 ]] ;;
|
||||
*amd64|*amd64.exe) [[ "$(uname -m)" == x86_64 ]] ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
|
||||
- name: Build native image
|
||||
run: mvn clean package -DskipTests -Pnative -q
|
||||
|
||||
- name: Rename artifact (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: mv qctl-cli/target/qctl qctl-cli/target/${{ matrix.artifact }}
|
||||
|
||||
- name: Rename artifact (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: mv qctl-cli/target/qctl.exe qctl-cli/target/${{ matrix.artifact }}
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact }}
|
||||
path: qctl-cli/target/${{ matrix.artifact }}
|
||||
|
||||
release:
|
||||
needs: build-native
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Flatten artifacts
|
||||
run: |
|
||||
mkdir -p release
|
||||
find artifacts -type f -exec mv {} release/ \;
|
||||
ls -la release/
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: release/*
|
||||
generate_release_notes: true
|
||||
|
||||
docker:
|
||||
needs: release
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download Linux AMD64 artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: qctl-linux-amd64
|
||||
path: .
|
||||
|
||||
- name: Download Linux ARM64 artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: qctl-linux-arm64
|
||||
path: .
|
||||
|
||||
- name: Prepare binaries
|
||||
run: |
|
||||
chmod +x qctl-linux-amd64 qctl-linux-arm64
|
||||
# Dockerfile expects qctl-linux-amd64 and qctl-linux-arm64
|
||||
ls -la qctl-linux-*
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: packaging/docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/qrun-io/qctl:${{ github.ref_name }}
|
||||
ghcr.io/qrun-io/qctl:latest
|
||||
|
||||
update-homebrew:
|
||||
permissions:
|
||||
contents: read
|
||||
needs: release
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Checkout homebrew-qctl tap
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: QRun-IO/homebrew-qctl
|
||||
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||
path: homebrew-tap
|
||||
|
||||
- name: Update Homebrew formula
|
||||
env:
|
||||
VERSION: ${{ github.ref_name }}
|
||||
run: |
|
||||
VERSION="${VERSION#v}"
|
||||
|
||||
SHA_MACOS_ARM64=$(shasum -a 256 artifacts/qctl-macos-arm64/qctl-macos-arm64 | cut -d' ' -f1)
|
||||
SHA_MACOS_AMD64=$(shasum -a 256 artifacts/qctl-macos-amd64/qctl-macos-amd64 | cut -d' ' -f1)
|
||||
SHA_LINUX_ARM64=$(shasum -a 256 artifacts/qctl-linux-arm64/qctl-linux-arm64 | cut -d' ' -f1)
|
||||
SHA_LINUX_AMD64=$(shasum -a 256 artifacts/qctl-linux-amd64/qctl-linux-amd64 | cut -d' ' -f1)
|
||||
|
||||
FORMULA="homebrew-tap/Formula/qctl.rb"
|
||||
|
||||
# Update version
|
||||
sed -i "s/version \"[^\"]*\"/version \"${VERSION}\"/" "$FORMULA"
|
||||
|
||||
# Update SHA256 hashes in order: macos-arm64, macos-amd64, linux-arm64, linux-amd64
|
||||
awk -v v1="$SHA_MACOS_ARM64" -v v2="$SHA_MACOS_AMD64" -v v3="$SHA_LINUX_ARM64" -v v4="$SHA_LINUX_AMD64" '
|
||||
BEGIN { n = 0 }
|
||||
/sha256/ {
|
||||
n++
|
||||
if (n == 1) sub(/sha256 "[^"]*"/, "sha256 \"" v1 "\"")
|
||||
else if (n == 2) sub(/sha256 "[^"]*"/, "sha256 \"" v2 "\"")
|
||||
else if (n == 3) sub(/sha256 "[^"]*"/, "sha256 \"" v3 "\"")
|
||||
else if (n == 4) sub(/sha256 "[^"]*"/, "sha256 \"" v4 "\"")
|
||||
}
|
||||
{ print }
|
||||
' "$FORMULA" > "$FORMULA.tmp" && mv "$FORMULA.tmp" "$FORMULA"
|
||||
|
||||
- name: Commit and push
|
||||
run: |
|
||||
cd homebrew-tap
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add Formula/qctl.rb
|
||||
git diff --staged --quiet || git commit -m "Update qctl to ${GITHUB_REF_NAME}"
|
||||
git push
|
||||
|
||||
update-scoop:
|
||||
needs: release
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: develop
|
||||
|
||||
- name: Download Windows artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: qctl-windows-amd64.exe
|
||||
path: artifacts
|
||||
|
||||
- name: Update Scoop manifest
|
||||
env:
|
||||
VERSION: ${{ github.ref_name }}
|
||||
run: |
|
||||
VERSION="${VERSION#v}"
|
||||
SHA_WINDOWS=$(shasum -a 256 artifacts/qctl-windows-amd64.exe | cut -d' ' -f1)
|
||||
|
||||
MANIFEST="packaging/scoop/qctl.json"
|
||||
|
||||
# Update version
|
||||
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"${VERSION}\"/" "$MANIFEST"
|
||||
|
||||
# Update download URL version
|
||||
sed -i "s|/download/v[^/]*/|/download/v${VERSION}/|g" "$MANIFEST"
|
||||
|
||||
# Update hash
|
||||
sed -i "s/\"hash\": \"[^\"]*\"/\"hash\": \"${SHA_WINDOWS}\"/" "$MANIFEST"
|
||||
|
||||
- name: Clean up artifacts
|
||||
run: rm -rf artifacts
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: "chore(scoop): update manifest to ${{ github.ref_name }}"
|
||||
title: "chore(scoop): update manifest to ${{ github.ref_name }}"
|
||||
body: "Automated Scoop manifest update for release ${{ github.ref_name }}"
|
||||
branch: chore/scoop-${{ github.ref_name }}
|
||||
base: develop
|
||||
add-paths: packaging/scoop/qctl.json
|
||||
|
||||
update-aur:
|
||||
needs: release
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: develop
|
||||
|
||||
- name: Download Linux AMD64 artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: qctl-linux-amd64
|
||||
path: artifacts
|
||||
|
||||
- name: Update AUR PKGBUILD
|
||||
env:
|
||||
VERSION: ${{ github.ref_name }}
|
||||
run: |
|
||||
VERSION="${VERSION#v}"
|
||||
SHA_LINUX=$(shasum -a 256 artifacts/qctl-linux-amd64 | cut -d' ' -f1)
|
||||
|
||||
PKGBUILD="packaging/aur/PKGBUILD"
|
||||
|
||||
# Update version
|
||||
sed -i "s/pkgver=.*/pkgver=${VERSION}/" "$PKGBUILD"
|
||||
|
||||
# Reset pkgrel for new version
|
||||
sed -i "s/pkgrel=.*/pkgrel=1/" "$PKGBUILD"
|
||||
|
||||
# Update hash
|
||||
sed -i "s/sha256sums_x86_64=('[^']*')/sha256sums_x86_64=('${SHA_LINUX}')/" "$PKGBUILD"
|
||||
|
||||
- name: Clean up artifacts
|
||||
run: rm -rf artifacts
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: "chore(aur): update PKGBUILD to ${{ github.ref_name }}"
|
||||
title: "chore(aur): update PKGBUILD to ${{ github.ref_name }}"
|
||||
body: "Automated AUR PKGBUILD update for release ${{ github.ref_name }}"
|
||||
branch: chore/aur-${{ github.ref_name }}
|
||||
base: develop
|
||||
add-paths: packaging/aur/PKGBUILD
|
||||
@@ -0,0 +1,664 @@
|
||||
name: qqq-all guarded release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: Reviewed source version (GA or exact coordinated RC)
|
||||
required: true
|
||||
type: string
|
||||
release_sha:
|
||||
description: Full develop commit SHA already signed and tagged with the selected version
|
||||
required: true
|
||||
type: string
|
||||
smoke_evidence:
|
||||
description: github (legacy default) or circle (public API evidence; optional credential)
|
||||
type: string
|
||||
default: github
|
||||
circle_workflow_id:
|
||||
description: Exact successful Circle workflow UUID; verified independently through both APIs
|
||||
type: string
|
||||
default: ''
|
||||
smoke_run_id:
|
||||
description: Successful Smoke workflow run ID for that exact develop SHA
|
||||
default: ''
|
||||
required: false
|
||||
type: string
|
||||
secrets:
|
||||
CIRCLECI_TOKEN:
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
checks: read
|
||||
actions: read
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
concurrency:
|
||||
group: qqq-all-release-4.1.0
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
environment: qqq-all-release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RELEASE_SHA: ${{ inputs.release_sha }}
|
||||
SMOKE_EVIDENCE: ${{ inputs.smoke_evidence }}
|
||||
CIRCLE_WORKFLOW_ID: ${{ inputs.circle_workflow_id }}
|
||||
SMOKE_RUN_ID: ${{ inputs.smoke_run_id }}
|
||||
RELEASE_ENABLED: ${{ vars.QQQ_ALL_RELEASE_ENABLED }}
|
||||
LICENSE_CLEARED: ${{ vars.QQQ_ALL_RELEASE_LICENSE_APPROVED }}
|
||||
VERSION: ${{ inputs.version }}
|
||||
TAG: ${{ inputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Check manual release controls and exact tag
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
test "$GITHUB_REF" = refs/heads/develop
|
||||
test "$RELEASE_ENABLED" = true
|
||||
test "$LICENSE_CLEARED" = true
|
||||
case "$VERSION" in 4.1.0|4.1.0-RC.1) ;; *) exit 1 ;; esac
|
||||
[[ "$RELEASE_SHA" =~ ^[0-9a-f]{40}$ ]]
|
||||
case "$SMOKE_EVIDENCE" in
|
||||
github) [[ "$SMOKE_RUN_ID" =~ ^[0-9]+$ ]] ;;
|
||||
circle)
|
||||
[[ "$CIRCLE_WORKFLOW_ID" =~ ^[0-9a-f-]{36}$ ]]
|
||||
;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
|
||||
test "$RELEASE_SHA" = "$GITHUB_SHA"
|
||||
test "$(git cat-file -t "refs/tags/$TAG")" = tag
|
||||
test "$(git rev-parse "refs/tags/$TAG^{commit}")" = "$RELEASE_SHA"
|
||||
gh api "repos/$GITHUB_REPOSITORY/git/tags/$(git rev-parse "refs/tags/$TAG")" > "$RUNNER_TEMP/tag-object.json"
|
||||
- name: Materialize reviewed central release gates
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p "$RUNNER_TEMP/central-release"
|
||||
cat > "$RUNNER_TEMP/central-release/qqq_all_release_gate.py" <<'PY'
|
||||
"""Fail-closed checks for the manual 4.1.0 GA / exact RC.1 release workflow."""
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
from xml.etree import ElementTree
|
||||
|
||||
|
||||
QBITS = (
|
||||
"quick-search", "user-role-permissions", "customizable-table-views",
|
||||
"standard-process-trace", "webhooks", "workflows", "geo-data",
|
||||
"sftp-data-integration",
|
||||
)
|
||||
RELEASE_VERSIONS = ("4.1.0", "4.1.0-RC.1")
|
||||
|
||||
|
||||
def immutable_version(value):
|
||||
return re.fullmatch(r"[0-9]+(?:\.[0-9]+){2,3}(?:-RC\.[1-9][0-9]*)?", value) is not None
|
||||
|
||||
|
||||
def validate_version(version):
|
||||
if version not in RELEASE_VERSIONS:
|
||||
raise GateError("This release workflow is limited to 4.1.0 and 4.1.0-RC.1")
|
||||
|
||||
|
||||
class GateError(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
def properties(path):
|
||||
root = ElementTree.parse(path).getroot()
|
||||
namespace = xml_namespace(root)
|
||||
values = root.find(f"{namespace}properties")
|
||||
if values is None:
|
||||
raise GateError(f"Missing Maven properties in {path}")
|
||||
return {child.tag.removeprefix(namespace): (child.text or "").strip() for child in values}
|
||||
|
||||
|
||||
def xml_namespace(root):
|
||||
return root.tag.partition("}")[0] + "}" if root.tag.startswith("{") else ""
|
||||
|
||||
|
||||
def coordinates(path):
|
||||
root = ElementTree.parse(path).getroot()
|
||||
namespace = xml_namespace(root)
|
||||
parent = root.find(f"{namespace}parent")
|
||||
|
||||
def value(name):
|
||||
direct = root.findtext(f"{namespace}{name}")
|
||||
inherited = parent.findtext(f"{namespace}{name}") if parent is not None else None
|
||||
return direct or inherited
|
||||
|
||||
return value("groupId"), value("artifactId"), value("version")
|
||||
|
||||
|
||||
def managed_dependencies(path):
|
||||
root = ElementTree.parse(path).getroot()
|
||||
namespace = xml_namespace(root)
|
||||
values = properties(path)
|
||||
if root.findall(f"{namespace}profiles/{namespace}profile/{namespace}dependencyManagement"):
|
||||
raise GateError(f"Profile-managed dependency override in {path}")
|
||||
dependencies = root.find(f"{namespace}dependencyManagement/{namespace}dependencies")
|
||||
if dependencies is None:
|
||||
raise GateError(f"Missing dependencyManagement in {path}")
|
||||
|
||||
def field(dependency, name, default=""):
|
||||
return (dependency.findtext(f"{namespace}{name}") or default).strip()
|
||||
|
||||
managed = []
|
||||
for dependency in dependencies.findall(f"{namespace}dependency"):
|
||||
version = field(dependency, "version")
|
||||
reference = re.fullmatch(r"\$\{([^}]+)\}", version)
|
||||
if reference:
|
||||
version = values.get(reference.group(1), "")
|
||||
if not immutable_version(version):
|
||||
raise GateError(f"Unreleased managed dependency in {path}: "
|
||||
f"{field(dependency, 'artifactId')}")
|
||||
managed.append((field(dependency, "groupId"), field(dependency, "artifactId"),
|
||||
version, field(dependency, "type", "jar"),
|
||||
field(dependency, "scope", "compile"),
|
||||
field(dependency, "classifier")))
|
||||
if not managed:
|
||||
raise GateError(f"No managed dependencies in {path}")
|
||||
return managed
|
||||
|
||||
|
||||
def validate_managed_bom(path, version):
|
||||
managed = managed_dependencies(path)
|
||||
entries = {(group, artifact): (pin, kind, scope) for group, artifact, pin, kind, scope, _ in managed}
|
||||
if len(entries) != len(managed):
|
||||
raise GateError(f"Duplicate managed dependency in {path}")
|
||||
if entries.get(("com.kingsrook.qqq", "qqq-bom-pom")) != (version, "pom", "import"):
|
||||
raise GateError(f"QQQ BOM import differs from {version} in {path}")
|
||||
values = properties(path)
|
||||
if entries.get(("com.kingsrook.qqq", "qqq-frontend-next")) != (
|
||||
values.get("qqq-frontend-next.version"), "jar", "compile"):
|
||||
raise GateError(f"Managed Next differs from its release pin in {path}")
|
||||
for name in QBITS:
|
||||
artifact = f"qbit-{name}"
|
||||
if entries.get(("com.kingsrook.qbits", artifact)) != (
|
||||
values.get(f"{artifact}.version"), "jar", "compile"):
|
||||
raise GateError(f"Managed {artifact} differs from its release pin in {path}")
|
||||
return managed
|
||||
|
||||
|
||||
def validate_published_poms(parent_path, bom_path, version, local_bom):
|
||||
expected = (
|
||||
(parent_path, "qqq-all-parent"),
|
||||
(bom_path, "qqq-all-bom"),
|
||||
)
|
||||
for path, artifact in expected:
|
||||
if coordinates(path) != ("com.kingsrook.qqq", artifact, version):
|
||||
raise GateError(f"Published {artifact} POM is not the {version} release")
|
||||
published = properties(bom_path)
|
||||
if published.get("qqq.version") != version:
|
||||
raise GateError(f"Published BOM does not import QQQ {version}")
|
||||
for name in QBITS:
|
||||
key = f"qbit-{name}.version"
|
||||
value = published.get(key, "")
|
||||
if not immutable_version(value):
|
||||
raise GateError(f"Published BOM {key} is not a release")
|
||||
local = properties(local_bom)
|
||||
for key in ("qqq.version", "qqq-frontend-next.version", *(f"qbit-{name}.version" for name in QBITS)):
|
||||
if published.get(key) != local.get(key):
|
||||
raise GateError(f"Published BOM {key} differs from release source")
|
||||
if validate_managed_bom(bom_path, version) != validate_managed_bom(local_bom, version):
|
||||
raise GateError("Published BOM dependencyManagement differs from release source")
|
||||
|
||||
|
||||
def validate_poms(root, version):
|
||||
validate_version(version)
|
||||
parent = properties(root / "pom.xml")
|
||||
bom = properties(root / "qqq-all-bom/pom.xml")
|
||||
if parent.get("revision") != version or bom.get("qqq.version") != version:
|
||||
raise GateError(f"Parent revision and QQQ BOM pin must both equal {version}")
|
||||
for name in QBITS:
|
||||
key = f"qbit-{name}.version"
|
||||
value = bom.get(key, "")
|
||||
if not immutable_version(value):
|
||||
raise GateError(f"{key} must be a published non-snapshot version")
|
||||
for key, value in bom.items():
|
||||
if key.endswith(".version") and not immutable_version(value):
|
||||
raise GateError(f"{key} must be an immutable release version")
|
||||
validate_managed_bom(root / "qqq-all-bom/pom.xml", version)
|
||||
|
||||
|
||||
def validate_smoke(run, jobs, sha):
|
||||
if not re.fullmatch(r"[0-9a-f]{40}", sha):
|
||||
raise GateError("Release SHA must be a full lowercase Git commit ID")
|
||||
expected = {
|
||||
"name": "Smoke", "path": ".github/workflows/smoke.yml",
|
||||
"head_sha": sha, "head_branch": "develop", "event": "push",
|
||||
"conclusion": "success",
|
||||
}
|
||||
for key, value in expected.items():
|
||||
if run.get(key) != value:
|
||||
raise GateError(f"Smoke run {key} must equal {value}")
|
||||
observed = {"core": False, "full": False}
|
||||
for job in jobs.get("jobs", []):
|
||||
name = job.get("name")
|
||||
if name in observed:
|
||||
if job.get("conclusion") != "success":
|
||||
raise GateError(f"Smoke job {name} did not pass")
|
||||
observed[name] = True
|
||||
if not all(observed.values()):
|
||||
raise GateError("Smoke run must include successful core and full jobs")
|
||||
|
||||
|
||||
def validate_upstream_release(release, version):
|
||||
if (not immutable_version(version) or release.get("tag_name") != "v" + version
|
||||
or release.get("draft") is not False
|
||||
or release.get("prerelease") is not ("-RC." in version)):
|
||||
raise GateError(f"Upstream release must be public v{version} with matching prerelease state")
|
||||
|
||||
|
||||
def validate_tag(tag, version, sha, tag_sha):
|
||||
validate_version(version)
|
||||
if not all(re.fullmatch(r"[0-9a-f]{40}", value) for value in (sha, tag_sha)):
|
||||
raise GateError("Tag and commit IDs must be full Git SHAs")
|
||||
if (tag.get("sha") != tag_sha or tag.get("tag") != version
|
||||
or tag.get("object", {}).get("type") != "commit"
|
||||
or tag.get("object", {}).get("sha") != sha
|
||||
or tag.get("verification", {}).get("verified") is not True
|
||||
or tag.get("verification", {}).get("reason") != "valid"):
|
||||
raise GateError("Release tag must be signed, verified, annotated and point to the exact release commit")
|
||||
|
||||
|
||||
def download_public_inputs(bom, version, destination, central="https://repo.maven.apache.org/maven2"):
|
||||
"""Fetch the declared first-party inputs and their parents without credentials."""
|
||||
validate_version(version)
|
||||
destination.mkdir(parents=True, exist_ok=True)
|
||||
receipts = []
|
||||
visited = set()
|
||||
|
||||
def fetch(group, artifact, pin, kind):
|
||||
coordinate = (group, artifact, pin, kind)
|
||||
if coordinate in visited:
|
||||
return
|
||||
if (not re.fullmatch(r"[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*", group)
|
||||
or not re.fullmatch(r"[A-Za-z0-9_-]+", artifact) or not immutable_version(pin)):
|
||||
raise GateError(f"Invalid or mutable public coordinate: {coordinate}")
|
||||
visited.add(coordinate)
|
||||
relative = f"{group.replace('.', '/')}/{artifact}/{pin}/{artifact}-{pin}.{kind}"
|
||||
url = central + "/" + relative
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=30) as response:
|
||||
data = response.read()
|
||||
except (urllib.error.URLError, OSError) as error:
|
||||
if isinstance(error, urllib.error.HTTPError):
|
||||
error.close()
|
||||
raise GateError(f"Public input unavailable: {relative}") from error
|
||||
if not data:
|
||||
raise GateError(f"Empty public input: {relative}")
|
||||
path = destination / relative
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(data)
|
||||
if kind == "pom":
|
||||
if coordinates(path) != (group, artifact, pin):
|
||||
raise GateError(f"Public POM coordinates differ: {relative}")
|
||||
root = ElementTree.fromstring(data)
|
||||
ns = xml_namespace(root)
|
||||
parent = root.find(f"{ns}parent")
|
||||
if parent is not None:
|
||||
parent_group = parent.findtext(f"{ns}groupId", "")
|
||||
parent_pin = parent.findtext(f"{ns}version", "")
|
||||
if not immutable_version(parent_pin):
|
||||
raise GateError(f"Mutable parent in {relative}")
|
||||
if parent_group.startswith("com.kingsrook"):
|
||||
fetch(parent_group, parent.findtext(f"{ns}artifactId", ""), parent_pin, "pom")
|
||||
if artifact == "qbit-build-parent":
|
||||
imports = root.findall(f"{ns}dependencyManagement/{ns}dependencies/{ns}dependency")
|
||||
props = root.find(f"{ns}properties")
|
||||
values = {child.tag.removeprefix(ns): child.text for child in props} if props is not None else {}
|
||||
qqq_imports = [dep for dep in imports if dep.findtext(f"{ns}groupId") == "com.kingsrook.qqq"
|
||||
and dep.findtext(f"{ns}artifactId") == "qqq-bom-pom"]
|
||||
if len(qqq_imports) != 1:
|
||||
raise GateError("Public qbit-build-parent must import the candidate QQQ BOM")
|
||||
dep = qqq_imports[0]
|
||||
actual = dep.findtext(f"{ns}version", "")
|
||||
actual = values.get(actual[2:-1], "") if actual.startswith("${") else actual
|
||||
if (actual != version or dep.findtext(f"{ns}type") != "pom"
|
||||
or dep.findtext(f"{ns}scope") != "import"):
|
||||
raise GateError("Public qbit-build-parent QQQ import differs from the candidate")
|
||||
receipts.append({"url": url, "sha256": hashlib.sha256(data).hexdigest(), "bytes": len(data)})
|
||||
|
||||
for group, artifact, pin, kind, _, classifier in validate_managed_bom(bom, version):
|
||||
if group.startswith("com.kingsrook"):
|
||||
if classifier or kind not in ("jar", "pom"):
|
||||
raise GateError(f"Unsupported first-party release input: {artifact}")
|
||||
fetch(group, artifact, pin, "pom")
|
||||
if kind == "jar":
|
||||
fetch(group, artifact, pin, "jar")
|
||||
(destination / "receipts.json").write_text(json.dumps(receipts, indent=2) + "\n")
|
||||
return receipts
|
||||
|
||||
|
||||
def validate_evidence(sha, smoke_run=None, smoke_jobs=None, circle_smoke=None):
|
||||
if circle_smoke is not None:
|
||||
if smoke_run is not None or smoke_jobs is not None:
|
||||
raise GateError("Select exactly one complete smoke evidence mode")
|
||||
from verify_all_circle_smoke import validate, EvidenceError
|
||||
try:
|
||||
if (circle_smoke.get("schema") != "qqq-all-circle-smoke/v1"
|
||||
or circle_smoke.get("repository") != "QRun-IO/qqq-all"
|
||||
or circle_smoke.get("sha") != sha):
|
||||
raise GateError("Circle evidence schema, repository or SHA differs")
|
||||
validate(sha, circle_smoke["workflow_id"], circle_smoke["workflow"],
|
||||
circle_smoke["pipeline"], circle_smoke["jobs"],
|
||||
circle_smoke["check_runs"], circle_smoke["pipeline_workflows"])
|
||||
except (EvidenceError, KeyError, TypeError) as error:
|
||||
raise GateError("Circle smoke evidence rejected") from error
|
||||
else:
|
||||
if smoke_run is None or smoke_jobs is None:
|
||||
raise GateError("Select exactly one complete smoke evidence mode")
|
||||
validate_smoke(smoke_run, smoke_jobs, sha)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--root", type=Path, required=True)
|
||||
parser.add_argument("--version", required=True)
|
||||
parser.add_argument("--sha", required=True)
|
||||
parser.add_argument("--smoke-run", type=Path)
|
||||
parser.add_argument("--smoke-jobs", type=Path)
|
||||
parser.add_argument("--circle-smoke", type=Path)
|
||||
parser.add_argument("--published-parent", type=Path, required=True)
|
||||
parser.add_argument("--published-bom", type=Path, required=True)
|
||||
parser.add_argument("--upstream-release", type=Path, required=True)
|
||||
parser.add_argument("--next-release", type=Path, required=True)
|
||||
parser.add_argument("--tag-object", type=Path, required=True)
|
||||
parser.add_argument("--tag-sha", required=True)
|
||||
parser.add_argument("--public-inputs", type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
validate_poms(args.root, args.version)
|
||||
validate_upstream_release(json.loads(args.upstream_release.read_text()), args.version)
|
||||
validate_upstream_release(json.loads(args.next_release.read_text()),
|
||||
properties(args.root / "qqq-all-bom/pom.xml")["qqq-frontend-next.version"])
|
||||
validate_tag(json.loads(args.tag_object.read_text()), args.version, args.sha, args.tag_sha)
|
||||
validate_evidence(args.sha,
|
||||
json.loads(args.smoke_run.read_text()) if args.smoke_run else None,
|
||||
json.loads(args.smoke_jobs.read_text()) if args.smoke_jobs else None,
|
||||
json.loads(args.circle_smoke.read_text()) if args.circle_smoke else None)
|
||||
validate_published_poms(args.published_parent, args.published_bom, args.version,
|
||||
args.root / "qqq-all-bom/pom.xml")
|
||||
download_public_inputs(args.root / "qqq-all-bom/pom.xml", args.version, args.public_inputs)
|
||||
except (GateError, OSError, ElementTree.ParseError, json.JSONDecodeError) as error:
|
||||
print(f"Release gate failed: {error}", file=sys.stderr)
|
||||
return 1
|
||||
print("Local POM and exact-commit smoke gates passed")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
PY
|
||||
cat > "$RUNNER_TEMP/central-release/verify_all_circle_smoke.py" <<'PY'
|
||||
#!/usr/bin/env python3
|
||||
"""Fetch and verify exact-source qqq-all Circle smoke evidence; never synthesize GH runs."""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib.request
|
||||
from urllib.parse import urlparse
|
||||
|
||||
REPO = 'QRun-IO/qqq-all'
|
||||
PROJECT = 'gh/' + REPO
|
||||
UUID = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
|
||||
|
||||
|
||||
class EvidenceError(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
def require(value, message):
|
||||
if not value:
|
||||
raise EvidenceError(message)
|
||||
|
||||
|
||||
def workflow_id(url):
|
||||
parsed = urlparse(url or '')
|
||||
require(parsed.scheme == 'https' and parsed.netloc == 'app.circleci.com', 'Untrusted Circle workflow URL')
|
||||
match = re.fullmatch('/workflow/(' + UUID + ')', parsed.path)
|
||||
require(match is not None, 'Unrecognized Circle workflow URL')
|
||||
return match.group(1)
|
||||
|
||||
|
||||
def validate(sha, selected, workflow, pipeline, jobs, checks, siblings):
|
||||
require(re.fullmatch(r'[0-9a-f]{40}', sha or ''), 'Expected full release SHA')
|
||||
require(re.fullmatch(UUID, selected or ''), 'Expected workflow UUID')
|
||||
require(workflow.get('id') == selected and workflow.get('project_slug') == PROJECT,
|
||||
'Wrong workflow identity or project')
|
||||
require(workflow.get('name') == 'verify-and-smoke' and workflow.get('status') == 'success',
|
||||
'Smoke workflow is not successful')
|
||||
# A rerun may execute selected jobs only. Do not infer inherited successes.
|
||||
require(not workflow.get('rerun_of') and workflow.get('auto_rerun_number', 0) == 0,
|
||||
'Rerun ancestry is not supported')
|
||||
require(workflow.get('pipeline_id') == pipeline.get('id') and pipeline.get('project_slug') == PROJECT,
|
||||
'Wrong pipeline identity or project')
|
||||
vcs = pipeline.get('vcs', {})
|
||||
require(vcs.get('revision') == sha and vcs.get('branch') == 'develop' and not vcs.get('tag'),
|
||||
'Pipeline is not the exact develop source')
|
||||
require(vcs.get('origin_repository_url', '').removesuffix('.git') == 'https://github.com/' + REPO,
|
||||
'Wrong source repository')
|
||||
trigger = pipeline.get('trigger', {})
|
||||
require(trigger.get('type') == 'webhook' and bool(trigger.get('received_at'))
|
||||
and bool(trigger.get('actor', {}).get('login')), 'Unproven webhook trigger')
|
||||
candidates = [c for c in checks if c.get('name') == 'verify-and-smoke' and c.get('app', {}).get('id') == 18001]
|
||||
require(candidates, 'No Circle publisher check')
|
||||
latest = max(candidates, key=lambda c: c.get('id', 0))
|
||||
require(latest.get('head_sha') == sha and latest.get('status') == 'completed'
|
||||
and latest.get('conclusion') == 'success', 'Latest Circle check did not pass this source')
|
||||
require(workflow_id(latest.get('details_url')) == selected, 'Selected workflow is not the latest trusted check')
|
||||
same = [w for w in siblings if w.get('name') == 'verify-and-smoke']
|
||||
require(len(same) == 1 and same[0].get('id') == selected,
|
||||
'Multiple workflow attempts require explicit ancestry reconciliation')
|
||||
require(jobs and all(j.get('status') == 'success' and j.get('type') == 'build' for j in jobs),
|
||||
'Workflow has missing, skipped, canceled, approval, or unsuccessful jobs')
|
||||
for name in ('build-and-test', 'core', 'full'):
|
||||
matches = [j for j in jobs if j.get('name') == name]
|
||||
require(len(matches) == 1 and matches[0].get('job_number') and matches[0].get('id'),
|
||||
'Missing or duplicate required smoke job: ' + name)
|
||||
return {'schema': 'qqq-all-circle-smoke/v1', 'repository': REPO, 'sha': sha,
|
||||
'branch': 'develop', 'workflow_id': selected, 'pipeline_id': pipeline['id'],
|
||||
'check_run_id': latest['id'], 'workflow': workflow, 'pipeline': pipeline,
|
||||
'jobs': jobs, 'check_runs': checks, 'pipeline_workflows': siblings}
|
||||
|
||||
|
||||
def gh(path):
|
||||
result = subprocess.run(['gh', 'api', '--method', 'GET', path], capture_output=True, timeout=60)
|
||||
require(result.returncode == 0, 'GitHub evidence read failed')
|
||||
return json.loads(result.stdout)
|
||||
|
||||
|
||||
class NoRedirect(urllib.request.HTTPRedirectHandler):
|
||||
def redirect_request(self, req, fp, code, msg, headers, newurl):
|
||||
raise EvidenceError('Circle API redirect refused')
|
||||
|
||||
|
||||
def circle(path):
|
||||
token = os.environ.get('CIRCLECI_TOKEN')
|
||||
# Public projects expose these records without authentication.
|
||||
headers = {'Accept': 'application/json'}
|
||||
if token:
|
||||
headers['Circle-Token'] = token
|
||||
request = urllib.request.Request('https://circleci.com/api/v2/' + path,
|
||||
headers=headers)
|
||||
with urllib.request.build_opener(NoRedirect).open(request, timeout=30) as response:
|
||||
raw = response.read(2_000_001)
|
||||
require(len(raw) <= 2_000_000, 'Evidence response exceeds bound')
|
||||
return json.loads(raw)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--sha', required=True)
|
||||
parser.add_argument('--workflow-id', required=True)
|
||||
parser.add_argument('--output', type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
require(re.fullmatch(UUID, args.workflow_id), 'Invalid workflow ID')
|
||||
require(re.fullmatch(r'[0-9a-f]{40}', args.sha), 'Invalid source SHA')
|
||||
workflow = circle('workflow/' + args.workflow_id)
|
||||
pipeline_id = workflow.get('pipeline_id', '')
|
||||
require(re.fullmatch(UUID, pipeline_id), 'Invalid pipeline ID')
|
||||
pipeline = circle('pipeline/' + pipeline_id)
|
||||
jobs = circle('workflow/' + args.workflow_id + '/job')
|
||||
siblings = circle('pipeline/' + pipeline_id + '/workflow')
|
||||
require(not jobs.get('next_page_token') and not siblings.get('next_page_token'),
|
||||
'Paginated workflow evidence requires reconciliation')
|
||||
checks = gh('repos/' + REPO + '/commits/' + args.sha + '/check-runs?filter=all&per_page=100')
|
||||
require(checks.get('total_count', 0) <= 100, 'Too many check runs to establish latest attempt')
|
||||
evidence = validate(args.sha, args.workflow_id, workflow, pipeline, jobs['items'], checks['check_runs'], siblings['items'])
|
||||
args.output.write_text(json.dumps(evidence, indent=2) + '\n', encoding='utf-8')
|
||||
print('Exact-source Circle smoke evidence verified')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except (EvidenceError, OSError, ValueError, KeyError, subprocess.TimeoutExpired):
|
||||
sys.exit('Circle smoke evidence rejected or unavailable; no release authorization')
|
||||
PY
|
||||
- name: Verify Circle smoke provenance
|
||||
if: inputs.smoke_evidence == 'circle'
|
||||
env:
|
||||
CIRCLECI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }}
|
||||
shell: bash
|
||||
run: python3 "$RUNNER_TEMP/central-release/verify_all_circle_smoke.py" --sha "$RELEASE_SHA" --workflow-id "$CIRCLE_WORKFLOW_ID" --output "$RUNNER_TEMP/circle-smoke.json"
|
||||
- name: Verify upstream release, signed tag, exact-commit smoke, public pins, and public GHCR
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
gh api "repos/QRun-IO/qqq/releases/tags/v$VERSION" > "$RUNNER_TEMP/upstream-release.json"
|
||||
next_version="$(python3 -c 'import sys; import os; sys.path.insert(0, os.path.join(os.environ["RUNNER_TEMP"], "central-release")); from qqq_all_release_gate import properties, validate_poms; from pathlib import Path; validate_poms(Path("."), os.environ["VERSION"]); print(properties(Path("qqq-all-bom/pom.xml"))["qqq-frontend-next.version"])')"
|
||||
gh api "repos/QRun-IO/qqq-frontend-next/releases/tags/v$next_version" > "$RUNNER_TEMP/next-release.json"
|
||||
smoke_args=()
|
||||
if [[ "$SMOKE_EVIDENCE" == github ]]; then
|
||||
gh api "repos/$GITHUB_REPOSITORY/actions/runs/$SMOKE_RUN_ID" > "$RUNNER_TEMP/smoke-run.json"
|
||||
gh api "repos/$GITHUB_REPOSITORY/actions/runs/$SMOKE_RUN_ID/jobs?per_page=100" > "$RUNNER_TEMP/smoke-jobs.json"
|
||||
smoke_args=(--smoke-run "$RUNNER_TEMP/smoke-run.json" --smoke-jobs "$RUNNER_TEMP/smoke-jobs.json")
|
||||
else
|
||||
smoke_args=(--circle-smoke "$RUNNER_TEMP/circle-smoke.json")
|
||||
fi
|
||||
central="https://repo.maven.apache.org/maven2/com/kingsrook/qqq"
|
||||
for artifact in qqq-all-parent qqq-all-bom; do
|
||||
curl --fail --silent --show-error \
|
||||
"$central/$artifact/$VERSION/$artifact-$VERSION.pom" \
|
||||
--output "$RUNNER_TEMP/$artifact.pom"
|
||||
done
|
||||
python3 "$RUNNER_TEMP/central-release/qqq_all_release_gate.py" --root . --version "$VERSION" --sha "$RELEASE_SHA" \
|
||||
"${smoke_args[@]}" \
|
||||
--published-parent "$RUNNER_TEMP/qqq-all-parent.pom" \
|
||||
--published-bom "$RUNNER_TEMP/qqq-all-bom.pom" \
|
||||
--upstream-release "$RUNNER_TEMP/upstream-release.json" \
|
||||
--next-release "$RUNNER_TEMP/next-release.json" \
|
||||
--tag-object "$RUNNER_TEMP/tag-object.json" \
|
||||
--tag-sha "$(git rev-parse "refs/tags/$TAG")" \
|
||||
--public-inputs "$RUNNER_TEMP/public-inputs"
|
||||
test "$(gh api /orgs/QRun-IO/packages/container/qqq-all --jq .visibility)" = public
|
||||
gh api --paginate 'orgs/QRun-IO/packages/container/qqq-all/versions?per_page=100' \
|
||||
--jq '.[] | .metadata.container.tags[]?' > "$RUNNER_TEMP/ghcr-tags.txt"
|
||||
if grep -Fxq "$VERSION" "$RUNNER_TEMP/ghcr-tags.txt"; then
|
||||
echo "GHCR tag $VERSION already exists" >&2
|
||||
exit 1
|
||||
fi
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
cache: maven
|
||||
- name: Verify release reactor
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
printf '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"/>\n' > "$RUNNER_TEMP/public-settings.xml"
|
||||
python3 -m unittest discover -s scripts -p 'test_*.py' -v
|
||||
mvn -B -ntp -s "$RUNNER_TEMP/public-settings.xml" -gs "$RUNNER_TEMP/public-settings.xml" \
|
||||
-Dmaven.repo.local="$RUNNER_TEMP/release-m2" verify \
|
||||
org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce -Drules=requireReleaseDeps
|
||||
- name: Recheck develop, annotated tag, and release absence before publication
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
test "$(gh api "repos/$GITHUB_REPOSITORY/branches/develop" --jq .commit.sha)" = "$RELEASE_SHA"
|
||||
test "$(git ls-remote origin "refs/tags/$TAG" | cut -f1)" = "$(git rev-parse "refs/tags/$TAG")"
|
||||
test "$(git ls-remote origin "refs/tags/$TAG^{}" | cut -f1)" = "$RELEASE_SHA"
|
||||
if release_check="$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" 2>&1)"; then
|
||||
echo "GitHub release $TAG already exists" >&2
|
||||
exit 1
|
||||
elif [[ "$release_check" != *"HTTP 404"* ]]; then
|
||||
echo "$release_check" >&2
|
||||
exit 1
|
||||
fi
|
||||
gh api --paginate 'orgs/QRun-IO/packages/container/qqq-all/versions?per_page=100' \
|
||||
--jq '.[] | .metadata.container.tags[]?' > "$RUNNER_TEMP/ghcr-tags-final.txt"
|
||||
if grep -Fxq "$VERSION" "$RUNNER_TEMP/ghcr-tags-final.txt"; then
|
||||
echo "GHCR tag $VERSION already exists" >&2
|
||||
exit 1
|
||||
fi
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish versioned image
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
image="ghcr.io/qrun-io/qqq-all:$VERSION"
|
||||
docker build \
|
||||
--label org.opencontainers.image.source=https://github.com/QRun-IO/qqq-all \
|
||||
--label "org.opencontainers.image.version=$VERSION" \
|
||||
--label "org.opencontainers.image.revision=$RELEASE_SHA" \
|
||||
--tag "$image" .
|
||||
docker push "$image"
|
||||
printf 'Published image: %s\n' "$image" >> "$GITHUB_STEP_SUMMARY"
|
||||
- name: Build image Compose distribution bundle
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
image="$(docker image inspect --format '{{index .RepoDigests 0}}' "ghcr.io/qrun-io/qqq-all:$VERSION")"
|
||||
python3 scripts/release_bundle.py --root . --version "$VERSION" --sha "$RELEASE_SHA" \
|
||||
--image "$image" --output "$RUNNER_TEMP"
|
||||
- name: Publish GitHub release with Compose bundle
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
release_flags=()
|
||||
case "$VERSION" in
|
||||
4.1.0) ;;
|
||||
4.1.0-RC.1) release_flags=(--prerelease --latest=false) ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
gh release create "$TAG" "$RUNNER_TEMP/qqq-all-$VERSION.tar.gz" \
|
||||
"$RUNNER_TEMP/qqq-all-$VERSION/compose.yaml" --repo "$GITHUB_REPOSITORY" \
|
||||
--verify-tag --title "qqq-all $VERSION" --notes-from-tag "${release_flags[@]}"
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: release-evidence-${{ inputs.version }}
|
||||
path: |
|
||||
${{ runner.temp }}/public-inputs/receipts.json
|
||||
${{ runner.temp }}/tag-object.json
|
||||
${{ runner.temp }}/upstream-release.json
|
||||
${{ runner.temp }}/next-release.json
|
||||
${{ runner.temp }}/circle-smoke.json
|
||||
${{ runner.temp }}/smoke-run.json
|
||||
${{ runner.temp }}/smoke-jobs.json
|
||||
${{ runner.temp }}/qqq-all-${{ inputs.version }}/release.json
|
||||
@@ -0,0 +1,13 @@
|
||||
name: Workflow lint
|
||||
'on':
|
||||
workflow_call:
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
actionlint:
|
||||
runs-on: ubuntu-24.04
|
||||
container: cimg/go:1.24
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Lint GitHub Actions workflows
|
||||
run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7 -color .github/workflows/*.yml
|
||||
@@ -8,3 +8,9 @@ tests/test_data
|
||||
|
||||
# IDE
|
||||
.idea
|
||||
|
||||
.claude
|
||||
|
||||
# Local Python regression-test caches.
|
||||
__pycache__/
|
||||
*.pyc
|
||||
+109
-1
@@ -5,6 +5,114 @@ All notable changes to QQQ Orb will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### 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
|
||||
|
||||
### Added
|
||||
- Auto-publish `dev:snapshot` on develop branch pushes
|
||||
- Auto-publish production releases on main branch pushes with semantic version bumping
|
||||
- Support for `[major]` and `[minor]` commit keywords to control version bumps (default: patch)
|
||||
- Security scanning job with Gitleaks, Semgrep, OWASP Dependency Check, and CycloneDX SBOM
|
||||
|
||||
## [0.6.2] - 2026-01-30
|
||||
|
||||
### Fixed
|
||||
- Node.js version commit fails with `invalid refspec 'HEAD:'` when `CIRCLE_BRANCH` is empty (detached HEAD builds)
|
||||
- Aligned `node_version_commit.sh` with Maven equivalent: added feature branch skip, empty branch fallback, and non-fatal push handling
|
||||
|
||||
## [0.6.1] - 2026-01-18
|
||||
|
||||
### Fixed
|
||||
- Skip version commit for feature branches (prevents unnecessary commits)
|
||||
|
||||
## [0.6.0] - 2026-01-14
|
||||
|
||||
### Added
|
||||
- SpotBugs and PMD static analysis workflows
|
||||
|
||||
### Fixed
|
||||
- Use `mvn install` for multi-module dependency resolution in static analysis
|
||||
|
||||
## [0.5.3] - 2026-01-10
|
||||
|
||||
### Fixed
|
||||
- NPM prerelease tags now correctly formatted
|
||||
- Skip GitHub release creation for release candidates
|
||||
|
||||
## [0.5.2] - 2026-01-09
|
||||
|
||||
### Fixed
|
||||
- Version commit push failures no longer fail the build (moved from 0.5.1 notes)
|
||||
- Strip `<rerunFailure>` elements from JUnit XML (moved from 0.5.1 notes)
|
||||
|
||||
## [0.5.1] - 2026-01-07
|
||||
|
||||
### Fixed
|
||||
- Added `DEBIAN_FRONTEND=noninteractive` to browser dependency installation to prevent interactive prompts from blocking CI
|
||||
|
||||
## [0.5.0] - 2025-12-28
|
||||
|
||||
### Added
|
||||
- Machine executor with native Docker support for Testcontainers and LocalStack
|
||||
- `install_java` command to install Temurin JDK and Maven on machine executors
|
||||
- Optional Node.js installation for frontend builds on machine executor
|
||||
|
||||
### Changed
|
||||
- Switched from Docker executor (cimg/openjdk) to Ubuntu machine executor
|
||||
- All Maven jobs now use machine executor with Docker pre-installed
|
||||
|
||||
### Fixed
|
||||
- GitHub SSH host key added before clone operations
|
||||
|
||||
## [0.4.0] - 2025-12-28
|
||||
|
||||
### Added
|
||||
- Java 21 support with configurable executor - New `java` executor using `cimg/openjdk` with version parameter (default: 21.0)
|
||||
- Automatic GitHub release creation for releases and release candidates
|
||||
- RC support for GitHub releases (published as pre-releases)
|
||||
|
||||
### Changed
|
||||
- License changed to AGPL-3.0 with QRun-IO copyright
|
||||
- Maven jobs now use the new `java` executor (resource_class: large)
|
||||
- Node jobs use `default` executor with configurable version
|
||||
|
||||
### Migration
|
||||
Projects needing Java 17 can explicitly set `java_version: "17.0"` in their workflow config.
|
||||
|
||||
## [0.3.13] - 2025-12-28
|
||||
|
||||
### Added
|
||||
- GitHub release configuration for CI pipeline
|
||||
- Standardized README documentation
|
||||
|
||||
### Changed
|
||||
- Merged develop branch updates in preparation for 0.4.0
|
||||
|
||||
## [0.3.12] - 2025-10-22
|
||||
|
||||
### Fixed
|
||||
- Version calculation now uses `CIRCLE_BRANCH` environment variable before falling back to git ref parsing
|
||||
|
||||
### Changed
|
||||
- Linting cleanup for spacing consistency
|
||||
|
||||
## [0.3.11] - 2025-10-09
|
||||
|
||||
### Fixed
|
||||
- Separated cache saves and restores by key for proper cache isolation
|
||||
|
||||
## [0.3.10] - 2025-10-09
|
||||
|
||||
### Fixed
|
||||
- Frontend build cache steps in test workflow corrected
|
||||
|
||||
## [0.3.9] - 2025-10-09
|
||||
|
||||
### Fixed
|
||||
- Frontend build now properly saves npm module cache
|
||||
|
||||
## [0.3.8] - 2025-09-29
|
||||
|
||||
### Added
|
||||
@@ -85,7 +193,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Multiple linting fixes from CircleCI integration
|
||||
- Improved error handling and validation
|
||||
|
||||
## [0.2.0] - 2025-09-15
|
||||
## [0.2.0] - 2025-09-13
|
||||
|
||||
### Added
|
||||
- Initial CircleCI orb implementation
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
CircleCI orb for QQQ framework projects. Provides pre-built jobs for building, testing, and publishing Maven and Node.js projects using GitFlow branching strategy.
|
||||
|
||||
## Build Commands
|
||||
|
||||
```bash
|
||||
make pack # Pack orb to target/qqq-orb-packed.yml
|
||||
make validate # Pack and validate orb
|
||||
make test # Pack and validate (alias for validate)
|
||||
make test-scripts # Run calculate_version.sh test suite
|
||||
make test-all # Run all tests (orb + scripts)
|
||||
make lint # Run yamllint, shellcheck, and CircleCI validation
|
||||
make dev # Development workflow: pack, validate, show status
|
||||
make clean # Remove target/ and tests/test_data/
|
||||
make publish-snapshot # Publish to kingsrook/qqq-orb@dev:snapshot
|
||||
make publish-release # Interactive production release with git tagging
|
||||
```
|
||||
|
||||
## Running Individual Tests
|
||||
|
||||
```bash
|
||||
./tests/run_tests.sh # Standard test run
|
||||
./tests/run_tests.sh --verbose # Verbose output
|
||||
./tests/run_tests.sh --ci # CI mode (minimal output)
|
||||
./tests/test_calculate_version.sh # Direct test suite execution
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Directory Structure
|
||||
|
||||
- `src/@orb.yml` - Main orb definition entry point
|
||||
- `src/commands/` - Reusable orb commands (YAML files that include scripts)
|
||||
- `src/jobs/` - Complete job definitions combining commands
|
||||
- `src/executors/` - Docker executor definitions (java.yml, default.yml)
|
||||
- `src/scripts/` - Bash scripts included in commands
|
||||
- `tests/` - Test suite for calculate_version.sh
|
||||
|
||||
### Key Components
|
||||
|
||||
**Executors:**
|
||||
- `java` - cimg/openjdk image with configurable version (17.0, 21.0), resource_class: large
|
||||
- `default` - cimg/node image for Node.js projects
|
||||
|
||||
**Jobs:**
|
||||
- `mvn_publish` - Full publish workflow (build, version, test, deploy, git ops, GitHub release)
|
||||
- `mvn_test_only` - Build and test for feature branches
|
||||
- `mvn_frontend_publish` / `mvn_frontend_test_only` - Same with frontend support
|
||||
- `node_publish` / `node_test_only` - Pure Node.js workflows
|
||||
|
||||
**Version Calculation:**
|
||||
The core logic is in `src/scripts/calculate_version.sh`. It determines version based on branch type:
|
||||
- `develop` -> `X.Y.Z-SNAPSHOT`
|
||||
- `release/*` -> `X.Y.Z-RC.N`
|
||||
- `main` (tagged) -> `X.Y.Z`
|
||||
- `hotfix/*` -> Patch version bump
|
||||
- `feature/*` -> `X.Y.Z-feature-{name}-{hash}-SNAPSHOT`
|
||||
|
||||
### Orb Packing
|
||||
|
||||
The orb uses CircleCI's "unpacked" format. YAML files in `src/` are packed into a single `target/qqq-orb-packed.yml`. Commands reference scripts via `<<include(scripts/scriptname.sh)>>` syntax.
|
||||
|
||||
### CI Pipeline
|
||||
|
||||
`.circleci/config.yml` runs lint/pack/review/shellcheck, then continues to `.circleci/test-deploy.yml` which runs command tests and publishes on release tags (`v*.*.*`).
|
||||
|
||||
## Linting Requirements
|
||||
|
||||
- YAML: yamllint for commands/jobs/examples
|
||||
- Shell: shellcheck for all .sh files in src/scripts/ and tests/
|
||||
- Orb: `circleci orb validate` for orb syntax
|
||||
|
||||
## Required Context Variables for Publishing
|
||||
|
||||
- `MAVEN_USERNAME`, `MAVEN_PASSWORD` - Sonatype credentials
|
||||
- `GPG_PRIVATE_KEY_B64`, `GPG_KEYNAME`, `GPG_PASSPHRASE` - GPG signing
|
||||
- `GITHUB_TOKEN` - GitHub API access
|
||||
|
||||
## Knowledge base
|
||||
|
||||
Deep-review dossiers for this repo and the wider QQQ platform live in the second-brain
|
||||
vault (Obsidian, `R:/Git.Local/KofTwentyTwo/second-brain`):
|
||||
|
||||
- Platform hub: `knowledge/qqq/qqq-hub.md`
|
||||
- This repo's dossier: `knowledge/qqq/repos/qqq-orb.md` (reviewed at develop
|
||||
commit `bdff16ff9582`, 2026-07-04) — covers 0.5.0→0.6.0→HEAD behavior changes,
|
||||
the npm dist-tag defect verdict, org-wide pin survey, licensing history, and
|
||||
open bug #5 (release-branch patch loss).
|
||||
- Release/versioning architecture: `knowledge/qqq/architecture/build-release-versioning.md`
|
||||
@@ -1,680 +1,191 @@
|
||||
QQQ - Low-code Application Framework for Engineers
|
||||
Copyright (C) 2021-2025 QRun-IO, LLC
|
||||
https://www.qrun.io | https://github.com/QRun-IO
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to the Licensor for inclusion in the Work by the copyright
|
||||
owner or by an individual or Legal Entity authorized to submit on
|
||||
behalf of the copyright owner. For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written
|
||||
communication sent to the Licensor or its representatives, including
|
||||
but not limited to communication on electronic mailing lists, source
|
||||
code control systems, and issue tracking systems that are managed by,
|
||||
or on behalf of, the Licensor for the purpose of discussing and
|
||||
improving the Work, but excluding communication that is conspicuously
|
||||
marked or otherwise designated in writing by the copyright owner as
|
||||
"Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright 2022-2025 QRunIO, LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -24,6 +24,7 @@ help:
|
||||
|
||||
# Pack the orb using the correct command for orb development
|
||||
pack:
|
||||
@python3 scripts/pack_pipeline.py
|
||||
@echo "Packing orb using 'circleci orb pack'..."
|
||||
@mkdir -p ./target/
|
||||
@circleci orb pack src > target/qqq-orb-packed.yml
|
||||
@@ -46,9 +47,56 @@ test-scripts:
|
||||
@echo "✅ Script tests passed!"
|
||||
|
||||
# Test all: run both orb tests and script tests
|
||||
test-all: test test-scripts
|
||||
test-all: test test-scripts test-pipelines
|
||||
@echo "🎉 All tests completed successfully!"
|
||||
|
||||
.PHONY: test-pipelines
|
||||
# PyYAML 6.0.3 is the same strict parser used by the setup job.
|
||||
test-pipelines: pack
|
||||
python3 tests/test_generate_pipeline.py --packed target/qqq-orb-packed.yml
|
||||
python3 tests/test_maven_ci_contract.py
|
||||
bash tests/test_cli_ci_behavior.sh
|
||||
python3 tests/test_cli_ci_contract.py
|
||||
python3 tests/test_standardize_qbit.py
|
||||
python3 tests/test_qbit_hotfix_profile.py
|
||||
python3 tests/test_ci_maintenance.py
|
||||
python3 tests/test_rollout_version.py
|
||||
python3 tests/test_enforce_orb_checks.py
|
||||
python3 tests/test_enroll_consumers.py
|
||||
python3 tests/test_reconcile_enrollment.py
|
||||
python3 tests/test_discover_enrollment.py
|
||||
python3 tests/test_finish_enrollment.py
|
||||
python3 tests/test_static_analysis_exit.py
|
||||
python3 tests/test_validate_standard.py
|
||||
python3 tests/test_voyage_profile.py
|
||||
python3 tests/test_next_native.py
|
||||
python3 tests/test_auxiliary_workflows.py
|
||||
python3 tests/test_qbit_codeql.py
|
||||
python3 tests/test_repository_policy.py
|
||||
python3 tests/test_intellij_plugin.py
|
||||
python3 tests/test_workflow_lint.py
|
||||
python3 tests/test_business_e2e.py
|
||||
python3 tests/test_qctl_native.py
|
||||
python3 -m unittest discover -s tests -p test_generate_qctl_workflow.py
|
||||
python3 tests/test_rc_finalize_sweep.py
|
||||
python3 tests/test_rc_guard.py
|
||||
python3 -m unittest discover -s tests -p test_generate_rc_workflow.py
|
||||
python3 -m unittest discover -s tests -p test_audit_estate.py
|
||||
python3 tests/test_all_profiles.py
|
||||
python3 tests/test_generate_all_release.py
|
||||
python3 -m unittest discover -s tests -p 'test_qqq_all_release*.py'
|
||||
python3 tests/test_verify_all_circle_smoke.py
|
||||
python3 tests/test_mobile_policy_profiles.py
|
||||
bash tests/test_all_artifact.sh
|
||||
python3 tests/test_maven_ci_rc_completion.py
|
||||
bash tests/test_maven_ci_push.sh
|
||||
bash tests/test_create_github_release.sh
|
||||
bash tests/test_maven_ci_cache.sh
|
||||
bash tests/test_maven_test_results.sh
|
||||
bash tests/test_maven_ci_install.sh
|
||||
bash tests/test_snapshot_refresh.sh
|
||||
bash tests/test_maven_settings_output.sh
|
||||
|
||||
# Clean up generated files
|
||||
clean:
|
||||
@echo "Cleaning up packed orb files..."
|
||||
@@ -172,3 +220,10 @@ publish-release: check-clean check-branch lint clean dev test-all
|
||||
echo "Pushing tag to remote..."; \
|
||||
git push origin "$$version"; \
|
||||
echo "✅ Production release $$version published successfully!"
|
||||
|
||||
.PHONY: test-publication-poms
|
||||
# Explicit integration gate: requires Java/Maven and public plugin downloads into
|
||||
# an isolated temporary repository. Never publishes or uses signing credentials.
|
||||
test-publication-poms:
|
||||
python3 tests/test_maven_publication_poms.py
|
||||
python3 tests/test_effective_publication_version.py
|
||||
@@ -0,0 +1,6 @@
|
||||
QQQ CircleCI Orb
|
||||
Copyright 2022-2025 QRunIO, LLC
|
||||
|
||||
This product includes software developed at QRunIO, LLC (https://qrun.io/).
|
||||
|
||||
Licensed under the Apache License, Version 2.0.
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
CircleCI orb for QQQ framework projects.
|
||||
|
||||
**For:** Teams using CircleCI to build, test, and publish QQQ applications
|
||||
**Status:** Stable (v0.3.8)
|
||||
For centralized pipeline ownership, see [standardized manifest-driven pipelines](docs/GENERATED-PIPELINES.md).
|
||||
The initial QBit profile uses a small `.qqq-ci.yml` and a setup entry point; existing direct job callers remain supported.
|
||||
For centrally managed patch adoption and exact-version rollback, see
|
||||
[managed patch updates](docs/managed-patch-updates.md).
|
||||
|
||||
**For:** Teams using CircleCI to build, test, and publish QQQ applications
|
||||
**Status:** Stable (v0.6.x)
|
||||
|
||||
## Why This Exists
|
||||
|
||||
@@ -13,40 +18,34 @@ This orb provides pre-built jobs for the complete QQQ development lifecycle. Add
|
||||
|
||||
## Features
|
||||
|
||||
- **Maven and npm Support** - Builds Java and Node.js projects
|
||||
- **GitFlow Integration** - Automated versioning based on branch type
|
||||
- **Publishing Automation** - Maven Central and npm registry publishing
|
||||
- **Test Coverage** - JaCoCo integration with coverage reporting
|
||||
- **Version Calculation** - Semantic versioning with SNAPSHOT, RC, and release support
|
||||
- **Maven and npm support** - Builds Java and Node.js projects
|
||||
- **Docker-native execution** - Machine executor with Docker pre-installed for Testcontainers/LocalStack
|
||||
- **GitFlow integration** - Automated versioning based on branch type
|
||||
- **Publishing automation** - Maven Central and npm registry publishing
|
||||
- **Test coverage** - JaCoCo integration with coverage reporting
|
||||
- **Version calculation** - Semantic versioning with SNAPSHOT, RC, and release support
|
||||
- **Java 21 default** - Temurin JDK with configurable version (17, 21)
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- CircleCI account
|
||||
- Repository connected to CircleCI
|
||||
- `qqq-maven-registry-credentials` context with publishing credentials
|
||||
|
||||
### Basic Configuration
|
||||
**Prerequisites:** CircleCI account, repository connected to CircleCI
|
||||
|
||||
```yaml
|
||||
# .circleci/config.yml
|
||||
version: 2.1
|
||||
orbs:
|
||||
qqq-orb: kingsrook/qqq-orb@2.1
|
||||
qqq-orb: kingsrook/qqq-orb@0.6
|
||||
|
||||
workflows:
|
||||
build_and_test:
|
||||
jobs:
|
||||
- qqq-orb/build
|
||||
- qqq-orb/test:
|
||||
requires: [qqq-orb/build]
|
||||
- qqq-orb/mvn_test_only
|
||||
|
||||
publish_snapshot:
|
||||
when:
|
||||
equal: [develop, << pipeline.git.branch >>]
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
- qqq-orb/mvn_publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: snapshot
|
||||
```
|
||||
@@ -57,9 +56,28 @@ workflows:
|
||||
|
||||
| Job | Purpose |
|
||||
|-----|---------|
|
||||
| `build` | Compile project |
|
||||
| `test` | Run tests with coverage |
|
||||
| `publish` | Build and publish artifacts |
|
||||
| `mvn_test_only` | Build and test Maven projects |
|
||||
| `mvn_publish` | Build, test, and publish Maven artifacts |
|
||||
| `mvn_frontend_test_only` | Build and test Maven projects with npm frontend |
|
||||
| `mvn_frontend_publish` | Build, test, and publish Maven projects with npm frontend |
|
||||
| `node_test_only` | Build and test Node.js projects |
|
||||
| `node_publish` | Build, test, and publish Node.js packages |
|
||||
| `static_analysis` | Run SpotBugs and PMD static analysis |
|
||||
| `security_scan` | Run Gitleaks, Semgrep, OWASP Dependency Check, and CycloneDX SBOM |
|
||||
|
||||
### npm Trusted Publishing
|
||||
|
||||
For npm Trusted Publishing, set `npm_trusted_publishing: true` and use a supported
|
||||
executor such as `node_version: "24.21"` on `node_publish`. Configure the package's
|
||||
[npm Trusted Publisher](https://docs.npmjs.com/trusted-publishers/) for the exact
|
||||
CircleCI organization, project, pipeline definition and VCS origin, and allow
|
||||
direct `npm publish`. The job requires Node >=22.14.0 and npm >=11.5.1, obtains an
|
||||
OIDC identity at publish time, and does not run `npm whoami` or need `NPM_TOKEN`.
|
||||
Existing token authentication remains the default. Trusted mode requires no
|
||||
project `.npmrc` or npm credential/config-path environment settings; it ignores user/global
|
||||
npm config and clears conventional token variables to prevent token fallback.
|
||||
CircleCI does not currently provide npm provenance attestations. A successful
|
||||
real publication, not a dry run, verifies the trust relationship.
|
||||
|
||||
### Branch Types
|
||||
|
||||
@@ -71,48 +89,24 @@ workflows:
|
||||
| `hotfix/1.5.1` | `1.5.1` |
|
||||
| `feature/*` | `1.5.0-feature-abc1234-SNAPSHOT` |
|
||||
|
||||
### Full GitFlow Configuration
|
||||
The Maven version step verifies the effective `project.version`, not only the
|
||||
`revision` property. For older POMs with a literal project version, it uses
|
||||
Maven's version plugin to align project and reactor coordinates with the
|
||||
calculated version. A mismatch after updating fails before publication.
|
||||
|
||||
### Java Version
|
||||
|
||||
Maven jobs run on Ubuntu machine executors with Temurin JDK. Default is Java 21. To use Java 17:
|
||||
|
||||
```yaml
|
||||
workflows:
|
||||
test_only:
|
||||
when:
|
||||
not:
|
||||
or:
|
||||
- equal: [develop, << pipeline.git.branch >>]
|
||||
- equal: [main, << pipeline.git.branch >>]
|
||||
- matches: { pattern: "^release/.*", value: << pipeline.git.branch >> }
|
||||
jobs:
|
||||
- qqq-orb/build
|
||||
- qqq-orb/test:
|
||||
requires: [qqq-orb/build]
|
||||
|
||||
publish_snapshot:
|
||||
when:
|
||||
equal: [develop, << pipeline.git.branch >>]
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: snapshot
|
||||
|
||||
publish_release_candidate:
|
||||
when:
|
||||
matches: { pattern: "^release/.*", value: << pipeline.git.branch >> }
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: release_candidate
|
||||
|
||||
publish_release:
|
||||
when:
|
||||
equal: [main, << pipeline.git.branch >>]
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: release
|
||||
jobs:
|
||||
- qqq-orb/mvn_test_only:
|
||||
java_version: "17"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
### Docker Support
|
||||
|
||||
Maven jobs use machine executors with Docker pre-installed. Tests using Testcontainers, LocalStack, or other Docker-dependent frameworks work without additional configuration.
|
||||
|
||||
### Required Context Variables
|
||||
|
||||
@@ -125,40 +119,48 @@ workflows:
|
||||
| `GPG_PASSPHRASE` | GPG passphrase |
|
||||
| `GITHUB_TOKEN` | GitHub API token |
|
||||
|
||||
### Project Requirements
|
||||
## Orb Publishing
|
||||
|
||||
Maven projects need a `pom.xml` with a `<revision>` property. The orb updates this property during builds.
|
||||
### QBit CI maintenance
|
||||
|
||||
## Development
|
||||
The QBit profile runs Maven verification without publishing when a single-parent
|
||||
`ci: ...` or `ci(scope): ...` commit changes only `.qqq-ci.yml`,
|
||||
`.circleci/config.yml`, `.github/workflows/codeql.yml`, or
|
||||
`.github/workflows/release-rc.yml`. This applies on
|
||||
main, develop, release, and hotfix branches. The normal test job still runs,
|
||||
including on branches normally excluded from feature tests, and reports through
|
||||
the required `verify` workflow.
|
||||
|
||||
```bash
|
||||
# Validate orb
|
||||
make validate
|
||||
Tags, merge commits (including release automation), application changes, other
|
||||
files, empty diffs, and unavailable history retain normal publishing behavior.
|
||||
This lets central configuration updates avoid unnecessary application versions
|
||||
without introducing per-repository maintenance workflows.
|
||||
|
||||
# Run tests
|
||||
make test-all
|
||||
The orb auto-publishes via CircleCI:
|
||||
|
||||
# Publish dev version
|
||||
make publish-snapshot
|
||||
```
|
||||
| Branch | Action |
|
||||
|--------|--------|
|
||||
| `develop` | Publishes `kingsrook/qqq-orb@dev:snapshot` |
|
||||
| `main` | Auto-increments version and publishes production release |
|
||||
| `vX.Y.Z` tag | Manual production release (legacy) |
|
||||
|
||||
Version bumps on main default to patch. Include `[minor]` or `[major]` in a commit message to bump accordingly.
|
||||
|
||||
## Project Status
|
||||
|
||||
Stable and used across all QQQ repositories.
|
||||
|
||||
### Roadmap
|
||||
|
||||
- GitHub Actions support
|
||||
- Parallel test execution
|
||||
- Container image publishing
|
||||
**Maturity:** Stable, used across all QQQ repositories
|
||||
**Breaking changes:** See [CHANGELOG.md](CHANGELOG.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a feature branch
|
||||
3. Run `make test-all`
|
||||
4. Submit a pull request
|
||||
```bash
|
||||
git clone git@github.com:QRun-IO/qqq-orb.git
|
||||
cd qqq-orb
|
||||
make test-all
|
||||
```
|
||||
|
||||
See [QQQ Contribution Guidelines](https://github.com/Kingsrook/qqq/blob/develop/CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
|
||||
MIT - Kingsrook, LLC
|
||||
Apache-2.0
|
||||
@@ -0,0 +1,37 @@
|
||||
# qqq-all manual release caller
|
||||
|
||||
Generate the tiny caller at the existing consumer path `.github/workflows/release.yml`:
|
||||
|
||||
```sh
|
||||
python src/scripts/generate_auxiliary_workflow.py all-release --ref <IMMUTABLE40SHA>
|
||||
```
|
||||
|
||||
No consumer files or workflow settings are changed by this patch. The immutable baseline
|
||||
is qqq-all `e35f1f6b99639eb998340f082fab89c7ac12426c`. The caller is manual-only, retaining
|
||||
its original name, version choice/default (`4.1.0` or `4.1.0-RC.1`) and required release SHA.
|
||||
No push, tag or scheduled release is introduced.
|
||||
|
||||
All five worker inputs are forwarded as inputs: `version`, `release_sha`, `smoke_run_id`,
|
||||
`smoke_evidence`, `circle_workflow_id`. Evidence defaults to `github`. The old required
|
||||
Smoke run field becomes optional in the dispatch form solely so Circle mode can omit it;
|
||||
the worker still requires a numeric Smoke run ID in GitHub mode and independently verifies
|
||||
it. Circle mode requires the exact successful workflow UUID, API-verified provenance,
|
||||
matching receipt and existing optional `CIRCLECI_TOKEN`. Missing evidence fails closed.
|
||||
|
||||
Original contents/packages write and actions read permissions remain; checks read is added
|
||||
for the central Circle-check validator. Only the optional existing Circle secret is mapped
|
||||
explicitly; Actions supplies the native GitHub token. No secret values or script inputs
|
||||
are added.
|
||||
|
||||
The protected `qqq-all-release` environment, enabled/license variables, exact version/tag,
|
||||
develop SHA, public artifacts/GHCR, independent cold verification and publication rechecks
|
||||
remain in the worker. Its concurrency group is the sole owner, avoiding caller/worker
|
||||
collision. Generation does not approve the environment or bypass central gates. Hosted
|
||||
approval/publication and token access remain unproven until an authorized release run.
|
||||
|
||||
```sh
|
||||
python3 -m unittest discover -s tests -p test_generate_all_release.py -v
|
||||
```
|
||||
|
||||
Root must actionlint the generated caller and worker. Legacy orchestration stays until the
|
||||
pinned worker and consumer evidence adapter are available and relevant tests pass.
|
||||
@@ -0,0 +1,42 @@
|
||||
# Business-platform E2E ownership
|
||||
|
||||
The reusable `.github/workflows/business-e2e.yml` preserves the exact audited jobs
|
||||
from `QRun-IO/qqq-business-platform` commit `8af799fce97e972f81f195df969d79a959f71dbc`,
|
||||
including actual Compose services, blocking Playwright tests, deployment dependency,
|
||||
alerts, summaries, artifacts, failure logs and unconditional cleanup. Tool versions
|
||||
and environment values are unchanged. The optional existing alert secret is declared
|
||||
and forwarded explicitly. No new credential is introduced.
|
||||
|
||||
The tiny caller is generated with:
|
||||
|
||||
```sh
|
||||
python src/scripts/generate_auxiliary_workflow.py business-e2e --ref <IMMUTABLE40SHA>
|
||||
```
|
||||
|
||||
It belongs at the SAME consumer path `.github/workflows/e2e.yml`. Events, schedule,
|
||||
manual dispatch and read permission remain identical. The caller owns the existing
|
||||
concurrency group; the worker has no second copy that could cancel its own caller.
|
||||
The worker is `workflow_call` only and cannot run its own schedule.
|
||||
|
||||
## Disabled coverage stays disabled
|
||||
|
||||
The existing consumer workflow is `disabled_inactivity`, as reported by the release
|
||||
owner. This source extraction does not enable, trigger, dispatch or alter settings.
|
||||
Before and after any later caller replacement, read back that same workflow ID/path
|
||||
and state; stop if disabled status changed. Do not call an enable API, rename the
|
||||
workflow path, or treat a source-only PR as coverage restoration. Any intentional
|
||||
reactivation is a separate authorized operation requiring working live-service proof.
|
||||
|
||||
This centralizes code ownership; disabled E2E coverage remains an explicit limitation.
|
||||
Likewise, `tools/no-ci-policy.json` records audited CI absence, not product readiness,
|
||||
quality approval or a claim that tests have passed.
|
||||
|
||||
Local contract tests compare every job/step to an immutable fixture and verify events,
|
||||
permissions, explicit secret mapping, pinned worker and concurrency ownership:
|
||||
|
||||
```sh
|
||||
python3 -m unittest discover -s tests -p test_business_e2e.py -v
|
||||
actionlint .github/workflows/business-e2e.yml
|
||||
```
|
||||
|
||||
Hosted E2E success is not claimed. Consumer/settings changes are outside this patch.
|
||||
@@ -0,0 +1,143 @@
|
||||
# Estate audit policy
|
||||
|
||||
`tools/audit_estate.py` classifies repositories from explicit mappings and observed source.
|
||||
It never changes consumers, branch rules or publication settings.
|
||||
|
||||
Source auditing reads the repository's current default branch unless
|
||||
`--live --source-branch main` (or an explicit `release/...` or `hotfix/...` branch)
|
||||
is supplied. Run separate audits for each maintained source branch: a clean
|
||||
default-branch report does not establish conformity on main or release branches.
|
||||
The selected branch is resolved to an immutable commit before any files are read.
|
||||
Reports identify both `source_branch` and the repository's `default_branch`;
|
||||
the manifest's `default_branch` must still match the repository default.
|
||||
Unavailable selected branches remain unknown without falling back to default.
|
||||
Explicit branch selection requires live lookup and cannot relabel an offline SHA.
|
||||
Required-check policy still controls which branch settings are inspected;
|
||||
`--source-branch` changes source selection, not that enforcement policy.
|
||||
|
||||
- Circle profiles include android, mcp-policy and marketing. Their manifest and canonical
|
||||
setup caller remain mandatory; a missing configuration is a finding.
|
||||
- MCP, business-platform and the organization `.github` repository use approved native
|
||||
bridges from `src/scripts/templates/auxiliary-bridges.json`. Unknown remaining workflows
|
||||
are findings. Legacy Circle configuration remains a finding until retired after equivalent
|
||||
native checks pass on the actual consumer head. Business E2E is not implicitly approved.
|
||||
- `qqq-orb` is the owner/bootstrap exception, not a consumer of itself. Audit requires its
|
||||
lint/pack/review/ShellCheck graph and continuation dependencies, executable command and
|
||||
pipeline-contract test jobs, and develop/main publishers gated by those tests. Both
|
||||
publishers must pack, validate and publish. This structural check is not hosted proof.
|
||||
- `tools/no-ci-policy.json` approves exactly nine named repositories with rationale,
|
||||
immutable baseline SHA and required identity paths. Their approved state has no Circle,
|
||||
Actions, manifest, Jenkins or GitLab entrypoint at the declared paths. A new workflow or
|
||||
missing identity path is drift; an unknown repository never inherits this exemption.
|
||||
Baseline SHA records audit provenance, not a requirement to freeze documentation forever.
|
||||
|
||||
`managed_branches` is an explicit, nonempty unique list of `main` and/or `develop`,
|
||||
provided only after branch inventory readback. Its default is both for compatibility.
|
||||
The auditor queries only listed branches. A missing policy remains unknown; an API
|
||||
403/404 does not prove a branch is absent and remains unknown. A policy entry alone
|
||||
never proves a branch exists: successful `Snapshot.checks` first reads the branch.
|
||||
|
||||
Only the exact approved no-CI repositories may declare an empty expected context list.
|
||||
They pass that check only after successful readback returns an actually empty set.
|
||||
Stale required contexts are findings. Ordinary, native and owner profiles still reject
|
||||
empty context policies. No-CI classification documents absence, not product readiness.
|
||||
|
||||
Required-check policy is independent of classification. Without an explicit observed
|
||||
context policy and successful branch-rule readback, check status stays `unknown`, including
|
||||
no-CI and bootstrap repositories. No classification fabricates a passing merge check.
|
||||
|
||||
## Organization workflow lint bridge
|
||||
|
||||
Generate only after the worker is published at an immutable commit:
|
||||
|
||||
```sh
|
||||
python src/scripts/generate_auxiliary_workflow.py github-workflow-lint --ref <40SHA>
|
||||
```
|
||||
|
||||
The output belongs at `.github/workflows/workflow-lint.yml` in `QRun-IO/.github`.
|
||||
The orb owns `.github/workflows/workflow-lint.yml` as a reusable worker. It retains the
|
||||
original Circle `cimg/go:1.24` image and exact actionlint v1.7.7 command over
|
||||
`.github/workflows/*.yml`, with checkout and read-only contents permission. Branch pushes
|
||||
run lint; fork PRs also run it without secrets. Same-repository PR events do not duplicate
|
||||
push lint, and tags do not add new builds. Manual dispatch is available for verification.
|
||||
|
||||
Keep the existing Circle actionlint pipeline and legacy RC worker until a hosted native
|
||||
canary proves tool/runtime equivalence and the required-check migration is reviewed.
|
||||
Do not remove the old RC coordinator while any consumer still references it.
|
||||
|
||||
## Checks
|
||||
|
||||
```sh
|
||||
python3 -m unittest discover -s tests -p test_audit_estate.py -v
|
||||
python3 -m unittest discover -s tests -p test_workflow_lint.py -v
|
||||
python3 -m unittest discover -s tests -p test_auxiliary_workflows.py -v
|
||||
actionlint .github/workflows/workflow-lint.yml
|
||||
```
|
||||
|
||||
Tests cover exact no-CI allowlists and drift, unknown repositories, missing configured
|
||||
profiles/native bridges, retained legacy workflows, bootstrap dependency/gate removal,
|
||||
required-check unknown states, and the lint image/tool/command/caller contract.
|
||||
|
||||
## Batch orb-version rollout
|
||||
|
||||
For a standard QBit without a manifest, start directly on the managed patch
|
||||
track using `python tools/standardize_qbit.py /checkout --orb-version 0.8
|
||||
--default-branch main`. Inspect the preview, then repeat with `--write`.
|
||||
This preserves the inferred publication and branch-filter policy while writing
|
||||
the same track to the manifest and setup caller. Use `rollout_version.py` below
|
||||
for repositories that already have a manifest. Neither command configures
|
||||
repository protection or automatically enrolls newly created repositories.
|
||||
|
||||
Upgrade existing canonical CircleCI consumers with one command:
|
||||
|
||||
```sh
|
||||
python tools/rollout_version.py --orb-version 0.7.11 /checkouts/qbit-one /checkouts/qqq-cli
|
||||
python tools/rollout_version.py --orb-version 0.7.11 --write /checkouts/qbit-one /checkouts/qqq-cli
|
||||
```
|
||||
|
||||
The first command previews the batch. The second updates only `.qqq-ci.yml` and
|
||||
`.circleci/config.yml`, after every supplied checkout passes the existing manifest
|
||||
and canonical-caller validators. It preserves publication opt-outs, release filters,
|
||||
credential context names and forwarded profile parameters. Already-current files
|
||||
are unchanged. Duplicate checkouts, custom jobs, invalid options and mismatched
|
||||
pins reject the batch before writing; resolve these in the central profile first.
|
||||
|
||||
Use isolated checkouts of the intended repository heads, inspect the resulting
|
||||
patches, then commit and push through the normal automated gates. The tool does not
|
||||
commit, push, publish packages, change GitHub rules or modify native/RC worker pins.
|
||||
A version update does not prove a publication succeeded: retain exact-head hosted
|
||||
verification and artifact evidence. The requested version must already be published.
|
||||
|
||||
```sh
|
||||
python3 -m unittest discover -s tests -p test_rollout_version.py
|
||||
```
|
||||
|
||||
## Live organization discovery
|
||||
|
||||
Use `--organization QRun-IO --live` instead of `--inventory inventory.json` to
|
||||
include newly created repositories on each audit. Discovery uses the existing
|
||||
`gh` authentication and all API pages, retaining archived entries for explicit
|
||||
skip reporting. Unknown repositories receive no automatic exemption. Duplicate,
|
||||
empty, malformed or failed discovery aborts instead of reusing a stale inventory.
|
||||
|
||||
```sh
|
||||
python tools/audit_estate.py --organization QRun-IO --live --orb-version 0.8 \
|
||||
--worker-sha <40SHA> --policy observed-checks.json --output audit.json
|
||||
```
|
||||
|
||||
The organization mode has no fixed repository-count ceiling. Supply
|
||||
`--expected-active N` for an independent count check when needed; saved-inventory
|
||||
mode preserves its default of 68. Reports identify the inventory source and
|
||||
credential visibility limit: inaccessible repositories cannot be certified.
|
||||
This is discovery and audit, not automatic enrollment or branch-rule mutation.
|
||||
|
||||
For a qualified batch of canonical orb branches, use the shared
|
||||
[branch-check enforcement command](branch-enforcement.md). It adds the observed
|
||||
CircleCI setup/verify gates while preserving other protections. Source enrollment,
|
||||
scanner transitions and scheduled reconciliation remain separate requirements.
|
||||
Scheduling and authenticated onboarding still need to be configured centrally.
|
||||
|
||||
## Batch enrollment
|
||||
|
||||
Use [the shared enrollment command](consumer-enrollment.md) to convert recognized
|
||||
legacy QBits and update existing canonical consumers in one validated batch.
|
||||
@@ -0,0 +1,248 @@
|
||||
# Standardized QQQ pipelines
|
||||
|
||||
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
|
||||
`qbit`; `core` owns the framework's complete acceptance/release graph. Frontend
|
||||
and CLI profiles described below retain their own publication contracts. Additional
|
||||
profiles belong in reviewed `PROFILE_TEMPLATES` renderers in
|
||||
`src/scripts/generate_pipeline.py`, with profile-specific schema and tests. There
|
||||
is no arbitrary script or job-YAML passthrough.
|
||||
|
||||
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
|
||||
orb version can be used for a controlled canary.
|
||||
|
||||
`.circleci/config.yml`:
|
||||
|
||||
```yaml
|
||||
version: 2.1
|
||||
setup: true
|
||||
orbs:
|
||||
qqq-orb: kingsrook/qqq-orb@0.7.0
|
||||
workflows:
|
||||
setup:
|
||||
jobs:
|
||||
- qqq-orb/generate_pipeline:
|
||||
orb_version: "0.7.0"
|
||||
filters:
|
||||
branches:
|
||||
ignore: automation/qbit-rc-pending
|
||||
tags:
|
||||
only: /.*/
|
||||
```
|
||||
|
||||
`.qqq-ci.yml`:
|
||||
|
||||
```yaml
|
||||
profile: qbit
|
||||
orb_version: "0.7.0"
|
||||
default_branch: develop
|
||||
java_version: "21"
|
||||
browsers: false
|
||||
api_checks: false
|
||||
docs_only: false
|
||||
publish:
|
||||
snapshot: true
|
||||
release_candidate: true
|
||||
release: true
|
||||
asciidoc: false
|
||||
```
|
||||
|
||||
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
|
||||
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
|
||||
to true for snapshots, RCs and tagged releases; AsciiDoc publication defaults to
|
||||
false. Unknown/duplicate keys, unexpected types, unsupported profiles and a setup
|
||||
parameter/manifest version mismatch fail before continuation. The canonical-caller
|
||||
validator also verifies the setup import, filters and profile-specific parameter
|
||||
declarations; additional jobs, commands, workflows or orbs fail validation. The
|
||||
parser is pinned to PyYAML 6.0.3 and uses its safe loader.
|
||||
|
||||
| Event | Workflow | Job contract |
|
||||
| --- | --- | --- |
|
||||
| develop | verify | existing mvn_publish, snapshot |
|
||||
| release/* | verify | existing mvn_publish, release_candidate |
|
||||
| vX.Y.Z tag resolving to the checkout | verify | existing mvn_publish, release |
|
||||
| main, feature/*, hotfix/*, other/unknown branch | verify | existing mvn_test_only |
|
||||
| Disabled publication or unrecognized/unproven tag | verify | full verification, no publication |
|
||||
|
||||
Generated `qbit`, `core`, `frontend-core`, and `frontend-material` pipelines use
|
||||
the stable workflow name `verify`. All selected jobs, dependencies and filters
|
||||
remain intact; this adds no executor or duplicate build. Other profiles retain
|
||||
their existing workflow names and native checks.
|
||||
|
||||
When upgrading from legacy workflow names, upgrade the immutable RC worker pin
|
||||
alongside the orb so finalization recognizes both names. Confirm the CircleCI
|
||||
app's successful `verify` check on the exact migration commit before replacing
|
||||
legacy required contexts. Require `setup` and `verify` on managed branches,
|
||||
preserving other required checks and controls. Human approval is not required;
|
||||
automated checks authorize the migration.
|
||||
|
||||
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
|
||||
push does **not** publish a release. Migrating a legacy main-publishing consumer
|
||||
therefore requires explicit review of its release contract. Existing direct orb
|
||||
callers remain supported.
|
||||
|
||||
The setup filter and generated jobs exclude `automation/qbit-rc-pending`, the
|
||||
shared RC orchestrator's persistent release lock. Lock updates must not trigger
|
||||
Maven test or publication work.
|
||||
|
||||
The shared jobs keep the `qqq-maven-registry-credentials` context, complete verify,
|
||||
coverage and configured API checks. Publishing retains version management, signed
|
||||
artifact deployment, Git operations and release handling. Generated calls disable
|
||||
the redundant preliminary compile; they do not skip tests or verification. Existing
|
||||
callers retain the compatibility defaults in the jobs.
|
||||
|
||||
## Core profile
|
||||
|
||||
QBit alone accepts `release_completion: true` (default false). It enables the
|
||||
shared Maven RC job's `notify_rc_published` only for RC publication, including
|
||||
fail-closed verification that the bumped version was pushed before dispatching
|
||||
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
|
||||
opt-in; other profiles reject the key.
|
||||
|
||||
Use `profile: core` for the QQQ framework. The orb owns the complete baseline
|
||||
acceptance, broker conformance, cold bootstrap, coverage, diagnostics, static
|
||||
analysis and publication graph. Core scripts remain in the core source repository.
|
||||
The independent baseline fixture pins job sets, dependency edges, contexts,
|
||||
coverage requirements and actual verification commands across all six workflows.
|
||||
|
||||
Core additionally supports `publish.feature` and `publish.hotfix` (both true by
|
||||
default), preserving `publish*` tag and hotfix branch publication. QBit supports
|
||||
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
|
||||
test-only. Snapshot, RC and GA behavior remains distinct; RC/GA/hotfix
|
||||
publication still requires the complete source coverage gate. Cold bootstrap and
|
||||
fresh consumer Maven repositories remain uncached. Shared installer policy replaces
|
||||
local package preparation; preliminary compilation is disabled before clean
|
||||
lifecycles and the dependency cache is saved after successful verification.
|
||||
|
||||
Lambda XML copies remain in sample coverage evidence. The sample JUnit collector
|
||||
excludes those two copied reports because their original module directories are
|
||||
already uploaded, avoiding duplicate test identities without dropping evidence.
|
||||
|
||||
External core API triggers require these declarations in the tiny **setup** config:
|
||||
|
||||
```yaml
|
||||
parameters:
|
||||
mongo_bind_diagnostics:
|
||||
type: boolean
|
||||
default: false
|
||||
next_acceptance_bundle_url:
|
||||
type: string
|
||||
default: ""
|
||||
next_acceptance_bundle_sha256:
|
||||
type: string
|
||||
default: ""
|
||||
next_acceptance_receipt_sha256:
|
||||
type: string
|
||||
default: ""
|
||||
```
|
||||
|
||||
Forward each value on `qqq-orb/generate_pipeline`, for example
|
||||
`mongo_bind_diagnostics: << pipeline.parameters.mongo_bind_diagnostics >>`, and
|
||||
likewise for the three bundle parameters. Requested values become defaults in the
|
||||
continued configuration; the continuation POST deliberately omits `parameters` to
|
||||
avoid CircleCI's setup/continuation/API parameter conflict. Verify both default and
|
||||
explicit API-triggered parameter values in the hosted canary before migrating
|
||||
triggering consumers. Other profiles reject non-default core parameters.
|
||||
|
||||
## Frontend profiles
|
||||
|
||||
`frontend-material` preserves the Maven frontend build/test/package/publication
|
||||
jobs, Java21/Node20 defaults, registry context, feature-tag, RC, GA and hotfix
|
||||
contracts. Declare setup pipeline parameter `run_playwright` (boolean, default
|
||||
false) and forward `run_playwright: << pipeline.parameters.run_playwright >>` on
|
||||
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
|
||||
Playwright image, npm ci with legacy peer dependencies and report uploads; only
|
||||
npm downloads (`~/.npm`) are cached, never node_modules.
|
||||
|
||||
`frontend-core` preserves Node24.21, npm trusted publishing and both existing
|
||||
registry/build-sample contexts. Unlike QBit, its existing main-push **and v-tag**
|
||||
release contract remains intentional. Both frontend profiles support explicit
|
||||
numeric-string `node_version` and publication toggles including feature/hotfix.
|
||||
Material also supports `java_version`. Browser/API/AsciiDoc flags are rejected
|
||||
rather than silently ignored on these profiles. Existing direct jobs remain usable.
|
||||
|
||||
## CLI profile
|
||||
|
||||
`cli` owns npm install, generated-client drift, build, unit tests and the real
|
||||
Prism smoke contract through `cli_verify_publish`. Publication is **disabled by
|
||||
default**. To enable the existing v-tag publication, declare `publish.release:
|
||||
true` plus `publish_context: VERIFIED_CONTEXT_NAME`, after verifying that an
|
||||
existing trusted CircleCI context grants the required GitHub Packages permission.
|
||||
No context name or credential availability is inferred from the former Actions
|
||||
GITHUB_TOKEN. A tag must resolve to the current checkout; the job additionally
|
||||
checks the client version before publishing its three fixed workspaces with the
|
||||
existing rc dist-tag. Main pushes never publish. CLI docs-only is currently
|
||||
rejected because generated-client verification remains mandatory.
|
||||
|
||||
## Conservative documentation routing
|
||||
|
||||
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
|
||||
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,
|
||||
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/
|
||||
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;
|
||||
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
|
||||
inputs or packaged application content.
|
||||
|
||||
The light route keeps workflow `verify` and names its job
|
||||
`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
|
||||
the hosted context name. Current protections must not be removed speculatively.
|
||||
|
||||
## Implementation and verification
|
||||
|
||||
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
|
||||
is valid CircleCI configuration YAML; it is saved at
|
||||
`/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
|
||||
them as base64 into packed_generate_pipeline.py before orb packing, preventing
|
||||
CircleCI from interpolating template expressions during setup. The orb includes
|
||||
the complete generated resource; no runtime source-tree template access is needed.
|
||||
make pack regenerates it and CI rejects a stale generated resource.
|
||||
Continuation credentials and response bodies are never printed.
|
||||
|
||||
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,
|
||||
whole-branch changes, tags, errors, defaults and source/packed parity. The hosted
|
||||
pipeline-contract-test runs the source suite and shared Maven behavioral tests;
|
||||
the full local target additionally extracts and executes the actual packed command.
|
||||
|
||||
## Node snapshot versions
|
||||
|
||||
The shared Node publisher calculates develop snapshots as
|
||||
`MAJOR.MINOR.NEXT_PATCH-SNAPSHOT.CIRCLE_BUILD_NUM`. A positive CircleCI job number
|
||||
is required, so independent publication jobs receive distinct npm coordinates.
|
||||
The package version is changed only in the build workspace and published under
|
||||
the `snapshot` dist-tag. No snapshot version commit is pushed: the branch remains
|
||||
at the source revision whose required checks ran, avoiding unchecked `[skip ci]`
|
||||
heads and recursive publication. Stable, RC and hotfix version policies are unchanged.
|
||||
|
||||
## Android and MCP policy profiles
|
||||
|
||||
`android` and `mcp-policy` accept only profile, orb_version and default_branch.
|
||||
Android retains the audited Android/GCP orb versions and every active unit,
|
||||
emulator and Maven-publication step. The emulator now runs on main as well as
|
||||
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.
|
||||
@@ -0,0 +1,46 @@
|
||||
# Marketing pipeline ownership
|
||||
|
||||
The `marketing` profile accepts only `profile`, `orb_version`, and
|
||||
`default_branch: main`. The QQQ version must match the setup caller's explicit
|
||||
orb version. The canonical QQQ setup produces one final continuation containing
|
||||
jobs from the pinned `kof22/munitor@0.3.11` orb. It never invokes Munitor's setup
|
||||
generator or creates another continuation.
|
||||
|
||||
The baseline fixture records the original Munitor 0.3.11 render. The shared
|
||||
profile selects one workflow for the current branch and exposes it as `verify`:
|
||||
PR checks for feature/hotfix/automation branches, develop, staging, release
|
||||
candidate, or production for main. Tags and the RC bookkeeping branch do not
|
||||
run these jobs. Existing deployment dependencies and contexts are preserved.
|
||||
|
||||
The build job installs dependencies once, lints, builds, runs Chromium
|
||||
Playwright tests, crawls local links and runs Lighthouse. The link crawl waits
|
||||
at most 60 attempts for the app on port 3005, propagates failures, and stops its
|
||||
server on exit. Playwright and Lighthouse reports are retained as artifacts,
|
||||
including on failure. The old synthetic coverage job was removed because it
|
||||
fabricated 100% rather than measuring coverage; actual tests and scans remain.
|
||||
|
||||
Production follows build → image build/Trivy/push/health → independent CD update
|
||||
and GitHub release. Both final jobs depend on the image job; neither depends on
|
||||
the other. Only main updates
|
||||
`KofTwentyTwo/cluster-gitops/tenants/qrun/website/kustomization.yaml`, using the
|
||||
existing `github` context; image publication uses `ghcr`. Production-only means
|
||||
no non-main deployment update, not no non-main artifacts: develop/staging image
|
||||
publishing and release-candidate GitHub releases remain unchanged.
|
||||
|
||||
Consumers need only the QQQ caller and `.qqq-ci.yml`. Before tests, the shared
|
||||
profile writes minimal `.munitor.yml` worker input into the build workspace:
|
||||
`pipeline: node-webapp`, Node 22, and `docker.use_repo_dockerfile: true`.
|
||||
Munitor's Docker worker still requires this file; the orb owns its contents.
|
||||
This preserves the repository Dockerfile rather than generating a replacement.
|
||||
Container health remains `/` on port 3000, distinct from the local test server
|
||||
on port 3005. The repository Dockerfile remains responsible for the standalone
|
||||
runtime without npm or npx.
|
||||
|
||||
The duplicate consumer GitHub test workflow can be removed only after these
|
||||
central checks qualify. Application test settings and assertions remain in the
|
||||
application repository; orchestration belongs here.
|
||||
|
||||
`MarketingContractTests` checks whole-graph equality and explicit release/test
|
||||
contracts. The normal generator suite additionally checks source/packed parity.
|
||||
These are configuration tests, not a claim of hosted delivery, credentials,
|
||||
container health, or production deployment verification.
|
||||
@@ -0,0 +1,36 @@
|
||||
# Next native workers
|
||||
|
||||
The orb repository owns the reusable workers in `.github/workflows/next-*.yml`.
|
||||
`src/scripts/generate_next_workflow.py --ref FULL_ORB_COMMIT` emits the sole tiny
|
||||
consumer `.github/workflows/next.yml` bridge; `--check PATH` validates its canonical
|
||||
shape. Pins must be immutable 40-character commits. Do not point consumers at an
|
||||
unreleased working tree or mutable default branch.
|
||||
|
||||
Native GitHub execution preserves the existing dynamic PR-label acceptance matrix,
|
||||
native ARM64 dashboard image proof and ephemeral GitHub Packages token. It is not
|
||||
a second copy of Circle's frontend tests. The consumer's old CI/acceptance/image
|
||||
workflow bodies must be removed when the bridge is activated and its checks proven.
|
||||
|
||||
The initial extraction preserves all five CI jobs, real-backend plan/build/shards/
|
||||
gate/quarantine jobs and AMD64/ARM64 image jobs. Acceptance remains 18 cells for
|
||||
main/tag/manual/full-acceptance and four cells for ordinary PRs. Each cell retains
|
||||
its isolated backend and existing serial-worker contract; one built artifact feeds
|
||||
all cells. The report merger and every-planned-shard evidence check remain required.
|
||||
Unrelated PR label edits no longer rerun validation: only `full-acceptance` label
|
||||
changes rerun acceptance, while unit/browser/image jobs skip all label-only events.
|
||||
|
||||
The `frontend-next` Circle profile retains the existing tag-only delivery contract:
|
||||
the tag build plus immutable npm/Maven version comparison, typecheck, lint, tests,
|
||||
static export and signed JAR deployment. Its manifest accepts only `profile`,
|
||||
`orb_version` and `default_branch`; its canonical setup caller ignores all branches.
|
||||
The shared Java installer owns the existing unattended package-install policy.
|
||||
Native workers own branch checks, with no duplicate Circle branch test/build jobs.
|
||||
Tag validation intentionally still overlaps native validation during this initial
|
||||
move. As before, JAR publication is independent of native acceptance; no new
|
||||
cross-platform coordination gate or artifact-reuse guarantee is claimed.
|
||||
Hosted permissions and protection-context migration still need canary validation.
|
||||
|
||||
`python3 tests/test_next_native.py` compares every worker job/step against the audited
|
||||
baseline and executes the original selector fixture to prove 18/4 counts. It checks
|
||||
the immutable caller references and label conditions. Run actionlint and hosted
|
||||
canaries before consumer migration; generated required contexts may differ.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Shared QBit source scanning
|
||||
|
||||
Generate the thin caller with `python3 src/scripts/generate_auxiliary_workflow.py qbit-codeql --ref <immutable-worker-sha>`.
|
||||
The reusable worker selects supported languages from tracked files in the actual checked-out branch. Historical Java branches therefore do not request an absent Actions database. Java, JavaScript/TypeScript, Python and Actions share one job; Kotlin selects an actual build instead of silently omitting Kotlin from no-build Java analysis.
|
||||
|
||||
The caller scans pull requests, main/develop/release/hotfix pushes and weekly, cancels superseded PR scans, and contains no scan implementation. Set `codeql_worker_sha` in the estate enforcement policy to require the exact canonical caller independently of other native worker pins. Existing default-setup repositories remain unchanged until migrated.
|
||||
|
||||
Roll out to both active default and maintained branches. Verify the worker on representative branch contents and preserve existing query coverage before replacing GitHub default setup; do not run duplicate default and advanced scanners permanently. Default setup cannot select languages independently for historical branches. A branch with no supported application or workflow source is a placeholder to classify, not a passing application scan.
|
||||
|
||||
Local tests execute the embedded language-selection step against real git indexes, including absent Actions, untracked generated files, mixed source, Kotlin and placeholders. Hosted CodeQL database creation and SARIF upload must also pass before claiming rollout completion.
|
||||
|
||||
References: [GitHub setup types](https://docs.github.com/en/code-security/concepts/code-scanning/setup-types) and [CodeQL build modes](https://docs.github.com/en/code-security/reference/code-scanning/codeql/build-options-for-compiled-languages).
|
||||
@@ -0,0 +1,63 @@
|
||||
# Preserve existing QBit release selection
|
||||
|
||||
Migration now reads the audited job filters, not just the presence of a
|
||||
publication job. The following bounded QBit-only manifest fields preserve the
|
||||
recognized contracts:
|
||||
|
||||
| Field | Values | Behavior |
|
||||
|---|---|---|
|
||||
| `release_on_main` | boolean, default false | Main pushes select the existing release job when release publishing is enabled. |
|
||||
| `release_tag_policy` | `stable`, `v-prefix`, `none` | Stable `v1.2.3`, the existing broad `/v.*/` contract, or no tags. |
|
||||
| `test_branch_policy` | `all`, `non-release`, `non-release-no-integration`, `feature`, `non-release-no-main`, `non-release-no-hotfix`, `non-release-no-main-hotfix`, `feature-no-hotfix` | Selects an audited test branch exclusion. |
|
||||
| `publish.hotfix` | boolean, default false | Runs the existing Maven hotfix publisher for nonempty `hotfix/*` branch events only when explicitly enabled. |
|
||||
|
||||
`feature` preserves the original exclusion of develop, main, release branches,
|
||||
and integration-prefixed branches; it is not a new feature-prefix-only rule.
|
||||
All policies continue to exclude the RC coordination lock branch.
|
||||
The three hotfix exclusions preserve the corresponding legacy policies while
|
||||
the single shared publisher handles hotfix events. Existing manifests do not
|
||||
enable hotfix publication implicitly; migration enables it only when the source
|
||||
configuration contains the recognized hotfix publisher and branch filter.
|
||||
No consumer-supplied regex, command, job, or arbitrary branch-publication rule
|
||||
is accepted.
|
||||
|
||||
An explicit tag policy also controls the canonical setup caller's tag filter.
|
||||
`none` prevents even setup from running on tags for the four test-only repos.
|
||||
Stable and broad policies run only their approved tags. Existing manifests
|
||||
without the field retain their previous canonical caller for compatibility.
|
||||
Every tag publication still verifies that the actual Git tag resolves to HEAD.
|
||||
Main publication does not invent a tag requirement that the existing jobs lacked.
|
||||
`publish.release: false` still disables release publication.
|
||||
|
||||
The 42 immutable source fixtures preserve eight main-push publishers, four broad
|
||||
tag publishers, the remaining stable tag publishers, and four test-only repos.
|
||||
Snapshot/RC inference accepts only the observed develop and release branch
|
||||
filters. Unknown filters, duplicate publication/test jobs, and custom job options
|
||||
fail migration rather than silently changing release behavior.
|
||||
|
||||
Use `tools/standardize_qbit.py --write` for the two-file migration. API callers
|
||||
must pass the inferred policy to
|
||||
`canonical_caller(version, manifest["release_tag_policy"], manifest["publish"].get("feature", False))`; the legacy one-argument
|
||||
form is only for manifests without an explicit policy.
|
||||
|
||||
`publish.feature` is false by default. Opting in enables the audited `publish*`
|
||||
tag contract, with the tag required to resolve to the checked-out commit. The
|
||||
canonical setup admits those tags alongside the declared release tag policy.
|
||||
Feature branch pushes remain test-only. Migration accepts Workflows' exact legacy
|
||||
literal `feature/.*` branch selector (not a regular expression); Git forbids `*`
|
||||
in branch names, so that selector cannot publish a branch. Unknown feature
|
||||
filters require a central profile change rather than silently broadening triggers.
|
||||
|
||||
Focused tests cover the immutable inventory, unknown-filter rejection, canonical
|
||||
caller agreement, main opt-in, broad/stable tag selection, HEAD provenance,
|
||||
publication opt-out and test exclusions. The packed generator suite also exercises
|
||||
main, broad RC-shaped tags, and excluded integration branches.
|
||||
Fifteen additional main-branch fixtures exercise 195 branch/tag cases,
|
||||
checking both test and publication selection. Source and packed generator tests
|
||||
also verify hotfix opt-in, its boolean validation, and unchanged main behavior.
|
||||
CMS's original YAML is retained with its immutable source SHA: its unquoted
|
||||
stable-tag regex is invalid YAML. The fixture repairs only that quoting. Both
|
||||
audited spellings of the stable regex map to the same ASCII-digit tag policy;
|
||||
arbitrary regexes remain rejected.
|
||||
|
||||
CI-only commits on publishing branches retain Maven verification without publishing when their changes are limited to the manifest, CircleCI caller, shared scanner caller, RC caller, or schema-drift caller. The commit must have one parent and a conventional ci title. Tags, application POMs, schema resources, tests, and other application inputs retain normal publication behavior. Canonical caller enforcement separately verifies the shared workflow definition and immutable worker pin.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Application-free branch verification
|
||||
|
||||
Use `profile: repository-policy` only on a branch containing repository policies,
|
||||
documentation, workflow configuration and optional unused Maven wrappers. It uses
|
||||
the same canonical setup caller as other profiles and one small Python verification
|
||||
job. It checks tracked YAML/JSON syntax and rejects application manifests, source
|
||||
files, unknown file types and symlinks. It never builds or publishes an application.
|
||||
|
||||
The manifest accepts only `profile`, `orb_version` and `default_branch`. The latter
|
||||
remains the repository's actual default branch. A future application promotion must
|
||||
select its real build profile in the same change; adding source without doing so fails.
|
||||
|
||||
Estate policy can set `branch_profiles: {main: repository-policy}` without changing
|
||||
the default branch's application profile. Require the CircleCI `setup` and `verify`
|
||||
checks on the policy branch. This profile does not establish application release
|
||||
readiness or replace the build/release checks on source-bearing branches.
|
||||
@@ -0,0 +1,51 @@
|
||||
# Specialist native ownership
|
||||
|
||||
`generate_auxiliary_workflow.py mcp-rag --ref FULL_ORB_COMMIT` and
|
||||
`business-db --ref FULL_ORB_COMMIT` emit canonical immutable bridges.
|
||||
Worker policy lives in this repository. No Circle pipeline is added for either
|
||||
bridge, and no consumer has been migrated by adding these definitions.
|
||||
|
||||
## MCP RAG
|
||||
|
||||
Audited source: `7ff9bc7af7e949eee164efb90e3b4a2b931b2278`.
|
||||
One `mvn -B -ntp clean verify` includes the POM-bound Checkstyle validate phase,
|
||||
Error Prone compiler, unit tests, Failsafe integration-test/verify and existing
|
||||
coverage checks. This replaces the separate native lint/compile and verify jobs.
|
||||
It does not introduce skipped tests or the old Circle-only PMD skip.
|
||||
|
||||
The worker keeps Java 21, Maven caching, the explicit optional
|
||||
`QQQ_MCP_VOYAGE_API_KEY` secret, JAR artifact handoff, and the original dependent
|
||||
main-push-only image job. GHCR authentication remains the ephemeral GitHub token
|
||||
with packages write permission. The repository Dockerfile, commit-SHA and latest
|
||||
tags are unchanged. Test reports are retained even when verification fails.
|
||||
|
||||
The caller covers all branch pushes (the old Circle coverage), PRs targeting main,
|
||||
and manual runs. A same-repository PR can still have both a branch-head and a
|
||||
merge-ref run: those inputs are not proven equivalent, so this migration does not
|
||||
silently drop merge validation. Superseded non-main runs of the same event/ref
|
||||
cancel; main publication is not cancelled. Native runtime cost still counts
|
||||
towards total CI cost; no measured savings are claimed.
|
||||
|
||||
Consumer Circle retirement requires hosted equivalence and an audit of existing
|
||||
`qstudio-ci` environment variables. Local source identifies the named Voyage
|
||||
secret, but cannot prove that a private Circle context has no other inputs.
|
||||
No credentials were copied, replaced or assumed. Hosted image publication,
|
||||
native permissions and required-check migration remain unverified here.
|
||||
|
||||
## Business database migrations
|
||||
|
||||
Audited source: `8af799fce97e972f81f195df969d79a959f71dbc`.
|
||||
The native worker retains the exact `mvn -B -pl db verify` job, Java 21,
|
||||
Maven cache, PR path filters and main push path filters. Its source paths are
|
||||
`db/**`, `pom.xml`, and the existing PR workflow path. It introduces no new
|
||||
schedule, publication, secret or Circle pipeline.
|
||||
|
||||
The existing disabled business-platform E2E workflow is an explicit exception.
|
||||
This implementation neither re-enables it nor claims that its live-service
|
||||
coverage has been standardized. Enablement is an external workflow setting,
|
||||
not something proven by the audited YAML. Consumer retirement/adoption must
|
||||
preserve that disabled state.
|
||||
|
||||
`tests/test_auxiliary_workflows.py` checks exact database worker/event equality,
|
||||
MCP image-job equality, the declared secret, all-branch coverage, and the actual
|
||||
POM phase bindings used to remove duplicate lint/compile work.
|
||||
@@ -0,0 +1,66 @@
|
||||
# Shared orb check enforcement
|
||||
|
||||
`tools/enforce_orb_checks.py` replaces repository-specific scripts for the shared
|
||||
CircleCI `setup` and `verify` branch gates. One invocation processes an explicit
|
||||
batch of current `main` and `develop` branches using existing `gh` authentication.
|
||||
|
||||
Create a targets file:
|
||||
|
||||
```json
|
||||
[
|
||||
{"repository": "QRun-IO/qbit-example", "branch": "main"},
|
||||
{"repository": "QRun-IO/qbit-example", "branch": "develop"}
|
||||
]
|
||||
```
|
||||
|
||||
Preview, then apply the same batch:
|
||||
|
||||
```sh
|
||||
python tools/enforce_orb_checks.py --targets targets.json --orb-version 0.8 --output enforcement-plan.json
|
||||
python tools/enforce_orb_checks.py --targets targets.json --orb-version 0.8 --output enforcement-result.json --apply
|
||||
```
|
||||
|
||||
Every branch must already contain the exact canonical caller for its manifest and
|
||||
have successful `setup` and `verify` checks from CircleCI app 18001 at its current
|
||||
commit. Supported profiles are QBit, Core, frontend-core, frontend-material and repository-policy.
|
||||
The complete batch is inspected before any mutation. Source/head/protection drift,
|
||||
unavailable APIs and unknown profiles fail closed. Existing repository rulesets are verified as described below.
|
||||
|
||||
The tool appends the app-bound checks, enables strict checks and administrator
|
||||
enforcement, and reads the result back. Existing required checks remain required.
|
||||
For protected branches it uses the narrow status-check/admin endpoints, preserving
|
||||
reviews, signatures, linear history, restrictions and other settings. For a
|
||||
previously unprotected branch it creates protection without adding human reviews.
|
||||
It never changes scanner configuration, repository visibility, billing, or source.
|
||||
|
||||
Output records the planned head and original protection, then verification as each
|
||||
branch completes. A batch is not transactional: if an API call fails, inspect the
|
||||
output and rerun; successful protections are retained rather than rolled back.
|
||||
An already-correct branch needs no mutation.
|
||||
|
||||
This command covers the shared orb gate pair only. Continue to run the estate
|
||||
audit for scanner/native-worker requirements and other policy. Automatic repository
|
||||
discovery, source enrollment and scheduled reconciliation remain separate work.
|
||||
|
||||
GitHub API reference: [protected branches](https://docs.github.com/en/rest/branches/branch-protection).
|
||||
|
||||
```sh
|
||||
python -m unittest discover -s tests -p test_enforce_orb_checks.py -v
|
||||
```
|
||||
|
||||
## Existing rulesets
|
||||
|
||||
When effective branch rules come from repository rulesets, the tool can verify
|
||||
existing enforcement without adding classic protection. Each contributing ruleset
|
||||
must be active for branches, have no bypass actors and require both setup and
|
||||
verify from CircleCI app18001. The current branch must also have successful gate
|
||||
runs. The tool rechecks the branch, effective rules and full ruleset records before
|
||||
reporting verified. Rule drift or an unbound/missing gate stops verification.
|
||||
|
||||
This path writes nothing. It preserves scanner requirements, conditions and the
|
||||
existing up-to-date-branch policy, including a false strict setting that avoids
|
||||
unnecessary rebuilds. Reports identify protection_mode=rulesets and the observed
|
||||
strict value. Unsupported organization-level rulesets, bypass actors and missing
|
||||
gates remain unresolved rather than being rewritten or ignored.
|
||||
|
||||
For classic protection with an empty push allowlist and admin enforcement disabled, the tool leaves the entire classic policy unchanged. After current-head gates pass, it creates a narrowly scoped active repository ruleset requiring app-bound setup and verify with no bypass actors. This enforces CI even for administrators without changing their existing branch access or locking all actors out. The ruleset retains the fleet freshness policy (strict=false); it does not weaken any existing classic policy. A same-named ruleset causes rejection rather than overwrite or duplication. Readback verifies the effective gates and unchanged classic protection; subsequent runs recognize the existing ruleset without writes.
|
||||
@@ -0,0 +1,152 @@
|
||||
# Batch consumer enrollment
|
||||
|
||||
Use one target file for canonical consumers of every supported Circle profile and
|
||||
legacy QBits whose jobs and publication filters the shared converter recognizes:
|
||||
|
||||
```json
|
||||
[
|
||||
{"checkout": "/work/qbit-example", "default_branch": "main"},
|
||||
{"checkout": "/work/qqq", "default_branch": "develop"}
|
||||
]
|
||||
```
|
||||
|
||||
The branch values must come from repository inventory. Run on clean isolated
|
||||
checkouts of the branches being migrated.
|
||||
|
||||
```sh
|
||||
python tools/enroll_consumers.py targets.json --orb-version 0.8
|
||||
python tools/enroll_consumers.py targets.json --orb-version 0.8 --write
|
||||
```
|
||||
|
||||
The command validates the entire batch before writing. Existing manifests keep
|
||||
all publication and profile options; only the managed orb version changes.
|
||||
Recognized legacy QBits receive the canonical caller and inferred publication
|
||||
policy. An unknown job, filter, profile option, duplicate target, symlink, or
|
||||
concurrent declaration edit rejects the batch. Repeating a completed enrollment
|
||||
makes no changes. Filesystem errors during the write phase can leave a partial
|
||||
batch; rerun after correcting the error. This is not a filesystem transaction.
|
||||
|
||||
Only `.circleci/config.yml` and `.qqq-ci.yml` are changed. The tool does not delete
|
||||
other workflows, infer publication from repository names, or enroll unknown
|
||||
custom pipelines. Their behavior must first be represented by a central profile.
|
||||
After committing and qualifying the exact source, apply the shared
|
||||
[branch enforcement tool](branch-enforcement.md) to supported gate profiles.
|
||||
|
||||
This command provides batch source conversion. Use the coordinator below for remote signed submissions. Local conversion alone does not prove fleet deployment or release success.
|
||||
|
||||
## Remote signed submissions
|
||||
|
||||
Supply observed current branches, without cloning each repository yourself:
|
||||
|
||||
```json
|
||||
[
|
||||
{"repository": "QRun-IO/qbit-example", "branch": "main"},
|
||||
{"repository": "QRun-IO/qqq", "branch": "develop"}
|
||||
]
|
||||
```
|
||||
|
||||
```sh
|
||||
python tools/reconcile_enrollment.py --targets remote-targets.json --orb-version 0.8 --output plan.json
|
||||
python tools/reconcile_enrollment.py --targets remote-targets.json --orb-version 0.8 --output result.json --apply
|
||||
```
|
||||
|
||||
Use existing `gh` authentication with repository write access. The coordinator
|
||||
never installs credentials or changes authentication. Every target is inspected
|
||||
at an immutable head and validated before any remote mutation. No repository
|
||||
clone, SSH key or local signing key is required. A moved target stops submission;
|
||||
refresh the plan instead of overwriting it.
|
||||
|
||||
An automation branch derives from the source commit and proposed declarations.
|
||||
The coordinator creates the branch at the observed base and uses GitHub's
|
||||
`createCommitOnBranch` API with `expectedHeadOid` for an atomic append. GitHub
|
||||
signs the commit when supported by the authenticated identity; the coordinator
|
||||
requires remote signature verification, exact parent, changed paths and
|
||||
declaration bytes before opening a PR. It never force-updates a branch.
|
||||
An interrupted branch creation, commit or PR creation can be resumed:
|
||||
an existing branch still at the planned base receives the missing commit;
|
||||
matching signed branches and PRs are reused. A mismatched branch is rejected.
|
||||
Closed existing PRs are reported as existing; they are not silently reopened.
|
||||
Reports include repository, branch, immutable head and submission URL, without
|
||||
embedding declaration contents or credentials. Keep the report if a later target
|
||||
fails; earlier valid submissions remain intact.
|
||||
|
||||
API permission, signature or commit-conflict failures stop the run. A timeout
|
||||
can occur after GitHub accepted a mutation, so inspect remote state or repeat
|
||||
the same invocation; do not create a different automation branch to retry.
|
||||
See [GitHub commit API documentation](https://docs.github.com/en/graphql/reference/commits#createcommitonbranch).
|
||||
|
||||
This handles remote target lists and signed submissions. Organization discovery is described below. Qualification-aware merging and classic branch enforcement are described below; scheduling and ruleset reconciliation remain separate work. A submitted PR is not a completed migration. Unknown profiles and
|
||||
native workflows require their own central conversion, not deletion by this tool.
|
||||
|
||||
## Organization discovery
|
||||
|
||||
The coordinator can select observed current branches directly from GitHub:
|
||||
|
||||
```sh
|
||||
python tools/reconcile_enrollment.py --organization QRun-IO --orb-version 0.8 --output organization-plan.json
|
||||
python tools/reconcile_enrollment.py --organization QRun-IO --orb-version 0.8 --output organization-result.json --apply
|
||||
```
|
||||
|
||||
Repository and branch inventories are paginated. Only existing main/develop
|
||||
branches are considered; historical release branches are excluded. Archived
|
||||
repositories and the orb's own bootstrap repository are reported separately.
|
||||
Each supported branch receives the same immutable preflight as explicit targets.
|
||||
Unknown workflows, missing entrypoints, unsupported branch layouts and unavailable
|
||||
APIs stay `unresolved` in the output. They are never counted as conforming or
|
||||
silently converted. No-CI and native-only repositories may therefore appear as
|
||||
unresolved here; use the estate auditor for their separate policy classification.
|
||||
|
||||
Discovery finishes before any submission. `--apply` processes qualified plans
|
||||
and retains unresolved entries for follow-up; one unsupported repository does
|
||||
not prevent independent valid submissions. An explicit `--targets` batch keeps
|
||||
its stricter behavior: any preflight failure stops the whole batch. By default neither mode merges PRs or changes branch protections. Use the explicit completion flags below.
|
||||
|
||||
## Qualification and enforcement
|
||||
|
||||
```sh
|
||||
python tools/reconcile_enrollment.py --targets remote-targets.json --orb-version 0.8 --output result.json --apply --merge-ready --enforce
|
||||
```
|
||||
|
||||
Both flags require `--apply` and are optional. `--merge-ready` revalidates the
|
||||
signed submission, exact parent/files/content and current base, requires successful
|
||||
CircleCI-app `setup` and `verify` checks and every advertised latest check/status,
|
||||
then requests a normal exact-head squash merge. It never uses admin override or
|
||||
force pushes. The resulting signed merge must have the qualified source tree.
|
||||
Pending/failed checks and changed bases are reported without merging. Repeated
|
||||
runs can advance the same PR once checks complete; there is no polling loop that
|
||||
holds a CI executor open.
|
||||
|
||||
`--enforce` independently checks the actual current target branch, which must
|
||||
pass its own orb gates before shared classic protection enforcement. Existing
|
||||
protections and other required checks are preserved. Supported gate profiles are
|
||||
QBit, Core, frontend-core, frontend-material and repository-policy. Other profiles
|
||||
remain explicitly unsupported for completion even when source enrollment works.
|
||||
Existing active repository rulesets with app-bound gates and no bypass actors are verified without writes. Unsupported or incomplete rulesets remain unresolved; none are rewritten or layered with classic protection. API/plan restrictions remain visible.
|
||||
|
||||
A merged source update and an enforced branch are separate reported outcomes.
|
||||
Neither proves artifact publication or deployment. Scheduling and ruleset
|
||||
reconciliation remain outstanding.
|
||||
|
||||
## Central hosted pass
|
||||
|
||||
The orb owner's CircleCI config accepts `run_enrollment_reconcile: true` on
|
||||
`main`. This selects one small Python container instead of the normal orb
|
||||
build/publication workflow. It uses the existing
|
||||
`qqq-maven-registry-credentials` context's GitHub token through `gh`.
|
||||
No consumer-specific runner configuration or local signing key is needed.
|
||||
|
||||
`tools/run_enrollment.py` verifies the owner repository and main branch, runs
|
||||
organization discovery, signed enrollment, qualified merging and enforcement,
|
||||
then exits. The pass has a 20-minute execution limit. Pending checks are reported
|
||||
for the next pass rather than polled while a paid executor waits. Incremental
|
||||
results and execution status are retained under `artifacts/enrollment`, including
|
||||
when execution fails or times out. A completed pass does not mean every repository
|
||||
conforms: unresolved and waiting entries remain explicit follow-up work.
|
||||
|
||||
Create a single daily CircleCI schedule for the owner project only after a manual
|
||||
main-branch pass verifies its hosted credentials and results. Set `branch: main`
|
||||
and `run_enrollment_reconcile: true` in the schedule parameters. Scheduling is
|
||||
an external project setting; merging this config does not itself enable a schedule.
|
||||
Keep the existing RC-finalization parameter false for these runs. A timed-out
|
||||
GitHub request may already have succeeded remotely; the next pass resumes from
|
||||
the deterministic branch and verified source rather than forcing updates.
|
||||
@@ -0,0 +1,70 @@
|
||||
# GitOps validation
|
||||
|
||||
The orb owns `.github/workflows/gitops.yml`. The consumer keeps only the immutable caller generated by `generate_auxiliary_workflow.py gitops --ref <orb-commit>` at `.github/workflows/validate.yml`.
|
||||
|
||||
One native job downloads Kustomize 5.7.1 with its pinned official SHA-256 and renders every Kustomization, including bases, overlays and proxy declarations. Missing configurations or a failed render fail the job. Rendered resources are discarded rather than logged or uploaded because they may contain Secrets. This checks rendering, not Kubernetes schema compatibility or cluster health. No cluster access or publication credentials are required.
|
||||
|
||||
The caller runs on main pushes and pull requests without path filters, so a required check always reports. Superseded PR runs are canceled. Feature pushes do not create duplicate jobs. Remove the old Circle pipeline only after the native job passes on the consumer, then disable obsolete Circle build requests and require the observed native check with no human review.
|
||||
|
||||
For marketing-website-cd, the prior Circle job only printed Hello World. Its former production role moved to KofTwentyTwo/cluster-gitops; validation does not re-enable that retired deployment path.
|
||||
|
||||
The shared registry includes marketing-website-cd and voyage-cd. Daily enrollment recognizes their canonical main-branch caller without creating Circle configuration. Recognition requires a signed immutable worker pin matching the supported worker, a complete source tree, and no additional Circle or GitHub workflows. Enforcement requires the GitHub Actions app-bound gitops / validate gate and preserves existing branch rules. Unavailable private-repository protections remain an explicit enforcement failure; recognition alone is not enforcement.
|
||||
|
||||
|
||||
### Documentation repositories with shell automation
|
||||
|
||||
Use the canonical `repository-policy` manifest with `shell_checks: true` for
|
||||
repositories containing documentation, YAML/JSON, Mermaid source, and shell tools.
|
||||
The shared job remains one small executor with no publication or deployment.
|
||||
It installs ShellCheck only for this opt-in and checks every tracked `.sh` file
|
||||
with `bash -n` and ShellCheck at warning severity; scripts are never executed.
|
||||
Mermaid files are treated as UTF-8 documentation, not rendered or syntax-validated.
|
||||
Application manifests and other executable languages still require a build profile.
|
||||
|
||||
|
||||
### Homebrew distribution taps
|
||||
|
||||
The `homebrew-tap` profile takes only `tap` (lowercase owner/name) and `formula`.
|
||||
One small job in a digest-pinned Homebrew container validates the exact checkout,
|
||||
reads all OS/architecture variants, fetches their binaries with checksum verification,
|
||||
then installs and tests the Linux formula. It does not publish or update formulae.
|
||||
macOS downloads are verified, but this Linux job does not execute macOS binaries.
|
||||
|
||||
|
||||
### Application template acceptance
|
||||
|
||||
The `application-template` profile renders the checked-out template through pinned
|
||||
qctl code and a checksum-verified catalog. It runs transforms but never post-generation
|
||||
hooks, then performs Maven verify on the generated application with all its tests.
|
||||
The renderer and Maven dependencies are cached; test reports and the generated JAR
|
||||
are retained. This is acceptance of a generated consumer, not Maven publication.
|
||||
Only the standard profile, orb version, and default branch are consumer settings.
|
||||
|
||||
The coordinator also recognizes qctl on main/develop and the approved .github,
|
||||
business-platform, MCP-RAG and IntelliJ callers on main. It verifies each complete
|
||||
workflow inventory, canonical caller, signed immutable orb pin and matching shared
|
||||
worker source before recognizing the repository. Native verification gates bind to
|
||||
the GitHub Actions app; release-only jobs are not merge requirements. No CircleCI
|
||||
caller is added to these native consumers. qctl requires its shared tests; the native binary job is push-only, and
|
||||
full platform release builds retain their existing shared-worker policy.
|
||||
|
||||
Existing classic branch protections without a required-status-check section gain
|
||||
an additive shared ruleset. Signing, reviews, history and access restrictions remain
|
||||
unchanged, and a subsequent reconciliation verifies the effective ruleset.
|
||||
|
||||
The same daily pass manages CircleCI's native `autocancel-builds` setting for
|
||||
canonical `repository-policy`, `homebrew-tap`, `application-template`, and
|
||||
`marketing` consumers. Marketing must retain `main` as its default branch;
|
||||
environment deployment remains main-only. CircleCI excludes default-branch,
|
||||
scheduled and rerun workflows from automatic cancellation. This avoids a custom
|
||||
cancellation job and does not add executions to consumer pipelines.
|
||||
|
||||
The pass uses the existing orb-publishing context on the trusted orb main branch.
|
||||
It changes only the cancellation flag, checks for source movement before writing,
|
||||
and verifies preservation of all other flags. Its separate
|
||||
`result.circle-settings.json` artifact records missing credentials/API access,
|
||||
unconverted sources and profiles needing cancellation-policy review explicitly.
|
||||
Publication-heavy profiles are not changed until their non-default release
|
||||
semantics are reviewed; a successful reconciliation pass does not certify them.
|
||||
|
||||
Because cancellation is project-wide, eligibility requires every discovered current main/develop branch to be canonical and use a reviewed profile. An unresolved branch or an unreviewed publishing profile prevents enabling the flag, regardless of branch order. The report lists all observed profiles.
|
||||
@@ -0,0 +1,28 @@
|
||||
# IntelliJ plugin native standard
|
||||
|
||||
The plugin is a real resource-only product, not a no-CI exemption. Its native
|
||||
profile is `intellij-plugin`, with an orb-owned reusable worker and canonical
|
||||
auxiliary bridge at `.github/workflows/build.yml`. Generate using
|
||||
`generate_auxiliary_workflow.py intellij-plugin --ref IMMUTABLE_ORB_SHA`.
|
||||
|
||||
PRs and main/develop/tag pushes use Linux/JDK17 and the committed Gradle wrapper
|
||||
(Gradle8.6 in audited source) to run `check buildPlugin`. Distribution ZIPs and
|
||||
reports are retained. There are no authored source tests in the audited product;
|
||||
this validates its actual Gradle packaging lifecycle without inventing app code.
|
||||
No consumer build.gradle.kts semantics are changed.
|
||||
|
||||
Publication remains opt-in manual: select `vVERSION`, set publish=true and the
|
||||
exact source version, then approve the `intellij-marketplace` environment. The
|
||||
worker requires successful same-source build, exact source version/tag/HEAD and
|
||||
remote tag identity, serializes publication, requires all four existing secret
|
||||
interfaces, then executes `signPlugin publishPlugin`. Secrets CERTIFICATE_CHAIN,
|
||||
PRIVATE_KEY, PRIVATE_KEY_PASSWORD and PUBLISH_TOKEN are passed only into that
|
||||
step. Ordinary builds and PRs never publish. The caller and worker need only
|
||||
contents:read; Marketplace authorization remains the existing token contract.
|
||||
|
||||
Root must configure/verify environment protection and existing secret availability,
|
||||
run the hosted build canary, and verify signed Marketplace release separately.
|
||||
No credentials, consumer migration or publication have been performed here.
|
||||
Version1.1.0 is already documented historically: do not republish it merely to
|
||||
test automation. The vVERSION convention is the explicit new guarded CI release
|
||||
contract, not a claim about historical tags. No GitHub release is synthesized.
|
||||
@@ -0,0 +1,37 @@
|
||||
# Managed patch updates
|
||||
|
||||
The canonical caller and manifest accept either an exact stable version such as
|
||||
`0.8.0` or a quoted minor track such as `"0.8"`. CircleCI resolves a minor track
|
||||
to its latest published patch. A major-only version, `latest`, `volatile`, and
|
||||
wildcards are rejected. The caller import, setup parameter, and manifest must
|
||||
still agree exactly.
|
||||
|
||||
Use a minor track after qualifying that release line. Future patch fixes then
|
||||
arrive on the repository's next pipeline without a version-bump PR or an extra
|
||||
fleet-wide build. Existing exact pins remain supported and are not changed by
|
||||
publishing this capability. YAML minor versions must be quoted to remain strings.
|
||||
|
||||
The central batch tool applies the same update to all supplied checkouts:
|
||||
|
||||
```sh
|
||||
python3 tools/rollout_version.py --orb-version 0.8 --write /path/to/repo1 /path/to/repo2
|
||||
```
|
||||
|
||||
This changes only the two canonical CI declarations. Publication policies,
|
||||
contexts, branch/tag filters, and profile options stay unchanged. Normal source
|
||||
and publication checks still run when a pipeline is triggered; this setting does
|
||||
not skip tests. GitHub reusable-worker commit pins are separate and unchanged.
|
||||
|
||||
Automatic patch adoption trades exact-version reproducibility for centrally
|
||||
managed fixes. Keep patch releases backward compatible, qualify central changes
|
||||
before production publication, and use an exact stable pin for a canary or
|
||||
rollback. For example, the same tool can move a consumer from `0.8` back to
|
||||
`0.8.0`. Historical pipeline reruns can resolve a newer patch; choose an exact
|
||||
pin when reproducing an earlier run. Setup and continuation each resolve their
|
||||
orb imports, so patch compatibility also matters when publication overlaps a run.
|
||||
|
||||
Changing minor tracks is an explicit migration. Do not use this feature to push
|
||||
breaking changes into a patch release or to bypass repository checks.
|
||||
|
||||
Reference: [CircleCI orb semantic versioning](https://circleci.com/docs/orbs/use/orb-concepts/).
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# Orb-owned native maintenance workflows
|
||||
|
||||
Four existing workflows retain their event contracts in generated tiny callers:
|
||||
|
||||
| Repository | Caller path | Orb worker |
|
||||
| --- | --- | --- |
|
||||
| QRun-IO/qqq | `.github/workflows/codeql.yml` | `core-codeql.yml` |
|
||||
| QRun-IO/qqq | `.github/workflows/published-bom-consumer.yml` | `core-published-bom-consumer.yml` |
|
||||
| QRun-IO/qqq | `.github/workflows/quickstart-lifecycle.yml` | `core-quickstart-lifecycle.yml` |
|
||||
| QRun-IO/qbit-authentik | `.github/workflows/schema-drift.yml` | `qbit-schema-drift.yml` |
|
||||
|
||||
Generate a caller with `python src/scripts/generate_auxiliary_workflow.py KIND
|
||||
--ref IMMUTABLE_ORB_COMMIT_SHA`; `--check PATH` detects drift. The estate auditor
|
||||
recognizes these exact approved bridges. No consumer files are changed by the
|
||||
generator unless its output is explicitly redirected by the rollout operator.
|
||||
|
||||
Worker jobs preserve audited QQQ commit
|
||||
`bc0b0f11ef9d436c80b2e3c5268726a6bc0881c1` and Authentik commit
|
||||
`dbae77da5b6236268900f1238ce083f9d078d66d`. Tests compare the complete job objects,
|
||||
events and permissions against those fixtures, with explicit exceptions for the
|
||||
CodeQL additions below and the portable quickstart directory-creation correction.
|
||||
This preserves BOM source/ref/version validation, immutable acceptance-tools
|
||||
checkout, browser/OS matrix, private diagnostic handling and schema drift test.
|
||||
The caller retains schedules, tag filters and dispatch choices. Reusable inputs
|
||||
supply empty defaults on scheduled/tag runs, matching the original absent inputs;
|
||||
quickstart tag runs still derive the candidate and source SHA in the original job.
|
||||
No credentials are inherited beyond the automatic job token.
|
||||
|
||||
Publish the orb commit and verify reusable access before adoption. Hosted check
|
||||
names may gain the reusable caller prefix: observe actual canary check names and
|
||||
update required checks only after successful execution, preserving other rules.
|
||||
Local structural tests cannot prove hosted CodeQL upload or native execution.
|
||||
No consumer migration, rule update or publication is performed by these files.
|
||||
|
||||
## CodeQL coverage before retiring duplicate default setup
|
||||
|
||||
The central matrix covers `actions`, `java-kotlin`, `javascript-typescript`, and
|
||||
`python`. The original Java/Kotlin and JavaScript/TypeScript entries and build
|
||||
modes remain unchanged. Actions and Python cover the additional language families
|
||||
observed in the repository's active default setup. No custom queries or packs
|
||||
are supplied, preserving the default query suite.
|
||||
|
||||
Do not disable default setup yet. First publish and adopt the immutable central
|
||||
worker, then prove a hosted canary successfully completes and uploads analyses
|
||||
for all four languages. Only after that evidence may the rollout retire duplicate
|
||||
default setup without reducing coverage. These source changes do not modify
|
||||
repository settings or claim hosted four-language success.
|
||||
@@ -0,0 +1,37 @@
|
||||
# qctl native platform worker
|
||||
|
||||
`qctl-native.yml` centrally owns qctl's source tests, native builds, release,
|
||||
Docker, Homebrew, Scoop and AUR jobs. This is the explicit native-runner exception
|
||||
to Circle profiles: macOS and Windows release binaries use GitHub-hosted runners.
|
||||
The orb owns the tiny caller generator and canonical-definition check; consumers
|
||||
retain no platform matrix or custom build/release logic.
|
||||
|
||||
Every PR and main/develop push runs the complete `mvn clean verify` source suite.
|
||||
Ordinary branch pushes additionally qualify Linux AMD64. Tags qualify all five
|
||||
Linux/macOS AMD64/ARM64 and Windows AMD64 binaries, then reuse those artifacts in
|
||||
release and packaging jobs. Manual `full_native: true` qualifies all five without
|
||||
publishing; false runs the source suite only. Publishing requires a tag push;
|
||||
fork PRs cannot enter native/publishing jobs and test tokens have read-only
|
||||
contents permissions. Existing Homebrew credential and packaging PR behavior stay
|
||||
unchanged. Tag runs are not auto-canceled.
|
||||
|
||||
The Intel macOS runner is explicitly `macos-15-intel`; `macos-15` is ARM64.
|
||||
Each native build also checks its actual machine architecture before compilation.
|
||||
See https://docs.github.com/en/actions/reference/runners/github-hosted-runners.
|
||||
|
||||
## Adoption
|
||||
|
||||
After publishing this worker at a reviewed immutable commit SHA, set
|
||||
`QCTL_SHARED_REF` to that SHA and run the orb's
|
||||
`src/scripts/generate_qctl_workflow.py` to produce `.github/workflows/build.yml`.
|
||||
`--check .github/workflows/build.yml` rejects local drift. The corresponding orb
|
||||
command is `generate_qctl_workflow`; the optional rendering job is
|
||||
`qctl_generate_workflow`. This is separate from the Circle pipeline generator.
|
||||
|
||||
Canary the caller before deleting/replacing the existing workflow. Verify full
|
||||
source tests, representative branch native build, manual five-platform output,
|
||||
and existing publishing/packaging permissions. Confirm actual hosted required
|
||||
check names before changing any rules: reusable calls may change their prefixes.
|
||||
Local configuration tests and actionlint do not prove native builds or release
|
||||
credentials. Keep the working native workflow until equivalent hosted evidence
|
||||
exists. No consumer migration or release has been performed by this patch.
|
||||
@@ -0,0 +1,55 @@
|
||||
# qqq-all Circle smoke evidence (opt-in, not yet adopted)
|
||||
|
||||
`qqq-all-release.yml` defaults to genuine GitHub Smoke evidence. Circle mode is
|
||||
explicit `smoke_evidence: circle`, `circle_workflow_id: <UUID>`, with a separately
|
||||
passed reusable secret `CIRCLECI_TOKEN` and `checks: read`. No credential is
|
||||
created or assumed available. The protected worker writes the reviewed orb-owned `qqq_all_release_gate.py` and
|
||||
`verify_all_circle_smoke.py` into its temporary directory and executes that gate
|
||||
against `--root .` (the consumer checkout). No consumer adapter is required.
|
||||
|
||||
The reviewed verifier is embedded verbatim in the reusable worker (a regression
|
||||
test prevents drift). It reads Circle workflow, pipeline, jobs and pipeline
|
||||
workflows, then checks GitHub app 18001's latest same-SHA `verify-and-smoke` Check
|
||||
Run and exact Circle workflow URL. Evidence requires QRun-IO/qqq-all, the release
|
||||
SHA on develop without a tag, a webhook trigger with actor and received time,
|
||||
successful workflow and all jobs, and exactly one successful build-and-test/core/full
|
||||
job each. API/manual triggers are rejected. Circle's webhook metadata does not
|
||||
expose a GitHub event subtype; this proves a develop webhook, not an asserted
|
||||
`push` event field. It is never represented as a GitHub Smoke run.
|
||||
|
||||
Selective reruns are not accepted: explicit rerun ancestry/auto-rerun flags or
|
||||
multiple same-name workflows within a pipeline fail closed. Paginated evidence
|
||||
also fails closed; the tool does not infer omitted jobs or attempts. A newer
|
||||
failed/pending check or different workflow UUID cannot be bypassed by selecting
|
||||
an older success. Both API sources must be readable; errors deny authorization.
|
||||
This conservative policy may require a fresh complete develop pipeline after a
|
||||
failure. Hosted schema/credential verification is still required before enabling.
|
||||
|
||||
## Central gate and rollout
|
||||
|
||||
`src/scripts/qqq_all_release_gate.py` is copied from audited qqq-all commit
|
||||
`e35f1f6b99639eb998340f082fab89c7ac12426c`. Every original validator body is
|
||||
unchanged. Its CLI accepts exactly one complete evidence mode: the original
|
||||
`--smoke-run`/`--smoke-jobs` pair, or `--circle-smoke`. Circle mode checks the schema,
|
||||
repository and SHA, then invokes the same verifier on every nested evidence field.
|
||||
It never treats an arbitrary Boolean or caller-uploaded receipt as proof.
|
||||
|
||||
The original `test_release_gate.py` and `test_release_rc.py` are retained in orb
|
||||
tests with only module/path import adaptations. They still exercise GA/RC limits,
|
||||
immutable dependencies, published POM matching, signed tags, public upstream state
|
||||
and cold public downloads. New mode/parity tests ensure both central scripts match
|
||||
their embedded worker definitions and all source-relative paths remain in the
|
||||
consumer checkout. The consumer's product tests and release bundle script remain.
|
||||
|
||||
Rollout needs a tiny caller passing `smoke_evidence: circle`, the workflow UUID,
|
||||
`checks: read`, and the existing explicitly authorized Circle credential. Validate
|
||||
a real complete develop Circle workflow and secret scope before removing the old
|
||||
GH Smoke workflow. No release-gate implementation should be copied back into a
|
||||
consumer. Existing legacy consumers can keep `smoke_evidence: github` by default.
|
||||
|
||||
The protected `qqq-all-release` environment, release flags, exact annotated signed
|
||||
tag checks, source identity, cold Maven verification, public input receipts,
|
||||
GHCR checks and prepublication develop/tag recheck remain in place. No consumer
|
||||
source changes, credential provisioning, release attempt or publication has been
|
||||
performed. Do not remove the genuine GH Smoke path until the new evidence mode
|
||||
has passed a real complete pipeline and central gate validation.
|
||||
@@ -0,0 +1,120 @@
|
||||
# RC completion without waiting runners
|
||||
|
||||
The reusable `qbit-release-rc.yml` keeps the existing cut entry point. `finalize: false`
|
||||
(the default) briefly merges develop, then records `qbit-rc-intent-<merge SHA>` as a
|
||||
90-day Actions artifact. It does not wait for CircleCI or Central. `finalize: true`
|
||||
accepts `merge_sha`, `bump_sha`, `branch`, and `version` from a publisher callback
|
||||
or explicit recovery retry. The callback is only a hint, never release authority.
|
||||
|
||||
The caller must remain `.github/workflows/release-rc.yml` on the repository default
|
||||
branch. It handles `repository_dispatch` type `qbit-rc-published` and passes those
|
||||
four fields and `finalize: true` to this reusable, with `secrets: inherit` and
|
||||
`contents: write`, `actions: read`, `checks: read`. Existing manual dispatch and merged/labelled
|
||||
PR cut behavior remains in the tiny caller. Add an explicit finalization retry
|
||||
option to manual dispatch; retrying finalization must not request another cut.
|
||||
GitHub documents dispatch/default-branch behavior at:
|
||||
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#repository_dispatch
|
||||
|
||||
## Ownership and provenance
|
||||
|
||||
- A cut atomically creates `refs/heads/automation/qbit-rc-pending` before changing
|
||||
the release branch. The ref initially points at develop and then at the exact
|
||||
merge API response SHA. A second cut fails while it exists. CI must ignore this
|
||||
exact automation branch. The lock has no expiry or automatic takeover.
|
||||
- Cut and finalizer share one repository concurrency group. The pending ref holds
|
||||
ownership between these short runs; workflow concurrency alone cannot do that.
|
||||
- Finalization retrieves the unique unexpired intent artifact and verifies its
|
||||
originating successful `release-rc.yml` run, repository, trigger and attempt.
|
||||
Callback fields must match that immutable intent.
|
||||
- The exact merge SHA must have a successful `verify` (or legacy
|
||||
`publish_release_candidate`) Check Run
|
||||
from CircleCI app ID `18001`; unrelated job statuses cannot authorize release.
|
||||
Terminal publisher failure stops finalization immediately. Pending/absent publication cannot authorize a tag.
|
||||
The RC bump must have exactly that one parent and the release branch must still
|
||||
point to it. A later unrelated bump or an old version is never substituted.
|
||||
- The Central POM must identify the expected artifact/version and have a
|
||||
Last-Modified time after the cut. Missing Central visibility leaves the intent
|
||||
pending, with no tag, no lock release, no sleeping runner.
|
||||
- Tags remain SSH-signed annotated tags using `QRUN_TAG_SIGNING_KEY`. Temporary
|
||||
key/repository/intent files are cleaned on all shell exits. Existing annotated
|
||||
tags must resolve to the exact bump; duplicate delivery cannot retarget a tag.
|
||||
A tag created before an interrupted release operation can finish the missing
|
||||
prerelease on retry. Ownership is compared again before lock deletion.
|
||||
|
||||
## Automatic retry and rollout
|
||||
|
||||
The orb's single centrally scheduled `rc_finalize_sweep` job uses the existing
|
||||
`qqq-maven-registry-credentials` context's `GITHUB_TOKEN` (or `GH_TOKEN`) and an
|
||||
explicit JSON allowlist, not `.github`'s repository-limited Actions token. It
|
||||
reads only pending locks, validates cut provenance and exact publisher success,
|
||||
checks Central availability, and redispatches the same immutable candidate.
|
||||
Idle repositories cause one read and no finalizer job. Central delay causes a
|
||||
later scheduled retry, not allocated polling. Terminal failure is visible in
|
||||
sweep job failure; the lock stays for diagnosis. Bound: 64 repositories,
|
||||
500 GitHub calls, 480 seconds plus the current bounded request; no infinite retry.
|
||||
The root owns the single Circle schedule and confirms existing credential access
|
||||
before enabling it. No new credential or service is required by this patch.
|
||||
|
||||
Roll out shared reusable and default-branch callers first, then the released orb
|
||||
callback/profile plus automation-branch exclusion. Enable the one central sweep
|
||||
only after checking the allowlist and representative cross-repository API access.
|
||||
The orb callback must be opt-in until callers exist, RC-only, after successful
|
||||
deployment AND successful pushed bump, with remote head and direct parent checks.
|
||||
Do not emit a callback after the legacy warning-only failed version push.
|
||||
|
||||
## Recovery
|
||||
|
||||
A failed cut, expired artifact, failed publisher or conflicting tag deliberately
|
||||
retains the lock. Inspect the cut run, lock SHA, release branch, Circle result,
|
||||
Central artifact and tag/release before changing state. If the cut is recoverable,
|
||||
retry the same publication/finalization; do not delete the lock merely to unblock
|
||||
another version. For an abandoned cut, an authorized operator must compare the
|
||||
current lock with the recorded expected SHA immediately before deleting that
|
||||
exact ref, under the same release lane. Never delete a different cut's lock or
|
||||
retag a published version. A missing/expired trusted artifact requires explicit
|
||||
release-captain reconciliation; the sweep does not invent provenance.
|
||||
|
||||
## Local checks
|
||||
|
||||
`python -m unittest discover -s tests -v` exercises the exact inline evaluator.
|
||||
`actionlint -shellcheck= .github/workflows/qbit-release-rc.yml` validates Actions
|
||||
syntax. Full actionlint with Windows native ShellCheck hung locally and was
|
||||
stopped; Linux actionlint/ShellCheck and end-to-end credential/callback rollout
|
||||
verification remain required. The orb has separate sweep/dispatch fixture tests.
|
||||
|
||||
### Published upload timeout recovery
|
||||
|
||||
A Circle deployment step can time out after Central has accepted and published its
|
||||
bundle. Use the canonical caller's explicit manual `recover` input with the existing
|
||||
`merge_sha`, `branch`, `version` and original `circle_build`. Run with `dry_run: true`
|
||||
first to verify evidence without changing the branch, tag, release or pending lock.
|
||||
This mode never builds, uploads, cuts a new candidate, or changes the failed Circle check.
|
||||
|
||||
The pinned orb worker requires the original successful cut intent and unchanged lock,
|
||||
the exact failed Circle workflow/check, a final deployment timeout after all preceding
|
||||
actions (including Maven Verify) succeeded, exactly one successful upload receipt,
|
||||
and an authenticated Central `PUBLISHED` response matching every staged coordinate.
|
||||
It also checks public POM coordinates and publication timestamps after the cut.
|
||||
Existing organization `CENTRAL_USERNAME` and `CENTRAL_PASSWORD` secrets authenticate
|
||||
only the Central status request; Circle evidence uses its public API. Redirects are
|
||||
rejected and credentials are never included in the recovery receipt.
|
||||
|
||||
After verification, recovery creates only the missing signed version bump as a direct
|
||||
child of the original release merge, using a normal fast-forward push. An existing
|
||||
bump must pass the same parent/version checks. The existing signed-tag/prerelease
|
||||
finalizer then completes the candidate and compares lock ownership before cleanup.
|
||||
A later explicit recovery retry verifies the original receipt again. Once the lock
|
||||
is gone, the completed release needs no recovery dispatch. Ordinary callbacks and
|
||||
scheduled reconciliation retain the requirement for a successful Circle publisher.
|
||||
|
||||
Central status API: https://central.sonatype.org/publish/publish-portal-api/
|
||||
|
||||
### Auditing independent worker revisions
|
||||
|
||||
The estate audit accepts `rc_worker_sha` in a profile or repository policy. For
|
||||
example, set `profiles.qbit.rc_worker_sha` to the approved immutable RC worker
|
||||
commit and keep `--worker-sha` at the approved revision for unchanged native
|
||||
workers. The audit still compares every caller to its exact canonical template
|
||||
and rejects mutable or mismatched pins. This avoids a fleet-wide native caller
|
||||
update when only RC release behavior changes. Required-check policy is separate;
|
||||
omitting it continues to report enforcement as unknown.
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Embed profile resources before Circle packs/interpolates its own syntax."""
|
||||
import base64
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import zlib
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
source = root / "src/scripts/generate_pipeline.py"
|
||||
output = root / "src/scripts/packed_generate_pipeline.py"
|
||||
text = source.read_text(encoding="utf-8")
|
||||
start = text.index("# BEGIN PROFILE RESOURCES")
|
||||
end = text.index("# END PROFILE RESOURCES") + len("# END PROFILE RESOURCES")
|
||||
embedded = ["# Generated by scripts/pack_pipeline.py; edit source/resources, then regenerate.", "import base64", "import zlib"]
|
||||
for variable, name in (("CORE_TEMPLATE", "core"), ("MATERIAL_TEMPLATE", "frontend-material"), ("VOYAGE_TEMPLATE", "voyage"), ("NEXT_TEMPLATE", "frontend-next"), ("ALL_TEMPLATE", "all"), ("STARTER_TEMPLATE", "app-starter"), ("ANDROID_TEMPLATE", "android"), ("POLICY_TEMPLATE", "mcp-policy"), ("REPOSITORY_POLICY_TEMPLATE", "repository-policy"), ("MARKETING_TEMPLATE", "marketing"), ("HOMEBREW_TEMPLATE", "homebrew-tap"), ("APPLICATION_TEMPLATE", "application-template")):
|
||||
resource = (source.parent / "templates" / (name + ".json")).read_text(encoding="utf-8").encode("utf-8")
|
||||
payload = base64.b64encode(zlib.compress(resource, level=9)).decode("ascii")
|
||||
embedded.append(f'{variable} = json.loads(zlib.decompress(base64.b64decode("{payload}")))')
|
||||
packed = text[:start] + "\n".join(embedded) + text[end:]
|
||||
if len(packed.encode("utf-8")) > 100_000:
|
||||
sys.exit("Packed generator exceeds the tested CircleCI command-argument budget")
|
||||
if "--check" in sys.argv:
|
||||
if not output.exists() or output.read_text(encoding="utf-8") != packed:
|
||||
sys.exit("Packed generator is stale; run python3 scripts/pack_pipeline.py")
|
||||
else:
|
||||
output.write_text(packed, encoding="utf-8", newline="\n")
|
||||
+3
-3
@@ -4,11 +4,11 @@ version: 2.1
|
||||
|
||||
description: >
|
||||
QQQ Orb to handle the branching, testing, releasing, and auto updating of
|
||||
all maven and npm based projects within the Kingsrook/QRunIO Repo world.
|
||||
all Maven and npm based projects within the QRun-IO ecosystem.
|
||||
|
||||
display:
|
||||
home_url: "https://www.qrun.io"
|
||||
source_url: "https://github.com/Kingsrook/qqq-orb"
|
||||
home_url: "https://github.com/QRun-IO/qqq-orb"
|
||||
source_url: "https://github.com/QRun-IO/qqq-orb"
|
||||
|
||||
orbs:
|
||||
browser-tools: circleci/browser-tools@1.4.7
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
description: >
|
||||
Collects all security scan reports into a central location for artifact
|
||||
storage. Generates a summary.txt with finding counts from each tool.
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Collect Security Reports
|
||||
command: <<include(scripts/collect_security_reports.sh)>>
|
||||
when: always
|
||||
@@ -0,0 +1,9 @@
|
||||
description: >
|
||||
Collects SpotBugs and PMD reports from all modules into a central
|
||||
location for artifact storage. Generates a summary report.
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Collect Static Analysis Reports
|
||||
command: <<include(scripts/collect_static_analysis_reports.sh)>>
|
||||
when: always
|
||||
@@ -10,6 +10,11 @@ description: >
|
||||
- Collects JUnit XML test results
|
||||
- Stores test results and screenshots
|
||||
- Saves Maven cache for future builds
|
||||
parameters:
|
||||
build_before_test:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Build the React app first; combined jobs already build it with frontend_build"
|
||||
steps:
|
||||
# Ensure no stale Chrome/Driver is shadowing the PATH (your base image had Chrome 109)
|
||||
- run:
|
||||
@@ -17,7 +22,7 @@ steps:
|
||||
command: <<include(scripts/frontend_test_cleanup.sh)>>
|
||||
|
||||
# Install current Chrome; DO NOT install chromedriver (let Selenium 4 auto-manage it)
|
||||
- browser-tools/install-chrome
|
||||
- install_chrome
|
||||
|
||||
# System libs Chrome needs in headless CI
|
||||
- run:
|
||||
@@ -52,6 +57,8 @@ steps:
|
||||
# GPG signing will happen later in mvn_jar_deploy when deploying to Maven Central.
|
||||
- run:
|
||||
name: Build app, start server, run tests
|
||||
environment:
|
||||
PARAM_BUILD_BEFORE_TEST: << parameters.build_before_test >>
|
||||
command: <<include(scripts/frontend_test_run.sh)>>
|
||||
|
||||
# Always collect and publish test results & screenshots
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
description: Read a strict QQQ manifest and continue with its standardized pipeline.
|
||||
parameters:
|
||||
orb_version:
|
||||
type: string
|
||||
description: Explicit orb version, identical to the setup import and manifest.
|
||||
manifest:
|
||||
type: string
|
||||
default: .qqq-ci.yml
|
||||
description: Repository manifest path.
|
||||
mongo_bind_diagnostics:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Core owned Mongo fixture diagnostics.
|
||||
run_playwright:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Material frontend Playwright validation before test or snapshot publication.
|
||||
next_acceptance_bundle_url:
|
||||
type: string
|
||||
default: ""
|
||||
description: Core Next acceptance bundle URL.
|
||||
next_acceptance_bundle_sha256:
|
||||
type: string
|
||||
default: ""
|
||||
description: Core Next acceptance bundle SHA256.
|
||||
next_acceptance_receipt_sha256:
|
||||
type: string
|
||||
default: ""
|
||||
description: Core Next acceptance receipt SHA256.
|
||||
steps:
|
||||
- run:
|
||||
name: Install manifest parser
|
||||
command: python3 -m pip install --disable-pip-version-check PyYAML==6.0.3
|
||||
- validate_standard:
|
||||
orb_version: << parameters.orb_version >>
|
||||
manifest: << parameters.manifest >>
|
||||
- run:
|
||||
name: Generate and continue standardized pipeline
|
||||
shell: python3
|
||||
environment:
|
||||
QQQ_CI_MANIFEST: << parameters.manifest >>
|
||||
QQQ_CI_ORB_VERSION: << parameters.orb_version >>
|
||||
QQQ_CI_CONTINUE: "true"
|
||||
QQQ_CI_MONGO_DIAGNOSTICS: << parameters.mongo_bind_diagnostics >>
|
||||
QQQ_CI_RUN_PLAYWRIGHT: << parameters.run_playwright >>
|
||||
QQQ_CI_NEXT_ACCEPTANCE_BUNDLE_URL: << parameters.next_acceptance_bundle_url >>
|
||||
QQQ_CI_NEXT_ACCEPTANCE_BUNDLE_SHA256: << parameters.next_acceptance_bundle_sha256 >>
|
||||
QQQ_CI_NEXT_ACCEPTANCE_RECEIPT_SHA256: << parameters.next_acceptance_receipt_sha256 >>
|
||||
command: << include(scripts/packed_generate_pipeline.py) >>
|
||||
@@ -0,0 +1,12 @@
|
||||
description: Emit the canonical qctl native-platform GitHub bridge pinned to a reviewed central worker SHA.
|
||||
parameters:
|
||||
shared_ref:
|
||||
type: string
|
||||
description: Immutable 40-character QRun-IO/.github commit containing qctl-native.yml.
|
||||
steps:
|
||||
- run:
|
||||
name: Generate qctl native workflow caller
|
||||
shell: python3
|
||||
environment:
|
||||
QCTL_SHARED_REF: << parameters.shared_ref >>
|
||||
command: <<include(scripts/generate_qctl_workflow.py)>>
|
||||
@@ -1,11 +1,12 @@
|
||||
description: >
|
||||
Full checkout of the repository
|
||||
- Clones the repository
|
||||
- Checks out the commit specified by CIRCLE_SHA1
|
||||
Full checkout of the repository with complete git history.
|
||||
Uses CircleCI's checkout (handles SSH keys and known_hosts)
|
||||
then fetches full history for version calculation.
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Full checkout
|
||||
name: Fetch full git history
|
||||
command: |
|
||||
git clone "$CIRCLE_REPOSITORY_URL" .
|
||||
git checkout "$CIRCLE_SHA1"
|
||||
git fetch --unshallow || true
|
||||
git fetch --tags || true
|
||||
@@ -2,7 +2,18 @@ description: >
|
||||
Git operations for version management
|
||||
- Adds SSH keys for Git operations
|
||||
- Sets up Git identity for version commits
|
||||
- Commits version changes if modified
|
||||
- Commits version changes if modified (skipped for feature branches)
|
||||
|
||||
parameters:
|
||||
require_pushed_version:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Require and record a successful version push for release completion"
|
||||
branch_type:
|
||||
type: string
|
||||
default: "snapshot"
|
||||
description: "Branch type: snapshot, release_candidate, release, hotfix, or feature"
|
||||
|
||||
steps:
|
||||
- add_ssh_keys # injects the CircleCI User Key (write-capable)
|
||||
- run:
|
||||
@@ -10,4 +21,7 @@ steps:
|
||||
command: <<include(scripts/manage_version_git_config.sh)>>
|
||||
- run:
|
||||
name: Commit version change if modified
|
||||
environment:
|
||||
BRANCH_TYPE: << parameters.branch_type >>
|
||||
REQUIRE_PUSHED_VERSION: << parameters.require_pushed_version >>
|
||||
command: <<include(scripts/manage_version_commit.sh)>>
|
||||
@@ -0,0 +1,5 @@
|
||||
description: Install stable Chrome using only its signed repository and existing Ubuntu dependency indexes.
|
||||
steps:
|
||||
- run:
|
||||
name: Install Google Chrome
|
||||
command: <<include(scripts/install_chrome.sh)>>
|
||||
@@ -0,0 +1,31 @@
|
||||
description: >
|
||||
Installs Eclipse Temurin JDK and Maven on Ubuntu machine executor.
|
||||
Sets JAVA_HOME and updates PATH for subsequent steps.
|
||||
Configures unattended package installation centrally.
|
||||
Optionally installs Node.js for frontend builds.
|
||||
Also verifies Docker is available (required for Testcontainers/LocalStack tests).
|
||||
|
||||
parameters:
|
||||
java_version:
|
||||
type: string
|
||||
default: "21"
|
||||
description: >
|
||||
Java major version to install (e.g., "17", "21").
|
||||
Uses Eclipse Temurin (AdoptOpenJDK successor) distribution.
|
||||
install_node:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Whether to also install Node.js (for frontend builds)"
|
||||
node_version:
|
||||
type: string
|
||||
default: "20"
|
||||
description: "Node.js major version to install (e.g., '18', '20')"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Install Java << parameters.java_version >> and build tools
|
||||
environment:
|
||||
PARAM_JAVA_VERSION: << parameters.java_version >>
|
||||
PARAM_INSTALL_NODE: << parameters.install_node >>
|
||||
PARAM_NODE_VERSION: << parameters.node_version >>
|
||||
command: <<include(scripts/install_java.sh)>>
|
||||
+25
-17
@@ -1,23 +1,31 @@
|
||||
description: >
|
||||
Builds the project and sets up the development environment
|
||||
- Restores Maven dependency cache for faster builds
|
||||
- Installs Chrome/ChromeDriver for browser testing
|
||||
- Compiles the project with Maven
|
||||
- Saves Maven cache for future builds
|
||||
Prepares Maven settings and restores the dependency repository.
|
||||
Browser installation and preliminary compilation retain their legacy defaults.
|
||||
The complete verification lifecycle saves the warmed repository.
|
||||
|
||||
parameters:
|
||||
install_browsers:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Install Chrome and ChromeDriver for browser tests"
|
||||
compile_before_verify:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run preliminary compile; disable when a later lifecycle compiles the project"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Setup Maven Settings
|
||||
command: <<include(scripts/setup_maven_settings.sh)>>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- browser-tools/install-chrome
|
||||
- browser-tools/install-chromedriver
|
||||
- run:
|
||||
name: Run Maven Compile
|
||||
command: <<include(scripts/mvn_build_compile.sh)>>
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- mvn_cache_restore
|
||||
- when:
|
||||
condition: << parameters.install_browsers >>
|
||||
steps:
|
||||
- install_chrome
|
||||
- browser-tools/install-chromedriver
|
||||
- when:
|
||||
condition: << parameters.compile_before_verify >>
|
||||
steps:
|
||||
- run:
|
||||
name: Run Maven Compile
|
||||
command: <<include(scripts/mvn_build_compile.sh)>>
|
||||
@@ -0,0 +1,12 @@
|
||||
description: >
|
||||
Restores Maven repository downloads using all tracked Maven inputs.
|
||||
A compatible repository fallback reuses downloads after dependency changes.
|
||||
Maven lifecycle invocations must refresh SNAPSHOT dependencies.
|
||||
steps:
|
||||
- run:
|
||||
name: Fingerprint Maven inputs
|
||||
command: <<include(scripts/maven_cache_fingerprint.sh)>>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v2-maven-repository-{{ arch }}-{{ checksum "/tmp/circleci/maven-cache-fingerprint" }}
|
||||
- v2-maven-repository-{{ arch }}-
|
||||
@@ -0,0 +1,13 @@
|
||||
description: >
|
||||
Saves the Maven repository after a successful complete lifecycle.
|
||||
Includes snapshot metadata, classifiers and installed reactor artifacts;
|
||||
excludes user settings and credentials outside the repository.
|
||||
Call after verify/install, never after preliminary compile alone.
|
||||
steps:
|
||||
- run:
|
||||
name: Fingerprint verified Maven inputs
|
||||
command: <<include(scripts/maven_cache_fingerprint.sh)>>
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2/repository
|
||||
key: v2-maven-repository-{{ arch }}-{{ checksum "/tmp/circleci/maven-cache-fingerprint" }}
|
||||
@@ -1,11 +1,16 @@
|
||||
description: >
|
||||
Publishes artifacts to Maven Central (Sonatype Central Portal)
|
||||
- Restores Maven dependency cache
|
||||
- Debugs Maven settings to verify configuration
|
||||
- Configures Maven credentials without logging settings
|
||||
- Sets up GPG signing for artifact verification
|
||||
- Deploys signed artifacts to Maven Central using release profile
|
||||
- Deploys signed artifacts and waits for confirmed Central release publication
|
||||
- Saves Maven cache for future builds
|
||||
|
||||
parameters:
|
||||
skip_verified_analysis:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Skip repeated SpotBugs and PMD only after this job has completed mvn_verify"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Setup Maven Settings
|
||||
@@ -15,6 +20,11 @@ steps:
|
||||
command: <<include(scripts/mvn_jar_deploy_gpg_setup.sh)>>
|
||||
- run:
|
||||
name: Publish to Sonatype Central (releases and SNAPSHOTs)
|
||||
# Central's native publication wait can be silent for its 30-minute limit.
|
||||
# Let Maven return its real result before CircleCI's inactivity watchdog.
|
||||
no_output_timeout: 35m
|
||||
environment:
|
||||
QQQ_SKIP_VERIFIED_ANALYSIS: << parameters.skip_verified_analysis >>
|
||||
command: <<include(scripts/mvn_jar_deploy.sh)>>
|
||||
- save_cache:
|
||||
paths:
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
description: >
|
||||
Runs PMD static analysis on Maven project.
|
||||
Detects code quality issues, potential bugs, and style violations.
|
||||
Requires maven-pmd-plugin configured in project pom.xml.
|
||||
|
||||
parameters:
|
||||
fail_on_violation:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if PMD finds violations"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Run PMD Analysis
|
||||
environment:
|
||||
PMD_FAIL_ON_VIOLATION: << parameters.fail_on_violation >>
|
||||
command: <<include(scripts/mvn_pmd.sh)>>
|
||||
@@ -0,0 +1,18 @@
|
||||
description: >
|
||||
Runs SpotBugs static analysis on Maven project.
|
||||
Reports potential bugs including null pointer issues, resource leaks,
|
||||
and security vulnerabilities (via FindSecBugs plugin).
|
||||
Requires spotbugs-maven-plugin configured in project pom.xml.
|
||||
|
||||
parameters:
|
||||
fail_on_error:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if SpotBugs finds bugs"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Run SpotBugs Analysis
|
||||
environment:
|
||||
SPOTBUGS_FAIL_ON_ERROR: << parameters.fail_on_error >>
|
||||
command: <<include(scripts/mvn_spotbugs.sh)>>
|
||||
@@ -1,6 +1,6 @@
|
||||
description: >
|
||||
Runs the complete Maven lifecycle including tests and generates reports
|
||||
- Restores Maven dependency cache
|
||||
- Saves the complete Maven dependency repository after successful verification
|
||||
- Runs Maven verify (compile, test, package, verify)
|
||||
- Collects JaCoCo code coverage reports
|
||||
- Stores test output artifacts
|
||||
@@ -13,6 +13,7 @@ steps:
|
||||
- run:
|
||||
name: Run Maven Verify
|
||||
command: <<include(scripts/mvn_verify.sh)>>
|
||||
- mvn_cache_save
|
||||
- run:
|
||||
name: Collect JaCoCo reports
|
||||
command: <<include(scripts/collect_jacoco_reports.sh)>>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
description: >
|
||||
Runs the production build for a Node.js application
|
||||
- Executes the build script with timing output
|
||||
|
||||
parameters:
|
||||
pkg_manager:
|
||||
type: string
|
||||
default: "pnpm"
|
||||
description: "Package manager to use (e.g., 'pnpm', 'npm', 'yarn')."
|
||||
build_script:
|
||||
type: string
|
||||
default: "build"
|
||||
description: "Name of the build script in package.json."
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Production build"
|
||||
environment:
|
||||
NODE_PKG_MANAGER: << parameters.pkg_manager >>
|
||||
BUILD_SCRIPT: << parameters.build_script >>
|
||||
command: <<include(scripts/node_app_build.sh)>>
|
||||
@@ -0,0 +1,31 @@
|
||||
description: >
|
||||
Runs Playwright end-to-end tests for a Node.js application
|
||||
- Installs Playwright browsers
|
||||
- Runs e2e test suite producing JUnit output
|
||||
- Stores test results and Playwright traces as artifacts
|
||||
|
||||
parameters:
|
||||
pkg_manager:
|
||||
type: string
|
||||
default: "pnpm"
|
||||
description: "Package manager to use (e.g., 'pnpm', 'npm', 'yarn')."
|
||||
e2e_script:
|
||||
type: string
|
||||
default: "test:e2e"
|
||||
description: "Name of the e2e test script in package.json."
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Run Playwright e2e tests"
|
||||
environment:
|
||||
NODE_PKG_MANAGER: << parameters.pkg_manager >>
|
||||
E2E_SCRIPT: << parameters.e2e_script >>
|
||||
command: <<include(scripts/node_app_e2e.sh)>>
|
||||
- store_test_results:
|
||||
path: test-results/e2e
|
||||
- store_artifacts:
|
||||
path: test-results/e2e
|
||||
destination: e2e-results
|
||||
- store_artifacts:
|
||||
path: playwright-report
|
||||
destination: playwright-report
|
||||
@@ -0,0 +1,72 @@
|
||||
description: >
|
||||
Installs dependencies for a Node.js application
|
||||
- Restores dependency cache
|
||||
- Runs install via configured package manager (pnpm, npm, yarn)
|
||||
- Saves dependency cache
|
||||
|
||||
parameters:
|
||||
pkg_manager:
|
||||
type: string
|
||||
default: "pnpm"
|
||||
description: "Package manager to use (e.g., 'pnpm', 'npm', 'yarn')."
|
||||
|
||||
steps:
|
||||
# Restore cache using only the lockfile for the configured pkg manager.
|
||||
# All three lockfiles cannot be checksummed simultaneously — CircleCI
|
||||
# fails hard if any referenced file doesn't exist.
|
||||
- when:
|
||||
condition:
|
||||
equal: [ pnpm, << parameters.pkg_manager >> ]
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- node-app-v1-pnpm-{{ checksum "pnpm-lock.yaml" }}
|
||||
- node-app-v1-pnpm-
|
||||
- when:
|
||||
condition:
|
||||
equal: [ npm, << parameters.pkg_manager >> ]
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- node-app-v1-npm-{{ checksum "package-lock.json" }}
|
||||
- node-app-v1-npm-
|
||||
- when:
|
||||
condition:
|
||||
equal: [ yarn, << parameters.pkg_manager >> ]
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- node-app-v1-yarn-{{ checksum "yarn.lock" }}
|
||||
- node-app-v1-yarn-
|
||||
- run:
|
||||
name: "Install dependencies"
|
||||
environment:
|
||||
NODE_PKG_MANAGER: << parameters.pkg_manager >>
|
||||
command: <<include(scripts/node_app_install.sh)>>
|
||||
- when:
|
||||
condition:
|
||||
equal: [ pnpm, << parameters.pkg_manager >> ]
|
||||
steps:
|
||||
- save_cache:
|
||||
key: node-app-v1-pnpm-{{ checksum "pnpm-lock.yaml" }}
|
||||
paths:
|
||||
- node_modules
|
||||
- ~/.cache/pnpm
|
||||
- when:
|
||||
condition:
|
||||
equal: [ npm, << parameters.pkg_manager >> ]
|
||||
steps:
|
||||
- save_cache:
|
||||
key: node-app-v1-npm-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- node_modules
|
||||
- ~/.npm
|
||||
- when:
|
||||
condition:
|
||||
equal: [ yarn, << parameters.pkg_manager >> ]
|
||||
steps:
|
||||
- save_cache:
|
||||
key: node-app-v1-yarn-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- node_modules
|
||||
- ~/.cache/yarn
|
||||
@@ -0,0 +1,37 @@
|
||||
description: >
|
||||
Runs type-check, lint, and unit tests for a Node.js application
|
||||
- Runs type checking, linting, and tests via package.json scripts
|
||||
- Stores test results as artifacts
|
||||
|
||||
parameters:
|
||||
pkg_manager:
|
||||
type: string
|
||||
default: "pnpm"
|
||||
description: "Package manager to use (e.g., 'pnpm', 'npm', 'yarn')."
|
||||
typecheck_script:
|
||||
type: string
|
||||
default: "typecheck"
|
||||
description: "Name of the typecheck script in package.json."
|
||||
lint_script:
|
||||
type: string
|
||||
default: "lint"
|
||||
description: "Name of the lint script in package.json."
|
||||
test_script:
|
||||
type: string
|
||||
default: "test"
|
||||
description: "Name of the test script in package.json."
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Run type-check, lint, and tests"
|
||||
environment:
|
||||
NODE_PKG_MANAGER: << parameters.pkg_manager >>
|
||||
TYPECHECK_SCRIPT: << parameters.typecheck_script >>
|
||||
LINT_SCRIPT: << parameters.lint_script >>
|
||||
TEST_SCRIPT: << parameters.test_script >>
|
||||
command: <<include(scripts/node_app_test.sh)>>
|
||||
- store_test_results:
|
||||
path: test-results
|
||||
- store_artifacts:
|
||||
path: test-results
|
||||
destination: test-results
|
||||
@@ -3,7 +3,13 @@ description: >
|
||||
- Adds SSH keys for Git operations
|
||||
- Sets up Git identity for version commits
|
||||
- Synchronizes NPM version
|
||||
- Commits version changes if modified
|
||||
- Commits version changes if modified (skipped for feature and snapshot builds)
|
||||
|
||||
parameters:
|
||||
branch_type:
|
||||
type: string
|
||||
default: "snapshot"
|
||||
description: "Branch type: snapshot, release_candidate, release, hotfix, or feature"
|
||||
|
||||
steps:
|
||||
- add_ssh_keys # injects the CircleCI User Key (write-capable)
|
||||
@@ -15,4 +21,6 @@ steps:
|
||||
command: <<include(scripts/sync-npm-version.sh)>>
|
||||
- run:
|
||||
name: Commit version changes if modified
|
||||
environment:
|
||||
BRANCH_TYPE: << parameters.branch_type >>
|
||||
command: <<include(scripts/node_version_commit.sh)>>
|
||||
@@ -3,10 +3,21 @@ description: >
|
||||
- Sets up NPM authentication
|
||||
- Publishes the package to NPM
|
||||
|
||||
parameters:
|
||||
trusted_publishing:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Authenticate npm publish using the CircleCI job's OIDC identity."
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Setup NPM authentication"
|
||||
command: <<include(scripts/node_npm_auth.sh)>>
|
||||
- unless:
|
||||
condition: << parameters.trusted_publishing >>
|
||||
steps:
|
||||
- run:
|
||||
name: "Setup NPM authentication"
|
||||
command: <<include(scripts/node_npm_auth.sh)>>
|
||||
- run:
|
||||
name: "Publish to NPM"
|
||||
command: npm publish --access public
|
||||
environment:
|
||||
QQQ_NPM_TRUSTED_PUBLISHING: << parameters.trusted_publishing >>
|
||||
command: <<include(scripts/node_npm_publish.sh)>>
|
||||
@@ -0,0 +1,12 @@
|
||||
description: Reconcile pending RC intents and dispatch verified finalizers without waiting runners.
|
||||
parameters:
|
||||
repositories:
|
||||
type: string
|
||||
description: Explicit JSON allowlist of QRun-IO qbit repositories (maximum 64).
|
||||
steps:
|
||||
- run:
|
||||
name: Reconcile pending release candidates
|
||||
environment:
|
||||
RC_REPOSITORIES_JSON: << parameters.repositories >>
|
||||
shell: python3
|
||||
command: <<include(scripts/rc_finalize_sweep.py)>>
|
||||
@@ -0,0 +1,9 @@
|
||||
description: >
|
||||
Generates a CycloneDX Software Bill of Materials (SBOM) in JSON format.
|
||||
Uses the CycloneDX Maven plugin to produce an aggregate BOM across all
|
||||
modules. No pom.xml changes required -- runs as a CLI Maven goal.
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Generate CycloneDX SBOM
|
||||
command: <<include(scripts/run_cyclonedx_sbom.sh)>>
|
||||
@@ -0,0 +1,17 @@
|
||||
description: >
|
||||
Runs Gitleaks secret detection scan on the repository.
|
||||
Detects hardcoded secrets, API keys, passwords, and tokens in source code
|
||||
and git history. Reports findings in JSON format.
|
||||
|
||||
parameters:
|
||||
fail_on_findings:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if Gitleaks detects secrets"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Run Gitleaks Secret Detection
|
||||
environment:
|
||||
GITLEAKS_FAIL_ON_FINDINGS: << parameters.fail_on_findings >>
|
||||
command: <<include(scripts/run_gitleaks.sh)>>
|
||||
@@ -0,0 +1,32 @@
|
||||
description: >
|
||||
Runs OWASP Dependency-Check to scan project dependencies for known CVEs.
|
||||
Uses the dependency-check-maven plugin as a CLI goal (no pom.xml changes needed).
|
||||
Includes retry logic (3 attempts) for NVD database download reliability.
|
||||
Supports NVD API key for faster database updates via NVD_API_KEY env var.
|
||||
|
||||
parameters:
|
||||
fail_on_cvss:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if vulnerabilities exceed the CVSS threshold"
|
||||
cvss_threshold:
|
||||
type: string
|
||||
default: "7"
|
||||
description: "CVSS score threshold (0-10). Vulnerabilities at or above this score are flagged."
|
||||
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-owasp-nvd-cache-{{ .Branch }}
|
||||
- v1-owasp-nvd-cache-
|
||||
- run:
|
||||
name: Run OWASP Dependency-Check
|
||||
environment:
|
||||
OWASP_FAIL_ON_CVSS: << parameters.fail_on_cvss >>
|
||||
OWASP_CVSS_THRESHOLD: << parameters.cvss_threshold >>
|
||||
command: <<include(scripts/run_owasp_dependency_check.sh)>>
|
||||
no_output_timeout: 30m
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2/repository/org/owasp
|
||||
key: v1-owasp-nvd-cache-{{ .Branch }}-{{ epoch }}
|
||||
@@ -0,0 +1,22 @@
|
||||
description: >
|
||||
Runs Semgrep SAST (Static Application Security Testing) analysis.
|
||||
Scans source code for security vulnerabilities, code quality issues,
|
||||
and OWASP Top 10 patterns. Produces JSON and SARIF reports.
|
||||
|
||||
parameters:
|
||||
fail_on_findings:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if Semgrep finds security issues"
|
||||
rulesets:
|
||||
type: string
|
||||
default: "p/java p/owasp-top-ten p/security-audit"
|
||||
description: "Space-separated list of Semgrep rulesets to run"
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Run Semgrep SAST Analysis
|
||||
environment:
|
||||
SEMGREP_FAIL_ON_FINDINGS: << parameters.fail_on_findings >>
|
||||
SEMGREP_RULESETS: << parameters.rulesets >>
|
||||
command: <<include(scripts/run_semgrep.sh)>>
|
||||
@@ -0,0 +1,19 @@
|
||||
description: >
|
||||
Enforces the canonical setup caller and profile-specific pipeline parameters.
|
||||
Run after installing pinned PyYAML and before generating the continuation.
|
||||
parameters:
|
||||
orb_version:
|
||||
type: string
|
||||
description: Exact version imported by setup and pinned in the manifest.
|
||||
manifest:
|
||||
type: string
|
||||
default: .qqq-ci.yml
|
||||
description: Standard manifest path (only .qqq-ci.yml is accepted).
|
||||
steps:
|
||||
- run:
|
||||
name: Validate central CI ownership
|
||||
shell: python3
|
||||
environment:
|
||||
QQQ_CI_ORB_VERSION: << parameters.orb_version >>
|
||||
QQQ_CI_MANIFEST: << parameters.manifest >>
|
||||
command: <<include(scripts/validate_standard.py)>>
|
||||
+10
-1
@@ -1,6 +1,7 @@
|
||||
description: >
|
||||
Complete CI/CD workflow example for Maven-based projects using GitFlow branching strategy.
|
||||
This example demonstrates how to use the qqq-orb for automated building, testing, and releasing.
|
||||
This example demonstrates how to use the qqq-orb for automated building, testing, releasing,
|
||||
and security scanning.
|
||||
|
||||
usage:
|
||||
version: 2.1
|
||||
@@ -72,3 +73,11 @@ usage:
|
||||
branches:
|
||||
only:
|
||||
- /hotfix\/.*/
|
||||
|
||||
security_scan:
|
||||
jobs:
|
||||
- qqq-orb/security_scan:
|
||||
context: [ qqq-maven-registry-credentials, qqq-security-credentials ]
|
||||
filters:
|
||||
branches:
|
||||
only: [ develop ]
|
||||
+11
-11
@@ -1,18 +1,18 @@
|
||||
description: >
|
||||
Java/OpenJDK executor using CircleCI's cimg/openjdk image.
|
||||
Provides Java runtime with Maven and Gradle pre-installed.
|
||||
Use the 'tag' parameter to select Java version (17.0, 21.0, etc).
|
||||
|
||||
docker:
|
||||
- image: 'cimg/openjdk:<<parameters.tag>>'
|
||||
Java/OpenJDK machine executor with Docker support.
|
||||
Uses Ubuntu 22.04 VM with Docker pre-installed.
|
||||
Java is installed via the install_java command.
|
||||
Required for tests that use Testcontainers or LocalStack Docker extensions.
|
||||
|
||||
parameters:
|
||||
tag:
|
||||
default: "21.0"
|
||||
image:
|
||||
default: ubuntu-2204:current
|
||||
description: >
|
||||
Java/OpenJDK version tag. Common values: 17.0, 21.0.
|
||||
See https://hub.docker.com/r/cimg/openjdk/tags for all available tags.
|
||||
Use '-node' suffix for Node.js support (e.g., '21.0-node').
|
||||
Ubuntu machine image tag. Use 'current' for latest or pin to specific
|
||||
version like 'ubuntu-2204:2023.02.1' for reproducibility.
|
||||
type: string
|
||||
|
||||
machine:
|
||||
image: '<<parameters.image>>'
|
||||
|
||||
resource_class: large
|
||||
@@ -0,0 +1,12 @@
|
||||
description: Publish a develop image only from the verified and smoke-tested workspace artifact.
|
||||
executor: java
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Verify source and artifact identity
|
||||
command: <<include(scripts/qqq_all_artifact.sh)>>
|
||||
- run:
|
||||
name: Publish public develop image
|
||||
command: <<include(scripts/qqq_all_develop_image.sh)>>
|
||||
@@ -0,0 +1,33 @@
|
||||
description: Run actual core HTTP or private full Compose acceptance against the exact verified jar.
|
||||
executor: java
|
||||
parameters:
|
||||
profile:
|
||||
type: enum
|
||||
enum: [core, full]
|
||||
steps:
|
||||
- checkout
|
||||
- install_java:
|
||||
java_version: "21"
|
||||
- mvn_cache_restore
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Verify source and artifact identity
|
||||
command: <<include(scripts/qqq_all_artifact.sh)>>
|
||||
- when:
|
||||
condition:
|
||||
equal: ["<< parameters.profile >>", core]
|
||||
steps:
|
||||
- run:
|
||||
name: Smoke packaged core over HTTP
|
||||
command: <<include(scripts/qqq_all_core_smoke.sh)>>
|
||||
- when:
|
||||
condition:
|
||||
equal: ["<< parameters.profile >>", full]
|
||||
steps:
|
||||
- run:
|
||||
name: Smoke private full Compose over HTTP
|
||||
command: python3 scripts/run_full_smoke.py
|
||||
- store_artifacts:
|
||||
path: target/smoke-diagnostics
|
||||
destination: full-smoke-diagnostics
|
||||
@@ -0,0 +1,37 @@
|
||||
description: Verify the complete qqq-all reactor once and record exact artifacts for smoke and image jobs.
|
||||
executor: java
|
||||
steps:
|
||||
- checkout
|
||||
- install_java:
|
||||
java_version: "21"
|
||||
- mvn_cache_restore
|
||||
- run:
|
||||
name: Test smoke and release assertions
|
||||
command: python3 -m unittest discover -s scripts -p 'test_*.py' -v
|
||||
- run:
|
||||
name: Verify complete reactor including BOM tests and packaged integration tests
|
||||
command: mvn -B -ntp --update-snapshots clean verify
|
||||
- run:
|
||||
name: Record framework dependency classpath for smoke diagnostics
|
||||
command: <<include(scripts/qqq_all_classpath.sh)>>
|
||||
- run:
|
||||
name: Record verified artifact identity
|
||||
environment:
|
||||
QQQ_ALL_ARTIFACT_ACTION: write
|
||||
command: <<include(scripts/qqq_all_artifact.sh)>>
|
||||
- mvn_cache_save
|
||||
- store_test_results:
|
||||
path: qqq-all-app/target/surefire-reports
|
||||
- store_test_results:
|
||||
path: qqq-all-app/target/failsafe-reports
|
||||
- store_test_results:
|
||||
path: qqq-all-bom-test/target/surefire-reports
|
||||
- store_artifacts:
|
||||
path: qqq-all-app/target/site
|
||||
destination: app-reports
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- qqq-all-app/target/qqq-all-app.jar
|
||||
- qqq-all-app/target/smoke-classpath.txt
|
||||
- .qqq-ci-artifact.json
|
||||
@@ -0,0 +1,35 @@
|
||||
description: >
|
||||
Authoritative QQQ CLI validation, with optional tagged GitHub Packages publication.
|
||||
Preserves generated-schema drift, build, tests and Prism smoke before publishing.
|
||||
docker:
|
||||
- image: cimg/node:22.12
|
||||
parameters:
|
||||
publish:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Publish three workspaces with rc dist-tag; requires matching version tag and GITHUB_TOKEN"
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-cli-npm-{{ arch }}-{{ checksum "package-lock.json" }}
|
||||
- v1-cli-npm-{{ arch }}-
|
||||
- run:
|
||||
name: Install locked CLI dependencies
|
||||
command: npm ci
|
||||
- run:
|
||||
name: Validate generated client, build, tests and Prism
|
||||
command: <<include(scripts/cli_verify.sh)>>
|
||||
- save_cache:
|
||||
key: v1-cli-npm-{{ arch }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- ~/.npm
|
||||
- store_artifacts:
|
||||
path: prism.log
|
||||
destination: prism.log
|
||||
- when:
|
||||
condition: << parameters.publish >>
|
||||
steps:
|
||||
- run:
|
||||
name: Publish verified CLI packages
|
||||
command: <<include(scripts/cli_publish.sh)>>
|
||||
@@ -0,0 +1,42 @@
|
||||
description: Setup entry point for the standardized manifest-driven QQQ pipelines.
|
||||
resource_class: small
|
||||
docker:
|
||||
- image: cimg/python:3.12
|
||||
parameters:
|
||||
orb_version:
|
||||
type: string
|
||||
description: Explicit version matching the imported setup orb and manifest.
|
||||
manifest:
|
||||
type: string
|
||||
default: .qqq-ci.yml
|
||||
description: Repository manifest path.
|
||||
mongo_bind_diagnostics:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Core owned Mongo fixture diagnostics.
|
||||
run_playwright:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Material frontend Playwright validation before test or snapshot publication.
|
||||
next_acceptance_bundle_url:
|
||||
type: string
|
||||
default: ""
|
||||
description: Core Next acceptance bundle URL.
|
||||
next_acceptance_bundle_sha256:
|
||||
type: string
|
||||
default: ""
|
||||
description: Core Next acceptance bundle SHA256.
|
||||
next_acceptance_receipt_sha256:
|
||||
type: string
|
||||
default: ""
|
||||
description: Core Next acceptance receipt SHA256.
|
||||
steps:
|
||||
- checkout
|
||||
- generate_pipeline:
|
||||
orb_version: << parameters.orb_version >>
|
||||
manifest: << parameters.manifest >>
|
||||
mongo_bind_diagnostics: << parameters.mongo_bind_diagnostics >>
|
||||
run_playwright: << parameters.run_playwright >>
|
||||
next_acceptance_bundle_url: << parameters.next_acceptance_bundle_url >>
|
||||
next_acceptance_bundle_sha256: << parameters.next_acceptance_bundle_sha256 >>
|
||||
next_acceptance_receipt_sha256: << parameters.next_acceptance_receipt_sha256 >>
|
||||
@@ -1,27 +1,35 @@
|
||||
description: >
|
||||
Unified publishing job for all branch types
|
||||
Unified publishing job for all branch types with frontend
|
||||
Handles version management, building, testing, and publishing based on branch type
|
||||
Supports: snapshot, release_candidate, release, and hotfix workflows
|
||||
Supports: snapshot, release_candidate, release, hotfix, and feature workflows
|
||||
|
||||
executor:
|
||||
name: java
|
||||
tag: << parameters.java_version >>
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
java_version:
|
||||
type: string
|
||||
default: "21.0-node"
|
||||
description: "Java/OpenJDK version with Node.js (e.g., '17.0-node', '21.0-node')."
|
||||
default: "21"
|
||||
description: "Java major version to install (e.g., '17', '21')"
|
||||
node_version:
|
||||
type: string
|
||||
default: "20"
|
||||
description: "Node.js major version to install (e.g., '18', '20')"
|
||||
branch_type:
|
||||
type: string
|
||||
default: "snapshot"
|
||||
description: "Branch type: snapshot, release_candidate, release, or hotfix"
|
||||
description: "Branch type: snapshot, release_candidate, release, hotfix, or feature"
|
||||
|
||||
steps:
|
||||
- install_java:
|
||||
java_version: << parameters.java_version >>
|
||||
install_node: true
|
||||
node_version: << parameters.node_version >>
|
||||
- git_full_checkout
|
||||
- mvn_manage_version
|
||||
- frontend_build
|
||||
- frontend_test
|
||||
- frontend_test:
|
||||
build_before_test: false
|
||||
- frontend_package
|
||||
- mvn_jar_deploy
|
||||
- git_operations
|
||||
- git_operations:
|
||||
branch_type: << parameters.branch_type >>
|
||||
@@ -1,20 +1,27 @@
|
||||
description: >
|
||||
Complete test-only workflow for feature branches
|
||||
Complete test-only workflow for feature branches with frontend
|
||||
Runs build, test, API version check, and documentation generation
|
||||
Used by: test_only workflow for feature branches
|
||||
Triggers: Any push to branches NOT matching develop, main, release/*, hotfix/*
|
||||
|
||||
executor:
|
||||
name: java
|
||||
tag: << parameters.java_version >>
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
java_version:
|
||||
type: string
|
||||
default: "21.0-node"
|
||||
description: "Java/OpenJDK version with Node.js (e.g., '17.0-node', '21.0-node')."
|
||||
default: "21"
|
||||
description: "Java major version to install (e.g., '17', '21')"
|
||||
node_version:
|
||||
type: string
|
||||
default: "20"
|
||||
description: "Node.js major version to install (e.g., '18', '20')"
|
||||
|
||||
steps:
|
||||
- install_java:
|
||||
java_version: << parameters.java_version >>
|
||||
install_node: true
|
||||
node_version: << parameters.node_version >>
|
||||
- git_full_checkout
|
||||
- frontend_build
|
||||
- frontend_test
|
||||
- frontend_test:
|
||||
build_before_test: false
|
||||
+39
-10
@@ -1,17 +1,27 @@
|
||||
description: >
|
||||
Unified publishing job for all branch types
|
||||
Handles version management, building, testing, and publishing based on branch type
|
||||
Supports: snapshot, release_candidate, release (tagged), feasture (tagged) and hotfix workflows
|
||||
Supports: snapshot, release_candidate, release (tagged), feature (tagged) and hotfix workflows
|
||||
|
||||
executor:
|
||||
name: java
|
||||
tag: << parameters.java_version >>
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
notify_rc_published:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Dispatch trusted RC completion after deployment and a verified version push"
|
||||
install_browsers:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Install Chrome and ChromeDriver for browser tests"
|
||||
compile_before_verify:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run preliminary compile; disable when a later lifecycle compiles the project"
|
||||
java_version:
|
||||
type: string
|
||||
default: "21.0"
|
||||
description: "Java/OpenJDK version (e.g., '17.0', '21.0'). See cimg/openjdk tags."
|
||||
default: "21"
|
||||
description: "Java major version to install (e.g., '17', '21')"
|
||||
branch_type:
|
||||
type: string
|
||||
default: "snapshot"
|
||||
@@ -26,9 +36,14 @@ parameters:
|
||||
description: "Whether to publish AsciiDoc documentation"
|
||||
|
||||
steps:
|
||||
- install_java:
|
||||
java_version: << parameters.java_version >>
|
||||
|
||||
- git_full_checkout
|
||||
|
||||
- mvn_build
|
||||
- mvn_build:
|
||||
install_browsers: << parameters.install_browsers >>
|
||||
compile_before_verify: << parameters.compile_before_verify >>
|
||||
|
||||
- mvn_manage_version
|
||||
|
||||
@@ -42,25 +57,39 @@ steps:
|
||||
steps:
|
||||
- check_middleware_api_versions
|
||||
|
||||
- mvn_jar_deploy
|
||||
- mvn_jar_deploy:
|
||||
skip_verified_analysis: true
|
||||
|
||||
- when:
|
||||
condition:
|
||||
not:
|
||||
equal: [ "<< parameters.branch_type >>", "feature" ]
|
||||
steps:
|
||||
- git_operations
|
||||
- git_operations:
|
||||
branch_type: << parameters.branch_type >>
|
||||
require_pushed_version: << parameters.notify_rc_published >>
|
||||
|
||||
- when:
|
||||
condition:
|
||||
and:
|
||||
- << parameters.notify_rc_published >>
|
||||
- equal: [ "<< parameters.branch_type >>", "release_candidate" ]
|
||||
steps:
|
||||
- run:
|
||||
name: Notify verified RC publication
|
||||
command: <<include(scripts/notify_rc_published.sh)>>
|
||||
|
||||
- when:
|
||||
condition: << parameters.publish_asciidoc >>
|
||||
steps:
|
||||
- publish_asciidoc
|
||||
|
||||
# GitHub releases only for final releases and hotfixes (not RCs)
|
||||
# RCs just publish artifacts - GitHub release happens when merged to main
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: [ "<< parameters.branch_type >>", "release" ]
|
||||
- equal: [ "<< parameters.branch_type >>", "release_candidate" ]
|
||||
- equal: [ "<< parameters.branch_type >>", "hotfix" ]
|
||||
steps:
|
||||
- publish_github_release:
|
||||
|
||||
@@ -4,23 +4,33 @@ description: >
|
||||
Used by: test_only workflow for feature branches
|
||||
Triggers: Any push to branches NOT matching develop, main, release/*, hotfix/*
|
||||
|
||||
executor:
|
||||
name: java
|
||||
tag: << parameters.java_version >>
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
install_browsers:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Install Chrome and ChromeDriver for browser tests"
|
||||
compile_before_verify:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run preliminary compile; disable when a later lifecycle compiles the project"
|
||||
java_version:
|
||||
type: string
|
||||
default: "21.0"
|
||||
description: "Java/OpenJDK version (e.g., '17.0', '21.0'). See cimg/openjdk tags."
|
||||
default: "21"
|
||||
description: "Java major version to install (e.g., '17', '21')"
|
||||
check_middleware_api_versions:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Whether to run middleware API version checks"
|
||||
|
||||
steps:
|
||||
- install_java:
|
||||
java_version: << parameters.java_version >>
|
||||
- git_full_checkout
|
||||
- mvn_build
|
||||
- mvn_build:
|
||||
install_browsers: << parameters.install_browsers >>
|
||||
compile_before_verify: << parameters.compile_before_verify >>
|
||||
- mvn_verify
|
||||
- when:
|
||||
condition: << parameters.check_middleware_api_versions >>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
description: >
|
||||
Build job for Node.js applications on protected branches
|
||||
Runs checkout, install, test, and production build
|
||||
Persists build output to workspace for downstream jobs (e.g., e2e)
|
||||
|
||||
executor:
|
||||
name: default
|
||||
tag: << parameters.node_version >>
|
||||
|
||||
parameters:
|
||||
node_version:
|
||||
type: string
|
||||
default: "lts"
|
||||
description: "Node.js version tag (e.g., 'lts', '18.0', '20.0')."
|
||||
pkg_manager:
|
||||
type: string
|
||||
default: "pnpm"
|
||||
description: "Package manager to use (e.g., 'pnpm', 'npm', 'yarn')."
|
||||
typecheck_script:
|
||||
type: string
|
||||
default: "typecheck"
|
||||
description: "Name of the typecheck script in package.json."
|
||||
lint_script:
|
||||
type: string
|
||||
default: "lint"
|
||||
description: "Name of the lint script in package.json."
|
||||
test_script:
|
||||
type: string
|
||||
default: "test"
|
||||
description: "Name of the test script in package.json."
|
||||
build_script:
|
||||
type: string
|
||||
default: "build"
|
||||
description: "Name of the build script in package.json."
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- node_app_install:
|
||||
pkg_manager: << parameters.pkg_manager >>
|
||||
- node_app_test:
|
||||
pkg_manager: << parameters.pkg_manager >>
|
||||
typecheck_script: << parameters.typecheck_script >>
|
||||
lint_script: << parameters.lint_script >>
|
||||
test_script: << parameters.test_script >>
|
||||
- node_app_build_step:
|
||||
pkg_manager: << parameters.pkg_manager >>
|
||||
build_script: << parameters.build_script >>
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- .next/
|
||||
- node_modules/
|
||||
- package.json
|
||||
@@ -0,0 +1,29 @@
|
||||
description: >
|
||||
End-to-end test job for Node.js applications using Playwright
|
||||
Attaches workspace from a prior build job and runs e2e tests
|
||||
Stores JUnit results and Playwright traces as artifacts
|
||||
|
||||
executor:
|
||||
name: default
|
||||
tag: << parameters.node_version >>
|
||||
|
||||
parameters:
|
||||
node_version:
|
||||
type: string
|
||||
default: "lts"
|
||||
description: "Node.js version tag (e.g., 'lts', '18.0', '20.0')."
|
||||
pkg_manager:
|
||||
type: string
|
||||
default: "pnpm"
|
||||
description: "Package manager to use (e.g., 'pnpm', 'npm', 'yarn')."
|
||||
e2e_script:
|
||||
type: string
|
||||
default: "test:e2e"
|
||||
description: "Name of the e2e test script in package.json."
|
||||
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- node_app_e2e:
|
||||
pkg_manager: << parameters.pkg_manager >>
|
||||
e2e_script: << parameters.e2e_script >>
|
||||
@@ -0,0 +1,40 @@
|
||||
description: >
|
||||
Test-only job for Node.js application feature branches
|
||||
Runs checkout, dependency install, and test suite
|
||||
Supports: pnpm, npm, and yarn package managers
|
||||
|
||||
executor:
|
||||
name: default
|
||||
tag: << parameters.node_version >>
|
||||
|
||||
parameters:
|
||||
node_version:
|
||||
type: string
|
||||
default: "lts"
|
||||
description: "Node.js version tag (e.g., 'lts', '18.0', '20.0')."
|
||||
pkg_manager:
|
||||
type: string
|
||||
default: "pnpm"
|
||||
description: "Package manager to use (e.g., 'pnpm', 'npm', 'yarn')."
|
||||
typecheck_script:
|
||||
type: string
|
||||
default: "typecheck"
|
||||
description: "Name of the typecheck script in package.json."
|
||||
lint_script:
|
||||
type: string
|
||||
default: "lint"
|
||||
description: "Name of the lint script in package.json."
|
||||
test_script:
|
||||
type: string
|
||||
default: "test"
|
||||
description: "Name of the test script in package.json."
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- node_app_install:
|
||||
pkg_manager: << parameters.pkg_manager >>
|
||||
- node_app_test:
|
||||
pkg_manager: << parameters.pkg_manager >>
|
||||
typecheck_script: << parameters.typecheck_script >>
|
||||
lint_script: << parameters.lint_script >>
|
||||
test_script: << parameters.test_script >>
|
||||
@@ -16,22 +16,29 @@ parameters:
|
||||
type: string
|
||||
default: "snapshot"
|
||||
description: "Branch type: snapshot, release_candidate, release, or hotfix"
|
||||
npm_trusted_publishing:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Use CircleCI OIDC instead of NPM_TOKEN (Node >=22.14, npm >=11.5.1)."
|
||||
|
||||
steps:
|
||||
- git_full_checkout
|
||||
- node_install_dependencies
|
||||
- node_run_tests
|
||||
- node_manage_version
|
||||
- node_manage_version:
|
||||
branch_type: << parameters.branch_type >>
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- node_build_package
|
||||
- node_publish
|
||||
- node_publish:
|
||||
trusted_publishing: << parameters.npm_trusted_publishing >>
|
||||
|
||||
# GitHub releases only for final releases and hotfixes (not RCs)
|
||||
# RCs just publish artifacts - GitHub release happens when merged to main
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: [ "<< parameters.branch_type >>", "release" ]
|
||||
- equal: [ "<< parameters.branch_type >>", "release_candidate" ]
|
||||
- equal: [ "<< parameters.branch_type >>", "hotfix" ]
|
||||
steps:
|
||||
- publish_github_release:
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
description: Render the native qctl workflow bridge. Does not build duplicate Circle binaries or publish.
|
||||
parameters:
|
||||
shared_ref:
|
||||
type: string
|
||||
description: Reviewed immutable QRun-IO/.github worker commit.
|
||||
docker:
|
||||
- image: cimg/python:3.12
|
||||
resource_class: small
|
||||
steps:
|
||||
- generate_qctl_workflow:
|
||||
shared_ref: << parameters.shared_ref >>
|
||||
@@ -0,0 +1,11 @@
|
||||
description: Central scheduled RC finalization sweep. Requires existing cross-repository GITHUB_TOKEN context.
|
||||
parameters:
|
||||
repositories:
|
||||
type: string
|
||||
description: Explicit JSON repository allowlist owned by the central schedule.
|
||||
docker:
|
||||
- image: cimg/python:3.12
|
||||
resource_class: small
|
||||
steps:
|
||||
- rc_finalize_sweep:
|
||||
repositories: << parameters.repositories >>
|
||||
@@ -0,0 +1,101 @@
|
||||
description: >
|
||||
Runs security scanning tools on a Maven project: Gitleaks (secret detection),
|
||||
Semgrep (SAST), OWASP Dependency-Check (CVE scanning), and CycloneDX (SBOM).
|
||||
All tools default to report-only mode. Use fail_on_* parameters to enforce gates.
|
||||
|
||||
Usage in consuming repo:
|
||||
workflows:
|
||||
security_scan:
|
||||
jobs:
|
||||
- qqq-orb/security_scan:
|
||||
context: [qqq-maven-registry-credentials, qqq-security-credentials]
|
||||
filters:
|
||||
branches:
|
||||
only: [develop]
|
||||
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
java_version:
|
||||
type: string
|
||||
default: "21"
|
||||
description: "Java major version to install"
|
||||
run_gitleaks:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run Gitleaks secret detection"
|
||||
run_semgrep:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run Semgrep SAST analysis"
|
||||
run_owasp:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run OWASP Dependency-Check CVE scanning"
|
||||
run_sbom:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run CycloneDX SBOM generation"
|
||||
fail_on_gitleaks:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if Gitleaks finds secrets"
|
||||
fail_on_semgrep:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if Semgrep finds security issues"
|
||||
fail_on_owasp:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if OWASP finds CVEs above threshold"
|
||||
semgrep_rulesets:
|
||||
type: string
|
||||
default: "p/java p/owasp-top-ten p/security-audit"
|
||||
description: "Space-separated list of Semgrep rulesets"
|
||||
owasp_cvss_threshold:
|
||||
type: string
|
||||
default: "7"
|
||||
description: "CVSS score threshold for OWASP (0-10)"
|
||||
|
||||
steps:
|
||||
- install_java:
|
||||
java_version: << parameters.java_version >>
|
||||
- git_full_checkout
|
||||
- run:
|
||||
name: Setup Maven Settings
|
||||
command: <<include(scripts/setup_maven_settings.sh)>>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- run:
|
||||
name: Build and Install for Security Analysis
|
||||
command: <<include(scripts/mvn_install_for_analysis.sh)>>
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- when:
|
||||
condition: << parameters.run_gitleaks >>
|
||||
steps:
|
||||
- run_gitleaks:
|
||||
fail_on_findings: << parameters.fail_on_gitleaks >>
|
||||
- when:
|
||||
condition: << parameters.run_semgrep >>
|
||||
steps:
|
||||
- run_semgrep:
|
||||
fail_on_findings: << parameters.fail_on_semgrep >>
|
||||
rulesets: << parameters.semgrep_rulesets >>
|
||||
- when:
|
||||
condition: << parameters.run_owasp >>
|
||||
steps:
|
||||
- run_owasp_dependency_check:
|
||||
fail_on_cvss: << parameters.fail_on_owasp >>
|
||||
cvss_threshold: << parameters.owasp_cvss_threshold >>
|
||||
- when:
|
||||
condition: << parameters.run_sbom >>
|
||||
steps:
|
||||
- run_cyclonedx_sbom
|
||||
- collect_security_reports
|
||||
- store_artifacts:
|
||||
path: /home/circleci/security-reports
|
||||
destination: security-reports
|
||||
@@ -0,0 +1,72 @@
|
||||
description: >
|
||||
Runs SpotBugs and PMD static analysis on a Maven project.
|
||||
This job is designed to be used in an optional workflow triggered
|
||||
by tag (static-analysis/*) or pipeline parameter.
|
||||
|
||||
Usage in consuming repo:
|
||||
workflows:
|
||||
static_analysis:
|
||||
when:
|
||||
or:
|
||||
- matches:
|
||||
pattern: "^static-analysis/.*"
|
||||
value: << pipeline.git.tag >>
|
||||
- equal: [true, << pipeline.parameters.run_static_analysis >>]
|
||||
jobs:
|
||||
- qqq-orb/static_analysis
|
||||
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
java_version:
|
||||
type: string
|
||||
default: "21"
|
||||
description: "Java major version to install"
|
||||
fail_on_spotbugs:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if SpotBugs finds bugs"
|
||||
fail_on_pmd:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Fail the build if PMD finds violations"
|
||||
run_spotbugs:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run SpotBugs analysis"
|
||||
run_pmd:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Run PMD analysis"
|
||||
|
||||
steps:
|
||||
- install_java:
|
||||
java_version: << parameters.java_version >>
|
||||
- git_full_checkout
|
||||
- run:
|
||||
name: Setup Maven Settings
|
||||
command: <<include(scripts/setup_maven_settings.sh)>>
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- run:
|
||||
name: Build and Install for Analysis
|
||||
command: <<include(scripts/mvn_install_for_analysis.sh)>>
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- when:
|
||||
condition: << parameters.run_spotbugs >>
|
||||
steps:
|
||||
- mvn_spotbugs:
|
||||
fail_on_error: << parameters.fail_on_spotbugs >>
|
||||
- when:
|
||||
condition: << parameters.run_pmd >>
|
||||
steps:
|
||||
- mvn_pmd:
|
||||
fail_on_violation: << parameters.fail_on_pmd >>
|
||||
- collect_static_analysis_reports
|
||||
- store_artifacts:
|
||||
path: /home/circleci/static-analysis-reports
|
||||
destination: static-analysis
|
||||
@@ -161,7 +161,7 @@ set_version() {
|
||||
##############################################
|
||||
## Use Maven versions plugin to set version ##
|
||||
##############################################
|
||||
mvn versions:set-property -Dproperty=revision -DnewVersion="$new_version" -DgenerateBackupPoms=false
|
||||
mvn -f "$POM_FILE" versions:set-property -Dproperty=revision -DnewVersion="$new_version" -DgenerateBackupPoms=false
|
||||
|
||||
#######################
|
||||
## Verify the change ##
|
||||
@@ -175,6 +175,26 @@ set_version() {
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_project_version() {
|
||||
local expected=$1 actual
|
||||
# A revision property can exist without being used by project.version.
|
||||
# Ask Maven for the effective coordinate, including inherited configuration.
|
||||
actual=$(mvn -f "$POM_FILE" -q -Dstyle.color=never \
|
||||
org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \
|
||||
-Dexpression=project.version -DforceStdout)
|
||||
if [[ "$actual" != "$expected" ]]; then
|
||||
mvn -f "$POM_FILE" -B versions:set -DnewVersion="$expected" -DgenerateBackupPoms=false
|
||||
actual=$(mvn -f "$POM_FILE" -q -Dstyle.color=never \
|
||||
org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \
|
||||
-Dexpression=project.version -DforceStdout)
|
||||
fi
|
||||
if [[ "$actual" != "$expected" ]]; then
|
||||
echo "ERROR: Effective project version is $actual; expected $expected" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Verified effective project version: $actual"
|
||||
}
|
||||
|
||||
#############################################
|
||||
## Branch Detection and Routing Functions ##
|
||||
#############################################
|
||||
@@ -434,6 +454,9 @@ main() {
|
||||
fi
|
||||
|
||||
echo ""
|
||||
if [[ "$DRY_RUN" != "true" ]]; then
|
||||
ensure_project_version "$NEW_VERSION"
|
||||
fi
|
||||
echo "=== Version calculation complete ==="
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Validate tag and fixed package destinations before asking for credentials.
|
||||
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/conformance/package.json', '@qrun-io/qqq-ui-api-conformance'],
|
||||
['packages/cli/package.json', '@qrun-io/qqq-cli'],
|
||||
];
|
||||
for (const [path, expectedName] of packages) {
|
||||
const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
|
||||
if (pkg.name !== expectedName || pkg.publishConfig?.registry !== 'https://npm.pkg.github.com') {
|
||||
throw new Error('Unexpected GitHub Packages destination: ' + path);
|
||||
}
|
||||
}
|
||||
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');
|
||||
}
|
||||
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.
|
||||
npm_config=$(mktemp)
|
||||
chmod 600 "$npm_config"
|
||||
trap 'rm -f "$npm_config"' EXIT
|
||||
cat > "$npm_config" <<'NPMRC'
|
||||
@qrun-io:registry=https://npm.pkg.github.com
|
||||
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
|
||||
NPMRC
|
||||
export NPM_CONFIG_USERCONFIG="$npm_config"
|
||||
# Fail closed if the Circle context token cannot authenticate to this registry.
|
||||
# Authentication alone is not proof of package write permission; hosted publish
|
||||
# migration remains gated on verifying the actual context's package access.
|
||||
npm whoami --registry https://npm.pkg.github.com >/dev/null
|
||||
npm publish -w @qrun-io/qqq-ui-api-client --registry https://npm.pkg.github.com --tag rc
|
||||
npm publish -w @qrun-io/qqq-ui-api-conformance --registry https://npm.pkg.github.com --tag rc
|
||||
npm publish -w @qrun-io/qqq-cli --registry https://npm.pkg.github.com --tag rc
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
npm run generate
|
||||
git diff --exit-code -- packages/ui-api-client/src/schema.ts
|
||||
npm run build
|
||||
npm test
|
||||
|
||||
# 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 &
|
||||
prism_pid=$!
|
||||
cleanup() {
|
||||
kill "$prism_pid" 2>/dev/null || true
|
||||
wait "$prism_pid" 2>/dev/null || true
|
||||
}
|
||||
trap cleanup EXIT
|
||||
ready=false
|
||||
for ((attempt = 0; attempt < 30; attempt++)); do
|
||||
if ! kill -0 "$prism_pid" 2>/dev/null; then
|
||||
echo "Prism exited before readiness; see prism.log" >&2
|
||||
exit 1
|
||||
fi
|
||||
if curl --connect-timeout 2 --max-time 3 -fsS http://127.0.0.1:4010/qqq/v1/version >/dev/null; then
|
||||
ready=true
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
if [[ "$ready" != true ]]; then
|
||||
echo "Prism readiness timed out; see prism.log" >&2
|
||||
exit 1
|
||||
fi
|
||||
curl --connect-timeout 2 --max-time 3 -fsS http://127.0.0.1:4010/qqq/v1/metaData/authentication >/dev/null
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Collect security scan reports to a central location for artifacts
|
||||
REPORT_DIR="/home/circleci/security-reports"
|
||||
mkdir -p "$REPORT_DIR/gitleaks" "$REPORT_DIR/semgrep" "$REPORT_DIR/owasp" "$REPORT_DIR/sbom"
|
||||
|
||||
echo "Collecting security scan reports..."
|
||||
|
||||
# Collect Gitleaks reports
|
||||
if [ -f /tmp/gitleaks-report.json ]; then
|
||||
cp /tmp/gitleaks-report.json "$REPORT_DIR/gitleaks/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Collect Semgrep reports
|
||||
if [ -f /tmp/semgrep-report.json ]; then
|
||||
cp /tmp/semgrep-report.json "$REPORT_DIR/semgrep/" 2>/dev/null || true
|
||||
fi
|
||||
if [ -f /tmp/semgrep-report.sarif ]; then
|
||||
cp /tmp/semgrep-report.sarif "$REPORT_DIR/semgrep/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Collect OWASP Dependency-Check reports
|
||||
if [ -f /tmp/owasp-dependency-check.json ]; then
|
||||
cp /tmp/owasp-dependency-check.json "$REPORT_DIR/owasp/" 2>/dev/null || true
|
||||
fi
|
||||
if [ -f /tmp/owasp-dependency-check.html ]; then
|
||||
cp /tmp/owasp-dependency-check.html "$REPORT_DIR/owasp/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Collect CycloneDX SBOM
|
||||
if [ -f /tmp/cyclonedx-sbom.json ]; then
|
||||
cp /tmp/cyclonedx-sbom.json "$REPORT_DIR/sbom/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Generate combined summary
|
||||
{
|
||||
echo "=== Security Scan Report Summary ==="
|
||||
echo "Generated: $(date)"
|
||||
echo ""
|
||||
|
||||
echo "Gitleaks (Secret Detection):"
|
||||
if [ -f "$REPORT_DIR/gitleaks/gitleaks-report.json" ]; then
|
||||
COUNT=$(python3 -c "import json; print(len(json.load(open('$REPORT_DIR/gitleaks/gitleaks-report.json'))))" 2>/dev/null || echo "unknown")
|
||||
echo " Findings: ${COUNT}"
|
||||
else
|
||||
echo " Not run or no report"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Semgrep (SAST):"
|
||||
if [ -f "$REPORT_DIR/semgrep/semgrep-report.json" ]; then
|
||||
COUNT=$(python3 -c "import json; r=json.load(open('$REPORT_DIR/semgrep/semgrep-report.json')); print(len(r.get('results', [])))" 2>/dev/null || echo "unknown")
|
||||
echo " Findings: ${COUNT}"
|
||||
else
|
||||
echo " Not run or no report"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "OWASP Dependency-Check (CVEs):"
|
||||
if [ -f "$REPORT_DIR/owasp/owasp-dependency-check.json" ]; then
|
||||
COUNT=$(python3 -c "
|
||||
import json
|
||||
r = json.load(open('$REPORT_DIR/owasp/owasp-dependency-check.json'))
|
||||
deps = r.get('dependencies', [])
|
||||
vulns = sum(len(d.get('vulnerabilities', [])) for d in deps)
|
||||
print(vulns)
|
||||
" 2>/dev/null || echo "unknown")
|
||||
echo " Vulnerabilities: ${COUNT}"
|
||||
else
|
||||
echo " Not run or no report"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "CycloneDX SBOM:"
|
||||
if [ -f "$REPORT_DIR/sbom/cyclonedx-sbom.json" ]; then
|
||||
COUNT=$(python3 -c "import json; r=json.load(open('$REPORT_DIR/sbom/cyclonedx-sbom.json')); print(len(r.get('components', [])))" 2>/dev/null || echo "unknown")
|
||||
echo " Components: ${COUNT}"
|
||||
else
|
||||
echo " Not run or no report"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "==================================="
|
||||
} > "$REPORT_DIR/summary.txt"
|
||||
|
||||
cat "$REPORT_DIR/summary.txt"
|
||||
echo ""
|
||||
echo "Reports collected to: $REPORT_DIR"
|
||||
Loaded 100 of 259 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user