@caddis/cli 0.4.117 → 0.4.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_exit.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_file_lock.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_frontmatter.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_redact.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_roadmap.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_rows.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_status.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_tidy.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_todo.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_workstreams.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/caddis_coordinate.py +43 -3
- package/bundles/antigravity-plugin/scripts/caddis_guide.json +2 -2
- package/bundles/antigravity-plugin/scripts/templates/coordinator.md +1 -0
- package/bundles/antigravity-plugin/skills/send-email/SKILL.md +2 -1
- package/bundles/antigravity-plugin/skills/stories/SKILL.md +6 -0
- package/bundles/codex/.codex/skills/devops/send-email/SKILL.md +2 -1
- package/bundles/manifest.json +2 -2
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc
CHANGED
|
Binary file
|
|
@@ -1130,6 +1130,11 @@ def load_config(repo_root: Path) -> dict:
|
|
|
1130
1130
|
text = path.read_text(encoding="utf-8")
|
|
1131
1131
|
except FileNotFoundError as exc:
|
|
1132
1132
|
raise FileNotFoundError(f"no coordinator config at {path} (run: caddis_coordinate.py config init)") from exc
|
|
1133
|
+
return _parse_config(text)
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
def _parse_config(text: str) -> dict:
|
|
1137
|
+
"""The checks of `load_config` on the text of a coordinator.md."""
|
|
1133
1138
|
config = _config_block(text)
|
|
1134
1139
|
if not isinstance(config, dict):
|
|
1135
1140
|
raise ValueError("the config json block must be one JSON object")
|
|
@@ -1170,6 +1175,24 @@ def _start_mode_at(repo_root: Path, rev: str) -> str | None:
|
|
|
1170
1175
|
return block["start_mode"] if block["start_mode"] in START_MODES else "invalid"
|
|
1171
1176
|
|
|
1172
1177
|
|
|
1178
|
+
def load_deploy_config(repo_root: Path) -> dict:
|
|
1179
|
+
"""The config deploy-verify uses: `.caddis/coordinator.md` on `origin/<default branch>` after a fetch.
|
|
1180
|
+
|
|
1181
|
+
A coordinator's own work tree can be far behind origin, and then it reads an old `deploy.jobs` (serve-sight,
|
|
1182
|
+
11 Nov 2026). With no `origin/HEAD` (not a clone), read the work tree as `load_config` does. Raise OSError
|
|
1183
|
+
when the fetch fails and FileNotFoundError when origin has no config."""
|
|
1184
|
+
if _origin_default_branch(repo_root) is None:
|
|
1185
|
+
return load_config(repo_root)
|
|
1186
|
+
fetched = _run(["git", "-C", str(repo_root), "fetch", "-q", "origin"])
|
|
1187
|
+
if fetched.returncode != 0:
|
|
1188
|
+
raise OSError(f"git fetch origin failed in {repo_root}: {fetched.stderr.strip()}")
|
|
1189
|
+
branch = _origin_default_branch(repo_root)
|
|
1190
|
+
shown = _run(["git", "-C", str(repo_root), "show", f"origin/{branch}:{_CONFIG_REL}"])
|
|
1191
|
+
if shown.returncode != 0:
|
|
1192
|
+
raise FileNotFoundError(f"no {_CONFIG_REL} on origin/{branch} in {repo_root}")
|
|
1193
|
+
return _parse_config(shown.stdout)
|
|
1194
|
+
|
|
1195
|
+
|
|
1173
1196
|
def _origin_default_branch(repo_root: Path) -> str | None:
|
|
1174
1197
|
"""The default branch from `refs/remotes/origin/HEAD`, never from the work tree (review, 24 Oct 2026)."""
|
|
1175
1198
|
out = _run(["git", "-C", str(repo_root), "symbolic-ref", "--short", "refs/remotes/origin/HEAD"])
|
|
@@ -1459,6 +1482,16 @@ def _call(runner: Callable[[list[str]], subprocess.CompletedProcess[str]], argv:
|
|
|
1459
1482
|
return result
|
|
1460
1483
|
|
|
1461
1484
|
|
|
1485
|
+
# Jobs that may be skipped in a deploy run and still count (`deploy.skippable_jobs` replaces the list). app-ci
|
|
1486
|
+
# skips deploy_uat on every run that does not deploy to UAT.
|
|
1487
|
+
DEFAULT_SKIPPABLE_JOBS = ("deploy_uat",)
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
def _job_short_name(name: object) -> str:
|
|
1491
|
+
"""`ci / deploy_uat` -> `deploy_uat`: a called workflow's jobs carry the caller job's name as a prefix."""
|
|
1492
|
+
return str(name or "").rsplit("/", 1)[-1].strip()
|
|
1493
|
+
|
|
1494
|
+
|
|
1462
1495
|
def deploy_verify(rid: str, cfg: dict, pr: int, merge_sha: str, *, docs_only: bool,
|
|
1463
1496
|
runner: Callable[[list[str]], subprocess.CompletedProcess[str]] | None = None,
|
|
1464
1497
|
env=os.environ, repo_root: Path | None = None) -> dict:
|
|
@@ -1468,7 +1501,8 @@ def deploy_verify(rid: str, cfg: dict, pr: int, merge_sha: str, *, docs_only: bo
|
|
|
1468
1501
|
Checks run in order and stop at the first failure (the rest are `skip`). D2 does not wait: the model waits
|
|
1469
1502
|
with `caddis_lanes.py ci-watch --run` first. Docs-only runs D1, D2 and D5 only, and D2 fails when the run
|
|
1470
1503
|
contradicts the flag (a job named `deploy...` succeeded, or `deploy.jobs` jobs succeeded). A non-docs run needs
|
|
1471
|
-
`deploy.jobs` successful jobs, and every job when it has more
|
|
1504
|
+
`deploy.jobs` successful jobs, and every job when it has more; a skipped job named in `deploy.skippable_jobs`
|
|
1505
|
+
(default `deploy_uat`) counts as done. `deploy.never_health_path` is never requested.
|
|
1472
1506
|
`GH_TOKEN` comes from the inherited environment only. `repo_root` is where the git commands of D3 run.
|
|
1473
1507
|
A run still in progress at D2 records health `pending`, not `failed`.
|
|
1474
1508
|
Raises ValueError, before any network call and with nothing recorded, for a merge SHA that is not a full SHA,
|
|
@@ -1555,15 +1589,21 @@ def deploy_verify(rid: str, cfg: dict, pr: int, merge_sha: str, *, docs_only: bo
|
|
|
1555
1589
|
jobs = None
|
|
1556
1590
|
if not isinstance(jobs, list):
|
|
1557
1591
|
raise _CheckFailed("gh run view did not print a jobs list")
|
|
1592
|
+
skippable = deploy.get("skippable_jobs", list(DEFAULT_SKIPPABLE_JOBS))
|
|
1593
|
+
if not isinstance(skippable, list) or not all(isinstance(n, str) and n for n in skippable):
|
|
1594
|
+
raise _CheckFailed(f"deploy.skippable_jobs must be a list of job names, not {skippable!r}")
|
|
1558
1595
|
succeeded = [j for j in jobs if isinstance(j, dict) and j.get("conclusion") == "success"]
|
|
1596
|
+
allowed = [j for j in jobs if isinstance(j, dict) and j.get("conclusion") == "skipped"
|
|
1597
|
+
and _job_short_name(j.get("name")) in skippable]
|
|
1559
1598
|
done = len(succeeded)
|
|
1560
1599
|
if docs_only: # a docs-only push deploys nothing: a run that deployed contradicts the flag
|
|
1561
1600
|
deployed = any("deploy" in str(j.get("name", "")).lower() for j in succeeded)
|
|
1562
1601
|
if deployed or (want_ok and done >= want):
|
|
1563
1602
|
raise _CheckFailed(f"docs-only flag contradicts the run: {done} jobs succeeded")
|
|
1564
1603
|
return
|
|
1604
|
+
done += len(allowed) # a named job that was skipped (deploy_uat on a PROD-only run) counts as done
|
|
1565
1605
|
others = ", ".join(f"{j.get('name')}={j.get('conclusion')}" for j in jobs
|
|
1566
|
-
if isinstance(j, dict) and j.get("conclusion") != "success")
|
|
1606
|
+
if isinstance(j, dict) and j.get("conclusion") != "success" and j not in allowed)
|
|
1567
1607
|
detail = f" ({others})" if others else ""
|
|
1568
1608
|
if done < want:
|
|
1569
1609
|
raise _CheckFailed(f"run {found['id']}: {done} of {want} jobs succeeded{detail}")
|
|
@@ -1958,7 +1998,7 @@ def _dispatch(args: argparse.Namespace) -> int:
|
|
|
1958
1998
|
return EXIT_OK
|
|
1959
1999
|
if args.command == "deploy-verify":
|
|
1960
2000
|
root = _deploy_root(args.config_path)
|
|
1961
|
-
out = deploy_verify(rid,
|
|
2001
|
+
out = deploy_verify(rid, load_deploy_config(root), args.pr, args.merge_sha, docs_only=args.docs_only,
|
|
1962
2002
|
runner=_deploy_run, repo_root=root)
|
|
1963
2003
|
marks = " ".join(f"{name}={mark}" for name, mark in out["checks"].items())
|
|
1964
2004
|
_emit(args, out, f"{out['health']}: {marks} ({out['reason']})")
|
|
@@ -30,6 +30,7 @@ What the keys mean:
|
|
|
30
30
|
| `peer_ack.ack_file` | Where each peer writes its ack: `{head, acked[], at}`. An ack older than 30 minutes does not count. Only a peer with a stake in the repo must ack: its folder is in the repo or a worktree of it, or the coordinator lists one of its PRs, branches or plan phases, or it sent `ready` or `phase`. A peer with no stake is not warned and is not in `acked[]`. |
|
|
31
31
|
| `deploy.event` | The event that starts the deploy run (for example `push`). |
|
|
32
32
|
| `deploy.jobs` | The number of jobs in the deploy run. |
|
|
33
|
+
| `deploy.skippable_jobs` | Optional. Jobs that may end `skipped` and still count toward `deploy.jobs`, by name after the last `/` (`ci / deploy_uat` is `deploy_uat`). Default `["deploy_uat"]`: app-ci skips it on every run that does not deploy to UAT. Any other skipped job fails D2. |
|
|
33
34
|
| `deploy.tag` | The release tag scheme. With `calver`, the tag must point at the merge SHA. |
|
|
34
35
|
| `deploy.base_url_env` | The environment variable that holds the production base URL on this machine. |
|
|
35
36
|
| `deploy.auth` | How the checks authenticate to production. |
|
|
@@ -56,7 +56,8 @@ For a local test relay only, set `allow_insecure_auth = true` (a boolean) in the
|
|
|
56
56
|
- A note to forward to another team: a plain subject with no prefix, for example `Data request for the weekly report`.
|
|
57
57
|
3. Dry run. It sends nothing, needs no credentials and writes `<file>.preview.html`:
|
|
58
58
|
`python -I scripts/send_email.py --dry-run --to x@example.com --subject t --body-file <file.md>`
|
|
59
|
-
Read the preview, then delete it.
|
|
59
|
+
Read the preview, then delete it. `md_to_html` writes each table on ONE line, so `grep -c "<tr"` counts tables,
|
|
60
|
+
not rows. Count rows with `grep -o "<tr" <file>.preview.html | wc -l`.
|
|
60
61
|
4. Send:
|
|
61
62
|
`python -I scripts/send_email.py --to <address> --subject '<subject>' --body-file <file.md> [--attach <file> ...]`
|
|
62
63
|
`--to` can repeat. Graph HTTP 202 means Graph accepted the mail. An SMTP "accepted" means the server took it.
|
|
@@ -48,3 +48,9 @@ Stop at the first step that does not exit 0, and report its output.
|
|
|
48
48
|
call.
|
|
49
49
|
- A sync rewrites the plan's whole section. A phase removed from the plan leaves the table.
|
|
50
50
|
- When the stored section has the same hash, the sync writes nothing and makes no new page version.
|
|
51
|
+
- On a page another user edited, the dry run prints the CURRENT version. The write bumps it (seen v5 to v6). The
|
|
52
|
+
section markers survive a real Confluence save: the next sync said `ACTION: unchanged`.
|
|
53
|
+
- `plain()` in `scripts/caddis_stories.py` must protect backtick code spans. It once stripped every `(...)` group
|
|
54
|
+
and corrupted SQL such as `SUM(Base)` and `WITH (NOLOCK)` (fixed in #278). It now holds each whole backtick run
|
|
55
|
+
as a placeholder (CommonMark rule). Review found edge cases: code inside links, code inside parentheses, and
|
|
56
|
+
multi-backtick runs. Any text simplifier for published output needs the same protection.
|
|
@@ -56,7 +56,8 @@ For a local test relay only, set `allow_insecure_auth = true` (a boolean) in the
|
|
|
56
56
|
- A note to forward to another team: a plain subject with no prefix, for example `Data request for the weekly report`.
|
|
57
57
|
3. Dry run. It sends nothing, needs no credentials and writes `<file>.preview.html`:
|
|
58
58
|
`python -I scripts/send_email.py --dry-run --to x@example.com --subject t --body-file <file.md>`
|
|
59
|
-
Read the preview, then delete it.
|
|
59
|
+
Read the preview, then delete it. `md_to_html` writes each table on ONE line, so `grep -c "<tr"` counts tables,
|
|
60
|
+
not rows. Count rows with `grep -o "<tr" <file>.preview.html | wc -l`.
|
|
60
61
|
4. Send:
|
|
61
62
|
`python -I scripts/send_email.py --to <address> --subject '<subject>' --body-file <file.md> [--attach <file> ...]`
|
|
62
63
|
`--to` can repeat. Graph HTTP 202 means Graph accepted the mail. An SMTP "accepted" means the server took it.
|
package/bundles/manifest.json
CHANGED
package/package.json
CHANGED