Compare commits
105
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98a7cd60bb
|
||
|
|
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 | ||
|
|
a347ddd68b | ||
|
|
f6e04f7a58 | ||
|
|
5580d51cf7 | ||
|
|
eb9de5db69 | ||
|
|
3f5dd9a746 | ||
|
|
65787b7dd2 | ||
|
|
4f07167e26 | ||
|
|
84a0e345b9 | ||
|
|
a1ef2a419f | ||
|
|
99a776ee2a | ||
|
|
5b167ca8f8 | ||
|
|
43247349d7 | ||
|
|
4486188522 | ||
|
|
1232a17f36 |
No files matched your search
@@ -1,5 +1,9 @@
|
||||
version: 2.1
|
||||
setup: true
|
||||
parameters:
|
||||
run_rc_finalize_sweep:
|
||||
type: boolean
|
||||
default: false
|
||||
orbs:
|
||||
orb-tools: circleci/orb-tools@12.3
|
||||
shellcheck: circleci/shellcheck@3.2
|
||||
@@ -8,8 +12,23 @@ filters: &filters
|
||||
tags:
|
||||
only: /.*/
|
||||
|
||||
jobs:
|
||||
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: << pipeline.parameters.run_rc_finalize_sweep >>
|
||||
jobs:
|
||||
- orb-tools/lint:
|
||||
filters: *filters
|
||||
@@ -27,3 +46,13 @@ 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: /.*/
|
||||
+139
-18
@@ -12,23 +12,143 @@ 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
|
||||
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 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_validate_standard.py
|
||||
python3 tests/test_voyage_profile.py
|
||||
python3 tests/test_next_native.py
|
||||
python3 tests/test_auxiliary_workflows.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
|
||||
# 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 +156,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,31 @@
|
||||
# GitHub Release Configuration
|
||||
# Auto-generates release notes from PR labels
|
||||
|
||||
changelog:
|
||||
exclude:
|
||||
labels:
|
||||
- ignore-for-release
|
||||
- duplicate
|
||||
- invalid
|
||||
authors:
|
||||
- dependabot
|
||||
- dependabot[bot]
|
||||
categories:
|
||||
- title: Breaking Changes
|
||||
labels:
|
||||
- breaking-change
|
||||
- breaking
|
||||
- title: New Features
|
||||
labels:
|
||||
- enhancement
|
||||
- feature
|
||||
- title: Bug Fixes
|
||||
labels:
|
||||
- bug
|
||||
- fix
|
||||
- title: Dependencies
|
||||
labels:
|
||||
- dependencies
|
||||
- title: Other Changes
|
||||
labels:
|
||||
- "*"
|
||||
@@ -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,370 @@
|
||||
# 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
|
||||
merge_sha:
|
||||
type: string
|
||||
default: ''
|
||||
bump_sha:
|
||||
type: string
|
||||
default: ''
|
||||
branch:
|
||||
type: string
|
||||
default: ''
|
||||
version:
|
||||
type: string
|
||||
default: ''
|
||||
secrets:
|
||||
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 }}
|
||||
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; CircleCI publish_release_candidate 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
|
||||
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 }}
|
||||
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
|
||||
# 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):
|
||||
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") == "publish_release_candidate" 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":
|
||||
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")
|
||||
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")
|
||||
# END RC GUARD
|
||||
if __name__ == "__main__":
|
||||
import json, sys
|
||||
try:
|
||||
if 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:
|
||||
print(evaluate(sys.argv[1], json.load(open(sys.argv[2])), json.load(open(sys.argv[3]))))
|
||||
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}$ && "$BUMP_SHA" =~ ^[0-9a-f]{40}$ ]]
|
||||
[[ "$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=$(gh api "repos/$REPO/git/ref/heads/$lock" -q .object.sha 2>/dev/null || true)
|
||||
# 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"
|
||||
gh api "repos/$REPO/commits/$BUMP_SHA" > "$workdir/commit.json"
|
||||
version=$(python3 "$workdir/rc_guard.py" "$MERGE_SHA" "$workdir/status.json" "$workdir/commit.json")
|
||||
[[ -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=$(gh api "repos/$REPO/git/ref/tags/v$version" --jq '.object.sha' 2>/dev/null || true)
|
||||
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,21 +1,191 @@
|
||||
MIT License
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
Copyright (c) 2021-2024 Kingsrook, LLC
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
1. Definitions.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
"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.
|
||||
@@ -19,11 +19,12 @@ help:
|
||||
@echo " make publish-release - Interactive production release (tagged version)"
|
||||
@echo ""
|
||||
@echo "Key Files:"
|
||||
@echo " src/@orb.yml - Main orb definition"
|
||||
@echo " src/@orb.yml - Main orb definition"
|
||||
@echo " target/qqq-orb-packed.yml - Packed orb (generated)"
|
||||
|
||||
# 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,45 @@ 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_validate_standard.py
|
||||
python3 tests/test_voyage_profile.py
|
||||
python3 tests/test_next_native.py
|
||||
python3 tests/test_auxiliary_workflows.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 +209,9 @@ 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
|
||||
@@ -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.
|
||||
@@ -1,393 +1,144 @@
|
||||
# QQQ Orb
|
||||
# qqq-orb
|
||||
|
||||
[](https://circleci.com/developer/orbs/orb/kingsrook/qqq-orb)
|
||||
[](https://circleci.com/developer/orbs/orb/kingsrook/qqq-orb)
|
||||
[](LICENSE)
|
||||
CircleCI orb for QQQ framework projects.
|
||||
|
||||
> **CircleCI Orb for QQQ Framework Projects**
|
||||
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.
|
||||
|
||||
CircleCI orb for Maven and Node.js projects using GitFlow. Provides automated building, testing, version management, and publishing to Maven Central and npm registries.
|
||||
**For:** Teams using CircleCI to build, test, and publish QQQ applications
|
||||
**Status:** Stable (v0.6.x)
|
||||
|
||||
## 🚀 Overview
|
||||
## Why This Exists
|
||||
|
||||
QQQ Orb is a **CircleCI orb** that provides standardized CI/CD workflows for projects in the QQQ ecosystem. It handles the complete development lifecycle from building and testing to publishing releases.
|
||||
QQQ projects share common CI/CD patterns: build with Maven, run tests, publish to Maven Central or npm. Setting this up from scratch means duplicating workflow configuration across every repository.
|
||||
|
||||
### What This Repository Contains
|
||||
This orb provides pre-built jobs for the complete QQQ development lifecycle. Add a few lines of YAML and your project has automated testing, version management, and publishing.
|
||||
|
||||
- **CircleCI Orb**: Reusable CI/CD workflows and commands
|
||||
- **GitFlow Integration**: Automated branching and version management with intelligent version calculation
|
||||
- **Multi-Platform Support**: Maven (Java) and npm (Node.js) project support
|
||||
- **Publishing Automation**: Automated publishing to Maven Central and npm
|
||||
- **Comprehensive Testing**: Full test suite with dynamic test environments
|
||||
- **Quality Gates**: Enforced linting, testing, and validation before publishing
|
||||
## Features
|
||||
|
||||
### What This Repository Does NOT Contain
|
||||
- **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)
|
||||
|
||||
- **QQQ Framework**: The actual low-code engine and backend
|
||||
- **Application Code**: Business logic or application-specific code
|
||||
- **Runtime Dependencies**: Libraries or frameworks used by applications
|
||||
## Quick Start
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
### Technology Stack
|
||||
|
||||
- **CircleCI Orbs**: Reusable configuration components
|
||||
- **GitFlow**: Branching strategy for release management
|
||||
- **Maven**: Java project build and dependency management
|
||||
- **npm**: Node.js package management
|
||||
- **Shell Scripts**: Automation and utility scripts with comprehensive testing
|
||||
- **YAML**: Configuration and workflow definitions
|
||||
|
||||
### Core Capabilities
|
||||
|
||||
- **Automated Building**: Maven and npm project compilation
|
||||
- **Testing**: Unit tests, integration tests, and coverage reporting
|
||||
- **Intelligent Version Management**: Automated semantic versioning based on GitFlow with feature branch support
|
||||
- **Publishing**: Maven Central and npm registry publishing with quality gates
|
||||
- **Documentation**: Automated documentation generation and publishing
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Using the Orb
|
||||
**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:
|
||||
test_only:
|
||||
filters:
|
||||
branches:
|
||||
ignore: [develop, main, /release\/.*/, /hotfix\/.*/]
|
||||
build_and_test:
|
||||
jobs:
|
||||
- qqq-orb/build
|
||||
- qqq-orb/test:
|
||||
requires: [qqq-orb/build]
|
||||
- qqq-orb/mvn_test_only
|
||||
|
||||
publish_snapshot:
|
||||
filters: { branches: { only: develop } }
|
||||
when:
|
||||
equal: [develop, << pipeline.git.branch >>]
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
- qqq-orb/mvn_publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: snapshot
|
||||
|
||||
publish_release_candidate:
|
||||
filters: { branches: { only: /release\/.*/ } }
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: release_candidate
|
||||
|
||||
production_release:
|
||||
filters: { branches: { only: main } }
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: release
|
||||
|
||||
hotfix_release:
|
||||
filters: { branches: { only: /hotfix\/.*/ } }
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: hotfix
|
||||
```
|
||||
|
||||
### Required Context
|
||||
## Usage
|
||||
|
||||
Set up `qqq-maven-registry-credentials` context in CircleCI:
|
||||
### Available Jobs
|
||||
|
||||
| Variable | Description | Required For |
|
||||
|----------|-------------|--------------|
|
||||
| `MAVEN_USERNAME` | Sonatype username | Maven publishing |
|
||||
| `MAVEN_PASSWORD` | Sonatype password | Maven publishing |
|
||||
| `GPG_PRIVATE_KEY_B64` | Base64 encoded GPG private key | Maven signing |
|
||||
| `GPG_KEYNAME` | GPG key identifier | Maven signing |
|
||||
| `GPG_PASSPHRASE` | GPG passphrase | Maven signing |
|
||||
| `GITHUB_TOKEN` | GitHub API token | GitHub releases |
|
||||
| `RDBMS_PASSWORD` | Database password | Integration testing |
|
||||
| Job | Purpose |
|
||||
|-----|---------|
|
||||
| `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 |
|
||||
|
||||
### Project Requirements
|
||||
### npm Trusted Publishing
|
||||
|
||||
- **Maven Projects**: `pom.xml` with `<revision>` property
|
||||
- **Node.js Projects**: `package.json` with version field
|
||||
- **Settings**: `/tmp/circleci/mvn-settings.xml` (auto-generated if missing)
|
||||
- **Documentation**: `docs/index.adoc` (optional, for documentation)
|
||||
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.
|
||||
|
||||
## 📁 Repository Structure
|
||||
### Branch Types
|
||||
|
||||
```
|
||||
src/
|
||||
├── @orb.yml # Main orb definition
|
||||
├── commands/ # Reusable commands
|
||||
│ ├── mvn_build.yml # Maven build command
|
||||
│ ├── mvn_verify.yml # Maven test and verify
|
||||
│ ├── mvn_jar_deploy.yml # Maven deployment
|
||||
│ ├── node_build_package.yml # Node.js build and package
|
||||
│ ├── node_publish.yml # npm publishing
|
||||
│ └── ... # Additional commands
|
||||
├── jobs/ # Complete workflow jobs
|
||||
│ ├── mvn_publish.yml # Maven publishing workflow
|
||||
│ ├── mvn_test_only.yml # Maven testing workflow
|
||||
│ ├── node_publish.yml # npm publishing workflow
|
||||
│ └── node_test_only.yml # npm testing workflow
|
||||
├── scripts/ # Shell scripts
|
||||
│ ├── calculate_version.sh # Intelligent version calculation
|
||||
│ ├── mvn_build_compile.sh # Maven compilation
|
||||
│ ├── node_npm_auth.sh # npm authentication
|
||||
│ └── ... # Additional scripts
|
||||
├── executors/ # Execution environments
|
||||
│ └── default.yml # Default executor configuration
|
||||
└── examples/ # Usage examples
|
||||
└── build.yml # Example configuration
|
||||
| Branch | Version Format |
|
||||
|--------|----------------|
|
||||
| `develop` | `1.5.0-SNAPSHOT` |
|
||||
| `release/1.5` | `1.5.0-RC.1` |
|
||||
| `main` | `1.5.0` (requires tag) |
|
||||
| `hotfix/1.5.1` | `1.5.1` |
|
||||
| `feature/*` | `1.5.0-feature-abc1234-SNAPSHOT` |
|
||||
|
||||
tests/ # Comprehensive test suite
|
||||
├── test_calculate_version.sh # Version calculation tests
|
||||
├── run_tests.sh # Test runner with CI support
|
||||
└── README.md # Test documentation
|
||||
### Java Version
|
||||
|
||||
Maven jobs run on Ubuntu machine executors with Temurin JDK. Default is Java 21. To use Java 17:
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
- qqq-orb/mvn_test_only:
|
||||
java_version: "17"
|
||||
```
|
||||
|
||||
## 🎯 Available Jobs
|
||||
### Docker Support
|
||||
|
||||
| Job | Branch | Output | Description |
|
||||
|-----|--------|--------|-------------|
|
||||
| `build` | Any | Compiled artifacts | Build project without testing |
|
||||
| `test` | Any | Test results + JaCoCo | Run tests with coverage |
|
||||
| `publish` | Any | Published artifacts | Unified publishing based on branch_type |
|
||||
Maven jobs use machine executors with Docker pre-installed. Tests using Testcontainers, LocalStack, or other Docker-dependent frameworks work without additional configuration.
|
||||
|
||||
### Publish Job Parameters
|
||||
### Required Context Variables
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `branch_type` | string | "snapshot" | Branch type: snapshot, release_candidate, release, hotfix |
|
||||
| Variable | Purpose |
|
||||
|----------|---------|
|
||||
| `MAVEN_USERNAME` | Sonatype username |
|
||||
| `MAVEN_PASSWORD` | Sonatype password |
|
||||
| `GPG_PRIVATE_KEY_B64` | Base64-encoded GPG key |
|
||||
| `GPG_KEYNAME` | GPG key ID |
|
||||
| `GPG_PASSPHRASE` | GPG passphrase |
|
||||
| `GITHUB_TOKEN` | GitHub API token |
|
||||
|
||||
## 🔧 Development
|
||||
## Orb Publishing
|
||||
|
||||
### Prerequisites
|
||||
The orb auto-publishes via CircleCI:
|
||||
|
||||
| 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
|
||||
|
||||
**Maturity:** Stable, used across all QQQ repositories
|
||||
**Breaking changes:** See [CHANGELOG.md](CHANGELOG.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
```bash
|
||||
# Install CircleCI CLI
|
||||
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | sudo bash
|
||||
|
||||
# Install linting tools (macOS)
|
||||
brew install shellcheck yamllint
|
||||
|
||||
# Install linting tools (Ubuntu/Debian)
|
||||
sudo apt-get install shellcheck yamllint
|
||||
```
|
||||
|
||||
### Development Commands
|
||||
|
||||
```bash
|
||||
# Core development
|
||||
make pack # Pack orb (resolves <<include()>>)
|
||||
make validate # Validate packed orb
|
||||
make lint # Run all linting checks (YAML, ShellCheck, CircleCI orb)
|
||||
make dev # Pack + validate + show status
|
||||
make clean # Clean build artifacts and test data
|
||||
|
||||
# Testing
|
||||
make test # Pack and validate orb
|
||||
make test-scripts # Run comprehensive calculate_version.sh tests
|
||||
make test-all # Run all tests (orb + scripts)
|
||||
|
||||
# Publishing (with full build cycle)
|
||||
make publish-snapshot # Publish as kingsrook/qqq-orb@dev:snapshot
|
||||
make publish-release # Publish as kingsrook/qqq-orb@X.Y.Z
|
||||
```
|
||||
|
||||
### Quality Gates
|
||||
|
||||
All publishing commands enforce a complete quality gate:
|
||||
|
||||
1. **check-clean**: Ensures working directory is clean
|
||||
2. **lint**: Runs all linting checks (YAML, ShellCheck, CircleCI orb validation)
|
||||
3. **clean**: Removes all generated files for fresh build
|
||||
4. **dev**: Development workflow (pack + validate)
|
||||
5. **test-all**: Comprehensive testing (orb + scripts)
|
||||
|
||||
## 📋 Intelligent Version Management
|
||||
|
||||
Automated version calculation with GitFlow integration and feature branch support:
|
||||
|
||||
| Branch Pattern | Version Change | Example |
|
||||
|----------------|----------------|---------|
|
||||
| `develop` | Minor bump | `1.5.0-SNAPSHOT` → `1.6.0-SNAPSHOT` |
|
||||
| `release/1.5` | RC versions | `1.5.0-RC.1`, `1.5.0-RC.2`, ... |
|
||||
| `main` | Stable release | `1.5.0-RC.3` → `1.5.0` **requires v* tag** |
|
||||
| `hotfix/1.5.1` | Patch bump | `1.5.0` → `1.5.1` |
|
||||
| `feature/new-feature` | Feature-specific | `1.5.0-SNAPSHOT` → `1.5.0-NEW-abc1234-SNAPSHOT` |
|
||||
|
||||
### Feature Branch Versioning
|
||||
|
||||
Feature branches create unique, traceable versions:
|
||||
- **Format**: `{version}-{feature_branch_name}-{commit_hash}-SNAPSHOT`
|
||||
- **Example**: `feature/new-feature` → `1.5.0-new-feature-abc1234-SNAPSHOT`
|
||||
- **Dynamic Updates**: Automatically updates when commit hash changes
|
||||
- **Safe Abbreviations**: 3-character uppercase feature name abbreviation
|
||||
|
||||
### Version Parsing Support
|
||||
|
||||
The version calculator handles multiple formats:
|
||||
- **Standard**: `1.5.0`, `1.5.0-SNAPSHOT`, `1.5.0-RC.1`
|
||||
- **V-prefixed**: `v1.5.0` → `1.5.0` (clean conversion)
|
||||
- **Feature-specific**: `1.5.0-new-feature-name-abc1234-SNAPSHOT`
|
||||
|
||||
**Main branch requires release tags**:
|
||||
```bash
|
||||
git tag -a v1.5.0 -m "Release 1.5.0"
|
||||
git push origin v1.5.0
|
||||
```
|
||||
|
||||
## 🧪 Comprehensive Testing
|
||||
|
||||
### Test Suite Features
|
||||
|
||||
- **Dynamic Test Environment**: Creates isolated git repositories for each test run
|
||||
- **Pattern Matching**: Supports wildcard patterns for commit hash testing
|
||||
- **Comprehensive Coverage**: Tests all branch types and edge cases
|
||||
- **CI Integration**: Clean exit codes and minimal output for CI systems
|
||||
- **Automatic Cleanup**: Test data removed automatically after tests
|
||||
|
||||
### Running Tests
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
git clone git@github.com:QRun-IO/qqq-orb.git
|
||||
cd qqq-orb
|
||||
make test-all
|
||||
|
||||
# Run specific test suites
|
||||
make test # Orb tests only
|
||||
make test-scripts # Script tests only
|
||||
|
||||
# Run with verbose output
|
||||
./tests/run_tests.sh --verbose
|
||||
|
||||
# Run in CI mode
|
||||
./tests/run_tests.sh --ci
|
||||
|
||||
# Run linting checks
|
||||
make lint
|
||||
```
|
||||
|
||||
### Test Coverage
|
||||
See [QQQ Contribution Guidelines](https://github.com/Kingsrook/qqq/blob/develop/CONTRIBUTING.md).
|
||||
|
||||
The orb includes comprehensive testing:
|
||||
- **YAML Validation**: CircleCI orb configuration validation
|
||||
- **Shell Script Testing**: ShellCheck for shell script validation
|
||||
- **Orb Packing**: Tests orb packing and resolution
|
||||
- **Version Calculation**: 20+ test cases covering all branch types
|
||||
- **Integration Testing**: End-to-end workflow testing
|
||||
- **Edge Case Testing**: Invalid formats, missing tags, error conditions
|
||||
## License
|
||||
|
||||
## 📦 Usage Examples
|
||||
|
||||
### Maven Project (Backend Only)
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: snapshot
|
||||
```
|
||||
|
||||
### Node.js Project (Frontend Only)
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: release
|
||||
```
|
||||
|
||||
### Hybrid Project (Maven + Node.js)
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
- qqq-orb/publish:
|
||||
context: qqq-maven-registry-credentials
|
||||
branch_type: release_candidate
|
||||
```
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
**Important**: This repository is a component of the QQQ framework. All contributions, issues, and discussions should go through the main QQQ repository.
|
||||
|
||||
### Development Workflow
|
||||
|
||||
1. **Fork the main QQQ repository**: https://github.com/Kingsrook/qqq
|
||||
2. **Create a feature branch**: `git checkout -b feature/amazing-feature`
|
||||
3. **Make your changes** (including orb changes if applicable)
|
||||
4. **Run tests**: `make test-all`
|
||||
5. **Run linting**: `make lint`
|
||||
6. **Commit your changes**: `git commit -m 'Add amazing feature'`
|
||||
7. **Push to the branch**: `git push origin feature/amazing-feature`
|
||||
8. **Open a Pull Request** to the main QQQ repository
|
||||
|
||||
### Code Standards
|
||||
|
||||
- **YAML**: Follow CircleCI orb best practices
|
||||
- **Shell Scripts**: Use ShellCheck for validation, comprehensive testing
|
||||
- **Documentation**: Update README and inline documentation
|
||||
- **Testing**: Comprehensive test coverage with dynamic test environments
|
||||
- **Quality Gates**: All changes must pass linting and testing
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||
|
||||
```
|
||||
QQQ Orb
|
||||
Copyright (C) 2021-2024 Kingsrook, LLC
|
||||
651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
|
||||
contact@kingsrook.com | https://github.com/Kingsrook/
|
||||
```
|
||||
|
||||
## 🆘 Support & Community
|
||||
|
||||
### ⚠️ Important: Use Main QQQ Repository
|
||||
|
||||
**All support, issues, discussions, and community interactions should go through the main QQQ repository:**
|
||||
|
||||
- **Main Repository**: https://github.com/Kingsrook/qqq
|
||||
- **Issues**: https://github.com/Kingsrook/qqq/issues
|
||||
- **Discussions**: https://github.com/Kingsrook/qqq/discussions
|
||||
- **Wiki**: https://github.com/Kingsrook/qqq/wiki
|
||||
|
||||
### Why This Repository Exists
|
||||
|
||||
This repository is maintained separately from the main QQQ repository to:
|
||||
- **Enable independent orb development** and versioning
|
||||
- **Allow orb-specific CI/CD** and deployment pipelines
|
||||
- **Provide clear separation** between orb and framework concerns
|
||||
- **Support different release cycles** for CI/CD tools vs. core framework
|
||||
|
||||
### Getting Help
|
||||
|
||||
- **Documentation**: Check the [QQQ Wiki](https://github.com/Kingsrook/qqq/wiki)
|
||||
- **Issues**: Report bugs and feature requests on [Main QQQ Issues](https://github.com/Kingsrook/qqq/issues)
|
||||
- **Discussions**: Join community discussions on [Main QQQ Discussions](https://github.com/Kingsrook/qqq/discussions)
|
||||
- **Questions**: Ask questions in the main QQQ repository
|
||||
|
||||
### Contact Information
|
||||
|
||||
- **Company**: Kingsrook, LLC
|
||||
- **Email**: contact@kingsrook.com
|
||||
- **Website**: https://qrun.io
|
||||
- **Main GitHub**: https://github.com/Kingsrook/qqq
|
||||
- **CircleCI Registry**: [kingsrook/qqq-orb](https://circleci.com/developer/orbs/orb/kingsrook/qqq-orb)
|
||||
|
||||
## 🙏 Acknowledgments
|
||||
|
||||
- **CircleCI Team**: For the excellent CI/CD platform and orb system
|
||||
- **Maven Team**: For the powerful Java build system
|
||||
- **npm Team**: For the Node.js package management system
|
||||
- **QQQ Framework Team**: For the underlying low-code platform
|
||||
- **Open Source Community**: For the tools and libraries that make this possible
|
||||
|
||||
---
|
||||
|
||||
**Built with ❤️ by the Kingsrook Team**
|
||||
|
||||
**This is a CI/CD component of the QQQ framework. For complete information, support, and community, visit: https://github.com/Kingsrook/qqq**
|
||||
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,67 @@
|
||||
# Estate audit policy
|
||||
|
||||
`tools/audit_estate.py` classifies repositories from explicit mappings and observed source.
|
||||
It never changes consumers, branch rules or publication settings.
|
||||
|
||||
- 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.
|
||||
@@ -0,0 +1,224 @@
|
||||
# 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 | publish_snapshot | existing mvn_publish, snapshot |
|
||||
| release/* | publish_release_candidate | existing mvn_publish, release_candidate |
|
||||
| vX.Y.Z tag resolving to the checkout | publish_release | existing mvn_publish, release |
|
||||
| main, feature/*, hotfix/*, other/unknown branch | test_only | existing mvn_test_only |
|
||||
| Disabled publication or unrecognized/unproven tag | test_only | full verification, no publication |
|
||||
|
||||
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 does not
|
||||
accept these keys. 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 `test_only` 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.
|
||||
|
||||
## 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,41 @@
|
||||
# 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 profile is the exact semantic graph rendered by Munitor 0.3.11 from
|
||||
marketing-website commit `4eb5f63b9fbfac8e5529fcd638324870cea08ae2`, with its
|
||||
manifest's floating `0.3` pin changed to `0.3.11` for the baseline render.
|
||||
The checked-in fixture records that real render; the JSON resource contains the
|
||||
same jobs, parameters, contexts, filters and dependency edges.
|
||||
|
||||
There are five workflows and 33 job invocations: PR checks (7), develop (7),
|
||||
staging (7), release candidate (8), and production (4). They preserve Node 22,
|
||||
Chromium Playwright and Lighthouse, the existing scan and quality jobs, advisory
|
||||
SAST, and the existing synthetic zero-threshold coverage command. That command
|
||||
does not measure actual coverage.
|
||||
|
||||
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.
|
||||
|
||||
Keep `.munitor.yml` as declarative worker input when migrating the consumer.
|
||||
Munitor's `generate_dockerfile` reads it from the attached workspace and requires
|
||||
`pipeline: node-webapp` and `docker.use_repo_dockerfile: true` to preserve the
|
||||
repository Dockerfile. The profile does not replace that file or validate all
|
||||
of its values. Changes to worker input require review alongside the centralized
|
||||
profile; arbitrary manifest job overrides are not supported. Health remains `/`
|
||||
on port 3000; the repository Dockerfile remains responsible for the standalone
|
||||
runtime without npm or npx.
|
||||
|
||||
`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,41 @@
|
||||
# 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` | Selects one of the five audited test branch exclusions. |
|
||||
|
||||
`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.
|
||||
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"])`; the legacy one-argument
|
||||
form is only for manifests without an explicit policy.
|
||||
|
||||
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.
|
||||
@@ -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,9 @@
|
||||
# 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.
|
||||
@@ -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,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,82 @@
|
||||
# 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 `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.
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/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"), ("MARKETING_TEMPLATE", "marketing")):
|
||||
payload = base64.b64encode(zlib.compress((source.parent / "templates" / (name + ".json")).read_bytes(), 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
-4
@@ -4,14 +4,13 @@ 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:
|
||||
localstack: localstack/platform@2.1
|
||||
browser-tools: circleci/browser-tools@1.4.7
|
||||
slack: circleci/slack@5.2.1
|
||||
node: circleci/node@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
|
||||
@@ -11,6 +11,8 @@ steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-npm-dependencies-{{ checksum "package.json" }}
|
||||
- run:
|
||||
name: Setup NPM authentication
|
||||
@@ -30,5 +32,8 @@ steps:
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- node_modules
|
||||
key: v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
key: v1-npm-dependencies-{{ checksum "package.json" }}
|
||||
@@ -33,6 +33,9 @@ steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "pom.xml" }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-npm-dependencies-{{ checksum "package.json" }}
|
||||
|
||||
# (Optional) Guard: if node_modules is missing, install it quickly so "npm run build" works
|
||||
- run:
|
||||
@@ -67,3 +70,9 @@ steps:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "pom.xml" }}
|
||||
|
||||
# Re-cache Node deps
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
key: v1-npm-dependencies-{{ checksum "package.json" }}
|
||||
@@ -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,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:
|
||||
- browser-tools/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,9 +1,8 @@
|
||||
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
|
||||
|
||||
steps:
|
||||
@@ -15,6 +14,9 @@ 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
|
||||
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 branches)
|
||||
|
||||
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,26 @@
|
||||
description: >
|
||||
Creates a GitHub Release for the current version tag.
|
||||
- Extracts version from pom.xml or package.json
|
||||
- Verifies the Git tag exists
|
||||
- Creates GitHub release with auto-generated notes
|
||||
- Adds artifact links to Maven Central and/or npmjs
|
||||
- Handles prerelease versions (RC, SNAPSHOT, alpha, beta)
|
||||
|
||||
parameters:
|
||||
project_type:
|
||||
type: enum
|
||||
enum: [maven, node, both, auto]
|
||||
default: auto
|
||||
description: >
|
||||
Project type for artifact link generation.
|
||||
- maven: Link to Maven Central
|
||||
- node: Link to npmjs
|
||||
- both: Link to both registries
|
||||
- auto: Auto-detect from project files
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: Create GitHub Release
|
||||
command: <<include(scripts/create_github_release.sh)>>
|
||||
environment:
|
||||
PROJECT_TYPE: << parameters.project_type >>
|
||||
@@ -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 ]
|
||||
@@ -0,0 +1,18 @@
|
||||
description: >
|
||||
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:
|
||||
image:
|
||||
default: ubuntu-2204:current
|
||||
description: >
|
||||
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,21 +1,34 @@
|
||||
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: localstack/default
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
java_version:
|
||||
type: string
|
||||
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_package
|
||||
- mvn_jar_deploy
|
||||
- git_operations
|
||||
- git_operations:
|
||||
branch_type: << parameters.branch_type >>
|
||||
@@ -1,12 +1,26 @@
|
||||
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: localstack/default
|
||||
executor: java
|
||||
|
||||
parameters:
|
||||
java_version:
|
||||
type: string
|
||||
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
|
||||
@@ -1,11 +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: localstack/default
|
||||
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"
|
||||
description: "Java major version to install (e.g., '17', '21')"
|
||||
branch_type:
|
||||
type: string
|
||||
default: "snapshot"
|
||||
@@ -20,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
|
||||
|
||||
@@ -43,9 +64,32 @@ steps:
|
||||
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 >>", "hotfix" ]
|
||||
steps:
|
||||
- publish_github_release:
|
||||
project_type: maven
|
||||
@@ -4,17 +4,33 @@ description: >
|
||||
Used by: test_only workflow for feature branches
|
||||
Triggers: Any push to branches NOT matching develop, main, release/*, hotfix/*
|
||||
|
||||
executor: localstack/default
|
||||
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"
|
||||
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 >>
|
||||
@@ -3,20 +3,43 @@ description: >
|
||||
Handles version management, building, testing, and publishing based on branch type
|
||||
Supports: snapshot, release_candidate, release, and hotfix workflows
|
||||
|
||||
executor: localstack/default
|
||||
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')."
|
||||
branch_type:
|
||||
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 >>", "hotfix" ]
|
||||
steps:
|
||||
- publish_github_release:
|
||||
project_type: node
|
||||
@@ -3,9 +3,15 @@ description: >
|
||||
Handles testing based on branch type
|
||||
Supports: snapshot, release_candidate, release, and hotfix workflows
|
||||
|
||||
executor: localstack/default
|
||||
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')."
|
||||
branch_type:
|
||||
type: string
|
||||
default: "snapshot"
|
||||
|
||||
@@ -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
|
||||
@@ -55,7 +55,15 @@ find_original_feature_branch() {
|
||||
####################################
|
||||
## Get current branch and version ##
|
||||
####################################
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
# Try to get branch from CircleCI environment variable first (for CI environments)
|
||||
# then fall back to git command (for local development)
|
||||
if [[ -n "$CIRCLE_BRANCH" ]]; then
|
||||
echo "Using branch from CircleCI environment: $CIRCLE_BRANCH"
|
||||
CURRENT_BRANCH="$CIRCLE_BRANCH"
|
||||
else
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
fi
|
||||
|
||||
CURRENT_VERSION=$(grep '<revision>' "$POM_FILE" | sed 's/.*<revision>//;s/<.*//')
|
||||
|
||||
# Check if we're on a tag (HEAD means we're on a tag)
|
||||
|
||||
@@ -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"
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Collect SpotBugs and PMD reports to a central location for artifacts
|
||||
REPORT_DIR="/home/circleci/static-analysis-reports"
|
||||
mkdir -p "$REPORT_DIR/spotbugs" "$REPORT_DIR/pmd"
|
||||
|
||||
echo "Collecting static analysis reports..."
|
||||
|
||||
# Collect SpotBugs reports
|
||||
find . -name "spotbugsXml.xml" -exec sh -c '
|
||||
MODULE=$(dirname "$1" | sed "s|^\./||;s|/target.*||" | tr "/" "_")
|
||||
cp "$1" "'"$REPORT_DIR/spotbugs"'/${MODULE}_spotbugs.xml" 2>/dev/null || true
|
||||
' _ {} \;
|
||||
|
||||
# Collect PMD reports
|
||||
find . -name "pmd.xml" -exec sh -c '
|
||||
MODULE=$(dirname "$1" | sed "s|^\./||;s|/target.*||" | tr "/" "_")
|
||||
cp "$1" "'"$REPORT_DIR/pmd"'/${MODULE}_pmd.xml" 2>/dev/null || true
|
||||
' _ {} \;
|
||||
|
||||
# Generate combined summary
|
||||
{
|
||||
echo "=== Static Analysis Report Summary ==="
|
||||
echo "Generated: $(date)"
|
||||
echo ""
|
||||
echo "SpotBugs:"
|
||||
} > "$REPORT_DIR/summary.txt"
|
||||
|
||||
find "$REPORT_DIR/spotbugs" -name "*.xml" 2>/dev/null | while read -r f; do
|
||||
MODULE=$(basename "$f" _spotbugs.xml)
|
||||
COUNT=$(grep -c "<BugInstance" "$f" 2>/dev/null || echo "0")
|
||||
echo " $MODULE: $COUNT bugs" >> "$REPORT_DIR/summary.txt"
|
||||
done
|
||||
|
||||
echo "" >> "$REPORT_DIR/summary.txt"
|
||||
echo "PMD:" >> "$REPORT_DIR/summary.txt"
|
||||
|
||||
find "$REPORT_DIR/pmd" -name "*.xml" 2>/dev/null | while read -r f; do
|
||||
MODULE=$(basename "$f" _pmd.xml)
|
||||
COUNT=$(grep -c "<violation" "$f" 2>/dev/null || echo "0")
|
||||
echo " $MODULE: $COUNT violations" >> "$REPORT_DIR/summary.txt"
|
||||
done
|
||||
|
||||
cat "$REPORT_DIR/summary.txt"
|
||||
echo ""
|
||||
echo "Reports collected to: $REPORT_DIR"
|
||||
@@ -3,86 +3,278 @@
|
||||
############################################################################
|
||||
## create_github_release.sh
|
||||
## GitHub Release Creation Script
|
||||
##
|
||||
##
|
||||
## This script creates GitHub releases for production releases.
|
||||
## The Git tag should already exist from the version management process.
|
||||
## This script creates the corresponding GitHub release using the GitHub API.
|
||||
##
|
||||
## Process:
|
||||
## 1. Extracts version from pom.xml revision field
|
||||
## 2. Verifies the Git tag exists (should be created by version management)
|
||||
## 3. Creates GitHub release using GitHub API (no gh CLI required)
|
||||
## 4. Generates release notes from recent commits
|
||||
## 1. Extracts version from pom.xml or package.json
|
||||
## 2. Verifies the Git tag exists
|
||||
## 3. Creates GitHub release using GitHub API with auto-generated notes
|
||||
## 4. Adds artifact links to Maven Central and/or npmjs
|
||||
##
|
||||
## Usage: Called by CircleCI orb commands publish_release and publish_hotfix
|
||||
## Environment Variables:
|
||||
## GITHUB_TOKEN - Required: GitHub token with repo scope
|
||||
## PROJECT_TYPE - Optional: maven, node, or both (default: auto-detect)
|
||||
## DRY_RUN - Optional: Set to "true" to skip API calls
|
||||
## CIRCLE_PROJECT_USERNAME - CircleCI: GitHub org/user
|
||||
## CIRCLE_PROJECT_REPONAME - CircleCI: Repository name
|
||||
##
|
||||
## Usage: Called by CircleCI orb command publish_github_release
|
||||
## Output: Creates GitHub release for the existing tag
|
||||
############################################################################
|
||||
|
||||
set -e
|
||||
|
||||
##################################
|
||||
## Extract version from pom.xml ##
|
||||
##################################
|
||||
VERSION=$(grep '<revision>' pom.xml | sed 's/.*<revision>//;s/<.*//')
|
||||
###################
|
||||
## Configuration ##
|
||||
###################
|
||||
DRY_RUN="${DRY_RUN:-false}"
|
||||
REPO_OWNER="${CIRCLE_PROJECT_USERNAME:-}"
|
||||
REPO_NAME="${CIRCLE_PROJECT_REPONAME:-}"
|
||||
API_URL="https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases"
|
||||
|
||||
############################
|
||||
## Validate configuration ##
|
||||
############################
|
||||
if [[ -z "$GITHUB_TOKEN" ]]; then
|
||||
echo "ERROR: GITHUB_TOKEN environment variable is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "$REPO_OWNER" ]] || [[ -z "$REPO_NAME" ]]; then
|
||||
echo "ERROR: CIRCLE_PROJECT_USERNAME and CIRCLE_PROJECT_REPONAME must be set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Repository: ${REPO_OWNER}/${REPO_NAME}"
|
||||
|
||||
###############################
|
||||
## Extract version from file ##
|
||||
###############################
|
||||
VERSION=""
|
||||
PROJECT_TYPE="${PROJECT_TYPE:-auto}"
|
||||
|
||||
# Auto-detect project type if not specified
|
||||
if [[ "$PROJECT_TYPE" == "auto" ]]; then
|
||||
if [[ -f "pom.xml" ]]; then
|
||||
PROJECT_TYPE="maven"
|
||||
elif [[ -f "package.json" ]]; then
|
||||
PROJECT_TYPE="node"
|
||||
else
|
||||
echo "ERROR: Cannot detect project type. No pom.xml or package.json found."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Project type: $PROJECT_TYPE"
|
||||
|
||||
# Extract version based on project type
|
||||
if [[ "$PROJECT_TYPE" == "maven" ]] || [[ "$PROJECT_TYPE" == "both" ]]; then
|
||||
if [[ -f "pom.xml" ]]; then
|
||||
VERSION=$(grep '<revision>' pom.xml | sed 's/.*<revision>//;s/<.*//' | head -1)
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
# Fallback to version tag if revision not found
|
||||
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>//;s/<.*//')
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$VERSION" ]] && { [[ "$PROJECT_TYPE" == "node" ]] || [[ "$PROJECT_TYPE" == "both" ]]; }; then
|
||||
if [[ -f "package.json" ]]; then
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
echo "ERROR: Could not extract version from project files"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TAG_NAME="v$VERSION"
|
||||
echo "Creating GitHub release for tag: $TAG_NAME"
|
||||
echo "Version: $VERSION"
|
||||
echo "Tag: $TAG_NAME"
|
||||
|
||||
#######################################
|
||||
## Determine if this is a prerelease ##
|
||||
#######################################
|
||||
PRERELEASE="false"
|
||||
if [[ "$VERSION" =~ -RC\.[0-9]+$ ]] || [[ "$VERSION" =~ -SNAPSHOT$ ]] || [[ "$VERSION" =~ -alpha ]] || [[ "$VERSION" =~ -beta ]]; then
|
||||
PRERELEASE="true"
|
||||
echo "This is a prerelease version"
|
||||
fi
|
||||
|
||||
##########################################
|
||||
## Verify the tag exists (should be created by version management) ##
|
||||
## Verify the tag exists ##
|
||||
##########################################
|
||||
if ! git tag --list | grep -q "^$TAG_NAME$"; then
|
||||
echo "ERROR: Tag $TAG_NAME does not exist"
|
||||
echo "The tag should have been created by the version management process"
|
||||
exit 1
|
||||
# Also check for version- prefix format
|
||||
ALT_TAG="version-$VERSION"
|
||||
if git tag --list | grep -q "^$ALT_TAG$"; then
|
||||
TAG_NAME="$ALT_TAG"
|
||||
echo "Using alternate tag format: $TAG_NAME"
|
||||
else
|
||||
echo "ERROR: Tag $TAG_NAME does not exist"
|
||||
echo "The tag should have been created by the version management process"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Tag $TAG_NAME exists, proceeding with GitHub release creation"
|
||||
|
||||
##########################################
|
||||
## Generate release notes from commits ##
|
||||
##########################################
|
||||
echo "Generating release notes..."
|
||||
################################
|
||||
## Build artifact links ##
|
||||
################################
|
||||
ARTIFACT_SECTION=""
|
||||
|
||||
# Get the previous tag for comparison
|
||||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match="v*" HEAD~1 2>/dev/null || echo "")
|
||||
# Maven Central links
|
||||
if [[ "$PROJECT_TYPE" == "maven" ]] || [[ "$PROJECT_TYPE" == "both" ]]; then
|
||||
if [[ -f "pom.xml" ]]; then
|
||||
GROUP_ID=$(grep -m1 '<groupId>' pom.xml | sed 's/.*<groupId>//;s/<.*//')
|
||||
ARTIFACT_ID=$(grep -m1 '<artifactId>' pom.xml | sed 's/.*<artifactId>//;s/<.*//')
|
||||
|
||||
if [[ -n "$PREVIOUS_TAG" ]]; then
|
||||
echo "Comparing with previous release: $PREVIOUS_TAG"
|
||||
RELEASE_NOTES=$(git log --pretty=format:"- %s" "$PREVIOUS_TAG"..HEAD | head -20)
|
||||
else
|
||||
echo "No previous tag found, using recent commits"
|
||||
RELEASE_NOTES=$(git log --pretty=format:"- %s" -10)
|
||||
if [[ -n "$GROUP_ID" ]] && [[ -n "$ARTIFACT_ID" ]]; then
|
||||
MAVEN_URL="https://central.sonatype.com/artifact/${GROUP_ID}/${ARTIFACT_ID}/${VERSION}"
|
||||
ARTIFACT_SECTION="### Artifacts
|
||||
|
||||
**Maven Central:**
|
||||
- [${GROUP_ID}:${ARTIFACT_ID}:${VERSION}](${MAVEN_URL})"
|
||||
echo "Maven artifact: ${GROUP_ID}:${ARTIFACT_ID}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create a more detailed release notes
|
||||
FULL_NOTES="## Release $VERSION
|
||||
# NPM links
|
||||
if [[ "$PROJECT_TYPE" == "node" ]] || [[ "$PROJECT_TYPE" == "both" ]]; then
|
||||
if [[ -f "package.json" ]]; then
|
||||
NPM_PACKAGE=$(jq -r '.name' package.json)
|
||||
|
||||
### Changes
|
||||
$RELEASE_NOTES
|
||||
if [[ -n "$NPM_PACKAGE" ]] && [[ "$NPM_PACKAGE" != "null" ]]; then
|
||||
NPM_URL="https://www.npmjs.com/package/${NPM_PACKAGE}/v/${VERSION}"
|
||||
if [[ -n "$ARTIFACT_SECTION" ]]; then
|
||||
ARTIFACT_SECTION="${ARTIFACT_SECTION}
|
||||
|
||||
### Artifacts
|
||||
This release includes Maven artifacts published to Maven Central.
|
||||
**NPM:**
|
||||
- [${NPM_PACKAGE}@${VERSION}](${NPM_URL})"
|
||||
else
|
||||
ARTIFACT_SECTION="### Artifacts
|
||||
|
||||
**NPM:**
|
||||
- [${NPM_PACKAGE}@${VERSION}](${NPM_URL})"
|
||||
fi
|
||||
echo "NPM package: ${NPM_PACKAGE}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add footer
|
||||
if [[ -n "$ARTIFACT_SECTION" ]]; then
|
||||
ARTIFACT_SECTION="${ARTIFACT_SECTION}
|
||||
|
||||
---
|
||||
*Automated release from CircleCI*"
|
||||
_Automated release via CircleCI_"
|
||||
fi
|
||||
|
||||
###########################
|
||||
## Create GitHub release ##
|
||||
###########################
|
||||
echo "Creating GitHub release for $TAG_NAME"
|
||||
|
||||
# Create the release using GitHub API
|
||||
curl -X POST \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"$TAG_NAME\",
|
||||
\"name\": \"Release $VERSION\",
|
||||
\"body\": $(echo "$FULL_NOTES" | jq -Rs .),
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
}" \
|
||||
"https://api.github.com/repos/Kingsrook/qqq/releases"
|
||||
if [[ "$DRY_RUN" == "true" ]]; then
|
||||
echo "DRY RUN: Would create release with:"
|
||||
echo " Tag: $TAG_NAME"
|
||||
echo " Name: Release $VERSION"
|
||||
echo " Prerelease: $PRERELEASE"
|
||||
echo " Artifact section:"
|
||||
echo "$ARTIFACT_SECTION"
|
||||
echo "DRY RUN: Skipping API call"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "✅ GitHub release created successfully for $TAG_NAME"
|
||||
# Build the request body
|
||||
# Using generate_release_notes to auto-generate from PRs (respects .github/release.yml)
|
||||
REQUEST_BODY=$(jq -n \
|
||||
--arg tag "$TAG_NAME" \
|
||||
--arg name "Release $VERSION" \
|
||||
--arg body "$ARTIFACT_SECTION" \
|
||||
--argjson prerelease "$PRERELEASE" \
|
||||
'{
|
||||
tag_name: $tag,
|
||||
name: $name,
|
||||
body: $body,
|
||||
draft: false,
|
||||
prerelease: $prerelease,
|
||||
generate_release_notes: true
|
||||
}')
|
||||
|
||||
# Keep response bodies private: errors can contain repository details or echoed input.
|
||||
request_release() {
|
||||
local method="$1" url="$2"
|
||||
local args=(-s --connect-timeout 10 --max-time 60 -w "\n%{http_code}" -X "$method"
|
||||
-H "Accept: application/vnd.github.v3+json"
|
||||
-H "Authorization: token $GITHUB_TOKEN")
|
||||
if [[ "$method" == POST ]]; then
|
||||
args+=(-H "Content-Type: application/json" -d "$REQUEST_BODY")
|
||||
fi
|
||||
if ! HTTP_RESPONSE=$(curl "${args[@]}" "$url"); then
|
||||
echo "ERROR: GitHub release request failed at the transport layer"
|
||||
return 1
|
||||
fi
|
||||
HTTP_BODY=$(printf '%s\n' "$HTTP_RESPONSE" | sed '$d')
|
||||
HTTP_CODE=$(printf '%s\n' "$HTTP_RESPONSE" | tail -n1)
|
||||
if [[ ! "$HTTP_CODE" =~ ^[0-9]{3}$ ]]; then
|
||||
echo "ERROR: GitHub release request returned an invalid HTTP status"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
same_published_tag() {
|
||||
jq -e --arg tag "$TAG_NAME" '.tag_name == $tag and .draft == false' \
|
||||
<<< "$HTTP_BODY" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
MAX_ATTEMPTS=2
|
||||
for ((attempt=1; attempt<=MAX_ATTEMPTS; attempt++)); do
|
||||
request_release POST "$API_URL"
|
||||
case "$HTTP_CODE" in
|
||||
2??)
|
||||
if ! same_published_tag; then
|
||||
echo "ERROR: GitHub release response did not confirm the requested published tag"
|
||||
exit 1
|
||||
fi
|
||||
echo "GitHub release created successfully for $TAG_NAME"
|
||||
exit 0
|
||||
;;
|
||||
5??)
|
||||
if [[ "$attempt" -lt "$MAX_ATTEMPTS" ]]; then
|
||||
echo "GitHub server error (HTTP $HTTP_CODE); retrying release creation"
|
||||
sleep 2
|
||||
else
|
||||
echo "ERROR: GitHub release creation failed after $MAX_ATTEMPTS attempts (HTTP $HTTP_CODE)"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
422)
|
||||
# A validation failure is not proof that this release already exists.
|
||||
if ! jq -e 'any(.errors[]?; .resource == "Release" and .field == "tag_name" and .code == "already_exists")' \
|
||||
<<< "$HTTP_BODY" >/dev/null 2>&1; then
|
||||
echo "ERROR: GitHub release creation rejected (HTTP 422)"
|
||||
exit 1
|
||||
fi
|
||||
ENCODED_TAG=$(jq -nr --arg tag "$TAG_NAME" '$tag | @uri')
|
||||
request_release GET "$API_URL/tags/$ENCODED_TAG"
|
||||
if [[ "$HTTP_CODE" != 200 ]] || ! same_published_tag; then
|
||||
echo "ERROR: Existing GitHub release could not be verified for the requested published tag (HTTP $HTTP_CODE)"
|
||||
exit 1
|
||||
fi
|
||||
echo "Published GitHub release for $TAG_NAME already exists; verified"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: GitHub release creation failed (HTTP $HTTP_CODE)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
exit 1
|
||||
@@ -14,4 +14,7 @@
|
||||
set -e
|
||||
|
||||
echo "Running Maven Compile with optimized settings"
|
||||
mvn -s /tmp/circleci/mvn-settings.xml -T4 --no-transfer-progress compile
|
||||
## --update-snapshots: the ~/.m2 cache is keyed only on the pom checksum, so
|
||||
## without it a SNAPSHOT dependency restored from cache is never re-checked
|
||||
## (Maven's daily update policy) and builds run against stale snapshots.
|
||||
mvn -s /tmp/circleci/mvn-settings.xml --update-snapshots -T4 --no-transfer-progress compile
|
||||
Loaded 100 of 209 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user