Repository navigation
docs(ops): give #2210 the drift-state contract #2878 required #2891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
68e3948
docs(ops): give #2210 the drift-state contract #2878 required
codex-automation 9ac766e
fix(docs): pin durable tracker cadence contract
codex-automation bc7d31d
style(docs): black-format durable tracker state gate
codex-automation 2cc24c2
docs(ops): pin #2210 red-signal and scoped tracker gates
codex-automation File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| """Keep the #2210 durable-tracker doc honest about Health 68's drift states (issue #2878). | ||
|
|
||
| The #2878 task list required both `CONSUMER_REPO_MAINTENANCE.md` and | ||
| `DURABLE_TRACKING_ISSUES.md` to carry the state and SLO contract; only the first | ||
| was updated, so the tracker page still promised a daily cron and described drift | ||
| itself as the red signal. These gates pin the doc to what the checker can | ||
| actually emit, so a sixth state cannot be added silently. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import re | ||
| from pathlib import Path | ||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parents[2] | ||
| TRACKER_DOC = REPO_ROOT / "docs" / "ops" / "DURABLE_TRACKING_ISSUES.md" | ||
| CHECKER = REPO_ROOT / "scripts" / "check_consumer_sync_drift.py" | ||
| HEALTH_68 = REPO_ROOT / ".github" / "workflows" / "health-68-consumer-sync-drift.yml" | ||
|
|
||
|
|
||
| def _per_repo_states() -> set[str]: | ||
| """Every value the checker assigns to a per-repo `state` key.""" | ||
| source = CHECKER.read_text(encoding="utf-8") | ||
| return set(re.findall(r'"state":\s*"([a-z_]+)"', source)) | ||
|
|
||
|
|
||
| def test_tracker_doc_documents_every_state_the_checker_emits() -> None: | ||
| documented = set(re.findall(r"\| `([a-z_]+)` \|", TRACKER_DOC.read_text(encoding="utf-8"))) | ||
| emitted = _per_repo_states() | {"converged"} | ||
|
|
||
| assert emitted <= documented, ( | ||
| f"states missing from DURABLE_TRACKING_ISSUES.md: {sorted(emitted - documented)}" | ||
| ) | ||
|
stranske marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def test_tracker_doc_does_not_promise_a_cron_health_68_no_longer_has() -> None: | ||
| text = TRACKER_DOC.read_text(encoding="utf-8") | ||
| workflow = HEALTH_68.read_text(encoding="utf-8") | ||
|
|
||
| assert "schedule:" not in workflow, "Health 68 regained a cron; update the tracker doc row" | ||
| assert "05:10" not in text, "the tracker row still advertises the removed daily 05:10 cron" | ||
| assert "Merge Sync PRs" in text | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| def test_tracker_doc_states_that_covered_drift_is_silent() -> None: | ||
| text = TRACKER_DOC.read_text(encoding="utf-8") | ||
|
|
||
| # The whole point of #2878: a covered run exits zero and appends nothing, so | ||
| # a quiet tracker must not be read as a broken workflow. | ||
| assert "covered" in text | ||
| assert "actionable" in text | ||
| assert "CONSUMER_REPO_MAINTENANCE.md#drift-coverage-states" in text | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.