Skip to content

feat(smurf-tf-drift): fix false drift detection and add env-specific alerts - #452

Open
sunnymor-cd wants to merge 2 commits into
clouddrove:masterfrom
sunnymor-cd:feat/tf-drift-workflow
Open

sunnymor-cd wants to merge 2 commits into
clouddrove:masterfrom
sunnymor-cd:feat/tf-drift-workflow

Conversation

@sunnymor-cd

@sunnymor-cd sunnymor-cd commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Description

Improves the shared smurf-tf-drift workflow to correctly detect actionable Terraform drift and avoid false positives when Terraform reports no infrastructure changes. Adds environment-aware issue and Slack notifications, configurable Slack alert titles, drift-related outputs, and improved drift handling for reusable single- and multi-environment workflows.

Type of Change

  • 🐛 Bug fix
  • ✨ New workflow
  • 📝 Documentation update
  • 🔧 Workflow enhancement
  • 🎨 Code style/formatting
  • ♻️ Refactoring
  • ⚡ Performance improvement
  • 🔒 Security improvement

Workflow Category

  • Terraform (tf-*)
  • CloudFormation (cf-*)
  • Docker (docker-*)
  • Helm (helm-*)
  • PR Automation (pr-*)
  • Security (security-*)
  • Release (release-*)
  • Notification (notify-*)
  • AWS-specific (aws-*)
  • GCP-specific (gcp-*)
  • YAML Lint (yl-*)
  • Other

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

Tested the shared workflow using staging, prod-us, and prod-eu Terraform environments.

  • Verified environments with No changes do not report drift.
  • Verified actual actionable Terraform changes are detected as drift.
  • Verified drift creates an environment-specific GitHub issue.
  • Verified clean environments do not create or update drift issues.
  • Verified Slack alerts are sent only for the affected environment.
  • Verified Slack alerts include the configured title, environment, repository, branch, and workflow run URL.
  • Verified multi-environment execution works correctly through a caller workflow matrix.
  • Ran yamllint and fixed formatting and lint issues.

Screenshots/Documentation

image image image

Related Issues

Closes #

Additional Notes

The workflow remains reusable for both single-environment and multi-environment Terraform setups. Environment-specific values are provided by the caller, allowing the shared workflow to handle Terraform drift detection, GitHub issues, and Slack notifications consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants