Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Rewrite messages who’s buttons we clicked #15

Closed
cdupuis opened this issue Sep 19, 2018 · 4 comments
Closed

Rewrite messages who’s buttons we clicked #15

cdupuis opened this issue Sep 19, 2018 · 4 comments
Labels
changelog:added Add this issue or pull request to added changelog section enhancement New feature or request

Comments

@cdupuis
Copy link
Member

cdupuis commented Sep 19, 2018

I find it very confusing to see eg the Raise PR button not disappearing when you clicked the button.

@cdupuis cdupuis added enhancement New feature or request changelog:added Add this issue or pull request to added changelog section labels Sep 19, 2018
@slimslenderslacks
Copy link
Contributor

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.

@slimslenderslacks
Copy link
Contributor

I've tried another way to get the message ids synced.

@slimslenderslacks
Copy link
Contributor

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 ...

@slenderslack
Copy link

@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.

atomist-bot added a commit that referenced this issue Sep 20, 2018
[atomist:generated]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
changelog:added Add this issue or pull request to added changelog section enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants