Skip to content

feat: Configure GitHub artifact provider to filter by workflow and name#709

Merged
BYK merged 7 commits intomasterfrom
feat/github-artifact-flexible-matching
Jan 30, 2026
Merged

feat: Configure GitHub artifact provider to filter by workflow and name#709
BYK merged 7 commits intomasterfrom
feat/github-artifact-flexible-matching

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jan 13, 2026

No description provided.

Co-authored-by: burak.kaya <burak.kaya@sentry.io>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 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 ✨

  • Configure GitHub artifact provider to filter by workflow and name by BYK in #709

Bug Fixes 🐛

Docker

  • Add image template var and strict template validation by BYK in #713
  • Add GITHUB_API_TOKEN and x-access-token fallbacks for ghcr.io by BYK in #710

Other

  • Don't mention PRs to avoid linking in changelog previews by BYK in #712

🤖 This preview updates automatically when you update the PR.

Remove unnecessary inline comments that were overly explanatory
for self-documenting code.
- Export ArtifactPatternsSchema from schema
- Move patternToRegexp and escapeRegex to utils/filters.ts
- Restructure getArtifactsFromWorkflowRuns to pre-compute applicable
  patterns per workflow, eliminating redundant filter checks
- Use Set to track seen artifact IDs instead of break statement
- Implement two-phase download pipeline: download all in parallel,
  then unpack all in parallel for better I/O throughput
- Add tests for new filter utility functions
@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-01-30 22:00 UTC

- Use ArtifactPatternsSchema in GitHubArtifactsConfigSchema union
- Remove re-export of patternToRegexp from github.ts
- Update tests to import patternToRegexp from utils/filters.ts
@BYK BYK marked this pull request as ready for review January 30, 2026 21:28
@BYK
Copy link
Member Author

BYK commented Jan 30, 2026

@sentry review

@BYK
Copy link
Member Author

BYK commented Jan 30, 2026

@cursoragent review

@cursor
Copy link
Contributor

cursor bot commented Jan 30, 2026

I've successfully completed the PR review and addressed the feedback. Here's a summary of what was done:

Review Changes Summary

1. Schema Already Correct

The ArtifactPatternsSchema was already properly exported and used in GitHubArtifactsConfigSchema, so no changes were needed.

2. Redundant Workflow Filtering Already Fixed

The current implementation correctly uses getApplicablePatterns() which is called once per workflow run before the artifact loop, avoiding the redundant per-artifact workflow checks that existed in earlier versions.

3. Fixed Resource Leak

This was the main issue that needed addressing. I modified downloadArtifactsInParallel() to:

  • Use Promise.allSettled() instead of Promise.all() for unpacking operations
  • Ensure temp files are cleaned up even if unpacking fails
  • Aggregate and report all unpacking errors
  • Log cleanup operations for debugging

4. Tests Already Correct

Tests were already importing patternToRegexp from utils/filters (the correct location), so no changes were needed.

5. All Tests Pass

Ran the full test suite - all 756 tests pass successfully.

Changes Committed and Pushed

The fix for the resource leak has been committed and pushed to the feat/github-artifact-flexible-matching branch with a descriptive commit message explaining the changes and their purpose.

Open in Cursor Open in Web

…ing fails

- Use Promise.allSettled instead of Promise.all for unpacking
- Clean up temp files for failed unpacks to prevent resource leaks
- Aggregate and report all unpacking errors

Addresses review feedback to prevent disk space exhaustion from
orphaned temporary files when unpacking operations fail.

Co-authored-by: burak.kaya <burak.kaya@sentry.io>
@BYK BYK merged commit 289242a into master Jan 30, 2026
16 checks passed
@BYK BYK deleted the feat/github-artifact-flexible-matching branch January 30, 2026 22:00
BYK added a commit to getsentry/cli that referenced this pull request Feb 9, 2026
## Summary

Upgrade to Craft 2.21.1 which supports workflow-specific artifact
filtering, eliminating the need to merge all CI artifacts into a single
SHA-named artifact.

## Changes

### `.craft.yml`
- Bump `minVersion` to `2.21.1`
- Replace `requireNames` with `artifactProvider.config.artifacts` for
precise artifact filtering
- Artifacts collected from `ci.yml` workflow: `sentry-*`, `npm-package`,
`gh-pages`

### `.github/workflows/ci.yml`
- Remove `merge-artifacts` job (previously downloaded all artifacts and
re-uploaded as `${{ github.sha }}`)
- Update `ci-status` job dependencies and status checking logic

## Benefits
- **Faster CI** — eliminates redundant download/upload step
- **Cleaner config** — artifact filtering at provider level with
explicit patterns
- **Better defaults** — leverages Craft 2.21.1 improvements

## References
- [Craft 2.21.1
Release](https://github.com/getsentry/craft/releases/tag/2.21.1)
- [PR #709: Configure GitHub artifact provider to filter by workflow and
name](getsentry/craft#709)
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.

3 participants