diff --git a/.github/tests/renovate_config_contract_test.py b/.github/tests/renovate_config_contract_test.py index 66dc2f8..831561c 100644 --- a/.github/tests/renovate_config_contract_test.py +++ b/.github/tests/renovate_config_contract_test.py @@ -28,6 +28,28 @@ def test_gomod_updates_are_tidied(self): self.assertIn("gomodTidy", config.get("postUpdateOptions", [])) + def test_portwing_lock_maintenance_is_disabled_exactly(self): + config = self.read_config() + + matches = [ + rule + for rule in config.get("packageRules", []) + if rule.get("matchRepositories") == ["CodesWhat/portwing"] + ] + + self.assertEqual(1, len(matches)) + self.assertEqual(["npm"], matches[0].get("matchManagers")) + self.assertEqual(["lockFileMaintenance"], matches[0].get("matchUpdateTypes")) + self.assertIs(matches[0].get("enabled"), False) + + def test_validation_runs_this_contract(self): + command = "python3 .github/tests/renovate_config_contract_test.py" + validation = (ROOT / "scripts/validate.sh").read_text() + workflow = (ROOT / ".github/workflows/standards-validation.yml").read_text() + + self.assertEqual(1, validation.count(command)) + self.assertEqual(1, workflow.count(command)) + if __name__ == "__main__": unittest.main() diff --git a/.github/workflows/standards-validation.yml b/.github/workflows/standards-validation.yml index 425ef4e..703d696 100644 --- a/.github/workflows/standards-validation.yml +++ b/.github/workflows/standards-validation.yml @@ -53,6 +53,7 @@ jobs: python3 .github/tests/greptile_config_contract_test.py python3 .github/tests/quality_report_contract_test.py python3 .github/tests/reusable_ci_contract_test.py + python3 .github/tests/renovate_config_contract_test.py python3 .github/tests/starchart_refresh_contract_test.py python3 .github/tests/main_is_released_contract_test.py diff --git a/renovate-config.json b/renovate-config.json index 541b88b..0258361 100644 --- a/renovate-config.json +++ b/renovate-config.json @@ -47,6 +47,19 @@ ], "groupName": "vite ecosystem", "groupSlug": "vite-ecosystem" + }, + { + "description": "Disable npm lock maintenance for Portwing because native packages are platform-specific", + "matchRepositories": [ + "CodesWhat/portwing" + ], + "matchManagers": [ + "npm" + ], + "matchUpdateTypes": [ + "lockFileMaintenance" + ], + "enabled": false } ] } diff --git a/scripts/validate.sh b/scripts/validate.sh index 5d02c10..e6d9504 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -16,6 +16,7 @@ python3 .github/tests/greptile_summon_contract_test.py python3 .github/tests/greptile_config_contract_test.py python3 .github/tests/quality_report_contract_test.py python3 .github/tests/reusable_ci_contract_test.py +python3 .github/tests/renovate_config_contract_test.py echo "==> compile python" python3 -m compileall -q .