Skip to content

SAP-2475: Add EC2 IAM drift guard and stage HTTP placeholder support - #66

Merged
marshyski merged 3 commits into
mainfrom
SAP-2475-Phase-B-Quartzctl-AWS-Deployment-Setup-wire-tofu-stages-and-update-quartz.yaml
Aug 10, 2026
Merged

SAP-2475: Add EC2 IAM drift guard and stage HTTP placeholder support#66
marshyski merged 3 commits into
mainfrom
SAP-2475-Phase-B-Quartzctl-AWS-Deployment-Setup-wire-tofu-stages-and-update-quartz.yaml

Conversation

@padili-metrostar

Copy link
Copy Markdown
Contributor

Pull Request

🔍 Description

Implements SAP-2475 reliability improvements for Quartz AWS/tofu workflows.

  • Added early EC2 IAM state-drift/orphan detection before apply (role/profile present in AWS but absent in state)
  • Added clear remediation guidance in error output for import vs cleanup paths
  • Added helper APIs for IAM role/profile existence checks in provider layer
  • Added stage HTTP check placeholder support and test coverage
  • Added/updated unit tests for drift error behavior and provider/stage logic

Related Jira: https://metrostarsystems.atlassian.net/browse/SAP-2475

📋 Checklist

  • I have tested this PR locally.
  • I have added/updated unit tests where applicable.
  • This PR adheres to the conventional commits standard.
  • I have run golangci-lint run and resolved all issues.
  • I have verified this PR does not expose any secrets or sensitive information.
  • I have updated documentation (README, CLI help text, etc.) if needed.

📦 Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Test or CI/CD improvement
  • Refactor or code cleanup
  • Other (describe):

🧪 How to Test

  1. Run go test ./...
  2. Run golangci-lint run
  3. Run mise run test-ci

📸 Screenshots / Output

  • go test ./... passes
  • golangci-lint run passes
  • mise run test-ci passes

🧑‍⚖️ Reviewer Notes

Please focus review on the new state-drift guard path in internal/cmd/tofu.go and provider IAM existence probes.

@padili-metrostar
padili-metrostar marked this pull request as draft August 6, 2026 18:20
@padili-metrostar padili-metrostar self-assigned this Aug 6, 2026
@padili-metrostar
padili-metrostar marked this pull request as ready for review August 6, 2026 20:33
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.52475% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.60%. Comparing base (58b6f29) to head (e7a5abf).

Files with missing lines Patch % Lines
internal/cmd/tofu.go 50.84% 28 Missing and 1 partial ⚠️
internal/provider/aws.go 0.00% 24 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
- Coverage   57.72%   57.60%   -0.12%     
==========================================
  Files          68       68              
  Lines        7422     7519      +97     
==========================================
+ Hits         4284     4331      +47     
- Misses       2688     2738      +50     
  Partials      450      450              
Files with missing lines Coverage Δ
internal/provider/aws_sdk.go 100.00% <ø> (ø)
internal/stages/http_check.go 87.61% <100.00%> (+1.75%) ⬆️
internal/provider/aws.go 70.70% <0.00%> (-12.76%) ⬇️
internal/cmd/tofu.go 52.95% <50.84%> (-0.20%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marshyski marshyski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marshyski
marshyski merged commit 807592e into main Aug 10, 2026
8 of 11 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@padili-metrostar
padili-metrostar deleted the SAP-2475-Phase-B-Quartzctl-AWS-Deployment-Setup-wire-tofu-stages-and-update-quartz.yaml branch August 10, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants