Page MenuHomePhabricator

requestctl should have a "find actions using pattern foo" feature
Closed, ResolvedPublic

Description

Hi,

We briefly discussed this on IRC, but: it would be nice if requestctl had a feature of the form "show me actions using pattern foo".

One can achieve this with a jq-based thing:

requestctl get action -o json | jq 'to_entries | .[] | select(.value.expression|test("ua/FISH")) | "action: \(.key), expression: \(.value.expression)" '

# outputs:
"action: cache-text/FISH, expression: pattern@ua/FISH"

[I swapped in FISH to avoid leaking anything]

...but a proper CLI argument to achieve similar would be great.

Event Timeline

CDanis triaged this task as Medium priority.Apr 7 2022, 2:50 PM
CDanis edited projects, added conftool; removed serviceops.

Another way of doing it is, on a puppetmaster frontend (e.g. where you run requestctl from):

git -C /srv/private grep --name-only pattern@<pattern>

Change 790712 had a related patch set uploaded (by Giuseppe Lavagetto; author: Giuseppe Lavagetto):

[operations/software/conftool@master] requestctl: add "find" command

https://gerrit.wikimedia.org/r/790712

Change 790712 merged by jenkins-bot:

[operations/software/conftool@master] requestctl: add "find" command

https://gerrit.wikimedia.org/r/790712