Ignore button findings that are probably dropdowns
Ignore button findings in dropdown files
For gitlab-org/gitlab@79abc488, this removes seven findings:
This is a genuine finding that should instead be migrated to a compliant dropdown (there's no point migrating the button itself):
These three are false positives, as they are deprecated filtered search items (e.g, see gitlab-org/gitlab@9949f57c for similar ones):
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/views/shared/issuable/_approved_by_dropdown.html.haml#L4
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/views/shared/issuable/_approved_by_dropdown.html.haml#L7
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/views/shared/issuable/_user_dropdown_item.html.haml#L5
These are buttons in a dropdown helper Ruby module, which probably shouldn't be used at all, and simply deleted:
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/helpers/dropdowns_helper.rb#L60
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/helpers/dropdowns_helper.rb#L94
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/helpers/dropdowns_helper.rb#L102
Ignore dropdown button findings
In total, this removes 21 button findings.
15 of these findings included dropdown
in the same line as
gl-button
, which should be covered by dropdown rules.
These could be seen by running a scan before this commit and using this query:
extra.metadata[pajamasCompliant eq false and componentLabel eq
"component:button"] and not path co "dropdown" and extra.lines co
"dropdown"
A few examples are:
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/views/projects/deployments/_actions.haml#L6
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/views/projects/merge_requests/_nav_btns.html.haml#L16
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/assets/javascripts/sidebar/components/assignees/assignee_title.vue#L47
This also removes 6 more findings which weren't real button findings:
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/assets/javascripts/behaviors/preview_markdown.js#L138
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/assets/javascripts/behaviors/preview_markdown.js#L164
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/assets/javascripts/emoji/components/picker.vue#L118
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/assets/javascripts/emoji/components/picker.vue#L120
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/app/assets/javascripts/emoji/components/picker.vue#L124
- https://gitlab.com/gitlab-org/gitlab/-/blob/79abc488404136bf9b4c00654ed9794ce1bee7fe/ee/app/assets/javascripts/admin/subscriptions/show/components/subscription_sync_button.vue#L43
Addresses #86
Screenshots
Before | After |
---|---|
![]() |
![]() |
Review/run this locally
- Copy the
pages in mr
job URL (must have succeeded) - Run
bin/review-mr.sh <job url>