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

Fix #3300: Add check for accessibility label for activities #3352

Merged
merged 182 commits into from
Jul 29, 2021

Conversation

Sparsh1212
Copy link
Contributor

@Sparsh1212 Sparsh1212 commented Jun 21, 2021

Explanation

Fixes #3300: Add check for accessibility labels for activities

The script parses the AndroidManifest.xml file of the app layer to ensure that the activity elements are defined with accessibility labels.

Note: The Activities listed in the ACCESSIBILITY_LABEL_CHECK_EXEMPTIONS_LIST will be skipped for this check, and currently, all the activities which were failing this check, have been added to this list so that the workflow doesn't fail.
We can remove any Activity from the exemption list, where we think that we can't go without a label for that Activity, or if a label is added for that Activity.

To run the script, use:

bazel run //scripts:accessibility_label_check -- $(pwd) app/src/main/AndroidManifest.xml

For testing the script, automated tests have been added.
To execute the tests, use:

bazel test //scripts:AccessibilityLabelCheckTest

Note: We are generating the test assets dynamically at the time of executing them. The test assets are automatically deleted when the test finishes.

SS when the CI check fails:

image

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@Sparsh1212
Copy link
Contributor Author

@BenHenning

  • All comments addressed
  • Migrated multiple exemption protos to share a single proto file and library
  • Added a check for redundant exemptions
  • Added tests for redundant exemptions

@Sparsh1212 Sparsh1212 assigned BenHenning and unassigned Sparsh1212 Jul 24, 2021
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @Sparsh1212. Just had 2 comments, otherwise this LGTM.

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Marking as requested to avoid this PR being accidentally merged before the last 2 comments are resolved.

@BenHenning BenHenning assigned rt4914 and Sparsh1212 and unassigned BenHenning Jul 28, 2021
@Sparsh1212
Copy link
Contributor Author

@BenHenning Thanks!
Changes done. PTAL.

@Sparsh1212 Sparsh1212 assigned BenHenning and unassigned Sparsh1212 Jul 28, 2021
@rt4914 rt4914 removed their assignment Jul 28, 2021
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @Sparsh1212! LGTM.

scripts/assets/accessibility_label_exemptions.textproto Outdated Show resolved Hide resolved
@BenHenning BenHenning merged commit 6610306 into develop Jul 29, 2021
@BenHenning BenHenning deleted the accesibilty-label-check branch July 29, 2021 18: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.

Create a Kotlin script to ensure that activities are defined with accessibility labels
6 participants