ci: comment a run-anywhere command to try the PR template artifact#491
Conversation
The PR Template Artifact job builds a scaffold with this PR's SDK tarballs but leaves it in the artifacts UI with no obvious way to consume it. Add a sticky PR comment that prints a self-contained command — gh run download of this run's artifact, unzip, then databricks apps init --template — with the run id, repo, artifact name, and output dir all baked in, so it can be pasted into any folder without a repo checkout. Reuses the existing github-script + marker-based upsert pattern (bundle-size, breaking-change). Adds job-level pull-requests: write for the comment. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Job-level permissions replace the top-level set rather than merging, so adding pull-requests: write dropped the top-level id-token: write that setup-jfrog-npm needs for its OIDC token (ACTIONS_ID_TOKEN_REQUEST_TOKEN unbound). List all three at the job level. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Fork PRs get a read-only GITHUB_TOKEN, so the github-script upsert would 403 and fail the whole pr-template-artifact job for an author who can't fix it. Guard the comment step with the same head-repo check bundle-size.yml and eval-pr-comment.yml already use. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
|
@MarioCadenas quick question - is it another comment or are we merging with the existing one? I'd vote to have just a single automated comment under PR to avoid bloat, especially that it's related - WDYT? |
its not related at all and they run in completely different points in time AFAIK |
There was a problem hiding this comment.
Approved regardless of the suggestion to merge Evals comment with this
its not related at all and they run in completely different points in time AFAIK
we already discussed that with Mario offline, the template artifact is going to be used by the evals pipeline (currently it's not due to the limitations of the evals pipeline). The evals comment is posted right away but it should've wait for the artifact too, so it makes sense to merge them 👍
Combine the evals-monitor link and the try-this-template command into a single sticky comment with two delimited sections instead of two separate comments. Add a shared upsert-pr-comment-section.cjs helper: each workflow owns one section id and rewrites only its block, preserving the other's content (a push reruns the template section without wiping the eval link). The two writers are separated in time — the eval link posts instantly on PR open, the template command posts after the ~5-min build — so concurrent writes to the shared comment don't occur. Bundle-size and breaking-change comments are intentionally left separate for now. Replaces the single-purpose upsert-template-artifact-comment.cjs and rewires eval-pr-comment.yml onto the shared helper. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Drop the separate Eval PR Comment workflow and the section-merge helper; the pr-template-artifact job now posts a single comment containing both the evals-monitor link and the run-anywhere template command. One writer, one comment, plain marker-based upsert — no cross-workflow coordination. Tradeoff: the eval link now rides the ~5-min build and is skipped on docs-only PRs (where the artifact job doesn't run and evals are moot), instead of posting instantly on every PR open. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 30086700900 -R databricks/appkit -n appkit-template-0.47.1-pr.b13a16b-feat-pr-template-try-comment-491 -D appkit-pr-491 \
&& unzip -o "appkit-pr-491/appkit-template-0.47.1-pr.b13a16b-feat-pr-template-try-comment-491.zip" -d "appkit-pr-491" \
&& databricks apps init --template "appkit-pr-491"The template pins |
Add an overall '🤖 AppKit PR bot' header and a '### 🔬 Run evals' title so the evals link matches the template section's heading instead of being a bare blockquote. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>


What
Adds a sticky PR comment to the PR Template Artifact job that prints a self-contained, run-anywhere command to scaffold an app from this PR's SDK build:
Why
The job already builds a template with this PR's
@databricks/appkit+@databricks/appkit-uitarballs pinned viafile:deps — but it lands in the artifacts UI with no obvious way to consume it. Testing meant hunting for the CI run, downloading the zip by hand, unzipping, and remembering theapps initinvocation.The requirement here was that the command be pasteable into any folder — not run from inside an appkit checkout. So the run id, repo, artifact name, and output dir are all interpolated from CI context at build time; there's no repo-local script to depend on.
How
.github/scripts/upsert-template-artifact-comment.cjs— marker-based sticky-comment upsert, cloned from the existing bundle-size / breaking-change scripts.pr-template-artifact: one builds the comment body (template-artifact-comment.md), one upserts it viaactions/github-script.pull-requests: write(overrides the top-levelread), matching the bundle-size job.Additive only (86 lines, 2 files); no change to the artifact itself.
Notes / limitations
gh auth login) since artifact download requires auth, and the Databricks CLI. Both are stated in the comment.pull-requests: write, so the comment step is skipped there — same behavior as the repo's other comment jobs..cjs, and the rendered comment markdown was simulated locally.