Skip to content

Conversation

runningcode
Copy link
Contributor

@runningcode runningcode commented Oct 8, 2025

Summary

Update GenerateDistributionPropertiesTask to check multiple sources for org and project configuration, following the established pattern used by other tasks like SentryUploadProguardMappingsTask.

Changes

Fallback Pattern Implementation

For org (organization slug):

  1. Extra properties (ext.sentryOrg)
  2. Extension property (extension.org)
  3. Environment variable (SENTRY_ORG)
  4. sentry.properties file (defaults.org or org)

For projectName (project slug):

  1. Extra properties (ext.sentryProject)
  2. Extension property (extension.projectName)
  3. Environment variable (SENTRY_PROJECT)
  4. sentry.properties file (defaults.project or project)

For authToken:

  • No changes since we will eventually adjust this to use a separate distribution token.

#skip-changelog as this hasn't been released yet

Resolves EME-397

🤖 Generated with Claude Code

Copy link

linear bot commented Oct 8, 2025

val sentryPropertiesFile = variant?.let { SentryPropertiesFileProvider.getPropertiesFilePath(project, it) }
val sentryProperties = sentryPropertiesFile?.let { PropertiesUtil.loadMaybe(File(it)) }

// Resolve org slug with fallback chain: ext -> extension -> env -> sentry.properties
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to discuss a different priority here.
Note: we're not getting .sentryclirc files yet. That can be added later.

…rtiesTask

Update GenerateDistributionPropertiesTask to check multiple sources for org and
project configuration, following the established pattern used by other tasks.

Changes:
- Add fallback chain for org: ext -> extension -> env -> sentry.properties
- Add fallback chain for project: ext -> extension -> env -> sentry.properties
- Auth token remains extension-only (no fallback)
- Pass sentryOrg/sentryProject parameters from AndroidComponentsConfig
- Add comprehensive tests for all fallback scenarios

Resolves EME-397

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

Co-Authored-By: Claude <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/add-fallback-for-org-project branch from 3e29cca to d887e8d Compare October 8, 2025 15:21
@runningcode runningcode marked this pull request as ready for review October 8, 2025 15:59
}
task.projectSlug.set(projectProvider)

// Auth token only from extension (no fallback)
Copy link
Member

@romtsn romtsn Oct 9, 2025

Choose a reason for hiding this comment

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

so this is deliberate? 'cause I think you can also set it via env variable (SENTRY_AUTH_TOKEN) and sentry.properties too. But I guess it's not gonna be the one you need for distribution, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes that’s correct, we’re going to add a separate env variable and extension property for this one in the future which is why it isn’t added here.

// Load sentry.properties if available
val sentryPropertiesFile =
variant?.let { SentryPropertiesFileProvider.getPropertiesFilePath(project, it) }
val sentryProperties = sentryPropertiesFile?.let { PropertiesUtil.loadMaybe(File(it)) }
Copy link
Member

Choose a reason for hiding this comment

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

wondering if that's fine to load it at configuration phase here, or should we move it to the task action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good point. This should probably be marked as an input as well.

Copy link
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, the priority also sounds fine!

…mpatible

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

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
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 caf5220 into main Oct 10, 2025
17 checks passed
@runningcode runningcode deleted the no/add-fallback-for-org-project branch October 10, 2025 12:41
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