Repository navigation
Upload apps through the datadog-apps CLI instead of vite build - #15
Merged
Merged
Conversation
`@datadog/vite-plugin` 3.3.0 removed the in-build upload and publish path; it now only writes `dist/datadog-app-assets.zip`. Every app's `upload` script was `DD_APPS_UPLOAD_ASSETS=1 vite build` and relied on that path, so once the lockfile floated the plugin from 3.2.12 to 3.3.0 (the root range is `^3.2.1`), uploads became local builds that exit 0. PR #14 merged green and `scott-mountains` never went live. Uploading now goes through `@datadog/apps-cli`, which is what the current scaffolder pairs with plugin 3.3.x: - Add `@datadog/apps-cli` as a root devDependency and move the plugin range to `^3.3.0`. The lockfile update is additions only: 32 new packages, no version changes elsewhere. - Point every app's `upload` script at `npx datadog-apps upload`. - Run the root-installed binary from each app's directory in CI, with `--version-name "$GITHUB_SHA"`, and fail the step when the CLI exits 0 without printing `Published version` so a silent no-op can't pass as a green deploy again. - Correct the agent docs that told the next agent to replace the CLI scripts with bare Vite scripts, which is how this happened. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
setnilson
marked this pull request as ready for review
October 1, 2026 20:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
PR #14 merged with a green deploy and
scott-mountainsnever went live. The deploy job built the app, wrote a zip to the runner, and exited 0 without ever contacting Datadog.@datadog/vite-plugin3.3.0 removed the in-build upload and publish path. Diffing the tarballs:upload assetsPublished uploaded versionApp package written toEvery app's
uploadscript wasDD_APPS_UPLOAD_ASSETS=1 vite build, which depended on that path. (That env var is read by neither version — uploading in 3.2.x was driven purely byapps.enableplus auth during the build, so the variable was always decorative.) The root range is^3.2.1, so when #14 regeneratedpackage-lock.jsonfrom scratch it floated 3.2.12 → 3.3.0 anduploadsilently becamebuild. Nothing in the pipeline noticed: the plugin exits 0, and the job's only failure modes were a missing-secrets check and a build error.This affected every app in the repo, not just
scott-mountains— the next deploy ofclockork8s-podswould have no-opped the same way.Changes
Uploading moves to
@datadog/apps-cli, which is what@datadog/create-apps@0.2.0now pairs with plugin 3.3.x.package.json— add@datadog/apps-cli(>=0.0.2 <0.1.0, matching the scaffolder), move the plugin range to^3.3.0. The lockfile change is additions only: 32 new packages, zero version changes, zero removals — deliberately not a full regeneration, since that is what caused this.uploadscript →npx datadog-apps upload. One-line diffs;devandbuildstay on plain Vite, which is still correct.datadog-app.config.json) with--version-name "$GITHUB_SHA", and fail the step if the CLI exits 0 without printingPublished version. The CLI already throws on its own failure paths; this guard is the backstop against the whole class of silent-no-op regressions.docs/agents/scaffolding.mdpitfall Add Barak Rainbow app #1 actively instructed the next agent to replace the generated CLI scripts with bare Vite scripts, because the old@datadog/appspackage 404'd. That is how this happened. Rewritten, along with the stale upload/publish guidance inbuild-upload-auth.md(plus three per-app copies) andcicd.md.Testing
npm cireproduces the lockfile;node_modules/.bin/datadog-appslinks correctly.npm run typecheck,npm run lint, andnpm run buildall pass — all 11 apps build.datadog-apps upload --helpresolves and--version-nameis a real flag.datadog-apps buildfromapps/scott-mountainssucceeds credential-free and emits the zip the CLI uploads, confirming the new split (plugin packages, CLI uploads).datadog-apps uploadwith no credentials in a non-interactive shell exits 1 withNo login is saved for datad0g.com— it fails loudly rather than no-opping, and no browser is opened.App package written…/App build complete.and neverPublished version, sogrep -qfires.No upload was run against Datadog from this branch.
Note on merge
Every app's
package.jsonchanged, so the change-detection step will select all 11 apps and upload them one matrix leg each. That is intended here — they have all been silently un-deployed since the plugin bump, so this re-syncs them and exercises the new path on every app.Follow-up not in this PR
docs/agents/build-upload-auth.mdhas pre-existing drift beyond the upload path — it documentsnpm run deploy/npm run publishscripts,--no-publish,DD_APPS_PUBLISH, keyring OAuth, and.env.local, none of which match this workspace or the current CLI. I fixed only what describes the path this PR changes. Happy to do a full docs pass separately.🤖 Generated with Claude Code