Skip to content

Commit 2836749

Browse files
authored
ci: fix devhub-validation (build with pnpm) and add a nightly DevHub build (#499)
* ci: build DevHub with pnpm + frozen lockfile in devhub-validation DevHub is a pnpm-only repo (commits only pnpm-lock.yaml, packageManager pnpm@10.11.0). The devhub-validation job installed it with `npm install`, which ignores the committed lock and does a floating, non-reproducible resolve on every run. A transitive dep publishing overnight was enough to shift the hoist and pull @databricks/appkit-ui/react into Next's react-server graph, crashing `next build` with `TypeError: b.createContext is not a function` on a job that passed the day before with no source change. Build DevHub the way DevHub's own CI does: pnpm install --frozen-lockfile and pnpm build. This makes the job reproducible and stops it silently mis-testing via a package manager DevHub never uses. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> * docs: touch readme to trigger devhub-validation Temporary docs-path touch so the docs path filter runs devhub-validation for the CI change in the previous commit. Safe to drop before merge. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> * ci: let pnpm/action-setup read pnpm version from packageManager Passing an explicit version: input conflicts with this repo's packageManager field (pnpm@10.21.0), and action-setup errors out. Match the other jobs and omit version: so it reads packageManager. pnpm 10.x reads DevHub's lockfileVersion 9.0 fine. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> * ci: drop redundant comment in devhub-validation Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> * Revert testing change * ci: extract reusable DevHub build workflow + add nightly run Move the devhub-validation build steps into a reusable workflow (devhub-build.yml, workflow_call) so the per-PR job and a new nightly share one definition instead of duplicating steps. - ci.yml devhub-validation now calls the reusable workflow, passing the PR's remote/ref; gating (needs detect-changes, docs filter) unchanged. - devhub-nightly.yml runs the same build daily against appkit main, to catch DevHub-side breaks that land between docs PRs. Failures surface via GitHub's built-in scheduled-workflow-failure email. Both callers grant id-token: write so the JFrog OIDC step keeps working. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> * docs: temporary touch to verify devhub-validation (revert before merge) Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> * ci: tighten devhub-nightly comment Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> * ci: revert docs test touch and trim workflow comments Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com> --------- Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
1 parent 672e757 commit 2836749

3 files changed

Lines changed: 82 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -325,35 +325,11 @@ jobs:
325325
name: DevHub Build Validation
326326
needs: detect-changes
327327
if: needs.detect-changes.outputs.docs == 'true'
328-
runs-on:
329-
group: databricks-protected-runner-group
330-
labels: linux-ubuntu-latest
331-
332-
steps:
333-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
334-
335-
- name: Setup JFrog npm
336-
uses: ./.github/actions/setup-jfrog-npm
337-
338-
- name: Clone DevHub
339-
run: git clone --depth 1 https://github.com/databricks/devhub.git /tmp/devhub
340-
341-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
342-
with:
343-
node-version: 22
344-
345-
- name: Install DevHub dependencies
346-
working-directory: /tmp/devhub
347-
run: npm install
348-
349-
- name: Sync AppKit docs from PR branch
350-
working-directory: /tmp/devhub
351-
env:
352-
APPKIT_REMOTE: ${{ github.event.pull_request.head.repo.clone_url || format('https://github.com/{0}.git', github.repository) }}
353-
APPKIT_BRANCH: ${{ github.head_ref || github.ref_name }}
354-
run: node scripts/sync-appkit-docs.mjs --force
355-
356-
- name: Build DevHub
357-
working-directory: /tmp/devhub
358-
run: npm run build
328+
permissions:
329+
contents: read
330+
id-token: write
331+
uses: ./.github/workflows/devhub-build.yml
332+
with:
333+
appkit-remote: ${{ github.event.pull_request.head.repo.clone_url || format('https://github.com/{0}.git', github.repository) }}
334+
appkit-ref: ${{ github.head_ref || github.ref_name }}
359335

.github/workflows/devhub-build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: DevHub Build
2+
3+
# Builds DevHub with AppKit docs synced from the given ref.
4+
# Called by ci.yml (per-PR) and devhub-nightly.yml.
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
appkit-remote:
10+
description: "Git URL to sync AppKit docs from"
11+
type: string
12+
default: "https://github.com/databricks/appkit.git"
13+
appkit-ref:
14+
description: "AppKit branch/ref to sync docs from"
15+
type: string
16+
default: "main"
17+
18+
permissions:
19+
contents: read
20+
id-token: write # required for the JFrog OIDC token exchange in setup-jfrog-npm
21+
22+
jobs:
23+
build:
24+
name: Build DevHub
25+
runs-on:
26+
group: databricks-protected-runner-group
27+
labels: linux-ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
31+
32+
- name: Setup JFrog npm
33+
uses: ./.github/actions/setup-jfrog-npm
34+
35+
- name: Clone DevHub
36+
run: git clone --depth 1 https://github.com/databricks/devhub.git /tmp/devhub
37+
38+
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
39+
40+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
41+
with:
42+
node-version: 22
43+
44+
- name: Install DevHub dependencies
45+
working-directory: /tmp/devhub
46+
run: pnpm install --frozen-lockfile
47+
48+
- name: Sync AppKit docs
49+
working-directory: /tmp/devhub
50+
env:
51+
APPKIT_REMOTE: ${{ inputs.appkit-remote }}
52+
APPKIT_BRANCH: ${{ inputs.appkit-ref }}
53+
run: node scripts/sync-appkit-docs.mjs --force
54+
55+
- name: Build DevHub
56+
working-directory: /tmp/devhub
57+
run: pnpm build
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: DevHub Nightly Build
2+
3+
# Daily check that AppKit main docs still build inside DevHub, catching DevHub-side
4+
# breaks that land between docs PRs. Failures surface via GitHub's scheduled-failure email.
5+
6+
on:
7+
schedule:
8+
- cron: "0 6 * * *" # 06:00 UTC daily
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
jobs:
16+
devhub-build:
17+
# Defaults build databricks/appkit main against DevHub.
18+
uses: ./.github/workflows/devhub-build.yml

0 commit comments

Comments
 (0)