Introduce a Triage::UniqueComment concern
This extract the logic that allows processors to ensure they post a comment only once to a new class and use it in the DocCommunityContribution
and NewPipelineOnApproval
processors.
This also improves the response returned to the webhook request to include the processors and their messages, as well as the logging on the server side to include the full response hash (useful for debugging purpose).
New server logging format
Incoming webhook event: #<Triage::NoteEvent:0x00007f777005eee0 @event={"object_kind"=>"note", "project"=>{"id"=>1, "path_with_namespace"=>"gitlab-org/gitlab-test"}, "object_attributes"=>{"note"=>"@gitlab-bot label ~\"group::source code\"", "noteable_type"=>"Issue"}, "issue"=>{"iid"=>1000000000000}}>, response: {"Triage::ReactiveLabeler"=>#<struct Triage::Handler::Result message="/label ~\"group::source code\"", error=nil>}
New response format
$ curl -X POST localhost:8080 -H "Content-Type: application/json" -H "X-Gitlab-Token: gitlab_webhook_token" -d @spec/fixture/gitlab_test_note.json
{"status":"ok","messages":{"Triage::ReactiveLabeler":"/label ~\"group::source code\""}}%
Action items
-
When adding a new Triager
, verify that it has been added to theDEFAULT_TRIAGERS
intriage/triage/handler.rb
in the appropriate order. -
If applicable, identify the affected groups and how to communicate to them: -
/cc @ person_or_group
=> -
Relevant Slack channels => -
Week-in-review
-
Closes #156 (closed).
Edited by Rémy Coutable