-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GH-1592] Notify Slack watchers on Terra submission creation #591
[GH-1592] Notify Slack watchers on Terra submission creation #591
Conversation
Test failures due to unrelated bug: |
Referencing a new unarchived workflow.
([{:keys [executor] :as workload} | ||
user-comment-note | ||
reference | ||
[_type snapshot :as _source-object]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up with some historical context:
We get this from the source
queue, originally I thought this would be a snapshot but instead it's a pair:
[:datarepo/snapshot <snapshot>]
I think the original intention was to think of a future where we submitted something-that-isn't-a-snapshot (like a row in a Terra entity table). But I elected not to fuss much with it.
(->> (get-in reference [:attributes :snapshot]) | ||
datarepo/snapshot | ||
(conj [:datarepo/snapshot]) | ||
(create-submission! workload user-comment-note reference)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but why combine the 2 arities here?
They seem different.
Maybe create-submission
and create-retry
?
(And then we wouldn't need the user-comment-note
parameter.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this but I was wary about the potential for unintended deviation. Besides the contents of the comment, the operations performed in either case are the same (alter method config, submit method config, emit Slack message). No hard feelings if you elect to fuss with this, of course.
(defn snapshot-url | ||
"Return a link to `snapshot` in TDR UI." | ||
[{:keys [id] :as _snapshot}] | ||
(datarepo-url "snapshots/details" id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably spozed to be (datarepo-url "snapshots" "details" id)
, but OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered about that, but I did see other usage patterns like this:
(def ^:private repository
"API URL for Data Repo API."
(partial datarepo-url "api/repository/v1"))
[executor/workflow-finished-slack-msg mock-workflow-finished-slack-msg | ||
slack/notify-watchers (constantly nil)] | ||
(is (= records (#'executor/notify-on-workflow-completion workload records)) | ||
"Should return all passed-in records"))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just … craazy.
~'wdl {:path "pipes/WDL/workflows/assemble_refbased.wdl" | ||
:release "master" | ||
:repo "viral-pipelines"}] | ||
~@body)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Purpose
When a Terra submission is created, WFL emits a Slack message with a link to the submission as well as the source snapshot.
Changes
executor
snapshot
object rather than refetch it from TDRTesting
with-redefs-fn
towith-redefs
in the test files I touched for better readabilityManual Verification
The system test
wfl.system.v1-endpoint-test/test-workload-sink-outputs-to-tdr
generates a Slack notification when it creates its submission, but its links break when the test cleans up its temporary resources:https://broadinstitute.slack.com/archives/C026PTM4XPA/p1647364194127229
I launched a workload off of a local WFL with a fixed snapshot:
Saw the submission launch Slack message for the original submission as well as its retry. The links in these messages work since the snapshot and workspace were not deleted, I clicked through them and confirmed that they work.
System Tests
Passed:
Review Instructions
executor/create-submission!