| 1 | # smbcloud-ascapi — token-source + builds API: plan (closed) |
| 2 | |
| 3 | This file tracks the remaining work from the builds-API / token-source |
| 4 | session on `smbcloud-ascapi` (repo: `github.com:smbcloudXYZ/smbcloud-ascapi`, |
| 5 | base branch `development`). |
| 6 | |
| 7 | Shipped as gh stack #9 (draft PRs, bottom to top): |
| 8 | #6 `fix/list-pagination` → #7 `feature/token-source` → |
| 9 | #8 `feature/builds-api` → #10 `feature/altool-upload`. |
| 10 | |
| 11 | ## Verification (done) |
| 12 | - [x] `cargo build` — clean. (Fixed: `--platform` must use the `CliPlatform` |
| 13 | ValueEnum wrapper, not `Platform` directly, then `.map(Platform::from)` |
| 14 | in the match arm.) |
| 15 | - [x] `cargo clippy --all-targets` — clean, on every stack layer. |
| 16 | - [x] `cargo test` — all passing (incl. doc-tests), on every stack layer. |
| 17 | |
| 18 | ## Feature work |
| 19 | - [x] altool upload orchestration (frontend crate): `frontend::upload`, |
| 20 | CLI `ascapi apps upload <pkg> [--wait]` (#10). Passes |
| 21 | `--p8-file-path` so altool uses the same key as the API calls. |
| 22 | CLI-only; deliberately not an MCP tool. |
| 23 | - [x] Unit tests for the new builds API (filter keys, list/pre-release |
| 24 | deserialization) (#8). |
| 25 | - [x] Fixed: builds/pre-release filters were sent to |
| 26 | `/v1/apps/{id}/builds` and `/v1/apps/{id}/preReleaseVersions`, which |
| 27 | don't accept `filter[...]`. Now `/v1/builds` and |
| 28 | `/v1/preReleaseVersions` with `filter[app]` (#8). |
| 29 | - [x] Unit tests for `token.rs` (`StaticToken`, `Client::new` over a |
| 30 | custom `TokenSource`) (#7) — `CountingSource` mint-counting tests in |
| 31 | `crates/core/src/client.rs::tests`, `StaticToken`/boxed-source tests |
| 32 | in `crates/core/src/token.rs::tests`. |
| 33 | - [x] MCP `list_builds` exposes `BuildFilter` — see |
| 34 | `crates/mcp/src/lib.rs:201` (constructs `BuildFilter` from the |
| 35 | request, including `processing-state`). |
| 36 | - [x] Documented `list_builds` limit=200 as page size, not a cap |
| 37 | (sitiai finding #6, PR #24). |
| 38 | - [x] `asc apps await-processing` poll loop built on `BuildsApi::list_builds` |
| 39 | (sitiai finding #5, PR #26) — a non-blocking alternative to altool |
| 40 | `--wait`. |
| 41 | |
| 42 | ## Docs |
| 43 | - [x] README crate table — builds API surface, altool upload. |
| 44 | - [x] CLAUDE.md — builds, build, pre-release-versions, upload. |
| 45 | |
| 46 | ## Release |
| 47 | - [x] Release build + offline smoke test (`--help`, `--dry-run apps upload`, |
| 48 | package validation errors). |
| 49 | - [ ] Live smoke test against ASC (needs `ASC_ISSUER_ID`): run |
| 50 | `apps builds <id> --pre-release-version …` and |
| 51 | `apps pre-release-versions <id> --platform ios` to confirm the |
| 52 | `/v1/builds` filter fix, then one real `apps upload`. **Still blocked |
| 53 | on credentials; no owner.** |
| 54 | - [x] Commits with co-author trailer, signed (GitHub: verified). |
| 55 | - [x] `gh stack` PRs (`remote.pushDefault` is `setoelkahfi`, there is no |
| 56 | `origin`). |
| 57 | - [x] Mark PRs ready for review and merge (`gh stack merge --yes`). |
| 58 | |
| 59 | ## Separate / unaddressed bug — documented in AGENTS.md |
| 60 | - [→] ASC API 401 on builds query. Not in this repo: Klepon has no |
| 61 | `build-ios.sh`. `onde-store/scripts/build-ios.sh` and |
| 62 | `smbcloud-browser/scripts/build-ios.sh` default `ASC_PRIVATE_KEY_PATH` |
| 63 | to `~/private_keys/AuthKey_<id>.p8`, while ascapi defaults to |
| 64 | `~/.appstoreconnect/private_keys/AuthKey_<id>.p8`. Two copies with |
| 65 | the same id can drift. Decide which file is current, then either |
| 66 | point the scripts at it or set `ASC_PRIVATE_KEY_PATH` once for both. |
| 67 | `ascapi apps upload` avoids the drift by passing the key explicitly. |
| 68 | **No code change here.** The drift is between sibling repos, not |
| 69 | inside `smbcloud-ascapi`; tracked as the "App Store Connect key |
| 70 | location" section in `AGENTS.md` so future sessions don't |
| 71 | re-investigate. |
| 72 | |
| 73 | ## Cleanup |
| 74 | - [x] Main working tree on `development` clean — the uncommitted copy of |
| 75 | #6–#8 was discarded once it landed on the branches. |
| 76 | - [x] Old local `feature/token` (`0eac45b`, unpushed) is superseded by #7; |
| 77 | branch is gone. |
| 78 | - [x] Worktree at `/tmp/ascapi-stack/wt` removed (`git worktree remove`). |
| 79 | |
| 80 | ## Status |
| 81 | Closed. All plan items in scope of this repo are merged. The one remaining |
| 82 | item (live ASC smoke test) is credential-blocked and not actionable from |
| 83 | here. The cross-repo key-drift finding lives in `AGENTS.md`. |