Skip to content

refactor(distribution): Separate upload and SDK installation controls#1017

Merged
runningcode merged 4 commits intomainfrom
no/refactor-distribution-api
Oct 27, 2025
Merged

refactor(distribution): Separate upload and SDK installation controls#1017
runningcode merged 4 commits intomainfrom
no/refactor-distribution-api

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

@runningcode runningcode commented Oct 24, 2025

Summary

Refactor the distribution API to provide clearer separation between upload control and auto-update SDK installation.

Note, this does not move the enabled property outside the ignored variants. So enabled only works for variants that are enabled and therefore have sentry enabled.

Key Changes

  1. Added enabled property: Controls whether build distribution uploads are enabled

    • Defaults to false
    • Only applies to variants that are not in ignoredVariants
  2. Renamed enabledVariants to updateSdkVariants: Clarifies this property controls auto-update SDK installation only, not uploads

  3. Updated upload logic: Now checks distribution.enabled instead of variant membership in enabledVariants

  4. Added build-time validation:

    • Error if updateSdkVariants contains variants in ignoredVariants
    • Error if updateSdkVariants is set but enabled is false

New API Example

sentry {
  ignoredVariants = setOf("debug")
  
  sizeAnalysis {
    enabled = true // Explicit control over size uploads
  }
  
  distribution {
    enabled = true // Controls build uploads for distribution (only for non-ignored variants)
    updateSdkVariants = setOf("beta") // Controls auto-update SDK installation
  }
}

Migration Guide

Before:

distribution {
  enabledVariants = ["beta"]
}

After:

distribution {
  enabled = true
  updateSdkVariants = ["beta"]
}

🤖 Generated with Claude Code

runningcode and others added 4 commits October 24, 2025 14:08
Refactor the distribution API to provide clearer separation between:
- Upload control via `enabled` property
- Auto-update SDK installation via `updateSdkVariants` property

This replaces the previous `enabledVariants` property which conflated
both concerns.

Key changes:
- Add `enabled: Boolean` property to control distribution uploads
  (defaults to false during EA)
- Rename `enabledVariants` to `updateSdkVariants` to clarify it
  controls auto-update SDK installation only
- Add validation to ensure `updateSdkVariants` doesn't include
  variants in `ignoredVariants`
- Add validation to ensure `updateSdkVariants` requires `enabled=true`
- Update upload logic to check `enabled` instead of variant membership
- Update tests to reflect new API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove references to Early Access and General Availability from
code comments to keep the implementation focused on current behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Apply spotless code formatting to distribution changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Set distribution.enabled convention to match sizeAnalysis.enabled,
which uses CI detection (currently evaluates to false).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/refactor-distribution-api branch from 13bd0a9 to 1923911 Compare October 24, 2025 14:43
@runningcode runningcode marked this pull request as ready for review October 24, 2025 15:12
Copy link
Copy Markdown
Contributor

@chromy chromy left a comment

Choose a reason for hiding this comment

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

lgtm

@runningcode runningcode merged commit 675a016 into main Oct 27, 2025
19 checks passed
@runningcode runningcode deleted the no/refactor-distribution-api branch October 27, 2025 10: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.

2 participants