@@ -132,6 +132,7 @@ use crate::gh_cache; |
132 | 132 | use crate::gh_closure; |
133 | 133 | use crate::gh_guard; |
134 | 134 | use crate::gh_metadata; |
| 135 | +use crate::gh_sync; |
135 | 136 | use fleet_config::{Config, DEFAULT_GH_CACHE_PORT}; |
136 | 137 | use fleet_secrets::Resolver; |
137 | 138 | use std::io::{IsTerminal, Write}; |
@@ -189,7 +190,20 @@ FLEET_GH_CACHE as a comma list; an address without a port gets port |
189 | 190 | `fleet gh cache-status` probes the configured daemons. `--cache-addr` |
190 | 191 | overrides every daemon address for one call; `--no-cache` resolves |
191 | 192 | in-process. When no daemon answers, the call resolves in-process and |
192 | | -says so on stderr — never silently."; |
| 193 | +says so on stderr — never silently. |
| 194 | +
|
| 195 | +Sync verbs (code#10973, step 2.2 of #9016): the `sync-*` shadow |
| 196 | +verbs are the typed Queue/GitHub sync surface for scripted flows |
| 197 | +(pm-stack dispatch's fallback, the opencode claimant, job bodies). |
| 198 | +Each declares its whole command line, validates it strictly, and |
| 199 | +rewrites to the canonical gh call before the guard, closure and |
| 200 | +metadata layers run, inheriting the rotation and the retry-safety |
| 201 | +rule. `fleet gh sync-labels --repo OWNER/REPO <issue|pr> <n>` prints |
| 202 | +an item's label names as JSON; `sync-view` prints labels,state,title |
| 203 | +JSON; `sync-comment` posts a comment (`--body` or `--body-file`); |
| 204 | +`sync-issue-create`, `sync-issue-get`, `sync-labels-add`, |
| 205 | +`sync-label-ensure` and `sync-issue-close` (fleet closure reasons) |
| 206 | +cover the issue writes dispatch composes. See gh_sync.rs."; |
193 | 207 |
|
194 | 208 | /// The fleet's GitHub Apps, in rotation order. Each carries its |
195 | 209 | /// private key (and, except the fleet App whose ID is a public |
@@ -1500,6 +1514,24 @@ pub fn run(config: &Config, args: &[String]) -> i32 { |
1500 | 1514 | if args.first().is_some_and(|a| a == "closures") { |
1501 | 1515 | return run_closures(&args[1..]); |
1502 | 1516 | } |
| 1517 | + // Sync verbs (#10973, step 2.2 of #9016): strictly-parsed typed |
| 1518 | + // verbs that rewrite to the canonical gh call. The rewrite is |
| 1519 | + // applied here, before the close guard, the closure layer and |
| 1520 | + // the metadata create path parse the arguments, so a sync call |
| 1521 | + // inherits every passthrough control — and the rotation below — |
| 1522 | + // exactly as the hand-written call it replaces would have. |
| 1523 | + let sync_rewrite; |
| 1524 | + let args: &[String] = match gh_sync::parse(args) { |
| 1525 | + Ok(Some(canonical)) => { |
| 1526 | + sync_rewrite = canonical; |
| 1527 | + &sync_rewrite |
| 1528 | + } |
| 1529 | + Ok(None) => args, |
| 1530 | + Err(e) => { |
| 1531 | + eprintln!("{e}"); |
| 1532 | + return EXIT_USAGE; |
| 1533 | + } |
| 1534 | + }; |
1503 | 1535 | let guard_intent = match gh_guard::parse(args) { |
1504 | 1536 | Ok(intent) => intent, |
1505 | 1537 | Err(e) => { |
|