Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aea43fa049 | ||
|
|
357aba57bc | ||
|
|
fb86d1a4a7 | ||
|
|
e9eb225480 | ||
|
|
09dac40a1e | ||
|
|
07a8f5cec2 | ||
|
|
c4f7b5ba76 | ||
|
|
3fd8baeda9 | ||
|
|
1334ababf1 | ||
|
|
3ca2b71ffa | ||
|
|
df9113296e | ||
|
|
9b73a4ed5f | ||
|
|
aa865fefd5 | ||
|
|
a5d10e8c1c | ||
|
|
4f1e5e663d | ||
|
|
898862a095 | ||
|
|
21403d2287 | ||
|
|
2675bb7a36 | ||
|
|
12eccc9e7d | ||
|
|
9e2652d735 | ||
|
|
c4e41dea6b | ||
|
|
4562d5c2d2 | ||
|
|
322a194c05 | ||
|
|
a92d6d13bb | ||
|
|
9772090684
|
||
|
|
ab666bb785 | ||
|
|
fc39293b9d
|
||
|
|
e83b8481b9 | ||
|
|
e4ecae6294
|
||
|
|
37b91db07b | ||
|
|
c30d821f7e
|
||
|
|
6ae688dcf4 | ||
|
|
78207c16be
|
||
|
|
efd50aee2f | ||
|
|
6dd473be25
|
||
|
|
1c8a7c57e5 | ||
|
|
abaebf50ff
|
||
|
|
c56e52d4cb | ||
|
|
09046d45b0
|
||
|
|
9e9e6c1fa5 | ||
|
|
45aaccd2a9 | ||
|
|
ab77962b6a | ||
|
|
d0792d60d6 | ||
|
|
72f5f4d4e7 | ||
|
|
00af9aae31 | ||
|
|
7e60372948 | ||
|
|
45bab9d960 | ||
|
|
f304afb0be | ||
|
|
f76b9f7a7c | ||
|
|
fdf62a2f5a | ||
|
|
94341ef481 | ||
|
|
2debeada5d | ||
|
|
6febeff590 | ||
|
|
8b58a45f35 | ||
|
|
fbe36d683d | ||
|
|
bd5ee3bec5 | ||
|
|
d4d6e97df0 | ||
|
|
c288a8864f | ||
|
|
9906c8f120 | ||
|
|
4dcf2c1891 | ||
|
|
cc30f599e6 | ||
|
|
05a2a5217a | ||
|
|
7d73ac90b6 | ||
|
|
edc1365ac9 | ||
|
|
0f33ddadf8 | ||
|
|
5e9bbb54ec | ||
|
|
5bcec90e33 | ||
|
|
a50b07d927 | ||
|
|
6318d90e96 | ||
|
|
a6fea661ff | ||
|
|
2894bae29a | ||
|
|
a14e8f9b24 | ||
|
|
83611872a3 | ||
|
|
30c4e0e85c | ||
|
|
f429d9f3c4 |
No files matched your search
@@ -83,7 +83,7 @@ workflows:
|
||||
when: << pipeline.parameters.run_enrollment_reconcile >>
|
||||
jobs:
|
||||
- enrollment-reconcile:
|
||||
context: qqq-maven-registry-credentials
|
||||
context: [qqq-maven-registry-credentials, orb-publishing]
|
||||
filters:
|
||||
branches:
|
||||
only: main
|
||||
|
||||
@@ -60,11 +60,14 @@ jobs:
|
||||
python3 tests/test_enforce_orb_checks.py
|
||||
python3 tests/test_native_next_gates.py
|
||||
python3 tests/test_native_gitops_gates.py
|
||||
python3 tests/test_native_specialist_gates.py
|
||||
python3 tests/test_enroll_consumers.py
|
||||
python3 tests/test_reconcile_enrollment.py
|
||||
python3 tests/test_discover_enrollment.py
|
||||
python3 tests/test_finish_enrollment.py
|
||||
python3 tests/test_run_enrollment.py
|
||||
python3 tests/test_install_reconcile_gh.py
|
||||
python3 tests/test_circle_project_settings.py
|
||||
python3 tests/test_static_analysis_exit.py
|
||||
python3 tests/test_validate_standard.py
|
||||
python3 tests/test_voyage_profile.py
|
||||
|
||||
+39
-10
@@ -1,14 +1,14 @@
|
||||
# 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.
|
||||
# GitOps validation
|
||||
|
||||
The shared registry includes marketing-website-cd and voyage-cd. Daily enrollment recognizes their canonical main-branch caller without creating Circle configuration. Recognition requires a signed immutable worker pin matching the supported worker, a complete source tree, and no additional Circle or GitHub workflows. Enforcement requires the GitHub Actions app-bound gitops / validate gate and preserves existing branch rules. Unavailable private-repository protections remain an explicit enforcement failure; recognition alone is not enforcement.
|
||||
The orb owns `.github/workflows/gitops.yml`. The consumer keeps only the immutable caller generated by `generate_auxiliary_workflow.py gitops --ref <orb-commit>` at `.github/workflows/validate.yml`.
|
||||
|
||||
One native job downloads Kustomize 5.7.1 with its pinned official SHA-256 and renders every Kustomization, including bases, overlays and proxy declarations. Missing configurations or a failed render fail the job. Rendered resources are discarded rather than logged or uploaded because they may contain Secrets. This checks rendering, not Kubernetes schema compatibility or cluster health. No cluster access or publication credentials are required.
|
||||
|
||||
The caller runs on main pushes and pull requests without path filters, so a required check always reports. Superseded PR runs are canceled. Feature pushes do not create duplicate jobs. Remove the old Circle pipeline only after the native job passes on the consumer, then disable obsolete Circle build requests and require the observed native check with no human review.
|
||||
|
||||
For marketing-website-cd, the prior Circle job only printed Hello World. Its former production role moved to KofTwentyTwo/cluster-gitops; validation does not re-enable that retired deployment path.
|
||||
|
||||
The shared registry includes marketing-website-cd and voyage-cd. Daily enrollment recognizes their canonical main-branch caller without creating Circle configuration. Recognition requires a signed immutable worker pin matching the supported worker, a complete source tree, and no additional Circle or GitHub workflows. Enforcement requires the GitHub Actions app-bound gitops / validate gate and preserves existing branch rules. Unavailable private-repository protections remain an explicit enforcement failure; recognition alone is not enforcement.
|
||||
|
||||
|
||||
### Documentation repositories with shell automation
|
||||
@@ -39,3 +39,32 @@ hooks, then performs Maven verify on the generated application with all its test
|
||||
The renderer and Maven dependencies are cached; test reports and the generated JAR
|
||||
are retained. This is acceptance of a generated consumer, not Maven publication.
|
||||
Only the standard profile, orb version, and default branch are consumer settings.
|
||||
|
||||
The coordinator also recognizes qctl on main/develop and the approved .github,
|
||||
business-platform, MCP-RAG and IntelliJ callers on main. It verifies each complete
|
||||
workflow inventory, canonical caller, signed immutable orb pin and matching shared
|
||||
worker source before recognizing the repository. Native verification gates bind to
|
||||
the GitHub Actions app; release-only jobs are not merge requirements. No CircleCI
|
||||
caller is added to these native consumers. qctl requires its shared tests; the native binary job is push-only, and
|
||||
full platform release builds retain their existing shared-worker policy.
|
||||
|
||||
Existing classic branch protections without a required-status-check section gain
|
||||
an additive shared ruleset. Signing, reviews, history and access restrictions remain
|
||||
unchanged, and a subsequent reconciliation verifies the effective ruleset.
|
||||
|
||||
The same daily pass manages CircleCI's native `autocancel-builds` setting for
|
||||
canonical `repository-policy`, `homebrew-tap`, `application-template`, and
|
||||
`marketing` consumers. Marketing must retain `main` as its default branch;
|
||||
environment deployment remains main-only. CircleCI excludes default-branch,
|
||||
scheduled and rerun workflows from automatic cancellation. This avoids a custom
|
||||
cancellation job and does not add executions to consumer pipelines.
|
||||
|
||||
The pass uses the existing orb-publishing context on the trusted orb main branch.
|
||||
It changes only the cancellation flag, checks for source movement before writing,
|
||||
and verifies preservation of all other flags. Its separate
|
||||
`result.circle-settings.json` artifact records missing credentials/API access,
|
||||
unconverted sources and profiles needing cancellation-policy review explicitly.
|
||||
Publication-heavy profiles are not changed until their non-default release
|
||||
semantics are reviewed; a successful reconciliation pass does not certify them.
|
||||
|
||||
Because cancellation is project-wide, eligibility requires every discovered current main/develop branch to be canonical and use a reviewed profile. An unresolved branch or an unreviewed publishing profile prevents enabling the flag, regardless of branch order. The report lists all observed profiles.
|
||||
@@ -16,7 +16,7 @@ import yaml
|
||||
# Generated by scripts/pack_pipeline.py; edit source/resources, then regenerate.
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+jSerpDNskKwTLaWluUxftE/WLH4RKV6xYwkJMusri4lzRflDRKKTIba/VivRARCs4fB+qLsjJC9D0K+sQ4AHMu/G7YgLI00KyCk3/YS6sq2BLnoFcgWvL0iUm3g5zLk8SD/mOJ/VxOucr0P+WVtKe0Sq709siJsRn4Uw3sMwzHLats1mx6Ko4oq92aq4tSjdxv1bgld+M9Wbk+spcqOe8wHk41yrtpbhdRmWlwzXk7UMYmL93HeXn76+CZPOj/oAEPDQdyJHY8hb2G99RWvWVaVSixagb0ni94pXrLine truncated
|
||||
MATERIAL_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNq1lMtugzAQRfd8heV1TNRKlar8QXdVt02EXDMhDthGfqRBiH/vQAmPvKRU6g7PjH3PXI+pI0IoHEEEb6yjK1JjAENlwatvK7OdH2IYTY3IwWLks4+QIdflpeIZYJoqYWMlhTXObH0sjFqOB64OT/HLa/zM9lypig77m/5rE51WzaKl25uvq2CJB+fdFO/UR0swaWBxyjsPpZvRU7EDkZswFp11ZFHDWEgEx8qJVp/OoZof2Md1qViKYqyuSSfhgiJrWnKRo0OsQB/jvTN6TUnTTLTPt9NZZjNZNaNvt9CDvgTWXHUX9Kad50VBUAV0ClpIcGccFK9NcZ225QhEhCSMFZBxUbESwHaE9CEkxw/3rOyV/uwcVvnd9fswKSTKpKEA92+efgRN3oexIwfpAi+IhQyHyEmjye/A3nP5SMa57cof9LebVW693HIxexsTg+avg1kojfXLc6wUxaXmHrmvbvgLWNtQgmaE4h5bW8X6quUNmctfRdREPykCLqM=")))
|
||||
VOYAGE_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNrtW+tz2zYS/56/AqPJXJKeSUqqHzndqBNbdm1NGzsnObneVDkNREISLBKgAVCWYuv+9lvwpQepV2K1TpoPsUhggV38drEPgLl/hlBhSISknBUqqGyW9nTLDe9IeL2HZ3jrBNR1DMwcQxGp0nbo8bDdp4zMNEEj9XBPNxWCTsBUYJTLxf2KHQhBmCrEZJO9ZApBJA+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gJTE8MkWnIo5zd4JtFob3jYfxvSFmDTa7M5NnuCSUmx3ilkKxcWB8hr5w653z69PH4v/SabCcM1uHcHhJZel6sRGJhx68w6SAykIB1nwu6qH/f+V/9p+KsYvQ8+jt9FUb/1cRwML5rDyafu/nuvacD+2Hc2nT/snNGl")))
|
||||
@@ -27,7 +27,7 @@ POLICY_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNqdVU1v2zAMvedXC
|
||||
REPOSITORY_POLICY_TEMPLATE = json.loads(zlib.decompress(base64.b64decode("eNqlVttu4zYQfc9XEH6RDETM7gYoiuz6YbE1ugFSJ2ncFkEcGLQ0splQpEpSid3A/94Z6hLZi1zQ5iEmh6MzZ4aHQz4dMDZ4AOuk0YMT9ol/PCTLnVk4nD7hmNaFkpnwkJRGyXTTLeBSZtJ7sGi5aSysWwvrshBLwOVBKovlUbnxK6NPjvnHT4POa9uMbg9bUAvOVDaFeaqEIx4DVwilBp2D81C6naCDdAXpval857RHxFa6x7sxalEEcqfaeQzA/ArY9dffzlgprMO0DnfdU1MUQmf0RZ3JMUsKVsqSyQYgSTLpxEJhqWSZNHVNAjd2sSHo0egn/oEfD3rI2+dS/Bfyfza7E9iLssQtEp7C5haALazQ6eodmcxmX75EF9fT7+eTaKZlURrr2Z0zupsYN9O5NZix8CslF6yxX+C0c3LVorQmBec607pQHDyS4WMFBWg/JWLCsfG089mIQs0wFEE7NurB8FC9OW5tWfn4JlpKHx2ySLkklwocjZN/otshzyA1GcRR5fPk52jIHVbCx9Fs9iEaPgPfENuYajdkubGMRrh9rF6XeTDcIi8cGV+bT2aaqmaFdMCuNqi+Yrwm7Ilh3go8ARmrjwarOWE8gqF4T9HZ6bfx5GpMRCfnU5zQ6Nv5xfXp5Nd6+Mv4/K/J+PcrmnHMTy61sdDOhPdWLipPudZEwl/EIZPe2NToXC7JuXjQj+0vT4ss2s60W4FS81BCYmMcB/0grdF8CZjA5eXl/OIcGV7Pr76Pz86iIRuNWORtBSgCV+W5XDdpcAQ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iM5iExrYIbqdXXjGtZDkd8KDnNTlblz1kOKWvIEWbjSYVer+lasHKRtq5gGcdbWK6ep18Jw3IddbYtJNVaXgG7StAGfHMPqdYAB80rq2Yr75S80/5iGq/s66OmPdE41/Dkkk3TkCiLPG4BbO5CwgWDHM6PBrVHwu9HbZK1UAWXq04W0JdayHXBsG13CWV2KP3xDtqAyJwhcAwZrsOCQHNuRD+tgvaT+TCdTuKKbN3T20NMDh8vXCe/gn7rVJqvDMvCv+mxRsJ0QMjzbeNbNR3aNw4vtaOHz5OW1GDuXzd4O1tTM3z++4l7cdGxp6V/7hT0yV60oSkTTBGz3ReCAodqilZl+7TTz/Zp83uOLn95Mn3ybQ9y94r/1nnT3faZ+xI4LidpqJNtx5vEMcL/fMjsLHeSVLEAMMszFigQ9R2qZKD8d/QoALm5ENn0HAVrubD5YsTliVTsISzf09SHaH/j2tSs9HdvSevb/th5G/vnRhptMDqKb5zhH3Ud+6w4a76sYyoGEoIQWv7Nm/Hihfjq5rxwL715e74t/dn9s/8DqAZZ8g==")))
|
||||
|
||||
|
||||
class ManifestError(ValueError):
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{
|
||||
"run": {
|
||||
"name": "Prepare pinned qctl renderer",
|
||||
"command": "set -euo pipefail\ntool_dir=\"${QQQ_TEMPLATE_TOOL_DIR:-$HOME/.cache/qqq-template-renderer}\"\nmaven_repo=\"${QQQ_TEMPLATE_MAVEN_REPO:-$HOME/.m2/repository}\"\nif [[ ! -d \"$tool_dir/.git\" ]]; then\n git init \"$tool_dir\"\n git -C \"$tool_dir\" remote add origin https://github.com/QRun-IO/qctl.git\n git -C \"$tool_dir\" fetch --depth=1 origin d84a5783bf09c58e42ba72203247f20bd5779302\n git -C \"$tool_dir\" checkout --detach FETCH_HEAD\nfi\ntest \"$(git -C \"$tool_dir\" rev-parse HEAD)\" = d84a5783bf09c58e42ba72203247f20bd5779302\n# Build the immutable, already-qualified renderer, not another copy of the consumer.\nif [[ ! -f \"$tool_dir/qctl-qqq/target/qctl-qqq-0.2.1.jar\" || ! -f \"$maven_repo/io/qrun/qctl/qctl-qqq/0.2.1/qctl-qqq-0.2.1.pom\" ]]; then\n mvn -B -ntp -f \"$tool_dir/pom.xml\" -Dmaven.repo.local=\"$maven_repo\" -pl qctl-qqq -am install -DskipTests\nfi\nmvn -B -ntp -f \"$tool_dir/pom.xml\" -Dmaven.repo.local=\"$maven_repo\" -pl qctl-qqq dependency:build-classpath -Dmdep.outputFile=\"$tool_dir/classpath.txt\"\n",
|
||||
"command": "set -euo pipefail\ntool_dir=\"${QQQ_TEMPLATE_TOOL_DIR:-$HOME/.cache/qqq-template-renderer}\"\nmaven_repo=\"${QQQ_TEMPLATE_MAVEN_REPO:-$HOME/.m2/repository}\"\nif [[ ! -d \"$tool_dir/.git\" ]]; then\n git init \"$tool_dir\"\n git -C \"$tool_dir\" remote add origin https://github.com/QRun-IO/qctl.git\n git -C \"$tool_dir\" fetch --depth=1 origin d84a5783bf09c58e42ba72203247f20bd5779302\n git -C \"$tool_dir\" checkout --detach FETCH_HEAD\nfi\ntest \"$(git -C \"$tool_dir\" rev-parse HEAD)\" = d84a5783bf09c58e42ba72203247f20bd5779302\ncd \"$tool_dir\"\n# Build the immutable, already-qualified renderer, not another copy of the consumer.\nif [[ ! -f \"$tool_dir/qctl-qqq/target/qctl-qqq-0.2.1.jar\" || ! -f \"$maven_repo/io/qrun/qctl/qctl-qqq/0.2.1/qctl-qqq-0.2.1.pom\" ]]; then\n mvn -B -ntp -f \"$tool_dir/pom.xml\" -Dmaven.repo.local=\"$maven_repo\" -pl qctl-qqq -am install -DskipTests\nfi\nmvn -B -ntp -f \"$tool_dir/pom.xml\" -Dmaven.repo.local=\"$maven_repo\" -pl qctl-qqq dependency:build-classpath -Dmdep.outputFile=\"$tool_dir/classpath.txt\"\n",
|
||||
"no_output_timeout": "10m"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
{
|
||||
"run": {
|
||||
"name": "Build framework dependencies for the sample",
|
||||
"command": "mvn -B -s /tmp/circleci/mvn-settings.xml -Drevision=0.0.0-sample-acceptance -DskipTests clean install"
|
||||
"command": "mvn -B -s /tmp/circleci/mvn-settings.xml -Drevision=0.0.0-sample-acceptance -DskipTests -Dspotbugs.skip=true -Dpmd.skip=true clean install"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -308,7 +308,7 @@
|
||||
{
|
||||
"run": {
|
||||
"name": "Build framework dependencies for the sample",
|
||||
"command": "mvn -B -s /tmp/circleci/mvn-settings.xml -Drevision=0.0.0-sample-multinode -DskipTests clean install"
|
||||
"command": "mvn -B -s /tmp/circleci/mvn-settings.xml -Drevision=0.0.0-sample-multinode -DskipTests -Dspotbugs.skip=true -Dpmd.skip=true clean install"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -336,7 +336,7 @@
|
||||
{
|
||||
"run": {
|
||||
"name": "Build framework dependencies for the consumers",
|
||||
"command": "mvn -B -s /tmp/circleci/mvn-settings.xml -Drevision=0.0.0-sample-acceptance -DskipTests clean install"
|
||||
"command": "mvn -B -s /tmp/circleci/mvn-settings.xml -Drevision=0.0.0-sample-acceptance -DskipTests -Dspotbugs.skip=true -Dpmd.skip=true clean install"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
"""Cost settings preserve source qualification and unrelated project controls."""
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import unittest
|
||||
from unittest.mock import Mock
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'tools'))
|
||||
import circle_project_settings as settings
|
||||
|
||||
|
||||
class SettingsTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.plan = {'repository': 'QRun-IO/marketing-website', 'profile': 'marketing',
|
||||
'branch': 'main', 'head': 'a' * 40, 'changed': False}
|
||||
self.before = {'autocancel-builds': False, 'setup-workflows': True,
|
||||
'build-fork-prs': False, 'drop-all-build-requests': False}
|
||||
self.source = Mock(side_effect=[{'archived': False, 'default_branch': 'main'},
|
||||
{'commit': {'sha': self.plan['head']}}])
|
||||
|
||||
def test_narrow_update_and_idempotent_readback(self):
|
||||
request = Mock(side_effect=[{'feature_flags': self.before}, {},
|
||||
{'feature_flags': {**self.before, 'autocancel-builds': True}}])
|
||||
result = settings.reconcile(self.plan, self.source, True, request)
|
||||
self.assertEqual({'state': 'enforced', 'changed': True}, result)
|
||||
self.assertEqual({'feature_flags': {'autocancel-builds': True}}, request.call_args_list[1].args[1])
|
||||
request = Mock(return_value={'feature_flags': {**self.before, 'autocancel-builds': True}})
|
||||
source = Mock(return_value={'archived': False, 'default_branch': 'main'})
|
||||
self.assertEqual({'state': 'enforced', 'changed': False},
|
||||
settings.reconcile(self.plan, source, True, request))
|
||||
self.assertEqual(1, request.call_count)
|
||||
|
||||
def test_dry_run_never_writes(self):
|
||||
request = Mock(return_value={'feature_flags': self.before})
|
||||
self.assertEqual({'state': 'inspected', 'changed': True},
|
||||
settings.reconcile(self.plan, self.source, False, request))
|
||||
request.assert_called_once_with(self.plan['repository'])
|
||||
|
||||
def test_unreviewed_profiles_and_unconverted_sources_never_call_api(self):
|
||||
for change, expected in [({'profile': 'qbit'}, 'not-managed'),
|
||||
({'profile': 'native-gitops'}, 'not-managed'),
|
||||
({'changed': True}, 'waiting-source')]:
|
||||
source, request = Mock(), Mock()
|
||||
result = settings.reconcile({**self.plan, **change}, source, True, request)
|
||||
self.assertEqual(expected, result['state'])
|
||||
source.assert_not_called()
|
||||
request.assert_not_called()
|
||||
|
||||
def test_changed_head_or_unexpected_default_branch_prevents_write(self):
|
||||
for responses in [
|
||||
[{'archived': False, 'default_branch': 'main'}, {'commit': {'sha': 'b' * 40}}],
|
||||
[{'archived': False, 'default_branch': 'develop'}],
|
||||
[{'archived': True, 'default_branch': 'main'}],
|
||||
]:
|
||||
request = Mock(return_value={'feature_flags': self.before})
|
||||
result = settings.reconcile(self.plan, Mock(side_effect=responses), True, request)
|
||||
self.assertEqual('unresolved', result['state'])
|
||||
self.assertTrue(all(len(call.args) == 1 for call in request.call_args_list))
|
||||
|
||||
def test_unrelated_setting_drift_and_unavailable_api_are_not_success(self):
|
||||
request = Mock(side_effect=[{'feature_flags': self.before}, {},
|
||||
{'feature_flags': {**self.before, 'autocancel-builds': True,
|
||||
'build-fork-prs': True}}])
|
||||
self.assertEqual('unresolved', settings.reconcile(self.plan, self.source, True, request)['state'])
|
||||
source = Mock(return_value={'archived': False, 'default_branch': 'main'})
|
||||
for response in [Mock(side_effect=ValueError('Central CircleCI credential unavailable')),
|
||||
Mock(return_value={'feature_flags': {}})]:
|
||||
self.assertEqual('unresolved', settings.reconcile(self.plan, source, True, response)['state'])
|
||||
|
||||
def test_repository_policy_requires_every_current_branch(self):
|
||||
main = {**self.plan, 'profile': 'repository-policy'}
|
||||
develop = {**main, 'branch': 'develop', 'profile': 'qbit'}
|
||||
for plans in ([main, develop], [develop, main]):
|
||||
source, request = Mock(), Mock()
|
||||
result = settings.reconcile_repository(plans, [], source, True, request)
|
||||
self.assertEqual('not-managed', result['state'])
|
||||
source.assert_not_called()
|
||||
request.assert_not_called()
|
||||
for plans, findings in [
|
||||
([main, {**main, 'branch': 'develop', 'changed': True}], []),
|
||||
([main], [{'repository': main['repository'], 'branch': 'develop', 'state': 'unresolved'}]),
|
||||
]:
|
||||
request = Mock()
|
||||
self.assertEqual('waiting-source', settings.reconcile_repository(
|
||||
plans, findings, Mock(), True, request)['state'])
|
||||
request.assert_not_called()
|
||||
|
||||
def test_repository_policy_checks_all_heads_and_writes_once(self):
|
||||
plans = [self.plan, {**self.plan, 'branch': 'develop', 'head': 'b' * 40}]
|
||||
def source(path):
|
||||
if '/branches/' in path:
|
||||
return {'commit': {'sha': next(p['head'] for p in plans if path.endswith('/' + p['branch']))}}
|
||||
return {'archived': False, 'default_branch': 'main'}
|
||||
request = Mock(side_effect=[{'feature_flags': self.before}, {},
|
||||
{'feature_flags': {**self.before, 'autocancel-builds': True}}])
|
||||
self.assertEqual({'state': 'enforced', 'changed': True},
|
||||
settings.reconcile_repository(plans, [], source, True, request))
|
||||
self.assertEqual(1, sum(len(call.args) == 2 for call in request.call_args_list))
|
||||
request = Mock()
|
||||
stale = lambda path: {'commit': {'sha': self.plan['head']}}
|
||||
self.assertEqual('unresolved', settings.reconcile_repository(plans, [], stale, True, request)['state'])
|
||||
request.assert_not_called()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -203,8 +203,21 @@ class EnforcementTests(unittest.TestCase):
|
||||
enforcement.verified_rulesets('QRun-IO/example', effective, lambda path: record)
|
||||
|
||||
def test_empty_push_allowlist_gains_ruleset_without_changing_access(self):
|
||||
classic = {'restrictions': {'users': [], 'teams': [], 'apps': []},
|
||||
'enforce_admins': {'enabled': False}, 'required_signatures': {'enabled': True}}
|
||||
self.assert_ruleset_preserves_classic({
|
||||
'restrictions': {'users': [], 'teams': [], 'apps': []},
|
||||
'enforce_admins': {'enabled': False}, 'required_signatures': {'enabled': True}})
|
||||
|
||||
def test_existing_protection_without_status_section_gains_ruleset(self):
|
||||
for admin in (False, True):
|
||||
with self.subTest(enforce_admins=admin):
|
||||
self.assert_ruleset_preserves_classic({
|
||||
'enforce_admins': {'enabled': admin},
|
||||
'required_signatures': {'enabled': True},
|
||||
'required_linear_history': {'enabled': True},
|
||||
'required_pull_request_reviews': {'required_approving_review_count': 2},
|
||||
'required_conversation_resolution': {'enabled': True}})
|
||||
|
||||
def assert_ruleset_preserves_classic(self, classic):
|
||||
state = {'ruleset': None, 'writes': []}
|
||||
|
||||
def request(path, method='GET', payload=None):
|
||||
@@ -241,7 +254,6 @@ class EnforcementTests(unittest.TestCase):
|
||||
self.assertEqual(1, len(state['writes']))
|
||||
self.assertEqual([], state['writes'][0]['bypass_actors'])
|
||||
self.assertEqual({'include': ['refs/heads/main'], 'exclude': []}, state['writes'][0]['conditions']['ref_name'])
|
||||
self.assertFalse(plan['before']['enforce_admins']['enabled'])
|
||||
self.assertEqual(classic, plan['before'])
|
||||
repeat = enforcement.inspect('QRun-IO/example', 'main', '0.8', request)
|
||||
self.assertFalse(repeat['changed'])
|
||||
|
||||
@@ -398,6 +398,37 @@ class PipelineTests(unittest.TestCase):
|
||||
self.write_manifest(profile="application-template", **invalid)
|
||||
self.render(ok=False)
|
||||
|
||||
def test_template_uncached_renderer_build_runs_in_renderer_directory(self):
|
||||
self.write_manifest(profile="application-template")
|
||||
tool = self.root / "renderer"
|
||||
(tool / ".git").mkdir(parents=True)
|
||||
binaries = self.root / "bin"
|
||||
binaries.mkdir()
|
||||
commands = {
|
||||
"git": "#!/bin/bash\nprintf '%s\\n' d84a5783bf09c58e42ba72203247f20bd5779302\n",
|
||||
"mvn": '#!/bin/bash\nset -eu\ntest "$PWD" = "$QQQ_TEMPLATE_TOOL_DIR"\nprintf "%s\\n" "$*" >> "$MAVEN_CALLS"\n',
|
||||
}
|
||||
for name, script in commands.items():
|
||||
path = binaries / name
|
||||
path.write_text(script, encoding="utf-8")
|
||||
path.chmod(0o755)
|
||||
for packed in ([False, True] if PACKED else [False]):
|
||||
with self.subTest(packed=packed):
|
||||
result = self.render(packed=packed, CIRCLE_BRANCH="main")
|
||||
bootstrap = next(step["run"]["command"] for step in result["jobs"]["verify-template"]["steps"]
|
||||
if isinstance(step, dict) and "run" in step)
|
||||
calls = self.root / ("maven-packed.log" if packed else "maven-source.log")
|
||||
env = {**self.env, "PATH": str(binaries) + os.pathsep + os.environ["PATH"],
|
||||
"QQQ_TEMPLATE_TOOL_DIR": str(tool), "QQQ_TEMPLATE_MAVEN_REPO": str(self.root / "m2"),
|
||||
"MAVEN_CALLS": str(calls)}
|
||||
completed = subprocess.run(["bash", "-c", bootstrap], cwd=self.repo, env=env,
|
||||
capture_output=True, text=True)
|
||||
self.assertEqual(0, completed.returncode, completed.stderr)
|
||||
invoked = calls.read_text().splitlines()
|
||||
self.assertEqual(2, len(invoked))
|
||||
self.assertIn(" install ", invoked[0])
|
||||
self.assertIn("dependency:build-classpath", invoked[1])
|
||||
|
||||
def test_homebrew_source_and_packed_is_one_nonpublishing_job(self):
|
||||
self.write_manifest(profile="homebrew-tap", tap="qrun-io/qctl", formula="qctl")
|
||||
for packed in ([False, True] if PACKED else [False]):
|
||||
@@ -582,6 +613,15 @@ class PipelineTests(unittest.TestCase):
|
||||
for entry in baseline["workflows"]["publish_snapshot"]["jobs"]:
|
||||
if "qqq-orb/mvn_publish" in entry:
|
||||
entry["qqq-orb/mvn_publish"]["requires"] += ["snapshot_sample_coverage_gate", "qqq-orb/static_analysis"]
|
||||
# Dependency assembly repeats neither analyzer; all acceptance commands stay exact.
|
||||
assembly_jobs = ("sample_acceptance", "sample_multinode_acceptance", "sample_consumer_acceptance")
|
||||
for name in assembly_jobs:
|
||||
assemblies = [step["run"] for step in baseline["jobs"][name]["steps"]
|
||||
if isinstance(step, dict) and "run" in step
|
||||
and "-DskipTests clean install" in step["run"]["command"]]
|
||||
self.assertEqual(len(assemblies), 1, name)
|
||||
assemblies[0]["command"] = assemblies[0]["command"].replace(
|
||||
"-DskipTests clean install", "-DskipTests -Dspotbugs.skip=true -Dpmd.skip=true clean install")
|
||||
self.git("tag", "v1.0.0")
|
||||
self.git("tag", "publish-fixture")
|
||||
events = [("feature/test", "", "test_only"), ("develop", "", "publish_snapshot"),
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
"""Capability probes must drain help output while still rejecting missing options."""
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import subprocess
|
||||
import unittest
|
||||
|
||||
|
||||
class InstallerTests(unittest.TestCase):
|
||||
def probe(self, flags):
|
||||
installer = Path(__file__).resolve().parents[1] / 'tools/install_reconcile_gh.sh'
|
||||
checks = '\n'.join(line for line in installer.read_text().splitlines()
|
||||
if line.startswith(('gh api --help', 'gh pr merge --help')))
|
||||
self.assertEqual(2, len(checks.splitlines()))
|
||||
producer = ("import signal,sys; signal.signal(signal.SIGPIPE,signal.SIG_DFL); "
|
||||
f"print({flags!r},flush=True); sys.stdout.write('x'*1048576)")
|
||||
script = 'set -euo pipefail\ngh() { python3 -c ' + shlex.quote(producer) + '; }\n' + checks
|
||||
return subprocess.run(['bash', '-c', script], capture_output=True, timeout=10).returncode
|
||||
|
||||
def test_large_help_output_does_not_kill_producer(self):
|
||||
self.assertEqual(0, self.probe('--slurp --match-head-commit'))
|
||||
|
||||
def test_missing_required_option_fails(self):
|
||||
self.assertNotEqual(0, self.probe('--slurp'))
|
||||
self.assertNotEqual(0, self.probe('--match-head-commit'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,149 @@
|
||||
"""Native recognition proves central ownership and app-bound verification gates."""
|
||||
import base64
|
||||
import copy
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import unittest
|
||||
from unittest import mock
|
||||
import yaml
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / 'tools'))
|
||||
import native_specialist_gates as native
|
||||
import reconcile_enrollment as remote
|
||||
import enforce_orb_checks as enforcement
|
||||
import finish_enrollment as finish
|
||||
|
||||
|
||||
class NativeTests(unittest.TestCase):
|
||||
def fixture(self, repo):
|
||||
self.repo, self.pin, self.head = repo, 'a' * 40, 'b' * 40
|
||||
self.profile, self.branches, kinds, _ = native.DEFINITIONS[repo]
|
||||
self.callers = dict(native.caller(kind, self.pin) for kind in kinds)
|
||||
self.paths = list(self.callers)
|
||||
self.signed, self.drift, self.truncated = True, False, False
|
||||
self.mode = '100644'
|
||||
self.runs = [{'id': i, 'name': gate['context'], 'app': {'id': gate['app_id']},
|
||||
'status': 'completed', 'conclusion': 'success'}
|
||||
for i, gate in enumerate(native.gates(self.profile))]
|
||||
self.before = {'required_status_checks': {'strict': True, 'checks': native.gates(self.profile)},
|
||||
'enforce_admins': {'enabled': True}}
|
||||
|
||||
def request(self, path, method='GET', payload=None):
|
||||
self.assertEqual('GET', method)
|
||||
if '/contents/' in path:
|
||||
self.assertNotIn('.circleci/', path)
|
||||
file = path.split('/contents/')[1].split('?')[0]
|
||||
if path.startswith('repos/QRun-IO/qqq-orb/'):
|
||||
raw = (ROOT / file).read_text() + ('# changed' if self.drift else '')
|
||||
else:
|
||||
raw = yaml.safe_dump(self.callers[file], sort_keys=False)
|
||||
return {'type': 'file', 'encoding': 'base64', 'content': base64.b64encode(raw.encode()).decode()}
|
||||
if '/git/trees/' in path:
|
||||
return {'truncated': self.truncated, 'tree': [{'path': p, 'type': 'blob', 'mode': self.mode} for p in self.paths]}
|
||||
if path.endswith('/commits/' + self.pin):
|
||||
return {'commit': {'verification': {'verified': self.signed}}}
|
||||
if '/check-runs?' in path:
|
||||
return {'check_runs': copy.deepcopy(self.runs)}
|
||||
if '/status?' in path:
|
||||
return {'statuses': []}
|
||||
if path.endswith('/protection'):
|
||||
return copy.deepcopy(self.before)
|
||||
if '/rules/branches/' in path:
|
||||
return []
|
||||
if '/branches/' in path:
|
||||
return {'commit': {'sha': self.head}}
|
||||
return {'archived': False, 'default_branch': 'main'}
|
||||
|
||||
def test_all_approved_callers_discover_enforce_and_qualify_without_mutation(self):
|
||||
for repo in native.DEFINITIONS:
|
||||
self.fixture(repo)
|
||||
for branch in self.branches:
|
||||
with self.subTest(repo=repo, branch=branch), mock.patch.object(remote, 'api', side_effect=self.request):
|
||||
plan = remote.inspect({'repository': repo, 'branch': branch}, '0.8')
|
||||
self.assertEqual(self.profile, plan['profile'])
|
||||
self.assertFalse(plan['changed'])
|
||||
self.assertEqual(set(self.callers), set(plan['worker_pins']))
|
||||
self.assertEqual({'state': 'unchanged'}, remote.apply(plan))
|
||||
self.assertEqual({'state': 'unchanged'}, finish.merge_ready(plan, {'state': 'unchanged'}))
|
||||
self.assertEqual([], finish.qualification(repo, self.head, self.profile))
|
||||
protected = enforcement.inspect(repo, branch, '0.8', self.request)
|
||||
self.assertFalse(protected['changed'])
|
||||
enforcement.enforce(protected, self.request)
|
||||
|
||||
def test_failed_missing_wrong_app_and_newer_failed_gate_reject(self):
|
||||
for repo in native.DEFINITIONS:
|
||||
self.fixture(repo)
|
||||
good = copy.deepcopy(self.runs)
|
||||
for bad in [[], good[1:], [dict(x, app={'id': 18001}) for x in good],
|
||||
good + [dict(good[0], id=99, conclusion='failure')]]:
|
||||
self.runs = bad
|
||||
with self.subTest(repo=repo), self.assertRaises(ValueError):
|
||||
enforcement.inspect(repo, 'main', '0.8', self.request)
|
||||
|
||||
def test_custom_caller_unsigned_or_changed_worker_rejects(self):
|
||||
for repo in native.DEFINITIONS:
|
||||
for defect in ('caller', 'unsigned', 'worker', 'mutable'):
|
||||
self.fixture(repo)
|
||||
if defect == 'caller':
|
||||
next(iter(self.callers.values()))['extra'] = True
|
||||
elif defect == 'unsigned':
|
||||
self.signed = False
|
||||
elif defect == 'worker':
|
||||
self.drift = True
|
||||
else:
|
||||
jobs = next(iter(self.callers.values()))['jobs']
|
||||
job = next(iter(jobs.values()))
|
||||
job['uses'] = job['uses'].replace(self.pin, 'main')
|
||||
with self.subTest(repo=repo, defect=defect), self.assertRaises(ValueError):
|
||||
native.validate(repo, self.head, 'main', self.request)
|
||||
|
||||
def test_complete_workflow_inventory_required(self):
|
||||
self.fixture('QRun-IO/qqq-business-platform')
|
||||
for path in ('.circleci/config.yml', '.github/workflows/custom.yml', '.github/workflows/extra.yaml'):
|
||||
self.paths.append(path)
|
||||
with self.assertRaisesRegex(ValueError, 'additional orchestration'):
|
||||
native.validate(self.repo, self.head, 'main', self.request)
|
||||
self.paths.pop()
|
||||
self.truncated = True
|
||||
with self.assertRaisesRegex(ValueError, 'complete source tree'):
|
||||
native.validate(self.repo, self.head, 'main', self.request)
|
||||
|
||||
def test_symlinked_or_missing_caller_rejects(self):
|
||||
self.fixture('QRun-IO/qctl')
|
||||
self.mode = '120000'
|
||||
with self.assertRaisesRegex(ValueError, 'regular source file'):
|
||||
native.validate(self.repo, self.head, 'main', self.request)
|
||||
self.paths = []
|
||||
with self.assertRaisesRegex(ValueError, 'regular source file'):
|
||||
native.validate(self.repo, self.head, 'main', self.request)
|
||||
|
||||
def test_unknown_repo_and_unapproved_branch_reject(self):
|
||||
self.fixture('QRun-IO/qqq-mcp-rag')
|
||||
for repo, branch in [('QRun-IO/unknown', 'main'), (self.repo, 'develop'), ('QRun-IO/qctl', 'release/old')]:
|
||||
with self.assertRaises(ValueError):
|
||||
native.validate(repo, self.head, branch, self.request)
|
||||
|
||||
def test_qctl_pr_gate_excludes_push_only_native_binary_job(self):
|
||||
worker = native.load_workflow((ROOT / '.github/workflows/qctl-native.yml').read_text())
|
||||
self.assertNotIn('if', worker['jobs']['test'])
|
||||
self.assertEqual("github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.full_native)",
|
||||
worker['jobs']['build-native']['if'])
|
||||
self.assertEqual([{'context': 'native / test', 'app_id': 15368}], native.gates('qctl'))
|
||||
|
||||
def test_github_yaml_events_and_duplicate_keys(self):
|
||||
self.assertEqual({'on': {'push': None}, 'enabled': True},
|
||||
native.load_workflow('on:\n push:\nenabled: true\n'))
|
||||
for raw in ('on: {}\non: {}\n', 'jobs: {build: {}, build: {}}\n', '1: value\n'):
|
||||
with self.subTest(raw=raw), self.assertRaises(ValueError):
|
||||
native.load_workflow(raw)
|
||||
|
||||
def test_native_enforcement_preserves_other_required_checks(self):
|
||||
self.fixture('QRun-IO/qctl')
|
||||
self.before['required_status_checks']['checks'].append({'context': 'security', 'app_id': 15368})
|
||||
plan = enforcement.inspect(self.repo, 'main', '0.8', self.request)
|
||||
self.assertIn({'context': 'security', 'app_id': 15368}, plan['required_status_checks']['checks'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -30,6 +30,7 @@ class RunnerTests(unittest.TestCase):
|
||||
output = Path(args[args.index('--output') + 1])
|
||||
output.write_text('[{"state":"unresolved"}]')
|
||||
self.assertEqual(1200, kwargs['timeout'])
|
||||
self.assertIn('--circle-settings', args)
|
||||
self.assertEqual('test-only-secret', kwargs['env']['GH_TOKEN'])
|
||||
raise subprocess.TimeoutExpired(args, 1200)
|
||||
self.assertEqual(124, run_enrollment.run(self.environment(), execute, directory))
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
"""Manage native cost controls only for profiles with reviewed cancellation semantics."""
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
from urllib.error import URLError
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
|
||||
AUTOCANCEL_PROFILES = {'repository-policy', 'homebrew-tap', 'application-template', 'marketing'}
|
||||
|
||||
|
||||
def request(repository, payload=None):
|
||||
"""Use existing central credentials; never expose authentication or error bodies."""
|
||||
if not re.fullmatch(r'QRun-IO/[A-Za-z0-9_.-]+', repository):
|
||||
raise ValueError('Only QRun-IO projects can be managed')
|
||||
token = os.environ.get('CIRCLE_TOKEN')
|
||||
if not token:
|
||||
raise ValueError('Central CircleCI credential unavailable')
|
||||
headers = {'Circle-Token': token, 'Accept': 'application/json'}
|
||||
if payload is not None:
|
||||
headers['Content-Type'] = 'application/json'
|
||||
operation = Request('https://circleci.com/api/v1.1/project/github/' + repository + '/settings',
|
||||
headers=headers, method='GET' if payload is None else 'PUT',
|
||||
data=None if payload is None else json.dumps(payload).encode())
|
||||
try:
|
||||
with urlopen(operation, timeout=30) as response:
|
||||
return json.load(response)
|
||||
except (URLError, ValueError):
|
||||
raise ValueError('CircleCI project settings unavailable') from None
|
||||
|
||||
|
||||
def reconcile(plan, source_request, apply=False, settings_request=request):
|
||||
"""Require a current canonical source and preserve every unrelated project flag."""
|
||||
if plan['profile'] not in AUTOCANCEL_PROFILES:
|
||||
return {'state': 'not-managed', 'reason': 'Profile cancellation policy not reviewed'}
|
||||
if plan['changed']:
|
||||
return {'state': 'waiting-source', 'reason': 'Canonical enrollment must land first'}
|
||||
repo = plan['repository']
|
||||
try:
|
||||
info = source_request(f'repos/{repo}')
|
||||
if info['archived'] or (plan['profile'] == 'marketing' and info['default_branch'] != 'main'):
|
||||
raise ValueError('Repository default branch or archive state differs from policy')
|
||||
before = settings_request(repo)['feature_flags']
|
||||
if not isinstance(before, dict) or type(before.get('autocancel-builds')) is not bool:
|
||||
raise ValueError('CircleCI cancellation flag is missing or invalid')
|
||||
changed = not before['autocancel-builds']
|
||||
if apply and changed:
|
||||
if source_request(f'repos/{repo}/branches/{plan["branch"]}')['commit']['sha'] != plan['head']:
|
||||
raise ValueError('Source changed after enrollment inspection')
|
||||
settings_request(repo, {'feature_flags': {'autocancel-builds': True}})
|
||||
after = settings_request(repo)['feature_flags']
|
||||
if after != {**before, 'autocancel-builds': True}:
|
||||
raise ValueError('CircleCI settings readback differs from the narrow update')
|
||||
return {'state': 'enforced' if apply else 'inspected', 'changed': changed}
|
||||
except (ValueError, KeyError, TypeError) as error:
|
||||
return {'state': 'unresolved', 'reason': str(error)}
|
||||
|
||||
|
||||
def reconcile_repository(plans, findings, source_request, apply=False, settings_request=request):
|
||||
"""A project-wide flag requires agreement across all discovered current branches."""
|
||||
repo = plans[0]['repository']
|
||||
if any(plan['repository'] != repo for plan in plans):
|
||||
raise ValueError('Expected one repository')
|
||||
if any(row['repository'] == repo and row.get('state') == 'unresolved' for row in findings):
|
||||
return {'state': 'waiting-source', 'reason': 'A current branch is unresolved'}
|
||||
if any(plan['profile'] not in AUTOCANCEL_PROFILES for plan in plans):
|
||||
return {'state': 'not-managed', 'reason': 'A current branch has an unreviewed cancellation policy'}
|
||||
if any(plan['changed'] for plan in plans):
|
||||
return {'state': 'waiting-source', 'reason': 'All current branches must have canonical enrollment'}
|
||||
try:
|
||||
for plan in plans:
|
||||
if source_request(f'repos/{repo}/branches/{plan["branch"]}')['commit']['sha'] != plan['head']:
|
||||
raise ValueError('Source changed after enrollment inspection')
|
||||
except (ValueError, KeyError, TypeError) as error:
|
||||
return {'state': 'unresolved', 'reason': str(error)}
|
||||
# Preserve the marketing default-branch guard even in mixed eligible profiles.
|
||||
plan = next((p for p in plans if p['profile'] == 'marketing'), plans[0])
|
||||
return reconcile(plan, source_request, apply, settings_request)
|
||||
@@ -27,8 +27,15 @@ _gitops_spec = importlib.util.spec_from_file_location('native_gitops_gates', ROO
|
||||
gitops = importlib.util.module_from_spec(_gitops_spec)
|
||||
_gitops_spec.loader.exec_module(gitops)
|
||||
|
||||
_specialist_spec = importlib.util.spec_from_file_location('native_specialist_gates', ROOT / 'tools/native_specialist_gates.py')
|
||||
specialists = importlib.util.module_from_spec(_specialist_spec)
|
||||
_specialist_spec.loader.exec_module(specialists)
|
||||
PROFILES |= specialists.PROFILES
|
||||
|
||||
|
||||
def gates(profile):
|
||||
if profile in specialists.PROFILES:
|
||||
return specialists.gates(profile)
|
||||
if profile == 'native-gitops':
|
||||
return gitops.gates()
|
||||
if profile == 'frontend-next':
|
||||
@@ -115,7 +122,9 @@ def inspect(repo, branch, version, request=api):
|
||||
raise ValueError('Archived repository')
|
||||
prefix = root + '/branches/' + branch
|
||||
head = request(prefix)['commit']['sha']
|
||||
if repo in gitops.REPOSITORIES:
|
||||
if repo in specialists.DEFINITIONS:
|
||||
profile, _ = specialists.validate(repo, head, branch, request)
|
||||
elif repo in gitops.REPOSITORIES:
|
||||
gitops.validate(repo, head, branch, request, standard.load_yaml)
|
||||
profile = 'native-gitops'
|
||||
else:
|
||||
@@ -138,9 +147,13 @@ def inspect(repo, branch, version, request=api):
|
||||
rulesets, ruleset_strict = verified_rulesets(repo, rules, request, desired_gates) if rules else ([], False)
|
||||
before = request(prefix + '/protection')
|
||||
restrictions = (before or {}).get('restrictions')
|
||||
use_ruleset = (not rulesets and restrictions is not None
|
||||
missing_status_section = before is not None and before.get('required_status_checks') is None
|
||||
empty_push_allowlist = (restrictions is not None
|
||||
and not any(restrictions.get(kind) for kind in ('users', 'teams', 'apps'))
|
||||
and not (before or {}).get('enforce_admins', {}).get('enabled'))
|
||||
# GitHub cannot PATCH a missing status-check subresource. An additive ruleset
|
||||
# preserves the existing signing, review, history and access policies.
|
||||
use_ruleset = not rulesets and (missing_status_section or empty_push_allowlist)
|
||||
runs = []
|
||||
page = 1
|
||||
while True:
|
||||
|
||||
@@ -50,6 +50,8 @@ def merge_ready(plan, result):
|
||||
if pr['state'] != 'MERGED':
|
||||
if pr['baseRefOid'] != plan['head'] or remote.api(f'repos/{repo}/branches/{plan["branch"]}')['commit']['sha'] != plan['head']:
|
||||
return {'state': 'stale-base', 'url': result['url']}
|
||||
if plan['profile'] in enforcement.specialists.PROFILES:
|
||||
enforcement.specialists.validate(repo, head, plan['branch'], remote.api)
|
||||
if plan['profile'] == 'native-gitops':
|
||||
enforcement.gitops.validate(repo, head, plan['branch'], remote.api, enforcement.standard.load_yaml)
|
||||
if plan['profile'] == 'frontend-next':
|
||||
|
||||
@@ -14,5 +14,6 @@ printf '%s %s\n' "$checksum" "$archive" | sha256sum --check --status
|
||||
tar -xOzf "$archive" "gh_${version}_linux_amd64/bin/gh" > "$binary"
|
||||
sudo install -m 0755 "$binary" /usr/local/bin/gh
|
||||
gh --version
|
||||
gh api --help | grep -q -- --slurp
|
||||
gh pr merge --help | grep -q -- --match-head-commit
|
||||
# Drain help output: grep -q can SIGPIPE gh under pipefail.
|
||||
gh api --help | grep -- --slurp >/dev/null
|
||||
gh pr merge --help | grep -- --match-head-commit >/dev/null
|
||||
@@ -0,0 +1,115 @@
|
||||
"""Recognize reviewed native consumers and their shared immutable orb workers."""
|
||||
import base64
|
||||
import importlib.util
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def module(name):
|
||||
spec = importlib.util.spec_from_file_location(name, ROOT / 'src/scripts' / (name + '.py'))
|
||||
result = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(result)
|
||||
return result
|
||||
|
||||
|
||||
auxiliary = module('generate_auxiliary_workflow')
|
||||
qctl = module('generate_qctl_workflow')
|
||||
standard = module('validate_standard')
|
||||
|
||||
|
||||
class WorkflowLoader(standard.UniqueLoader):
|
||||
# GitHub uses YAML 1.2: unquoted "on" is an event key, not a boolean.
|
||||
yaml_implicit_resolvers = {
|
||||
key: [(tag, pattern) for tag, pattern in values if tag != 'tag:yaml.org,2002:bool']
|
||||
for key, values in standard.UniqueLoader.yaml_implicit_resolvers.items()
|
||||
}
|
||||
|
||||
|
||||
WorkflowLoader.add_implicit_resolver('tag:yaml.org,2002:bool', re.compile(r'^(true|false)$', re.I), list('tTfF'))
|
||||
|
||||
|
||||
def load_workflow(raw):
|
||||
try:
|
||||
return yaml.load(raw, Loader=WorkflowLoader)
|
||||
except yaml.YAMLError as error:
|
||||
raise ValueError('Invalid native workflow YAML') from error
|
||||
|
||||
|
||||
# Only observed, mandatory verification gates; release-only jobs are not PR gates.
|
||||
DEFINITIONS = {
|
||||
'QRun-IO/qctl': ('qctl', ('main', 'develop'), ('qctl',),
|
||||
('native / test',)),
|
||||
'QRun-IO/.github': ('native-workflow-lint', ('main',), ('github-workflow-lint',),
|
||||
('actionlint / actionlint',)),
|
||||
'QRun-IO/qqq-business-platform': ('native-business', ('main',), ('business-db', 'business-e2e'),
|
||||
('validate / empty-database-migration', 'validate / Deployment gate / E2E passed')),
|
||||
'QRun-IO/qqq-mcp-rag': ('native-mcp', ('main',), ('mcp-rag',),
|
||||
('validate / Build and Test',)),
|
||||
'QRun-IO/qqq-app-developer-intellij-plugin': ('intellij-plugin', ('main',), ('intellij-plugin',),
|
||||
('plugin / build',)),
|
||||
}
|
||||
PROFILES = {definition[0] for definition in DEFINITIONS.values()}
|
||||
|
||||
|
||||
def gates(profile):
|
||||
names = next(definition[3] for definition in DEFINITIONS.values() if definition[0] == profile)
|
||||
return [{'context': name, 'app_id': 15368} for name in names]
|
||||
|
||||
|
||||
def caller(kind, pin):
|
||||
if kind == 'qctl':
|
||||
return '.github/workflows/build.yml', load_workflow(qctl.generate(pin))
|
||||
return auxiliary.BRIDGES[kind]['path'], auxiliary.canonical(kind, pin)
|
||||
|
||||
|
||||
def validate(repo, head, branch, request):
|
||||
if repo not in DEFINITIONS or branch not in DEFINITIONS[repo][1]:
|
||||
raise ValueError('Native recognition requires an approved repository and branch')
|
||||
profile, _, kinds, _ = DEFINITIONS[repo]
|
||||
|
||||
def content(owner, path, ref):
|
||||
item = request(f'repos/{owner}/contents/{path}?ref={ref}')
|
||||
if item.get('type') != 'file' or item.get('encoding') != 'base64':
|
||||
raise ValueError('Native workflow must be a regular file')
|
||||
return base64.b64decode(item['content']).decode('utf-8').replace('\r\n', '\n')
|
||||
|
||||
paths, pins, verified = set(), {}, set()
|
||||
for kind in kinds:
|
||||
path, _ = caller(kind, '0' * 40)
|
||||
actual = load_workflow(content(repo, path, head))
|
||||
try:
|
||||
pin = next(iter(actual['jobs'].values()))['uses'].rsplit('@', 1)[1]
|
||||
_, expected = caller(kind, pin)
|
||||
except (KeyError, TypeError, IndexError, ValueError, AttributeError, StopIteration):
|
||||
raise ValueError('Native caller has no immutable orb pin') from None
|
||||
if actual != expected:
|
||||
raise ValueError('Native caller differs from the canonical shared bridge')
|
||||
if pin not in verified:
|
||||
commit = request('repos/QRun-IO/qqq-orb/commits/' + pin)
|
||||
if not commit['commit']['verification']['verified']:
|
||||
raise ValueError('Native worker commit is not verified')
|
||||
verified.add(pin)
|
||||
for job in expected['jobs'].values():
|
||||
worker = job['uses'].split('@')[0].removeprefix('QRun-IO/qqq-orb/')
|
||||
if content('QRun-IO/qqq-orb', worker, pin) != (ROOT / worker).read_text(encoding='utf-8'):
|
||||
raise ValueError('Pinned native worker differs from the supported contract')
|
||||
paths.add(path)
|
||||
pins[path] = pin
|
||||
tree = request(f'repos/{repo}/git/trees/{head}?recursive=1')
|
||||
if tree.get('truncated') is not False or not isinstance(tree.get('tree'), list):
|
||||
raise ValueError('Native recognition requires the complete source tree')
|
||||
entries = {entry['path']: entry for entry in tree['tree']}
|
||||
for path in paths:
|
||||
entry = entries.get(path, {})
|
||||
if entry.get('type') != 'blob' or entry.get('mode') not in ('100644', '100755'):
|
||||
raise ValueError('Native caller is missing or is not a regular source file')
|
||||
for entry in tree['tree']:
|
||||
path = entry['path']
|
||||
if path == '.circleci/config.yml' or (path.startswith('.github/workflows/')
|
||||
and path.endswith(('.yml', '.yaml')) and path not in paths):
|
||||
raise ValueError('Native repository has additional orchestration: ' + path)
|
||||
return profile, pins
|
||||
@@ -12,6 +12,7 @@ import tempfile
|
||||
|
||||
import enroll_consumers
|
||||
import native_gitops_gates as gitops
|
||||
import native_specialist_gates as specialists
|
||||
import yaml
|
||||
|
||||
PATHS = ('.circleci/config.yml', '.qqq-ci.yml')
|
||||
@@ -109,6 +110,10 @@ def inspect(target, version):
|
||||
if info['archived']:
|
||||
raise ValueError('Archived repository')
|
||||
head = api(f'repos/{repo}/branches/{branch}')['commit']['sha']
|
||||
if repo in specialists.DEFINITIONS:
|
||||
profile, pins = specialists.validate(repo, head, branch, api)
|
||||
return {**target, 'head': head, 'profile': profile, 'version': version,
|
||||
'changed': False, 'worker_pins': pins}
|
||||
if repo in gitops.REPOSITORIES:
|
||||
pin = gitops.validate(repo, head, branch, api, yaml.safe_load)
|
||||
return {**target, 'head': head, 'profile': 'native-gitops', 'version': version,
|
||||
@@ -182,6 +187,7 @@ def main():
|
||||
parser.add_argument('--apply', action='store_true')
|
||||
parser.add_argument('--merge-ready', action='store_true')
|
||||
parser.add_argument('--enforce', action='store_true')
|
||||
parser.add_argument('--circle-settings', action='store_true')
|
||||
parser.add_argument('--output', type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
if (args.merge_ready or args.enforce) and not args.apply:
|
||||
@@ -214,6 +220,17 @@ def main():
|
||||
if args.enforce:
|
||||
row['enforcement'] = finish_enrollment.enforce_current(plan)
|
||||
args.output.write_text(json.dumps(report, indent=2), encoding='utf-8')
|
||||
if args.circle_settings:
|
||||
import circle_project_settings
|
||||
settings = []
|
||||
for repo in sorted({plan['repository'] for plan in plans}):
|
||||
branches = [plan for plan in plans if plan['repository'] == repo]
|
||||
settings.append({'repository': repo,
|
||||
'profiles': sorted({plan['profile'] for plan in branches}),
|
||||
**circle_project_settings.reconcile_repository(
|
||||
branches, findings, api, apply=args.apply)})
|
||||
args.output.with_suffix('.circle-settings.json').write_text(
|
||||
json.dumps(settings, indent=2), encoding='utf-8')
|
||||
print(json.dumps({'targets': len(plans), 'changed': sum(p['changed'] for p in plans),
|
||||
'unresolved': sum(row['state'] == 'unresolved' for row in findings),
|
||||
'applied': args.apply}))
|
||||
|
||||
@@ -22,7 +22,8 @@ def run(environment=None, execute=subprocess.run, root=None):
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
args = [sys.executable, str(root / 'tools/reconcile_enrollment.py'),
|
||||
'--organization', 'QRun-IO', '--orb-version', '0.8',
|
||||
'--output', str(output / 'result.json'), '--apply', '--merge-ready', '--enforce']
|
||||
'--output', str(output / 'result.json'), '--apply', '--merge-ready', '--enforce',
|
||||
'--circle-settings']
|
||||
try:
|
||||
result = execute(args, cwd=root, env=env, timeout=1200, check=False)
|
||||
code = result.returncode
|
||||
|
||||
Reference in new issue
Block a user