Skip to content

Commit

Permalink
chore(datadog): Remove datadog-related code
Browse files Browse the repository at this point in the history
  • Loading branch information
rslinckx committed Sep 30, 2024
1 parent f577b3e commit 37e94e3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 35 deletions.
6 changes: 1 addition & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ inputs:
github-token:
description: "github token needed for API calls"
required: true
datadog-key:
description: "Datadog API KEY to post MSG on deploy"
required: false
slack-url:
description: "Slack Post URL to post MSG on deploy"
required: false
Expand Down Expand Up @@ -54,7 +51,7 @@ runs:
run: poetry install -C ${{github.action_path}} --only main

- name: Run dev-sync script
run: poetry run -C ${{github.action_path}} python ${{github.action_path}}/dev-sync.py from_github to_zendesk to_slack to_datadog
run: poetry run -C ${{github.action_path}} python ${{github.action_path}}/dev-sync.py from_github to_zendesk to_slack
shell: bash
env:
FROM_REF: ${{ inputs.from_ref }}
Expand All @@ -66,7 +63,6 @@ runs:

# CREDS
GH_TOKEN: ${{ inputs.github-token}}
DD_API_KEY: ${{ inputs.datadog-key}}
SLACK_URL: ${{ inputs.slack-url}}
ZD_USERNAME: ${{ inputs.zendesk-username}}
ZD_PASSWORD: ${{ inputs.zendesk-password}}
28 changes: 0 additions & 28 deletions dev-sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,34 +310,6 @@ def to_slack(ctx: click.Context, slack_url: str) -> None:
click.echo(json.dumps(payload))


@group_from_github.command("to_datadog")
@click.option("--datadog-key", envvar="DD_API_KEY")
@click.pass_context
def to_datadog(ctx: click.Context, datadog_key: str) -> None:
click.secho("Announcing release on datadog", fg="green", underline=True)
ctx_obj = cast(ContextObj, ctx.obj)

diff_link = ctx_obj["diff_link"]
to_ref = ctx_obj["to_ref"]
commits = ctx_obj["commits"]
status = ctx_obj["status"]
payload = {
"title": f"Just deployed {to_ref} on {status}",
"text": f" [{len(commits)} commits]({diff_link})",
"priority": "normal",
"tags": [f"deployment:{status}"],
"alert_type": "info",
"source": "Git",
}

if not ctx_obj["dry_run"]:
result = requests.post(
f"https://app.datadoghq.eu/api/v1/events?api_key={datadog_key}", json=payload, timeout=10
)
click.echo("->")
click.echo(result.text)


@group_from_github.command("to_test")
@click.pass_context
def to_test(ctx: click.Context) -> None:
Expand Down
1 change: 0 additions & 1 deletion env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ FROM_REF=
TO_REF=
GL_ISSUES=
SLACK_URL=
DD_KEY=
2 changes: 1 addition & 1 deletion launch.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

/app/dev-sync.py from_github to_zendesk to_slack to_datadog
/app/dev-sync.py from_github to_zendesk to_slack

0 comments on commit 37e94e3

Please sign in to comment.