abcxyz / abcxyz/guardian

Have guardian add comment to PR when apply fails due to plan being more than 7 days old

Open
#416 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
26
Forks
7
Avg merge
1d 1h
Merged PRs (30d)
1

Description

### TL;DR

Have guardian add comment to PR when apply fails due to plan being more than 7 days old. Currently in this scenario the terraform apply fails but there's no notification in the PR that something went wrong

### Detailed design

```markdown

```

### Alternatives considered

```markdown

```

### Additional information

Scenario:

1. PR is created, all checks passed (including guardian)
2. More than 7 days later the PR is reviewed and merged
3. Terraform apply fails to due the plan no longer existing
4. No notification in the PR comment thread
5. Developer at some point notices that there's an issue and has to troubleshoot (maybe seeing that a workflow failed)
6. Developer pushes a noop commit to regenerate the plan and then merges the change.

Desired behavior: Guardian adds a comment to the PR to notify developers that something went wrong (ideally suggesting the source of the issue)

If needed we can provided a PR + Workflow examples in a non-public repo.

Contributor guide

Open the contributing guide

Research direction

Look for the guardian code that handles terraform apply failures, likely in a GitHub Actions workflow or a guardian command. Find where the plan age is checked and the apply fails. Add logic to post a comment to the PR via the GitHub API when this condition triggers. Check existing PR comment functions and error handling patterns. Test by simulating an old plan failure in a development environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, terraform
Domain
ci-cd, devops, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.