-
-
Notifications
You must be signed in to change notification settings - Fork 38
ref(proguard): Detect mappings from produced artifacts #1377
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
Open
sentry-junior
wants to merge
11
commits into
fix/agp-93-optimization-mappings
Choose a base branch
from
refactor/proguard-mapping-artifact-detection
base: fix/agp-93-optimization-mappings
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
22083d5
ref(proguard): Detect mappings from produced artifacts
sentry-junior[bot] 197263b
fix(proguard): Skip absent mapping providers
sentry-junior[bot] 995eb9e
test(proguard): Expect UUID task to skip without mapping
sentry-junior[bot] 9cb1d03
test(proguard): Keep unit test assertion focused
sentry-junior[bot] 7948d25
ref(proguard): Narrow mapping provider lookup
sentry-junior[bot] e9c8704
fix(proguard): Handle missing mapping provider value
sentry-junior[bot] c959046
fix(proguard): Document missing mapping provider
sentry-junior[bot] ca1cea5
fix(proguard): Reuse safe mapping lookup
sentry-junior[bot] 0379c48
fix(proguard): Handle missing Gradle provider values
sentry-junior[bot] 8710499
fix(proguard): Clean stale mapping metadata
sentry-junior[bot] 0c89cd3
test(proguard): Provide mappings for UUID metadata tests
sentry-junior[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -374,9 +374,10 @@ class SentryPluginTest : | |
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we should also update |
||
| @Test | ||
| fun `does not include a UUID in the APK`() { | ||
| // isMinifyEnabled is disabled by default in debug builds | ||
| runner.appendArguments(":app:assembleDebug").build() | ||
| val build = runner.appendArguments(":app:assembleDebug").build() | ||
|
|
||
| assertEquals(TaskOutcome.SUCCESS, build.task(":app:generateSentryProguardUuidDebug")?.outcome) | ||
| assertEquals(TaskOutcome.SKIPPED, build.task(":app:uploadSentryProguardMappingsDebug")?.outcome) | ||
| assertThrows(AssertionError::class.java) { | ||
| verifyProguardUuid(testProjectDir.root, variant = "debug", signed = false) | ||
| } | ||
|
|
@@ -1119,25 +1120,17 @@ class SentryPluginTest : | |
| ) | ||
|
|
||
| val result1 = runner.appendArguments(":app:testReleaseUnitTest").build() | ||
| val uuid1 = verifyProguardUuid(testProjectDir.root, inGeneratedFolder = true) | ||
| assertFalse { "minifyReleaseWithR8" in result1.output } | ||
| assertEquals( | ||
| TaskOutcome.SUCCESS, | ||
| result1.task(":app:generateSentryProguardUuidRelease")?.outcome, | ||
| ) | ||
|
|
||
| val result2 = runner.build() | ||
| val uuid2 = verifyProguardUuid(testProjectDir.root, inGeneratedFolder = true) | ||
| assertFalse { "minifyReleaseWithR8" in result2.output } | ||
|
|
||
| // UUIDs may differ between runs when minify doesn't run, because there's no mapping file | ||
| // to generate a deterministic hash from. The important assertion is that minify doesn't run. | ||
| // When minify DOES run (in production builds), the UUID will be deterministic. | ||
| assertNotEquals( | ||
| "00000000-0000-0000-0000-000000000000", | ||
| uuid1.toString(), | ||
| "UUID should be generated", | ||
| ) | ||
| assertNotEquals( | ||
| "00000000-0000-0000-0000-000000000000", | ||
| uuid2.toString(), | ||
| "UUID should be generated", | ||
| assertEquals( | ||
| TaskOutcome.SUCCESS, | ||
| result2.task(":app:generateSentryProguardUuidRelease")?.outcome, | ||
| ) | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we narrow these to the known “provider has no value” / missing-artifact cases (and rethrow anything else)? Worried we might suppress exceptions we shouldn't....