Skip to content

feat(BEX-252): add brevo app status command - #35

Merged
piyushsarin-sib merged 5 commits into
features_set_public_clifrom
BEX-252-app-status
Jul 24, 2026
Merged

feat(BEX-252): add brevo app status command#35
piyushsarin-sib merged 5 commits into
features_set_public_clifrom
BEX-252-app-status

Conversation

@piyushsarin-sib

Copy link
Copy Markdown
Collaborator

Summary

  • Add a read-only brevo app status command that reports an app's review lifecycle state (configured, submitted, in_review, approved, rejected, changes_requested) with a canned human-readable message. Resolves the app from --app-id, the linked app-config.json, or an interactive picker, and supports --json ({ state, message }). Reviewer feedback is delivered by email and is never surfaced here.
  • Introduce appService.fetchAppState as the canonical state-read path (backed by GET /v3/app-store/apps/:id/state) so future submit/withdraw commands share one read path.
  • Surface the API's error field alongside message in client error handling, so upload-style errors reach the user instead of a generic status line.
  • Keep AGENTS.md, SKILL.md, and a changeset in sync with the new command.

Test Plan

  • yarn test — full suite passes (639 tests)
  • brevo app status --app-id <id> prints the state label and message
  • brevo app status --app-id <id> --json returns { state, message }
  • Omitting --app-id falls back to app-config.json, then the interactive picker
  • An unknown/new server state maps to the generic message instead of erroring
  • A 404 surfaces an "app not found" error

Refs: BEX-252

🤖 Generated with Claude Code

Add a read-only `brevo app status` command that reports an app's
review lifecycle state (configured, submitted, in_review, approved,
rejected, changes_requested) with a canned human-readable message.
Resolves the app from --app-id, the linked app-config.json, or an
interactive picker; supports --json ({ state, message }). Reviewer
feedback is delivered by email and is never surfaced here.

State is read via a new appService.fetchAppState, the canonical
state-read path for future submit/withdraw commands, backed by the
/v3/app-store/apps/:id/state endpoint.

Also surface the API's `error` field (in addition to `message`) in
client error handling, so upload-style errors like
"distribution_type cannot be changed via upload" reach the user.

Docs (AGENTS.md, SKILL.md) and a changeset are updated in sync.

Co-authored-by: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 05:37
@piyushsarin-sib piyushsarin-sib self-assigned this Jul 24, 2026
@piyushsarin-sib
piyushsarin-sib changed the base branch from main to features_set_public_cli July 24, 2026 05:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Not ready to approve

The status command’s handling of a missing/empty state currently leads to confusing user output and should be normalized (with types/tests aligned) before merging.

Pull request overview

Adds a new read-only brevo app status subcommand that reports an OAuth app’s review lifecycle state via a dedicated API endpoint, alongside small supporting plumbing (types, endpoints, docs, and error handling).

Changes:

  • Introduces brevo app status command with --app-id resolution fallback (flag → app-config.json → picker) and --json output.
  • Adds appService.fetchAppState backed by GET /v3/app-store/apps/:id/state and wires the endpoint/CLI constants.
  • Improves API error surfacing by using error when message is missing; updates tests and agent docs + changeset.
File summaries
File Description
src/types.ts Adds app review lifecycle state types/response shape.
src/services/app.ts Adds fetchAppState() service method (canonical state read path).
src/lib/constants.ts Adds /state endpoint builder and CLI.APP_STATUS constant.
src/lang/en.ts Adds user-facing status strings and canned per-state messages.
src/commands/definitions.ts Registers the new app status subcommand and options.
src/commands/app/status.ts Implements brevo app status logic, output formatting, and --json.
src/bin/index.ts Updates top-level help banner to include the new command.
src/api/client.ts Enhances error message extraction to fall back to API error.
src/tests/services/app.test.ts Adds tests for fetchAppState() behavior and 404 mapping.
src/tests/commands/app/status.test.ts Adds command tests for resolution logic, JSON output, and messaging.
src/tests/api/client.test.ts Tests error vs message preference in API error handling.
agent-context/SKILL.md Documents the new command for agent usage (state + canned message).
agent-context/AGENTS.md Updates agent-facing command matrix with brevo app status.
.changeset/curly-status-command.md Adds a minor changeset for the new user-visible command.

Review details

  • Files reviewed: 13/14 changed files
  • Comments generated: 3
  • Review effort level: Low

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/app/status.ts Outdated
Comment thread src/types.ts
Comment thread src/__tests__/commands/app/status.test.ts
piyushsarin-sib and others added 3 commits July 24, 2026 11:18
…X-252-app-status

# Conflicts:
#	agent-context/AGENTS.md
#	agent-context/SKILL.md
#	src/commands/definitions.ts
#	src/lib/constants.ts
#	src/services/app.ts
…mands

Reformat the root `brevo --help` command listing for readability:
column-align signatures and descriptions (wrapping long signatures
onto their own indented line), fill in previously-blank descriptions,
and group `app status` / `app withdraw` under an "App-review commands
(public apps only)" heading. Help-text formatting only — no command,
flag, exit-code, or error-message contract changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address PR review feedback: when the API returns no state, normalize it
to an "unknown" sentinel so both the text header and --json output stay
meaningful instead of rendering a blank label / `state: ""`. Mark
AppStateResponse.state optional to match the tolerated runtime shape, add
friendly copy pointing the user to `brevo app upload`, and update the
test plus agent docs (SKILL.md/AGENTS.md).

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

Copy link
Copy Markdown
Collaborator Author

Addressed the review feedback in 083966c:

  • Missing/empty state is now normalized to an unknown sentinel, so the text header (App status: Unknown) and --json output ({ state: "unknown", … }) both stay meaningful instead of rendering a blank label / state: "".
  • Added friendly copy for the unknown/empty case pointing the user to make sure the app is public and has been uploaded via brevo app upload.
  • AppStateResponse.state is now optional, matching the tolerated runtime shape ({} responses).
  • Updated the corresponding test to assert the sentinel and message, and synced SKILL.md / AGENTS.md to document the unknown state.

Render `brevo app status` as a colour-coded, aligned status card (tone +
glyph per review state) and give the empty/`unknown` state actionable copy
telling the user to check the app is public and uploaded, instead of a raw
empty value.

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

Copy link
Copy Markdown

@Tribhuvan14 Tribhuvan14 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

@piyushsarin-sib
piyushsarin-sib merged commit 9e721cf into features_set_public_cli Jul 24, 2026
2 checks passed
@piyushsarin-sib
piyushsarin-sib deleted the BEX-252-app-status branch July 24, 2026 07:38
Tribhuvan14 added a commit that referenced this pull request Jul 24, 2026
Brings in `brevo app status` (BEX-252, #35). Conflict resolution:
- src/bin/index.ts: adopt the reworked help layout and add `app submit`
  to the new "App-review commands" section alongside status/withdraw.
- src/lang/en.ts: keep both additive blocks (APP_SUBMIT_* and APP_STATUS_*).
- src/lib/constants.ts: drop this branch's provisional CLI.APP_STATUS
  duplicate — the status PR ships the canonical one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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