Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions tests/workflows/test_consumer_sync_create_only_evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ def _manifest_entries() -> dict[str, dict]:
def test_consumer_create_only_files_are_manifested() -> None:
entries = _manifest_entries()

# .github/dependabot.yml was intentionally dropped from the template and the
# manifest in #2401 (P3b of the Renovate fleet migration): create_only sync
# would otherwise resurrect Dependabot on every re-sync. It must no longer be
# manifested.
# Consumer-specific bootstrap files must be seeded without clobbering repos
# that already customized their local configuration.
for source in (
".github/workflows/pr-00-gate.yml",
".github/workflows/ci.yml",
".github/renovate.json",
):
assert source in entries
assert entries[source]["sync_mode"] == "create_only"
Expand All @@ -38,11 +37,21 @@ def test_consumer_create_only_files_are_manifested() -> None:
):
assert entries[source]["overwrite_repos"] == ["stranske/Template"]

# Guard against re-adding the Dependabot config to the manifest (would
# resurrect Dependabot on consumers via create_only sync). See #2401.
# .github/dependabot.yml was intentionally dropped from the template and the
# manifest in #2401 (P3b of the Renovate fleet migration): create_only sync
# would otherwise resurrect Dependabot on every re-sync. It must no longer be
# manifested.
assert ".github/dependabot.yml" not in entries


def test_consumer_renovate_template_extends_fleet_preset() -> None:
template = yaml.safe_load(
(REPO_ROOT / "templates/consumer-repo/.github/renovate.json").read_text(encoding="utf-8")
)

assert template["extends"] == ["github>stranske/Workflows//renovate-presets/fleet"]


def test_gate_manifest_entry_documents_fresh_consumer_bootstrap_risk() -> None:
entries = _manifest_entries()
gate = entries[".github/workflows/pr-00-gate.yml"]
Expand Down
9 changes: 9 additions & 0 deletions tests/workflows/test_maint82_sync_campaign_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import yaml

WORKFLOW = Path(".github/workflows/maint-82-sync-dependency-campaign.yml")
CAMPAIGN_SCRIPT = Path(".github/scripts/sync_dependency_campaign.js")


def _refresh_script() -> str:
Expand Down Expand Up @@ -35,3 +36,11 @@ def test_campaign_workflow_bot_agnostic_identity():
assert data["name"] == "Sync/Dependency Campaign"
# Loads the renamed campaign script.
assert "sync_dependency_campaign.js" in _refresh_script()


def test_campaign_tracks_renovate_as_dependency_bot():
script = CAMPAIGN_SCRIPT.read_text(encoding="utf-8")

assert "renovate[bot]" in script
assert "app/renovate" in script
assert "headRef.startsWith('renovate/')" in script
Loading