Skip to content

feat(apps): add publish option to upload without auto-publishing#416

Open
setnilson wants to merge 1 commit into
masterfrom
sarah.nilson/apps-upload-without-publish
Open

feat(apps): add publish option to upload without auto-publishing#416
setnilson wants to merge 1 commit into
masterfrom
sarah.nilson/apps-upload-without-publish

Conversation

@setnilson

@setnilson setnilson commented Jun 15, 2026

Copy link
Copy Markdown

What

Adds a `publish` option to the apps plugin so high-code apps can be uploaded as drafts without immediately going live.

Previously, `npm run upload` always called `release/live` after a successful upload — there was no way to separate the two steps.

How

  • New `publish?: boolean` option in `AppsOptions` (defaults to `true`, preserving existing behavior)
  • `DD_APPS_PUBLISH=false` / `DATADOG_APPS_PUBLISH=false` env var as an alternative
  • Explicit config takes precedence over the env var
  • When `publish: false`, skips the `PUT .../release/live` call and logs a draft message instead

The `upload-no-publish` npm script that uses this is scaffolded automatically via `@datadog/create-apps` (separate web-ui PR). For existing projects, users can add it manually:

"upload-no-publish": "DD_APPS_UPLOAD_ASSETS=1 DD_APPS_PUBLISH=false vite build"

Changes

  • `packages/core/src/helpers/env.ts` — registers `APPS_PUBLISH` env var
  • `packages/plugins/apps/src/types.ts` — adds `publish` to `AppsOptions` and `AppsOptionsWithDefaults`
  • `packages/plugins/apps/src/validate.ts` — resolves default from env var
  • `packages/plugins/apps/src/upload.ts` — gates `release/live` call on `context.publish`
  • `packages/plugins/apps/src/vite/handle-upload.ts` — passes `options.publish` through
  • `packages/plugins/apps/README.md` — documents `apps.publish` and the `upload-no-publish` script pattern
  • Tests updated throughout (235 passing)

Add a `publish` option to the apps plugin that controls whether the
`release/live` API call fires after a successful upload. Defaults to
`true` (existing behavior unchanged). Set `publish: false` in
vite.config.ts or pass `DD_APPS_PUBLISH=false` to upload a draft
without making it live.

Recommended package.json pattern:
  "upload-no-publish": "DD_APPS_UPLOAD_ASSETS=1 DD_APPS_PUBLISH=false vite build"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@setnilson setnilson marked this pull request as ready for review June 17, 2026 17:32
@setnilson setnilson requested review from a team and yoannmoinet as code owners June 17, 2026 17:32
@setnilson setnilson requested a review from sdkennedy2 June 17, 2026 17:39
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.

1 participant