fix(craft): use regex pattern for binary artifact matching#230
Merged
Conversation
Craft's patternToRegexp() treats plain strings as exact matches, escaping
special characters like *. The pattern 'sentry-*' was being converted to
/^sentry\-\*$/ which only matches the literal string 'sentry-*', not
artifact names like 'sentry-linux-x64' or 'sentry-darwin-arm64'.
This caused the 0.9.0 release to ship without any platform binaries —
only gh-pages and npm-package (exact name matches) were uploaded.
Use Craft's regex syntax ('/^sentry-.*$/') so the pattern is parsed as
an actual regex that matches all sentry-prefixed artifacts.
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Cli
Other
Bug Fixes 🐛Upgrade
Other
Documentation 📚
Internal Changes 🔧Ci
Other
Other
🤖 This preview updates automatically when you update the PR. |
3 tasks
BYK
added a commit
to getsentry/craft
that referenced
this pull request
Feb 11, 2026
…terns match patternToRegexp() silently escaped glob characters (* and ?), treating "sentry-*" as an exact match for the literal string "sentry-*" instead of matching "sentry-linux-x64" etc. This caused getsentry/cli#230 where a release shipped without platform binaries. Add first-class glob support: * maps to .* and ? maps to . in regex. Plain strings and /regex/ syntax remain unchanged. Add validation in doListArtifactsWithFilters() that every configured workflow pattern matched at least one workflow run, and every artifact pattern matched at least one artifact. This catches misconfigurations early with clear error messages listing available names, instead of letting them surface as confusing per-target failures. Add a belt-and-suspenders check in publishMain() that errors when artifact filters are configured but zero artifacts are found.
BYK
added a commit
to getsentry/craft
that referenced
this pull request
Feb 11, 2026
…terns match (#748) ## Summary Fixes a class of silent misconfiguration bugs in artifact pattern matching, motivated by [getsentry/cli#230](getsentry/cli#230) where `'sentry-*'` in `.craft.yml` was silently treated as an exact match for the literal string `"sentry-*"` instead of matching `"sentry-linux-x64"` etc. ### Changes **Glob pattern support** (`src/utils/filters.ts`): - `patternToRegexp()` now supports glob wildcards: `*` maps to `.*`, `?` maps to `.` in regex - Plain strings and `/regex/` syntax remain unchanged - New `globToRegex()` helper function **All-patterns-must-match validation** (`src/artifact_providers/github.ts`): - New `validateAllPatternsMatched()` method ensures every configured workflow pattern matched at least one workflow run, and every artifact pattern matched at least one artifact - Runs after the existing retry/polling loop succeeds — "wait for CI" behavior is preserved - Error messages include available workflow/artifact names for easy debugging - Reports all mismatches at once **Publish-level safeguard** (`src/commands/publish.ts`): - When `artifactProvider.config.artifacts` is set but zero artifacts are found, `reportError()` stops the publish early instead of proceeding to targets that will individually fail with confusing messages ### Backward Compatibility - Plain strings without `*` or `?`: behavior unchanged (exact match) - `/regex/` syntax: behavior unchanged - Strings with `*` or `?`: previously silently wrong (escaped the chars), now correctly treated as globs — this is a bugfix - Legacy SHA-based artifact lookup: completely unaffected Refs: getsentry/cli#230
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the broken
curlinstall (curl https://cli.sentry.dev/install | bash) which 404s because 0.9.0 shipped without platform binaries.Root Cause
Craft's
patternToRegexp()treats plain strings as exact matches, escaping*to\*. The pattern'sentry-*'in.craft.ymlbecame/^sentry\-\*$/— matching only the literal string"sentry-*", not actual artifact names likesentry-linux-x64.Only
gh-pagesandnpm-package(exact name matches) were downloaded and uploaded to the GitHub release. All 5 platform binaries were silently skipped.Fix
Use Craft's regex syntax (
'/^sentry-.*$/'with enclosing slashes) so the pattern is parsed as an actual regex.This was introduced in #215 when migrating from
requireNames(which used proper regex/^sentry-.+$/) to the newartifactProviderconfig.