Closed mpadge closed 3 years ago
Will it be possible to simply add these additional basic_command versions with command: approve bronze, and so on?
Yes, additional basic_command
responders can be added with command: approve gold
, command: approve silver
and command: approve bronze
. They will not conflict wih each other or with the original command: approve
as all the command strings are different.
It would also be good to ensure that approve bronze/gold/silver commands were not recognised when submission-type = standard, and that simple approve without grade was not recognised when submission-type = stats (and maybe that doing so generates additional message that approve has to have bronze/silver/gold for those submissions).
It looks like to add all this logic the only solution is custom responders
I think this extension of the approve command conflicts with this other one: https://github.com/ropensci-org/buffy/issues/8
The resulting command would be confusing, difficult to remember and prone to errors:
@helper-bot approve repo-package-name silver
I suggest we keep the command as @helper-bot approve
and have the grade information in the body of the issue:
Adding a <--grade--><--end-grade->
HTML comment to the submissions template would allow for this flow:
@helper-bot set silver as grade
command only for editors can be used to set a value for the grade.@helper-bot approve
command reads the grade and use it as appropiate. And if it is needed (based on submission-type) but empty the response could be a simple message like "Please add a grade (bronze/silver/gold) before approval" Something similar could be done for the package-name to keep the approve command as easy to use as posible. @mpadge WDYT? cc/ @maelle
It sounds good as I don't think we can do without the repo-package-name for now (when submissions happen via a form it'll be different but for now we can't expect to always be able to read it from the submission).
I suggest "mint" as a shorter command @helper-bot mint silver
.
Looking forward to hearing @mpadge's opinion.
I entirely agree here - putting <---grade--->
as a HTML variable is definitely better, and it is really important to make this as easy as possible for editors, which that definitely does. As does @helper-bot mint gold
- that is indeed :1st_place_medal: !!
@xuanxu Shall we put the <---grade--->
variable in the issue template, or will it only be added by a mint
command? If the former, let me know and I'll update straight away.
To me (I know I wasn't asked :innocent: ) having it added via the command sounds safer for now as we can't guarantee issue body integrity at submission.
Oh yeah, that's a really good point @maelle, thanks!
I'd add the HTML comment to the template. We can have a command that looks for the <!--grade--><!--end-grade-->
placeholder in the body and if it's not present it add it at the end of the text, so it is "backwards compatible".
@xuanxu The PR above adds a HTML statsgrade
variable to the template. We then just need to modify the approved
command to add some if
logic:
Something like:
if:
value_matches:
statsgrade: bronze
add_labels:
6/approved-bronze
if:
value_matches:
statsgrade: silver
add_labels:
6/approved-silver
if:
value_matches:
statsgrade: gold
add_labels:
6/approved-gold
How would we now best do that?
@mpadge Great! I'll add that to the new responder 👍
@xuanxu There is currently a single
approve
command:https://github.com/ropensci-org/buffy/blob/208f2f11467dd86c814d824f7d41cf4846b336ca/config/settings-production.yml#L32-L43
New system will retain this command for
submission-type
=standard
, but will also feature three additional "grades" triggered by commands of:I don't know how strict the command matching of
command: approve
is? Will it be possible to simply add these additionalbasic_command
versions withcommand: approve bronze
, and so on? Or does there need to be some modification of command syntax parsing? Either way, please help!And to make matters a bit more complicated / refined: It would also be good to ensure that
approve bronze/gold/silver
commands were not recognised whensubmission-type
=standard
, and that simpleapprove
without grade was not recognised whensubmission-type
=stats
(and maybe that doing so generates additional message that approve has to havebronze/silver/gold
for those submissions).