fix(cli): name the record a 404 could not find - #1620
Goran Gajic (gorangajic) merged 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. WalkthroughThe change adds record-specific 404 subjects for sessions, triggers, issues, flows, and files. Record IDs take precedence over environment IDs. Requests without a recognized record or environment subject report an unmatched request. Shell formatting now uses the record noun and ID. Tests cover subject resolution and 404 output. Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant PublicAPI
participant notFoundSubject
participant describeNotFound
PublicAPI->>notFoundSubject: resolve record or environment subject
notFoundSubject-->>PublicAPI: return 404 subject
PublicAPI->>describeNotFound: provide not-found subject
describeNotFound-->>PublicAPI: return record-specific or unmatched-request message
Merge Risk: ⚪ Minimal · up to The CLI now provides clearer 404 messages for missing records and unmatched requests without identified compatibility or runtime risk. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
A missing trigger read as "could not find trigger.get", which sounds like the endpoint is gone rather than the record. Triggers, issues, flows, agent sessions and files now answer with what was asked for and its id, and a request with no such id says it matched nothing.
8cf9c6d to
64c031b
Compare
qawolf trigger get --trigger-id trg-1on a trigger that does not exist answered "QA Wolf API could not find trigger.get (HTTP 404)" — the name of the endpoint, which reads as though the endpoint itself were gone. Issues, flows, agent sessions and files all said the same kind of thing.Relates to WIZ-12150. Stacked on #1619, which fixed the same wording for runners, runs and environments; review that one first.
Overview of Changes
A 404 on one of these now names what was missing and the id it was asked for:
QA Wolf has no trigger trg-1 (HTTP 404).A request that names no such record — a listing, a search — says it matched nothing rather than that it could not be found.Where a record is looked up inside an environment, the record wins. Missing a trigger is not an environment problem, which is the thing this family of changes is about.
Testing
bun run typecheck bun run lint bun run format:check bun run knip bun run test bun run buildUnit tests cover each named record, the case where a request scopes an environment as well, and the ids a route only takes as arguments (a workspace, a timezone) staying out of the message. Also run against a local stub answering 404 to check the real command output.
Checklist
🤖 Generated with Claude Code