Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jan 12, 2026

Problem

Craft requires a single artifact named with the commit SHA containing all release files at the root level. The current workflow uploads separate artifacts (built-packages, spotlight-binaries, electron-binaries) with custom names, causing Craft to fail with:

Error: Can't find any artifacts for revision "aee365d..."

Additionally, the electron-mac job may still be running when Craft attempts to publish, causing the electron-binaries artifact to be missing.

Solution

Add a merge-artifacts job that:

  1. Waits for both build and electron-mac jobs to complete
  2. Downloads and flattens all artifacts using merge-multiple: true
  3. Uploads them as a single artifact named with the commit SHA

Changes

  • build.yml: Add merge-artifacts job at the end of the workflow
  • .craft.yml: Update statusProvider context to Merge Artifacts and update requireNames to match flattened file patterns

Craft requires a single artifact named with the commit SHA containing all
release files. The current workflow uploaded separate artifacts with custom
names, causing Craft to fail with 'Can't find any artifacts for revision'.

Changes:
- Add merge-artifacts job to build.yml that combines built-packages,
  spotlight-binaries, and electron-binaries into a single SHA-named artifact
- Update statusProvider context to wait for 'Merge Artifacts' job
- Update requireNames to match flattened file patterns
@BYK BYK deployed to Preview January 12, 2026 22:30 — with GitHub Actions Active
@vercel
Copy link

vercel bot commented Jan 12, 2026

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

Project Deployment Review Updated (UTC)
spotlightjs Ready Ready Preview, Comment Jan 12, 2026 10:31pm

@github-actions
Copy link
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Added a dynamic header for dragbar by MathurAditya724 in #1223
  • Better error message display by MathurAditya724 in #1222

Bug Fixes 🐛

Ui

  • Add validation guards to WebVitalsDetail to prevent crashes by BYK in #1243
  • Handle null/undefined span.description safely by BYK in #1239

Other

  • (craft) Merge artifacts for Craft release discovery by BYK in #1249
  • (sentry) Upload and use source maps for all build targets by BYK in #1241
  • Improve EADDRINUSE error handling and UX by BYK in #1240
  • Updated react-router-dom version to latest by MathurAditya724 in #1245
  • Add error handling for base64 decode operations by BYK in #1237
  • Silence non-fixable Sentry errors by BYK in #1242
  • Add null safety to WebVitals comparators by BYK in #1238
  • Add null check for itemHeader in processEnvelope by BYK in #1233
  • Shiki theme in light mode by MathurAditya724 in #1230

Documentation 📚

Website

  • Add feedback note for Spotlight SDK in documentation by MathurAditya724 in #1228
  • Add NextJS guide by betegon in #1129

Other

  • Add section for the spotlight sdk by MathurAditya724 in #1227

Build / dependencies / internal 🔧

Craft

  • Fix Craft traget ids by BYK in #1248
  • Bump craft version to fix releases by BYK in #1246

Release

  • Add pnpm and Node.js setup to release workflow by BYK in #1247
  • Migrate to Craft by betegon in #1232

Other

  • (deps) Bump @modelcontextprotocol/sdk from 1.24.3 to 1.25.2 by dependabot in #1234
  • Add workflow to notify issues on release by betegon in #1236
  • Using the param instead of calling a function by MathurAditya724 in #1224

Other

  • Node 24.x support by BYK in #1235
  • Vite windows deny bypass by BYK in #1229
  • Qs security vulnerability fix by BYK in #1226
  • Dependency security updates by BYK in #1225
  • Event origin badges ui by BYK in #1221

🤖 This preview updates automatically when you update the PR.

@BYK BYK changed the title fix(craft): Merge artifacts for Craft release discovery ci(release): Merge artifacts for Craft release discovery Jan 12, 2026
@BYK BYK marked this pull request as ready for review January 12, 2026 22:33
@BYK BYK enabled auto-merge (squash) January 12, 2026 22:33
- name: Download release artifacts
uses: actions/download-artifact@v5
with:
pattern: '{built-packages,spotlight-binaries,electron-binaries}'
Copy link

Choose a reason for hiding this comment

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

Bug: The pattern parameter for actions/download-artifact uses brace expansion ({a,b,c}), which is likely unsupported. Standard glob syntax does not include brace expansion, which is a shell feature.
Severity: CRITICAL

🔍 Detailed Analysis

The actions/download-artifact@v5 action is configured with a pattern using brace expansion: '{built-packages,spotlight-binaries,electron-binaries}'. Brace expansion is a shell feature and is not typically supported by standard glob libraries, including the one likely used by GitHub Actions (@actions/glob). The action will probably search for a single artifact with the literal name '{built-packages,spotlight-binaries,electron-binaries}', which does not exist. This will cause the artifact download to fail, breaking the subsequent merge-artifacts job and preventing the release from being created.

💡 Suggested Fix

Replace the brace expansion pattern with a method that is explicitly supported. Either call the download-artifact action multiple times, once for each artifact name, or use a wildcard pattern like * or *-binaries if appropriate, combined with merge-multiple: true to download all required artifacts into a single directory.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/build.yml#L419

Potential issue: The `actions/download-artifact@v5` action is configured with a
`pattern` using brace expansion:
`'{built-packages,spotlight-binaries,electron-binaries}'`. Brace expansion is a shell
feature and is not typically supported by standard glob libraries, including the one
likely used by GitHub Actions (`@actions/glob`). The action will probably search for a
single artifact with the literal name
`'{built-packages,spotlight-binaries,electron-binaries}'`, which does not exist. This
will cause the artifact download to fail, breaking the subsequent `merge-artifacts` job
and preventing the release from being created.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8505748

@BYK BYK merged commit 201e7cd into main Jan 12, 2026
23 of 24 checks passed
@BYK BYK deleted the fix/craft-artifact-merge branch January 12, 2026 22:36
with:
pattern: '{built-packages,spotlight-binaries,electron-binaries}'
path: artifacts/
merge-multiple: true
Copy link

Choose a reason for hiding this comment

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

Artifact paths not flattened despite PR description claim

Medium Severity

The PR description claims that merge-multiple: true "flattens" artifacts, but this option only merges multiple artifacts into the same directory while preserving their internal directory structure. Files from spotlight-binaries will have paths like packages/spotlight/dist-bin/spotlight-linux-x64, not spotlight-linux-x64 at the root. The requireNames pattern /^spotlight-/ in .craft.yml expects files starting with "spotlight-" which won't match unless Craft matches against basenames rather than full relative paths. If Craft uses full paths for matching, this will cause release validation to fail.

Additional Locations (1)

Fix in Cursor Fix in Web

uses: actions/upload-artifact@v5
with:
name: ${{ github.sha }}
path: artifacts/
Copy link

Choose a reason for hiding this comment

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

Missing error handling for empty artifact upload

Low Severity

The merged artifact upload step is missing if-no-files-found: error, unlike all other artifact uploads in this workflow (lines 128, 137, 144, 403). With the default warn behavior, if the artifacts/ directory ends up empty due to a download issue, the upload step would succeed but no artifact would be created. Craft would then fail later with a confusing "Can't find any artifacts for revision" error rather than failing at the source. Adding the explicit error check would maintain consistency and provide clearer failure messages.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants