Compare commits

...
Author SHA1 Message Date
james.maesandCodex 776196a5a4 fix(ci): verify maintenance on nonpublishing branches
Co-Authored-By: Codex <noreply@openai.com>
2026-10-21 16:43:10 -05:00
4 changed files with 36 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -225,7 +225,7 @@ def qbit_template(config, branch, tag):
kind = "hotfix"
if kind != "test" and not config["publish"][kind]:
kind = "test"
maintenance = kind != "test" and proven_ci_maintenance(branch, tag)
maintenance = proven_ci_maintenance(branch, tag)
if maintenance:
kind = "test"
workflow = "test_only" if kind == "test" else "publish_" + kind
+1 -1
View File
@@ -225,7 +225,7 @@ def qbit_template(config, branch, tag):
kind = "hotfix"
if kind != "test" and not config["publish"][kind]:
kind = "test"
maintenance = kind != "test" and proven_ci_maintenance(branch, tag)
maintenance = proven_ci_maintenance(branch, tag)
if maintenance:
kind = "test"
workflow = "test_only" if kind == "test" else "publish_" + kind
+22
View File
@@ -34,6 +34,28 @@ class MaintenanceTests(unittest.TestCase):
self.assertEqual(job['filters']['branches'], {'ignore': 'automation/qbit-rc-pending'})
self.assertNotIn('branch_type', job)
def test_nonpublishing_branches_verify_maintenance_but_keep_application_policy(self):
manifest = {'profile': 'qbit', 'orb_version': '0.8', 'default_branch': 'main',
'release_on_main': False, 'test_branch_policy': 'feature-no-hotfix',
'publish': {'snapshot': False, 'release_candidate': False, 'hotfix': False}}
with mock.patch.object(Path, 'read_text', return_value=yaml.safe_dump(manifest)):
config = pipeline.load_manifest('unused', '0.8')
maintenance_paths = self.paths
with mock.patch.object(pipeline, 'git', side_effect=self.git_result):
for branch in ('main', 'develop', 'release/0.1', 'hotfix/1.2.3'):
for maintenance in (True, False):
with self.subTest(branch=branch, maintenance=maintenance):
self.paths = maintenance_paths if maintenance else b'src/Main.java\0'
result = pipeline.qbit_template(config, branch, '')
job = result['workflows']['test_only']['jobs'][0]['qqq-orb/mvn_test_only']
ignored = job['filters']['branches']['ignore']
if maintenance:
self.assertEqual(ignored, 'automation/qbit-rc-pending')
else:
self.assertEqual(ignored, ['automation/qbit-rc-pending',
'/(develop|main|release/.*|hotfix/.*|integration.*)/'])
self.assertNotIn('branch_type', job)
def test_application_changes_and_unknown_files_publish_normally(self):
for paths in (b'pom.xml\0', b'.qqq-ci.yml\0src/Main.java\0', b'.github/workflows/custom-release.yml\0', b'', None):
self.paths = paths
+12
View File
@@ -605,6 +605,18 @@ class PipelineTests(unittest.TestCase):
if PACKED:
self.assertEqual(result, self.render(packed=True, CIRCLE_BRANCH="main"))
def test_nonpublishing_main_ci_change_runs_verification_with_packed_parity(self):
self.write_manifest(default_branch="main", release_on_main=False,
test_branch_policy="feature")
self.git("add", ".qqq-ci.yml")
self.git("-c", "commit.gpgsign=false", "commit", "-qm", "ci: use central pipeline")
result = self.render(CIRCLE_BRANCH="main")
job = result["workflows"]["verify"]["jobs"][0]["qqq-orb/mvn_test_only"]
self.assertEqual(job["filters"]["branches"], {"ignore": "automation/qbit-rc-pending"})
self.assertNotIn("branch_type", job)
if PACKED:
self.assertEqual(result, self.render(packed=True, CIRCLE_BRANCH="main"))
def test_qbit_publication_policy_packed_parity(self):
self.write_manifest(release_on_main=True, release_tag_policy="v-prefix",
test_branch_policy="feature")