Skip to content
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

Add automatic badging verification #1001

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Add automatic badging verification #1001

merged 1 commit into from
Oct 31, 2023

Conversation

alexvanyo
Copy link
Contributor

@alexvanyo alexvanyo commented Oct 26, 2023

This PR automates the manual badging process outlined here (https://developer.android.com/guide/topics/manifest/uses-feature-element#testing). Instead of manually needing to invoke aapt2, this PR sets up 3 Gradle tasks for each variant's artifact. Using prodRelease as an example, this PR creates three tasks:

  • generateProdReleaseBadging - generates the badging information from the universal apk
  • updateProdReleaseBadging - updates the golden, checked-in badging information from the generated version
  • checkProdReleaseBadging - verifies that the generated badging information matches the golden version

This badging describes important pieces of information about the resulting app package, which impacts how the app is distributed. This includes package name, version code, sdk versions, requsted permissions, launchable activities, and features.

Many of these attributes are resolved dynamically as part of build scripts, meaning that it may not be obvious when something changes - it could be due to a build configuration change, a newly included library, or implicitly required features.

These attributes are also vital to know, as they impact whether an app is available to download on certain devices,

In the spirit of https://developer.squareup.com/blog/surfacing-hidden-change-to-pull-requests/, committing this badging information into version control, and then verifying it as part of CI will require surfacing changes during review, which also provides an opportunity to allow checking if that change to badging is intentional.

Change-Id: Ic8fca86d7aa84675fa91fb1aa99abcc6e19d663e
@alexvanyo alexvanyo marked this pull request as ready for review October 26, 2023 04:15
Copy link
Collaborator

@dturner dturner left a comment

Choose a reason for hiding this comment

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

Great idea. Thanks for adding this.

@dturner dturner merged commit c8c83d4 into main Oct 31, 2023
5 checks passed
@dturner dturner deleted the av/badging branch October 31, 2023 15:54
@dturner dturner added the continuous-integration GitHub Actions, Build/Test workflows, CI performance, errors etc label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous-integration GitHub Actions, Build/Test workflows, CI performance, errors etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants