-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
Webhook notifications are not triggered on "apply" event, possibly because server-side repo config contains a workflow with custom "run" command for "apply" step.
Slack nor HTTP webhook is not triggered when a user calls atlantis apply
via GitHub comment. Atlantis logs (with debug level logging) don't mention an attempt to try sending a notification on either endpoint.
By inspecting the access logs for the custom notification webhook URL endpoint, I didn't find any POST requests.
Reproduction Steps
Configure Slack or HTTP webhook notification in Atlantis server configuration.
Define a custom workflow with custom "run" command for "apply" step.
Open a PR on GitHub and trigger Terraform apply by commenting atlantis apply
to the PR.
Observe is Slack or HTTP webbook notification arrives.
Logs
Environment details
- Atlantis version: 0.36.0
- Deployment method: Docker (running the official Atlantis container image)
- Atlantis flags:
--config /home/atlantis/.atlantis/atlantis-server.yaml --gh-app-id ${GH_APP_ID} --gh-app-key-file /home/atlantis/gh_app_key.pem --repo-config /home/atlantis/.atlantis/repos.yaml --gh-webhook-secret ${GH_WEBHOOK_SECRET} --write-git-creds --repo-allowlist '${REPO_ALLOWLIST}' --atlantis-url ${ATLANTIS_URL}
Atlantis server-side config file:
# config file
log-level: "debug"
slack-token: "XXXXXXXX"
workflows:
- event: "apply"
kind: "slack"
channel: "XXXXXXXXXX"
- event: "apply"
kind: "http"
url: "https://XXXXXX"
Repo-config repos.yaml
file:
# config file
---
repos:
- id: "github.com/[ORG]/[REPO]"
apply_requirements: ["mergeable"]
workflow: "sops"
workflows:
sops:
plan:
steps:
- run: &terraform_init_cmd
shell: "bash"
command: |
source /home/atlantis/.atlantis/.env.sops && /home/atlantis/.atlantis/bin/sops exec-env ../.terraform.env 'timestamp=$(date +"%Y-%m-%d_%H%M%S"); terraform init -backend-config="bucket=${TFSTATE_BUCKET}" -backend-config="region=${TFSTATE_REGION}" > /tmp/terraform_init_${timestamp}.log 2>&1 || cat /tmp/terraform_init_${timestamp}.log && rm -f /tmp/terraform_init_${timestamp}.log'
- run:
shell: "bash"
output: strip_refreshing
command: |
source /home/atlantis/.atlantis/.env.sops && /home/atlantis/.atlantis/bin/sops exec-env ../.terraform.env 'terraform plan -out terraform.tfplan'
apply:
steps:
- run: *terraform_init_cmd
- run:
shell: "bash"
output: strip_refreshing
command: |
source /home/atlantis/.atlantis/.env.sops && /home/atlantis/.atlantis/bin/sops exec-env ../.terraform.env 'terraform apply -auto-approve terraform.tfplan'