Closed bonjourmauko closed 7 years ago
Expressing it this way, it strikes me that we might want to spec out the Slack interactions at some point... It's likely that Slack will grow in importance as a way of interacting with BGB.
Good feedback, said otherwise : « When I'm requesting a badge in Slack, and I'm following the instructions given to me, and Slack tells me the badge request was unsuccessful, I want to know what went wrong, so to resubmit my command, or ask for help with clearly identified problem, and have it solved ASAP »
@Morendil Done, dunno how to test though...
You can route a test command to a review app, using the Slack settings panel for the team. Go to "Manage integrations" then "Slack commands".
Using the Sinatra error handling is neat, but looking at the code doesn't leave me very confident that the external behaviour is preserved by this transformation, so I'd definitely do some testing via Slack.
@Morendil Ended up adding integration testing for /compte, was way easier...
Could you try and test my last commit ?
On it - in the meantime you can also try it yourself on Slack!
/compte-test-validation
=> Darn – that slash command didn't work (error message: 500_service_error
). (1st try only), plus "Zut, il y a une erreur: Le format du nom doit être prenom.nom"/compte-test-validation toto
=> Zut, il y a une erreur: Email invalide, typo ?/compte-test-validation toto titi
=> Zut, il y a une erreur: Email invalide, typo ?/compte-test-validation laurent.bossavit titi
=> Zut, il y a une erreur: Email invalide, typo ?/compte-test-validation laurent.bossavit a@b.com
=> Zut, il y a une erreur: Mot de passe requis/compte-test-validation laurent.bossavit a@b.com truc
=> OK, création de compte en cours ! (Should fail with password error, probably doesn't because I used my own name for testing)By now this PR has, to my eyes, outgrown the intent originally expressed by the branch name ("refactor account request"), possibly a hint to split it into refactoring vs new feature development.
As experienced on Slack, we should probably also suppress in-channel output to Slack if the command results in any error (whether by failing validation or by external failure).
rebase + fixup
The original intent of this PR is effectively to start refactoring ActionRequest
. Feedback is precisely a feature/solution so I decided not to address it here by now (I wrote the job story somewhere else if we want to come back to this later). As it stands, I think the only thing this PR does is to « Validate AccountRequest parameters ». Thanks to confirm (or not) this is RTM now.
Thanks to approve or tell me if you think is RTM for you.