Skip to content

ci: smoke den-api native build output (catches unbuilt workspace dist exports) - #3528

Draft
benjaminshafii wants to merge 3 commits into
devfrom
ci/den-api-native-build-smoke
Draft

benjaminshafii wants to merge 3 commits into
devfrom
ci/den-api-native-build-smoke

Conversation

@benjaminshafii

@benjaminshafii benjaminshafii commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

What / why

#3466 broke prod den-api at boot (ERR_MODULE_NOT_FOUND for @openwork/types/dist/automations.js) while every PR check stayed green:

  • typecheck resolves the types export condition → src/*.ts
  • bun tests resolve bun → src/*.ts
  • tsx/dev + eval harness resolve development → src/*.ts
  • the "Build openwork-den-api" job builds the Docker image, whose Dockerfile was patched in the same PR

Prod deploys via Render's native build (scripts/build.mjs), which nothing in CI exercises — and only a plain-Node boot resolves the node condition → dist/*.js. This job closes that gap: it runs the native build, then resolves @openwork/types/automations and @openwork/automations under Node's node condition from den-api's package context, and asserts dist/main.js exists.

⚠️ This job is red on this branch — by design

This branch is plain dev, which still has the live breakage. The failing run here is the demonstration that the backstop catches exactly this failure class. It goes green once #3527 (the prod fix) merges and this branch rebases.

Open questions for review (cc @reachjalil)

  1. Is the import-smoke approach right, or would you rather boot dist/main.js against a health check (heavier, needs env/DB stubs)?
  2. Should the smoke enumerate dist-condition workspace deps dynamically instead of hardcoding the two current packages?
  3. Path filters / triggers reasonable?

Validation

Workflow-only change (no app runtime): actionlint passes (sole warning is the custom blacksmith-4vcpu-ubuntu-2204 runner label, shared by existing workflows); every uses: action+version and the runner label are copied verbatim from ci-tests.yml / den-db-check.yml; concurrency follows the repo's cancel-in-progress: true convention.

Add a PR/dev job that runs den-api's native build (the Render deploy path,
not the Docker image) and then resolves @openwork/types/automations and
@openwork/automations under Node's node export condition. Catches workspace
exports that point at unbuilt dist/ files, which typecheck and bun/tsx tests
cannot see because they resolve the types/bun/development conditions to src.
@vercel

vercel Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 4, 2026 9:53pm
openwork-den Ready Ready Preview Aug 4, 2026 9:53pm
openwork-den-worker-proxy Ready Ready Preview Aug 4, 2026 9:53pm
openwork-landing Ready Ready Preview, v0 Aug 4, 2026 9:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
openwork-diagnostics Skipped Skipped Aug 4, 2026 9:53pm

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: c6716fc
Status: ✅  Deploy successful!
Preview URL: https://786bb596.openwork.pages.dev
Branch Preview URL: https://ci-den-api-native-build-smok.openwork.pages.dev

View logs

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project openwork-diagnostics with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project openwork-app with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project openwork-den with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project openwork-landing with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

Comment on lines +45 to +63
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11.4.0

- name: Get pnpm store path
id: pnpm-store
shell: bash
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"

- name: Cache pnpm store
uses: actions/cache@v5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Workflow executes mutable remote action references

Pin the newly added GitHub Actions to full commit SHAs instead of mutable major-version tags so a tag change or compromised release cannot execute attacker-controlled code on the CI runner.

Evidence
  • The PR-triggered job runs actions/checkout@v6, actions/setup-node@v6, pnpm/action-setup@v4, and actions/cache@v5 directly from mutable remote tags.
  • These actions execute before and alongside repository-controlled pnpm install and build commands on the Blacksmith runner.
  • A malicious tag update or compromised action release would therefore run code in this newly introduced workflow with the job's GitHub token and runner access.

Identified by Warden · diff-security-review · XYL-7NU

This branch was successfully deployed

4 active (outdated) and 1 inactive (outdated) deployments
Preview – openwork-den — 1419916c Deployed Aug 4, 2026 by vercel[bot]
Preview – openwork-landing — 1419916c Deployed Aug 4, 2026 by vercel[bot]
Preview – openwork-den-worker-proxy — 1419916c Deployed Aug 4, 2026 by vercel[bot]
Preview – openwork-app — 1419916c Deployed Aug 4, 2026 by vercel[bot]
Preview – openwork-diagnostics — 1419916c Deployed Aug 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants