Take mr-risk's string labels with grep, so make check passes on main
What does this MR do and why?
make check fails on main. RuboCop 1.91.0, the version Gemfile.lock pins, reports one offense in the MR Risk Labeler:
src/mr-risk/scripts/payload.rb:21:33: C: [Correctable] Style/SelectByKind: Prefer grep to select with a kind check.Payload.labels now takes mr["labels"].grep(String) instead of select { |label| label.is_a?(String) }. It keeps the same labels, because grep tests String === label, which is label.is_a?(String). grep exists on Ruby 2.7, the target these scripts are linted at.
Every open merge request that runs make check against main fails at lint until this lands. Each one's specs pass.
Size
flows/mr-risk.yml goes from 37,074 to 37,062 bytes. flows/flow.yml and flows/deps.yml are unchanged.
How to set up and validate locally
- Run
make checkwith a UTF-8 locale. git diff origin/main -- flows/shows only the packedclassify_areasandplan_removalsscripts inflows/mr-risk.yml, the two steps that loadpayload.
Committed with SKIP=prettier, because the prettier hook can't install on this machine (nodeenv fails on a Node pre-release). The other hooks ran and passed.