Skip to content

feat: enable public app distribution in brevo app create - #30

Merged
piyushsarin-sib merged 5 commits into
features_set_public_clifrom
enable-public-app
Jul 23, 2026
Merged

feat: enable public app distribution in brevo app create#30
piyushsarin-sib merged 5 commits into
features_set_public_clifrom
enable-public-app

Conversation

@Tribhuvan14

Copy link
Copy Markdown
Collaborator

Summary

Enables --distribution public on brevo app create — the "coming soon" rejection is removed and the Public option in the interactive prompt is no longer disabled.

  • brevo app create --distribution public now creates a public app instead of erroring; the APP_CREATE_PUBLIC_UNAVAILABLE message is removed.
  • The interactive distribution prompt offers Public as a selectable choice.
  • Scaffolded app-config.json now writes the app's actual distribution type into auth.type (via a new {{DISTRIBUTION}} template variable) and drops the redundant top-level distribution key.
  • readProjectConfig() transparently backfills auth.type from the legacy top-level distribution key, so previously scaffolded projects keep working; auth.type wins when both are present.
  • agent-context/AGENTS.md and agent-context/SKILL.md updated to document the new --distribution <private|public> surface.

Test Plan

  • Updated app create test: --distribution public now creates the app with distribution_type: 'public' and asserts the API payload.
  • New config tests covering the legacy distribution key: backfill into auth.type, precedence of auth.type when both exist, and new-format configs without the key.
  • Removed the stale top-level distribution fixture key from app update tests.
  • Full suite: 40 suites, 627 tests passing.

🤖 Generated with Claude Code

Accept --distribution public (remove the coming-soon rejection) and
enable the Public option in the interactive prompt. Scaffolded
app-config.json now writes the actual distribution type into auth.type
and drops the redundant top-level distribution key; legacy configs are
read transparently by backfilling auth.type from the old key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 23, 2026 06:45
@Tribhuvan14 Tribhuvan14 self-assigned this Jul 23, 2026
@Tribhuvan14
Tribhuvan14 changed the base branch from main to feature-set-public-app July 23, 2026 06:46

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.

Pull request overview

Enables creating public OAuth apps via brevo app create --distribution public, updates the interactive prompt to allow selecting Public, and aligns scaffolded app-config.json with the app’s real distribution type while keeping older scaffolded projects compatible via config backfill.

Changes:

  • Allow --distribution public in app create (removed “coming soon” rejection) and update CLI examples/docs accordingly.
  • Update scaffolded app-config.json to store distribution in auth.type via new {{DISTRIBUTION}} template var; remove redundant top-level distribution.
  • Add config compatibility logic + tests to backfill auth.type from legacy top-level distribution.

Blocking note: This is user-visible behavior; the repo guidelines require a Changeset, but .changeset/ currently contains only README.md (no pending changeset file).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/templates/files/app-config.json.tmpl Writes distribution into auth.type via {{DISTRIBUTION}} and removes legacy top-level distribution.
src/lib/config.ts Removes ProjectConfig.distribution and backfills auth.type from legacy top-level distribution.
src/lang/en.ts Removes the stale “public distribution coming soon” message.
src/commands/definitions.ts Adds --distribution public example and documents `private
src/commands/app/scaffold.ts Adds {{DISTRIBUTION}} template variable sourced from the remote app’s distribution_type.
src/commands/app/create.ts Allows public distribution via flag/prompt and passes distribution_type: 'public' to the API.
src/tests/lib/config.test.ts Adds tests covering legacy distribution backfill and precedence rules.
src/tests/commands/app/update.test.ts Removes the legacy distribution key from config fixtures.
src/tests/commands/app/create.test.ts Updates test to assert public app creation payload instead of “coming soon” rejection.
agent-context/SKILL.md Documents --distribution <private|public> guidance for agents.
agent-context/AGENTS.md Updates command surface docs to include public distribution semantics.

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

@piyushsarin-sib
piyushsarin-sib changed the base branch from feature-set-public-app to features_set_public_cli July 23, 2026 06:52
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread src/lib/config.ts Outdated
createdAt?: string;
updatedAt?: string;
auth: {
/** Distribution type of the app: 'private' or 'public' */

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.

Please add add changelog file, please add default url during submission

piyushsarin-sib and others added 2 commits July 23, 2026 12:39
Add TESTING.md as a running checklist of verification criteria (seeded
with the enable-public-app changes) and TODO.md as a work tracker.

First tracked task: migrate old users' app-config.json distribution type
into auth.type on `brevo app update`, dropping the legacy top-level
`distribution` key so existing projects converge to the new format.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reword APP_CREATE_REDIRECT_HINT so the localhost default is explicitly
labeled a local test-server callback URL (used by `brevo app start oauth`),
with a reminder to add a production callback URL before going live.

- Update create.test.ts assertions to match the new wording
- Append the hint change to the existing changeset (minor bump unchanged)
- Add a TESTING.md verification entry, per the new working-docs convention
  documented in CLAUDE.md

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

* fix(config): migrate legacy distribution key on write-back (BEX-327)

readProjectConfig() backfilled auth.type from the legacy top-level
distribution key on read, but never stopped forwarding that legacy key
into the object callers eventually write back to disk, so it round-tripped
forever instead of converging old projects to the new shape. Now dropped
centrally in readProjectConfig(), so every write-back path (update.ts,
start.ts) migrates automatically. Also narrows auth.type from string to
'private' | 'public'.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(config): move distribution_type to a top-level field (BEX-327)

Per the resolved discussion on the Product solutioning doc ("distribution_type
would be moved out and reflect auth as well"), ProjectConfig now carries
distribution_type as a top-level field matching the real brevo app upload
payload shape, instead of the nested auth.type introduced earlier today.
auth is back to just { scopes, redirectUrls }.

readProjectConfig() backfills distribution_type from whichever shape is on
disk, in precedence order: top-level distribution_type -> interim auth.type
(never released) -> oldest legacy top-level distribution (every
currently-published scaffold) -> defaults to 'private'. All legacy shapes
are dropped on the next write-back.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@piyushsarin-sib
piyushsarin-sib merged commit 7cfaf94 into features_set_public_cli Jul 23, 2026
2 checks passed
@piyushsarin-sib
piyushsarin-sib deleted the enable-public-app branch July 23, 2026 11:10
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