Skip to content

Commit 791b146

Browse files
committed
feat(jobs): add interceptors, HTTP routes, validation, and streaming for jobs plugin
Signed-off-by: Atila Fassina <atila@fassina.eu>
1 parent b0e3be3 commit 791b146

File tree

124 files changed

+9810
-1219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+9810
-1219
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
name: install-appkit-tarball
3+
description: "Install appkit tgz builds into a project. Downloads from the prepare-release CI workflow (default) or builds locally. Use when testing appkit release candidates, installing pre-release appkit, or when user says 'install appkit tarball', 'install local appkit', 'use local appkit', 'link appkit tgz', 'install appkit from CI'."
4+
user-invocable: true
5+
allowed-tools: Read, Edit, Bash, Glob
6+
---
7+
8+
# Install AppKit Tarball
9+
10+
Installs AppKit tgz packages into a project from either the CI prepare-release workflow or a local build.
11+
12+
## Arguments
13+
14+
Parse the user's input to determine mode and options:
15+
16+
- **No args** → CI mode, latest successful prepare-release run, install in CWD
17+
- **GitHub Actions URL** (contains `actions/runs/`) → CI mode, extract run ID from URL
18+
- **Numeric run ID** → CI mode, that specific run
19+
- **`--local <path>`** → Local build mode from the given appkit repo path
20+
- **`--dir <path>`** (combinable with any above) → Override install target directory (default: CWD)
21+
22+
## Workflow
23+
24+
Follow these steps exactly:
25+
26+
### Step 1: Determine target directory
27+
28+
If `--dir` was provided, use that path. Otherwise use the current working directory.
29+
Verify `package.json` exists in the target directory.
30+
31+
### Step 2: Get tgz files
32+
33+
#### Option A: CI mode (default)
34+
35+
**2a. Find the workflow run:**
36+
37+
If no run ID was provided, get the latest successful run:
38+
39+
```bash
40+
gh run list --repo databricks/appkit --workflow prepare-release.yml --status success --limit 1 --json databaseId,number
41+
```
42+
43+
If a GitHub Actions URL was provided, extract the run ID from it (the number after `/runs/`).
44+
45+
**2b. Find the artifact name:**
46+
47+
```bash
48+
gh api "repos/databricks/appkit/actions/runs/{RUN_ID}/artifacts" --jq '.artifacts[] | select(.name | test("^appkit-release-[0-9]")) | .name'
49+
```
50+
51+
**2c. Download the artifact:**
52+
53+
```bash
54+
gh run download {RUN_ID} --repo databricks/appkit --name "{ARTIFACT_NAME}" --dir /tmp/appkit-release-artifacts
55+
```
56+
57+
**2d. Verify checksums:**
58+
59+
```bash
60+
cd /tmp/appkit-release-artifacts && shasum -a 256 -c SHA256SUMS
61+
```
62+
63+
Note: Use `shasum -a 256` (macOS) not `sha256sum` (Linux).
64+
65+
**2e. Print the downloaded version:**
66+
67+
```bash
68+
cat /tmp/appkit-release-artifacts/VERSION
69+
```
70+
71+
The tgz files are now at `/tmp/appkit-release-artifacts/databricks-appkit-*.tgz` and `/tmp/appkit-release-artifacts/databricks-appkit-ui-*.tgz`.
72+
73+
#### Option B: Local build mode
74+
75+
**2a. Build tgz files:**
76+
77+
```bash
78+
cd {LOCAL_APPKIT_PATH} && pnpm pack:sdk
79+
```
80+
81+
**2b. Find the tgz files:**
82+
83+
Glob for `*.tgz` in:
84+
- `{LOCAL_APPKIT_PATH}/packages/appkit/tmp/*.tgz`
85+
- `{LOCAL_APPKIT_PATH}/packages/appkit-ui/tmp/*.tgz`
86+
87+
There should be exactly one tgz in each directory.
88+
89+
### Step 3: Copy tgz files to target directory
90+
91+
Copy both `databricks-appkit-*.tgz` and `databricks-appkit-ui-*.tgz` to the target directory.
92+
93+
### Step 4: Update package.json
94+
95+
Read `package.json` in the target directory. Edit `@databricks/appkit` and `@databricks/appkit-ui` dependency values to use `file:./` prefix pointing to the tgz filenames.
96+
97+
For example, if the tgz file is `databricks-appkit-0.22.0.tgz`:
98+
```json
99+
"@databricks/appkit": "file:./databricks-appkit-0.22.0.tgz"
100+
```
101+
102+
Same pattern for `@databricks/appkit-ui`.
103+
104+
### Step 5: Install dependencies
105+
106+
Run in the target directory:
107+
108+
```bash
109+
npm install --force ./databricks-appkit-{VERSION}.tgz ./databricks-appkit-ui-{VERSION}.tgz
110+
```
111+
112+
### Step 6: Clean up
113+
114+
If CI mode was used, remove the temp directory:
115+
116+
```bash
117+
rm -rf /tmp/appkit-release-artifacts
118+
```
119+
120+
### Step 7: Report
121+
122+
Print a summary:
123+
- Source: CI run #{number} or local build from {path}
124+
- Version installed
125+
- Target directory
126+
- Installed packages
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Setup JFrog npm registry'
2+
description: 'Obtains a JFrog OIDC token and configures npm to use the JFrog Artifactory proxy'
3+
inputs:
4+
npmrc-path:
5+
description: 'Path to write .npmrc file (use .npmrc for project-level override)'
6+
required: false
7+
default: '~/.npmrc'
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- name: Get JFrog OIDC token
12+
shell: bash
13+
run: |
14+
set -euo pipefail
15+
ID_TOKEN=$(curl -sLS \
16+
-H "User-Agent: actions/oidc-client" \
17+
-H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
18+
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=jfrog-github" | jq .value | tr -d '"')
19+
echo "::add-mask::${ID_TOKEN}"
20+
ACCESS_TOKEN=$(curl -sLS -XPOST -H "Content-Type: application/json" \
21+
"https://databricks.jfrog.io/access/api/v1/oidc/token" \
22+
-d "{\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\", \"subject_token_type\":\"urn:ietf:params:oauth:token-type:id_token\", \"subject_token\": \"${ID_TOKEN}\", \"provider_name\": \"github-actions\"}" | jq .access_token | tr -d '"')
23+
echo "::add-mask::${ACCESS_TOKEN}"
24+
if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then
25+
echo "FAIL: Could not extract JFrog access token"
26+
exit 1
27+
fi
28+
echo "JFROG_ACCESS_TOKEN=${ACCESS_TOKEN}" >> "$GITHUB_ENV"
29+
echo "JFrog OIDC token obtained successfully"
30+
31+
- name: Configure npm
32+
shell: bash
33+
run: |
34+
set -euo pipefail
35+
NPMRC_PATH="${{ inputs.npmrc-path }}"
36+
NPMRC_PATH="${NPMRC_PATH/#\~/$HOME}"
37+
cat > "$NPMRC_PATH" << EOF
38+
registry=https://databricks.jfrog.io/artifactory/api/npm/db-npm/
39+
//databricks.jfrog.io/artifactory/api/npm/db-npm/:_authToken=${JFROG_ACCESS_TOKEN}
40+
always-auth=true
41+
EOF
42+
echo "npm configured to use JFrog registry (wrote to $NPMRC_PATH)"

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ concurrency:
1111
permissions:
1212
contents: read
1313
pull-requests: read
14+
id-token: write
1415

1516
jobs:
1617
detect-changes:
@@ -42,6 +43,8 @@ jobs:
4243

4344
steps:
4445
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
46+
- name: Setup JFrog npm
47+
uses: ./.github/actions/setup-jfrog-npm
4548
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
4649
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4750
with:
@@ -69,6 +72,8 @@ jobs:
6972
run: pnpm run knip
7073
- name: Run License Check
7174
run: pnpm run check:licenses
75+
- name: Check template deps are pinned
76+
run: pnpm exec tsx tools/check-template-deps.ts
7277

7378
test:
7479
name: Unit Tests
@@ -80,6 +85,8 @@ jobs:
8085

8186
steps:
8287
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
88+
- name: Setup JFrog npm
89+
uses: ./.github/actions/setup-jfrog-npm
8390
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
8491
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
8592
with:
@@ -100,6 +107,8 @@ jobs:
100107

101108
steps:
102109
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
110+
- name: Setup JFrog npm
111+
uses: ./.github/actions/setup-jfrog-npm
103112
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
104113
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
105114
with:
@@ -128,6 +137,8 @@ jobs:
128137

129138
steps:
130139
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
140+
- name: Setup JFrog npm
141+
uses: ./.github/actions/setup-jfrog-npm
131142
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
132143
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
133144
with:
@@ -177,6 +188,8 @@ jobs:
177188

178189
steps:
179190
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
191+
- name: Setup JFrog npm
192+
uses: ./.github/actions/setup-jfrog-npm
180193
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
181194
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
182195
with:

.github/workflows/docs-deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
name: Build Docs
2626
steps:
2727
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
28+
- name: Setup JFrog npm
29+
uses: ./.github/actions/setup-jfrog-npm
2830
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
2931
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3032
with:

.github/workflows/pr-title.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,19 @@ jobs:
1818
name: Conventional Commit Title
1919
steps:
2020
- name: Validate PR title
21-
uses: ytanikin/pr-conventional-commits@fda730cb152c05a849d6d84325e50c6182d9d1e9 # 1.5.1
21+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2224
with:
23-
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","style","build"]'
24-
add_label: 'false'
25+
types: |
26+
feat
27+
fix
28+
docs
29+
test
30+
ci
31+
refactor
32+
perf
33+
chore
34+
revert
35+
style
36+
build
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Prepare Release Lakebase
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'packages/lakebase/**'
9+
10+
concurrency:
11+
group: prepare-release-lakebase
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
jobs:
19+
prepare:
20+
runs-on:
21+
group: databricks-protected-runner-group
22+
labels: linux-ubuntu-latest
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup JFrog npm
31+
uses: ./.github/actions/setup-jfrog-npm
32+
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
38+
with:
39+
node-version: 24
40+
cache: "pnpm"
41+
42+
- name: Install dependencies
43+
run: pnpm install --frozen-lockfile
44+
45+
- name: Check for releasable commits
46+
id: version
47+
working-directory: packages/lakebase
48+
run: |
49+
VERSION=$(pnpm exec release-it --release-version --ci) || true
50+
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
51+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
52+
echo "Next version: $VERSION"
53+
else
54+
echo "No releasable commits — skipping release preparation"
55+
echo "version=" >> "$GITHUB_OUTPUT"
56+
fi
57+
58+
- name: Generate changelog
59+
if: steps.version.outputs.version != ''
60+
working-directory: packages/lakebase
61+
run: |
62+
pnpm exec release-it ${{ steps.version.outputs.version }} --ci
63+
- name: Build
64+
if: steps.version.outputs.version != ''
65+
run: pnpm --filter=@databricks/lakebase build:package
66+
67+
- name: Dist
68+
if: steps.version.outputs.version != ''
69+
run: pnpm --filter=@databricks/lakebase dist
70+
71+
- name: SBOM
72+
if: steps.version.outputs.version != ''
73+
run: pnpm --filter=@databricks/lakebase release:sbom
74+
75+
- name: Pack
76+
if: steps.version.outputs.version != ''
77+
run: npm pack packages/lakebase/tmp
78+
79+
- name: Generate SHA256
80+
if: steps.version.outputs.version != ''
81+
run: sha256sum *.tgz > SHA256SUMS
82+
83+
- name: Write version file
84+
if: steps.version.outputs.version != ''
85+
run: echo "${{ steps.version.outputs.version }}" > VERSION
86+
87+
- name: Upload release metadata
88+
if: steps.version.outputs.version != ''
89+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
90+
with:
91+
name: lakebase-release-meta-${{ github.run_number }}
92+
retention-days: 7
93+
path: VERSION
94+
95+
- name: Upload release artifacts
96+
if: steps.version.outputs.version != ''
97+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
98+
with:
99+
name: lakebase-release-${{ github.run_number }}
100+
retention-days: 7
101+
path: |
102+
*.tgz
103+
packages/lakebase/changelog-diff.md
104+
VERSION
105+
SHA256SUMS

0 commit comments

Comments
 (0)