Closed cdupuis closed 6 years ago
I'm confused about this as well. It looked to me like I should now be sending the correct message id but it's still not working.
I've tried another way to get the message ids synced.
The SDM is sending the command handler request:
{:destinations
[{:user_agent "slack",
:slack {:team {:id "T7K9AUCQ5"}, :channel {:name "npm1-test"}}}],
:command "BroadcastNudge",
:source
{:user_agent "slack",
:slack
{:team {:id "T7K9AUCQ5", :name "atm-slimslender"},
:channel {:id "CBVS0MT4N", :name "npm-test"},
:user {:id "U7K2ZRWHH", :name "jim"},
:thread_ts "1537406332.000100"}},
:actions
[{:id "libraryimpactconfirmupdate-0",
:command "LibraryImpactConfirmUpdate",
:parameters
[{:name "msgId",
:value "broadcastNudge-@atomist/sdm-pack-npmtest-0.2.4"}
{:name "name", :value "@atomist/sdm-pack-npmtest"}
{:name "version", :value "0.2.4"}],
:automation
{:name "@atomist/sdm-pack-fingerprints", :version "1.0.0"}}],
:content_type "application/x-atomist-slack+json",
:correlation_id "662d3b89-93d6-40e7-87e6-176bc76a3f35",
:team {:id "ANBD24ZEC", :name "atm-slimslender"},
:id "broadcastNudge-@atomist/sdm-pack-npmtest-0.2.4",
:automation
{:name "@atomist/sdm-pack-fingerprints", :version "1.0.0"},
:api_version "1",
:timestamp 1537407116339,
:body
{"attachments"
[{"author_name" "Library Update",
"author_icon" "https://images.atomist.com/rug/warning-yellow.png",
"text"
"<@U7K2ZRWHH> has updated the target version of `@atomist/sdm-pack-npmtest`.\n\nThe reason provided is:\n\n_go_",
"fallback" "Library Update",
"mrkdwn_in" ["text"],
"color" "#ffcc00"}
{"text"
"Shall we update library `@atomist/sdm-pack-npmtest` to *0.2.4*?",
"fallback" "none",
"actions"
[{"text" "Raise PR",
"type" "button",
"name" "automation-command::libraryimpactconfirmupdate-0"}],
"color" "#ffcc00",
"footer" "@atomist/sdm-pack-fingerprints/1.0.0",
"callback_id" "cllbck1"}]},
:post_mode "ttl"}
and when I click on the Raise PR, incoming webhooks is immediately responding Slack with the:
Last action: "Raise PR" by jim today at 6:32 PM
which, to me, indicates that incoming webhooks is not executing the last attachment filter (where the whole "Shall we update library" attachment is removed. This logic is driven partially by callback_ids and I can see why this wouldn't happen with the above payload. However, and this is where I need some guidance from you ...
@cdupuis - I did end up just hard-coding the action callback_id to "atm-confirm..." and that worked but I still feel like there's probably a more SDM correct way to do this. For now, I've got the PR button going away when you click it.
I find it very confusing to see eg the Raise PR button not disappearing when you clicked the button.