Compare commits

...
Author SHA1 Message Date
james.maesandCodex 30bd089702 ci: trigger scans for newly protected release target
The original promotion PR was created before main protection, so default CodeQL did not run. Reopening did not register a scan. Trigger the documented push event without changing the tested source tree.

Co-Authored-By: Codex <noreply@openai.com>
2026-10-20 21:45:28 -05:00
james.maesandCodex 0692f9dfec release: promote tested Android publisher and All regression coverage
Promote the exact tested develop tree while preserving the existing linear main history after earlier squash promotions.

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

---------

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

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

No files matched your search

+1
View File
@@ -3,3 +3,4 @@
*.py text eol=lf *.py text eol=lf
*.yml text eol=lf *.yml text eol=lf
*.yaml text eol=lf *.yaml text eol=lf
*.json text eol=lf
+6 -3
View File
@@ -12,7 +12,7 @@ on:
required: true required: true
type: string type: string
smoke_evidence: smoke_evidence:
description: github (legacy default) or circle (requires consumer adapter and Circle credential) description: github (legacy default) or circle (public API evidence; optional credential)
type: string type: string
default: github default: github
circle_workflow_id: circle_workflow_id:
@@ -494,9 +494,12 @@ jobs:
def circle(path): def circle(path):
token = os.environ.get('CIRCLECI_TOKEN') token = os.environ.get('CIRCLECI_TOKEN')
require(token, 'CIRCLECI_TOKEN is required for Circle evidence mode') # 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, request = urllib.request.Request('https://circleci.com/api/v2/' + path,
headers={'Circle-Token': token, 'Accept': 'application/json'}) headers=headers)
with urllib.request.build_opener(NoRedirect).open(request, timeout=30) as response: with urllib.request.build_opener(NoRedirect).open(request, timeout=30) as response:
raw = response.read(2_000_001) raw = response.read(2_000_001)
require(len(raw) <= 2_000_000, 'Evidence response exceeds bound') require(len(raw) <= 2_000_000, 'Evidence response exceeds bound')
+2 -2
View File
@@ -22,9 +22,9 @@ VOYAGE_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNrtW+tz2zYS/56/A
NEXT_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNrNVE1v2zAMvedXCFqAtlscb70tQLGtXTEUGFYgHXqJM0OxmUSJLCmS7DYr8t9HubaXOOnHYYfdLPLp6fGR9EOHEFqAsVxJOiCn/Q89H1FmYvH4gN94Wq1WAUYwQJdczqxRahlWwc9xfD08j28vhzdX1z/imOKVTcmxUNscOp8Ibudxyux8ophJ4wUzTRoBcA9J7pSP1Q+GC1Yw2qsR1oH2jKMqgKFkDslS5a4BkYZwW3nIpXVMiLgkHOxgEFVnpUoBs87k0NtF+Ez81yZ6ekq3AJvme/OEDpPL/Wcly/xz9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orO3qewf/DTp3nXKRlo3BgHE8IVqqMe6Y5iTLgPSUgfVsjqaXOSDVwJAiw7t8gA6GS5ZQ3ebfWUI52dRZcujqF1VefE69m8CjhFWU2y4CN88sXp6CFWtf3xp365uP63imznAp1d2CHK5O3t7da9tHza1iuEdM6LqXv+4wWOGzcXgJTE8MkWnIo5zd4JtFob3jYfxvSFmDTa7M5NnuCSUmx3ilkKxcWB8hr5w653z69PH4v/SabCcM1uHcHhJZel6sRGJhx68w6SAykIB1nwu6qH/f+V/9p+KsYvQ8+jt9FUb/1cRwML5rDyafu/nuvacD+2Hc2nT/snNGl")))
ALL_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNq1T7EOgjAU3PmKpjNIdHQyJg4ukmDiYkwDUkxt4UkLEkP4dwsSUojootu7u/fu7lUWQvhOpWKQ4iVazOZ2w4AMlYaVnjXKsszRjCYwZ+lFSQDuduSKEM9fk8PG32+9HSFYn9StRwmSxwJKw0gHsfjhBGnkqAQ47RWtXaGNPHYY9YpZwQ2EIC8X47bbSYOkccRhwUTUhuRU5dhYqvu5rfglZ1xxFHMGSbE91G4SYiYmZUmzgkk6/LPTplsjdPrXD3EhxIcf3sk//sEy1QbVVm09Ad15mhY="))) ALL_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNq1T7EOgjAU3PmKpjNIdHQyJg4ukmDiYkwDUkxt4UkLEkP4dwsSUojootu7u/fu7lUWQvhOpWKQ4iVazOZ2w4AMlYaVnjXKsszRjCYwZ+lFSQDuduSKEM9fk8PG32+9HSFYn9StRwmSxwJKw0gHsfjhBGnkqAQ47RWtXaGNPHYY9YpZwQ2EIC8X47bbSYOkccRhwUTUhuRU5dhYqvu5rfglZ1xxFHMGSbE91G4SYiYmZUmzgkk6/LPTplsjdPrXD3EhxIcf3sk//sEy1QbVVm09Ad15mhY=")))
STARTER_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNp1UMGKwkAMvc9XlDmKtejR0yJ42MsKCl5EQnUzZbbTiZ0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+hjwTUzXUFs8d0Hsw6mYVQza96IZo3qjOdVeYvAefaGqwDS7SfCRaRklHAZA9/L4zAhwrBrdmiZaKj78VgQwe2637EOhRvUifKVP0E+HELwPjj2WPhqxIlCl3G5u4pgcpjhq87IKiUc4qGj8NmCTAFFi15HObHp7vLD5gLXiPGDUbLXTF37lJluGXONcI6aTvTlC2I0VejryyywCgqcWXAHl1AYMVNd5hRKpLvbyWSz2XxF39H7VuHZ/EE2Q7orNBwzb2fFEtZ53Psj6YRBHO2OrUMaxOyJCZV74XRNwmkb9YusjU+6u3OoZU/pAF97DuVyXyv6WnEo9vna7nOdXr8trMqrvDBpv88rKK52XkI/7dVhyoiw6fYJDvv6lXaVTvBtMpn0QOJ5bzI8Fu4jGQb1HojoaPWB+hM4ahP8KL2OlXjg1t+Ym506ASriBbDG64Sr0glN1C9TJ5xyd2ehE07oAK8ThnK51wleJwzFPq8TPtfpXid4nTAYNzt1gmaCEcMw7DvmMbHMKwb/SVZNCv+JzjCuON/vbwbwlhcuZxEfr3K8yjkLqnpJ9BtHyOsnr58ugshVbR/VM/ezuMLhBvcODhzy/8NhuSgd0qmCc63igtrquPby93r+YJYRLv2LvsES1XuKmGFfvJ2KKEXuXrpFNIZckKt+llQ4TGNc4tq+2Q4P/lbJzxWTdv1zpUIqCgP7xvAsqdy0RzH5xLWSGaDdSHcIdhhOlM5ICViCMXjA/2UdqH2StngXvklasNCw0DJJpDXl2LCGh83UxJ3R4zXJxIEFHsEuIwaBKuUb5T+chfEh62tks9Z/qkigP/+63PR6Mvr6Oub/cvR+XeL+e3q0Gf0Hgnpc+w==")))
class ManifestError(ValueError): class ManifestError(ValueError):
+6 -9
View File
@@ -86,14 +86,8 @@
"android/restore-gradle-cache", "android/restore-gradle-cache",
{ {
"run": { "run": {
"name": "Write credentials to gradle.properties", "name": "Publish with shared Maven credentials",
"command": "echo \"\" >> gradle.properties\necho \"githubQqqMavenRegistryUsername=${QQQ_ANDROID_MAVEN_REGISTRY_USERNAME}\" >> gradle.properties\necho \"githubQqqMavenRegistryPassword=${QQQ_ANDROID_MAVEN_REGISTRY_PASSWORD}\" >> gradle.properties\n" "command": "set -euo pipefail\n: \"${GITHUB_TOKEN:?GitHub Packages write credential is required}\"\n# Authenticate before compiling; repository access is necessary, not proof of package write access.\nregistry_user=$(python3 <<'PYTHON'\nimport json\nimport os\nimport urllib.request\n\nclass NoRedirect(urllib.request.HTTPRedirectHandler):\n def redirect_request(self, req, fp, code, msg, headers, newurl):\n raise RuntimeError(\"GitHub authentication redirect refused\")\n\ntry:\n opener = urllib.request.build_opener(NoRedirect)\n def get(path):\n request = urllib.request.Request(\"https://api.github.com/\" + path,\n headers={\"Authorization\": \"Bearer \" + os.environ[\"GITHUB_TOKEN\"],\n \"Accept\": \"application/vnd.github+json\"})\n with opener.open(request, timeout=30) as response:\n return json.load(response)\n user = get(\"user\").get(\"login\")\n if not isinstance(user, str) or not user or not get(\"repos/QRun-IO/qqq-maven-registry\").get(\"permissions\", {}).get(\"push\"):\n raise ValueError(\"Missing registry access\")\n print(user)\nexcept Exception:\n raise SystemExit(\"GitHub Packages credential cannot access the Maven registry\") from None\nPYTHON\n)\nexport ORG_GRADLE_PROJECT_githubQqqMavenRegistryUsername=\"$registry_user\"\nexport ORG_GRADLE_PROJECT_githubQqqMavenRegistryPassword=\"$GITHUB_TOKEN\"\n./gradlew --console=plain publishMavenPublicationToGithubQqqMavenRegistryRepository\n"
}
},
{
"run": {
"name": "Publish (Deploy) to Maven",
"command": "./gradlew publishMavenPublicationToGithubQqqMavenRegistryRepository\n"
} }
} }
] ]
@@ -116,7 +110,10 @@
"branches": { "branches": {
"only": "main" "only": "main"
} }
} },
"context": [
"qqq-maven-registry-credentials"
]
} }
} }
] ]
+1 -1
View File
@@ -318,7 +318,7 @@
"smoke_evidence": { "smoke_evidence": {
"description": "Evidence provider; github preserves the original Smoke workflow validation", "description": "Evidence provider; github preserves the original Smoke workflow validation",
"type": "choice", "type": "choice",
"default": "github", "default": "circle",
"options": [ "options": [
"github", "github",
"circle" "circle"
+5 -5
View File
@@ -11,7 +11,7 @@
"name": "build-and-test", "name": "build-and-test",
"node_version": "22", "node_version": "22",
"package_manager": "npm", "package_manager": "npm",
"test_commands": "[ \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\" ]", "test_commands": "[\"npm run lint\", \"npm run build\", \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\"]",
"context": [ "context": [
"github" "github"
], ],
@@ -137,7 +137,7 @@
"name": "build-and-test", "name": "build-and-test",
"node_version": "22", "node_version": "22",
"package_manager": "npm", "package_manager": "npm",
"test_commands": "[ \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\" ]", "test_commands": "[\"npm run lint\", \"npm run build\", \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\"]",
"context": [ "context": [
"github" "github"
], ],
@@ -252,7 +252,7 @@
"name": "build-and-test", "name": "build-and-test",
"node_version": "22", "node_version": "22",
"package_manager": "npm", "package_manager": "npm",
"test_commands": "[ \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\" ]", "test_commands": "[\"npm run lint\", \"npm run build\", \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\"]",
"context": [ "context": [
"github" "github"
], ],
@@ -367,7 +367,7 @@
"name": "build-and-test", "name": "build-and-test",
"node_version": "22", "node_version": "22",
"package_manager": "npm", "package_manager": "npm",
"test_commands": "[ \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\" ]", "test_commands": "[\"npm run lint\", \"npm run build\", \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\"]",
"context": [ "context": [
"github" "github"
], ],
@@ -514,7 +514,7 @@
"name": "build-and-test", "name": "build-and-test",
"node_version": "22", "node_version": "22",
"package_manager": "npm", "package_manager": "npm",
"test_commands": "[ \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\" ]", "test_commands": "[\"npm run lint\", \"npm run build\", \"npx playwright install chromium --with-deps\", \"npm run test:chromium\", \"npm run lighthouse\"]",
"context": [ "context": [
"github" "github"
], ],
+5 -2
View File
@@ -86,9 +86,12 @@ class NoRedirect(urllib.request.HTTPRedirectHandler):
def circle(path): def circle(path):
token = os.environ.get('CIRCLECI_TOKEN') token = os.environ.get('CIRCLECI_TOKEN')
require(token, 'CIRCLECI_TOKEN is required for Circle evidence mode') # 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, request = urllib.request.Request('https://circleci.com/api/v2/' + path,
headers={'Circle-Token': token, 'Accept': 'application/json'}) headers=headers)
with urllib.request.build_opener(NoRedirect).open(request, timeout=30) as response: with urllib.request.build_opener(NoRedirect).open(request, timeout=30) as response:
raw = response.read(2_000_001) raw = response.read(2_000_001)
require(len(raw) <= 2_000_000, 'Evidence response exceeds bound') require(len(raw) <= 2_000_000, 'Evidence response exceeds bound')
+2 -1
View File
@@ -35,7 +35,8 @@ class AllReleaseCallerTests(unittest.TestCase):
for name in inputs: for name in inputs:
self.assertEqual('${{ inputs.' + name + ' }}', passed[name]) self.assertEqual('${{ inputs.' + name + ' }}', passed[name])
self.assertEqual('string', self.contract['inputs'][name]['type']) self.assertEqual('string', self.contract['inputs'][name]['type'])
self.assertEqual('github', inputs['smoke_evidence']['default']) # Migrated consumers no longer own a separate GitHub Smoke workflow.
self.assertEqual('circle', inputs['smoke_evidence']['default'])
self.assertEqual(['github', 'circle'], inputs['smoke_evidence']['options']) self.assertEqual(['github', 'circle'], inputs['smoke_evidence']['options'])
self.assertFalse(inputs['smoke_run_id']['required']) self.assertFalse(inputs['smoke_run_id']['required'])
self.assertFalse(inputs['circle_workflow_id']['required']) self.assertFalse(inputs['circle_workflow_id']['required'])
+11 -1
View File
@@ -29,8 +29,17 @@ MANIFEST = {"profile": "qbit", "orb_version": "0.7.0", "default_branch": "develo
class MarketingContractTests(unittest.TestCase): class MarketingContractTests(unittest.TestCase):
def test_exact_munitor_render_and_single_continuation(self): def test_munitor_render_with_explicit_build_and_single_continuation(self):
baseline = yaml.safe_load((ROOT / "tests/fixtures/marketing-munitor-0311-rendered.yml").read_text(encoding="utf-8")) baseline = yaml.safe_load((ROOT / "tests/fixtures/marketing-munitor-0311-rendered.yml").read_text(encoding="utf-8"))
# The original delegated job never builds: require the shared profile
# to prepare the standalone artifact before browser/Lighthouse checks.
for workflow in baseline["workflows"].values():
for entry in workflow["jobs"]:
if "munitor/node_build_and_test" in entry:
build = entry["munitor/node_build_and_test"]
build["test_commands"] = json.dumps([
"npm run lint", "npm run build",
*json.loads(build["test_commands"])])
for branch in ("feature/example", "main", "develop", "staging", "release/1"): for branch in ("feature/example", "main", "develop", "staging", "release/1"):
result = pipeline.marketing_template({}, branch, "") result = pipeline.marketing_template({}, branch, "")
self.assertEqual(result, baseline) self.assertEqual(result, baseline)
@@ -46,6 +55,7 @@ class MarketingContractTests(unittest.TestCase):
build = jobs["munitor/node_build_and_test"] build = jobs["munitor/node_build_and_test"]
self.assertEqual(build["node_version"], "22") self.assertEqual(build["node_version"], "22")
self.assertEqual(json.loads(build["test_commands"]), [ self.assertEqual(json.loads(build["test_commands"]), [
"npm run lint", "npm run build",
"npx playwright install chromium --with-deps", "npx playwright install chromium --with-deps",
"npm run test:chromium", "npm run lighthouse"]) "npm run test:chromium", "npm run lighthouse"])
if name == "production": if name == "production":
+63 -2
View File
@@ -2,7 +2,10 @@
import contextlib import contextlib
import io import io
import json import json
import os
from pathlib import Path, PurePosixPath from pathlib import Path, PurePosixPath
import subprocess
import tempfile
import unittest import unittest
from unittest import mock from unittest import mock
@@ -17,17 +20,75 @@ class MobilePolicyTests(unittest.TestCase):
after = json.loads((ROOT / "src/scripts/templates/android.json").read_text()) after = json.loads((ROOT / "src/scripts/templates/android.json").read_text())
self.assertEqual(after["orbs"], before["orbs"]) self.assertEqual(after["orbs"], before["orbs"])
self.assertEqual(set(after["jobs"]), {"unit-test", "android-test", "maven-deploy"}) self.assertEqual(set(after["jobs"]), {"unit-test", "android-test", "maven-deploy"})
for name, job in after["jobs"].items(): for name in ("unit-test", "android-test"):
self.assertEqual(job, before["jobs"][name]) self.assertEqual(after["jobs"][name], before["jobs"][name])
self.assertEqual(after["jobs"]["maven-deploy"]["executor"], before["jobs"]["maven-deploy"]["executor"])
self.assertEqual(after["jobs"]["maven-deploy"]["steps"][:2], before["jobs"]["maven-deploy"]["steps"][:2])
entries = after["workflows"]["test-and-build"]["jobs"] entries = after["workflows"]["test-and-build"]["jobs"]
self.assertEqual(entries[0], "unit-test") self.assertEqual(entries[0], "unit-test")
self.assertEqual(entries[1], {"android-test": {}}) self.assertEqual(entries[1], {"android-test": {}})
publish = entries[2]["maven-deploy"] publish = entries[2]["maven-deploy"]
self.assertEqual(publish["context"], ["qqq-maven-registry-credentials"])
self.assertEqual(publish["requires"], ["unit-test", "android-test"]) self.assertEqual(publish["requires"], ["unit-test", "android-test"])
self.assertEqual(publish["filters"], {"branches": {"only": "main"}}) self.assertEqual(publish["filters"], {"branches": {"only": "main"}})
# No new dormant Firebase benchmark or nonexistent app module build. # No new dormant Firebase benchmark or nonexistent app module build.
self.assertNotIn("benchmarks-ftl", after["jobs"]) self.assertNotIn("benchmarks-ftl", after["jobs"])
def test_android_publication_uses_shared_credentials_without_persisting_them(self):
data = json.loads((ROOT / "src/scripts/templates/android.json").read_text())
steps = data["jobs"]["maven-deploy"]["steps"]
self.assertEqual(len(steps), 3)
command = steps[2]["run"]["command"]
with tempfile.TemporaryDirectory() as folder:
root = Path(folder)
runner = root / "gradlew"
runner.write_text('''#!/bin/bash
set -eu
test "$1" = --console=plain
test "$2" = publishMavenPublicationToGithubQqqMavenRegistryRepository
test "$ORG_GRADLE_PROJECT_githubQqqMavenRegistryUsername" = fixture-user
test "$ORG_GRADLE_PROJECT_githubQqqMavenRegistryPassword" = fixture-password
touch invoked
''')
runner.chmod(0o755)
python = root / "python3"
python.write_text("#!/bin/bash\ncat >/dev/null\n[[ ${DENY_ACCESS:-0} == 0 ]] || exit 1\necho fixture-user\n")
python.chmod(0o755)
base = {**os.environ, "GITHUB_TOKEN": "fixture-password",
"PATH": str(root) + os.pathsep + os.environ["PATH"]}
for mode in ("missing", "denied", "success"):
env = dict(base)
if mode == "missing":
env.pop("GITHUB_TOKEN")
elif mode == "denied":
env["DENY_ACCESS"] = "1"
result = subprocess.run(["bash", "-c", command], cwd=root, env=env, capture_output=True, text=True)
self.assertEqual(result.returncode == 0, mode == "success")
self.assertEqual((root / "invoked").exists(), mode == "success")
self.assertFalse((root / "gradle.properties").exists())
self.assertNotIn("fixture-password", result.stdout + result.stderr)
def test_android_registry_preflight_fails_closed(self):
data = json.loads((ROOT / "src/scripts/templates/android.json").read_text())
command = data["jobs"]["maven-deploy"]["steps"][2]["run"]["command"]
script = command.split("<<'PYTHON'\n", 1)[1].split("\nPYTHON", 1)[0]
for identity, permissions, allowed in (({"login": "fixture-user"}, {"push": True}, True),
({"login": "fixture-user"}, {"push": False}, False),
({}, {"push": True}, False)):
opener = mock.Mock()
responses = [json.dumps(identity), json.dumps({"permissions": permissions})]
opener.open.side_effect = lambda *args, **kwargs: io.StringIO(responses.pop(0))
with mock.patch("urllib.request.build_opener", return_value=opener), \
mock.patch.dict(os.environ, {"GITHUB_TOKEN": "fixture-password"}), \
contextlib.redirect_stdout(io.StringIO()) as output:
if allowed:
exec(compile(script, "registry-preflight", "exec"), {})
self.assertEqual(output.getvalue().strip(), "fixture-user")
else:
with self.assertRaises(SystemExit):
exec(compile(script, "registry-preflight", "exec"), {})
self.assertNotIn("fixture-password", output.getvalue())
def test_policy_stays_small_and_validates_actual_pattern_content(self): def test_policy_stays_small_and_validates_actual_pattern_content(self):
data = json.loads((ROOT / "src/scripts/templates/mcp-policy.json").read_text()) data = json.loads((ROOT / "src/scripts/templates/mcp-policy.json").read_text())
job = data["jobs"]["validate-patterns"] job = data["jobs"]["validate-patterns"]
+51
View File
@@ -0,0 +1,51 @@
"""Run the workflow's publication shell with a recording CLI, never GitHub."""
import json
import os
import subprocess
import tempfile
import yaml
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
def workflow_shell(name):
worker = yaml.safe_load((ROOT / ".github/workflows/qqq-all-release.yml").read_text())
return next(step["run"] for step in worker["jobs"]["release"]["steps"]
if step.get("name") == name)
class ReleaseWorkflowTest(unittest.TestCase):
def test_rc_is_prerelease_never_latest_and_ga_keeps_existing_release_behavior(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
gh = root / "gh"
gh.write_text("#!/usr/bin/env python3\nimport json, os, sys\n"
"with open(os.environ['CALLS'], 'w') as f: json.dump(sys.argv[1:], f)\n")
gh.chmod(0o755)
calls = root / "calls.json"
for version in ("4.1.0", "4.1.0-RC.1", "4.1.0-RC.2"):
calls.unlink(missing_ok=True)
environment = {**os.environ, "PATH": directory + os.pathsep + os.environ["PATH"],
"CALLS": str(calls), "VERSION": version, "TAG": version,
"RUNNER_TEMP": directory, "GITHUB_REPOSITORY": "QRun-IO/qqq-all"}
result = subprocess.run(["bash", "-c", workflow_shell("Publish GitHub release with Compose bundle")],
env=environment, capture_output=True, text=True)
if version == "4.1.0-RC.2":
self.assertNotEqual(0, result.returncode)
self.assertFalse(calls.exists())
continue
self.assertEqual(0, result.returncode, result.stderr)
args = json.loads(calls.read_text())
self.assertEqual(["release", "create", version], args[:3])
self.assertIn(str(root / ("qqq-all-" + version + ".tar.gz")), args)
self.assertIn("--verify-tag", args)
if version == "4.1.0-RC.1":
self.assertIn("--prerelease", args)
self.assertIn("--latest=false", args)
else:
self.assertNotIn("--prerelease", args)
self.assertNotIn("--latest=false", args)
+25
View File
@@ -1,7 +1,11 @@
import copy import copy
import importlib.util import importlib.util
import io
import os
from pathlib import Path from pathlib import Path
import unittest import unittest
from unittest import mock
import urllib.error
import yaml import yaml
ROOT = Path(__file__).parents[1] ROOT = Path(__file__).parents[1]
@@ -25,6 +29,27 @@ def fixture():
class EvidenceTests(unittest.TestCase): class EvidenceTests(unittest.TestCase):
def test_public_evidence_needs_no_credential_and_optional_token_stays_on_circle(self):
for token in ('', 'fixture-token'):
opener = mock.Mock()
opener.open.return_value = io.BytesIO(b'{"status":"success"}')
with mock.patch.dict(os.environ, {'CIRCLECI_TOKEN': token}), \
mock.patch.object(v.urllib.request, 'build_opener', return_value=opener):
self.assertEqual(v.circle('workflow/' + W), {'status': 'success'})
request = opener.open.call_args.args[0]
self.assertEqual(request.full_url, 'https://circleci.com/api/v2/workflow/' + W)
self.assertEqual(request.get_header('Circle-token'), token or None)
def test_unavailable_public_evidence_is_not_a_success(self):
opener = mock.Mock()
opener.open.side_effect = urllib.error.HTTPError('https://circleci.com', 403, 'Forbidden', {}, None)
with mock.patch.dict(os.environ, {'CIRCLECI_TOKEN': ''}), \
mock.patch.object(v.urllib.request, 'build_opener', return_value=opener), \
self.assertRaises(OSError):
v.circle('workflow/' + W)
with self.assertRaises(v.EvidenceError):
v.NoRedirect().redirect_request(None, None, 302, '', {}, 'https://other.example/')
def test_success_returns_real_circle_evidence_not_fake_github_run(self): def test_success_returns_real_circle_evidence_not_fake_github_run(self):
evidence = v.validate(SHA, W, *fixture()) evidence = v.validate(SHA, W, *fixture())
self.assertEqual('qqq-all-circle-smoke/v1', evidence['schema']) self.assertEqual('qqq-all-circle-smoke/v1', evidence['schema'])