-
Notifications
You must be signed in to change notification settings - Fork 47
fix: Make release signing configuration lazy to fix CI builds #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes CI build failures for dependabot PRs by deferring release signing configuration validation until release builds are actually executed. The changes allow the Gradle configuration phase to complete successfully even when signing environment variables are not available, while still ensuring proper validation when building release variants.
- Removed exception throwing during Gradle configuration phase that was blocking all builds
- Added lazy validation that only runs when release tasks are executed
- Extended support for both standard and GHUI-prefixed environment variables
app/build.gradle
Outdated
|
|
||
| // Validate release signing configuration before building release | ||
| tasks.whenTaskAdded { task -> | ||
| if (task.name.contains('assembleRelease') || task.name.contains('bundleRelease')) { |
Copilot
AI
Jul 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using string contains for task name matching is fragile and could match unintended tasks. Consider using more specific patterns like task.name.matches('.[aA]ssembleRelease.') or checking task types instead.
| if (task.name.contains('assembleRelease') || task.name.contains('bundleRelease')) { | |
| if (task.name.matches('.*assembleRelease') || task.name.matches('.*bundleRelease')) { |
app/build.gradle
Outdated
| def keyPassword = System.getenv("KEY_PASSWORD") ?: System.getenv("GHUI_KEY_PASSWORD") | ||
|
|
Copilot
AI
Jul 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The validation logic checks for empty strings but doesn't validate that the keystore file exists or that the passwords are valid. Consider adding a check for the keystore file existence as well.
| def keyPassword = System.getenv("KEY_PASSWORD") ?: System.getenv("GHUI_KEY_PASSWORD") | |
| def keyPassword = System.getenv("KEY_PASSWORD") ?: System.getenv("GHUI_KEY_PASSWORD") | |
| def keystoreFile = file("keystore.jks") | |
| if (!keystoreFile.exists()) { | |
| throw new GradleException("Release builds require a valid keystore file. Please ensure 'keystore.jks' exists in the project directory.") | |
| } | |
fbcf995 to
37f4223
Compare
- Remove exception throwing during configuration phase - Set empty defaults for signing credentials to allow gradle configuration - This fixes CI failures for dependabot PRs that don't have access to secrets - Release builds will still fail naturally if credentials are missing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
37f4223 to
0fce840
Compare
Summary
Problem
All dependabot PRs are failing CI because the build.gradle file throws an exception during configuration phase when KEYSTORE_PASSWORD and KEY_PASSWORD environment variables are not set. Dependabot PRs don't have access to repository secrets.
Solution
Test plan
🤖 Generated with Claude Code