-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Lakeflow Jobs Plugin #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's agentic review: Code Review: Jobs Plugin for Databricks Lakeflow JobsScope: P1 -- High
P2 -- Moderate
P3 -- Low
Coverage
Verdict: Ready with fixes. The docs/code mismatch (#1) and SSE parsing (#2) should be addressed before merge. Items #3-5 are recommended. Items #6-8 are at your discretion. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| --- | ||
| name: install-appkit-tarball | ||
| 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'." | ||
| user-invocable: true | ||
| allowed-tools: Read, Edit, Bash, Glob | ||
| --- | ||
|
|
||
| # Install AppKit Tarball | ||
|
|
||
| Installs AppKit tgz packages into a project from either the CI prepare-release workflow or a local build. | ||
|
|
||
| ## Arguments | ||
|
|
||
| Parse the user's input to determine mode and options: | ||
|
|
||
| - **No args** → CI mode, latest successful prepare-release run, install in CWD | ||
| - **GitHub Actions URL** (contains `actions/runs/`) → CI mode, extract run ID from URL | ||
| - **Numeric run ID** → CI mode, that specific run | ||
| - **`--local <path>`** → Local build mode from the given appkit repo path | ||
| - **`--dir <path>`** (combinable with any above) → Override install target directory (default: CWD) | ||
|
|
||
| ## Workflow | ||
|
|
||
| Follow these steps exactly: | ||
|
|
||
| ### Step 1: Determine target directory | ||
|
|
||
| If `--dir` was provided, use that path. Otherwise use the current working directory. | ||
| Verify `package.json` exists in the target directory. | ||
|
|
||
| ### Step 2: Get tgz files | ||
|
|
||
| #### Option A: CI mode (default) | ||
|
|
||
| **2a. Find the workflow run:** | ||
|
|
||
| If no run ID was provided, get the latest successful run: | ||
|
|
||
| ```bash | ||
| gh run list --repo databricks/appkit --workflow prepare-release.yml --status success --limit 1 --json databaseId,number | ||
| ``` | ||
|
|
||
| If a GitHub Actions URL was provided, extract the run ID from it (the number after `/runs/`). | ||
|
|
||
| **2b. Find the artifact name:** | ||
|
|
||
| ```bash | ||
| gh api "repos/databricks/appkit/actions/runs/{RUN_ID}/artifacts" --jq '.artifacts[] | select(.name | test("^appkit-release-[0-9]")) | .name' | ||
| ``` | ||
|
|
||
| **2c. Download the artifact:** | ||
|
|
||
| ```bash | ||
| gh run download {RUN_ID} --repo databricks/appkit --name "{ARTIFACT_NAME}" --dir /tmp/appkit-release-artifacts | ||
| ``` | ||
|
|
||
| **2d. Verify checksums:** | ||
|
|
||
| ```bash | ||
| cd /tmp/appkit-release-artifacts && shasum -a 256 -c SHA256SUMS | ||
| ``` | ||
|
|
||
| Note: Use `shasum -a 256` (macOS) not `sha256sum` (Linux). | ||
|
|
||
| **2e. Print the downloaded version:** | ||
|
|
||
| ```bash | ||
| cat /tmp/appkit-release-artifacts/VERSION | ||
| ``` | ||
|
|
||
| The tgz files are now at `/tmp/appkit-release-artifacts/databricks-appkit-*.tgz` and `/tmp/appkit-release-artifacts/databricks-appkit-ui-*.tgz`. | ||
|
|
||
| #### Option B: Local build mode | ||
|
|
||
| **2a. Build tgz files:** | ||
|
|
||
| ```bash | ||
| cd {LOCAL_APPKIT_PATH} && pnpm pack:sdk | ||
| ``` | ||
|
|
||
| **2b. Find the tgz files:** | ||
|
|
||
| Glob for `*.tgz` in: | ||
| - `{LOCAL_APPKIT_PATH}/packages/appkit/tmp/*.tgz` | ||
| - `{LOCAL_APPKIT_PATH}/packages/appkit-ui/tmp/*.tgz` | ||
|
|
||
| There should be exactly one tgz in each directory. | ||
|
|
||
| ### Step 3: Copy tgz files to target directory | ||
|
|
||
| Copy both `databricks-appkit-*.tgz` and `databricks-appkit-ui-*.tgz` to the target directory. | ||
|
|
||
| ### Step 4: Update package.json | ||
|
|
||
| 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. | ||
|
|
||
| For example, if the tgz file is `databricks-appkit-0.22.0.tgz`: | ||
| ```json | ||
| "@databricks/appkit": "file:./databricks-appkit-0.22.0.tgz" | ||
| ``` | ||
|
|
||
| Same pattern for `@databricks/appkit-ui`. | ||
|
|
||
| ### Step 5: Install dependencies | ||
|
|
||
| Run in the target directory: | ||
|
|
||
| ```bash | ||
| npm install --force ./databricks-appkit-{VERSION}.tgz ./databricks-appkit-ui-{VERSION}.tgz | ||
| ``` | ||
|
|
||
| ### Step 6: Clean up | ||
|
|
||
| If CI mode was used, remove the temp directory: | ||
|
|
||
| ```bash | ||
| rm -rf /tmp/appkit-release-artifacts | ||
| ``` | ||
|
|
||
| ### Step 7: Report | ||
|
|
||
| Print a summary: | ||
| - Source: CI run #{number} or local build from {path} | ||
| - Version installed | ||
| - Target directory | ||
| - Installed packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rebase the PR? The updated skill is on main: https://github.com/databricks/appkit/blob/main/.claude/skills/install-appkit-artifact.md