Skip to content

fix(app submit): skip redundant fetch and show raw missing-field names (BEX-454) - #81

Merged
shubham773 merged 2 commits into
sync/main-into-feature_set-brevo-cli-v2from
fix/bex-454-app-submit-fetch-and-field-names
Aug 31, 2026
Merged

fix(app submit): skip redundant fetch and show raw missing-field names (BEX-454)#81
shubham773 merged 2 commits into
sync/main-into-feature_set-brevo-cli-v2from
fix/bex-454-app-submit-fetch-and-field-names

Conversation

@shubham773

Copy link
Copy Markdown
Contributor

What & why

Two fixes to brevo app submit (public-apps preview surface). Both were visible in a debug run of the command against a not-yet-submittable app.

1. No redundant app fetch when the app isn't submittable

The command ran the state preflight (GET .../state), which already reports submittable and the list of missing_fields, and then always fetched the full app (GET /cli/apps/{id}) before running the submittability gate. So a not-submittable app made a second, wasted request before erroring out.

The submittability gate now runs immediately after the state read, before the fetch — a not-submittable app errors without the extra call.

2. Missing-field names shown exactly as the API returns them

The state API returns raw field keys (e.g. logoLink, oauth.scopes). The human-readable path was remapping them to friendly labels (Logo URL, Scopes). Both --json and interactive output now show the field names exactly as the backend returns them.

Notes

  • Precedence (intentional): the submittability gate now runs before the "only public apps can submit" capability check. This is required — the public check needs distribution_type, which only the app fetch provides, so avoiding the fetch means gating on submittability first. submittable is meaningful only for public apps, so a private app still falls through to the existing not-public error.
  • Agent docs (SKILL.md / AGENTS.md) carry no app submit reference (gated feature), so no doc sync was needed.

Testing

  • submit.test.ts updated (raw-key assertions + fetchApp not-called guards) — 27/27 pass.
  • Full suite: 1416/1416 pass. yarn lint clean.

Ref: BEX-454

🤖 Generated with Claude Code

Shubham Verma and others added 2 commits August 27, 2026 16:47
…s (BEX-454)

The command ran the state preflight and then always fetched the full app before the submittability gate, so a not-submittable app triggered a wasted GET /cli/apps/{id} call. Move the gate to run right after the state read, before the fetch.

Also stop relabelling the missing-field names: the state API returns keys like logoLink / oauth.scopes, which the human path was rewriting to 'Logo URL' / 'Scopes'. Both --json and interactive output now show the names exactly as the API returns them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
app status ignored any message the state endpoint returns and always rendered locally-canned per-state copy. Prefer the API's message field when present; keep the per-state copy as a fallback for an older server that omits it (or sends a blank string), matching how state / submittable / missing_fields already tolerate an older server.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@piyushsarin-sib piyushsarin-sib left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shubham773
shubham773 merged commit 309a9e9 into sync/main-into-feature_set-brevo-cli-v2 Aug 31, 2026
2 checks passed
@shubham773
shubham773 deleted the fix/bex-454-app-submit-fetch-and-field-names branch August 31, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants