Skip to content

feat(snapshots): Add snapshot upload task#1091

Merged
runningcode merged 12 commits intomainfrom
no/snapshot-uploads
Mar 6, 2026
Merged

feat(snapshots): Add snapshot upload task#1091
runningcode merged 12 commits intomainfrom
no/snapshot-uploads

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

@runningcode runningcode commented Mar 3, 2026

Context this is just the first version of the feature for BYO snapshots where customers already generate their own snapshots through another framework. This allows them to upload the snapshot folder directory to us.

Summary

  • Adds a new sentryUploadSnapshots task that invokes sentry-cli build snapshots --app-id <APP_ID> <path> to upload snapshots to Sentry
  • Adds a sentry.snapshots extension block with appId and path properties
  • Task is registered unconditionally using lazy property wiring

Usage

In your app module's build.gradle.kts:

sentry {
  snapshots {
    appId.set("com.example.myapp")
    path.set(file("path/to/snapshots"))
  }
}

Then run:

./gradlew sentryUploadSnapshots

🤖 Generated with Claude Code

Add a new `sentryUploadSnapshots` task that uploads snapshots to Sentry
via `sentry-cli build snapshots`. The task is registered when the user
configures a snapshots path via the new `sentry.snapshots` extension
block.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 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 ✨

  • (snapshots) Add snapshot upload task by runningcode in #1091

Internal Changes 🔧

Deps

  • Update Android SDK to v8.34.0 by github-actions in #1092
  • Update CLI to v3.3.0 by github-actions in #1093
  • Update CLI to v3.2.3 by github-actions in #1090
  • Bump getsentry/craft from 2.21.7 to 2.23.1 by dependabot in #1088
  • Bump actions/upload-artifact from 6 to 7 by dependabot in #1087
  • Bump getsentry/craft from 2.21.4 to 2.21.7 by dependabot in #1085
  • Update CLI to v3.2.2 by github-actions in #1084
  • Bump gradle/actions from 5.0.1 to 5.0.2 by dependabot in #1086

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 2603da1

runningcode and others added 2 commits March 3, 2026 17:07
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Register the task unconditionally and let the lazy DirectoryProperty
handle resolution at execution time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@runningcode runningcode changed the title feat(snapshots): Add snapshot upload task feat(snapshots): Add snapshot upload task (WIP) Mar 3, 2026
sentry-cli build snapshots requires --app-id. Add it as a required
property on the SnapshotsExtension.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@runningcode runningcode changed the title feat(snapshots): Add snapshot upload task (WIP) feat(snapshots): Add snapshot upload task Mar 4, 2026
@runningcode runningcode marked this pull request as ready for review March 4, 2026 07:37
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move all wiring logic into the task's register() method so the plugin
call site only passes project, extension, and org/project overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM, a couple of minor things though (sentry properties probably needs to be addressed)

Add proper telemetry setup via configureTelemetryNoVariant, wire
sentryProperties file, and pass buildEvents and cliExecutable to the
register method. Remove unused GradleInternal import.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
runningcode and others added 2 commits March 5, 2026 15:05
The snapshot upload task has no variant context, so variant needs to
be optional when resolving the sentry.properties file path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Telemetry wiring is not needed for the snapshot upload task.
Remove the unused buildEvents parameter and the
configureTelemetryNoVariant helper function.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

runningcode and others added 2 commits March 5, 2026 17:28
When variant is null (e.g. snapshot uploads), buildTypeName resolves
to an empty string, producing nonsensical paths with double separators
like src//sentry.properties. Guard buildTypeName-based paths the same
way flavorName-based paths are already guarded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that getPropertiesFilePath with a null variant finds files in
the project root and does not search buildType-specific paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@runningcode runningcode closed this Mar 6, 2026
@runningcode runningcode reopened this Mar 6, 2026
@runningcode runningcode merged commit f74417d into main Mar 6, 2026
25 of 41 checks passed
@runningcode runningcode deleted the no/snapshot-uploads branch March 6, 2026 08:22
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