コード例 #1
0
ファイル: test_card.py プロジェクト: trevenrawr/dagster
def test_add_attachment_to_card():
    card = Card()
    card.add_attachment("Pipeline failure !!!")
    card.add_attachment("Pipeline success !!!")
    assert len(card.attachments) == 2
    assert card.attachments[0][
        "contentType"] == "application/vnd.microsoft.card.hero"
    assert card.attachments[0]["content"]["subtitle"] == "Pipeline failure !!!"
    assert card.type == "message"
コード例 #2
0
ファイル: hooks.py プロジェクト: trevenrawr/dagster
 def _hook(context: HookContext):
     text = message_fn(context)
     if dagit_base_url:
         text += "<a href='{base_url}/instance/runs/{run_id}'>View in Dagit</a>".format(
             base_url=dagit_base_url,
             run_id=context.run_id,
         )
     card = Card()
     card.add_attachment(text_message=text)
     context.resources.msteams.post_message(payload=card.payload)
コード例 #3
0
ファイル: sensors.py プロジェクト: helloworld/dagster
    def teams_on_pipeline_failure(context: PipelineFailureSensorContext):

        text = message_fn(context)
        if dagit_base_url:
            text += "<a href='{base_url}/instance/runs/{run_id}'>View in Dagit</a>".format(
                base_url=dagit_base_url,
                run_id=context.pipeline_run.run_id,
            )
        card = Card()
        card.add_attachment(text_message=text)
        teams_client.post_message(payload=card.payload)