Skip to content

Commit

Permalink
docs: Add description of @infracost snooze command (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdmgolub authored Jan 21, 2025
1 parent ce4c647 commit f6fd861
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
38 changes: 27 additions & 11 deletions docs/integrations/github_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,44 @@ The GitHub App automatically reflects the following changes in Infracost:

From the Org Settings > Integrations > GitHub App page, you can disable pull request comments so cost estimates, guardrails and tagging policies are only shown in Infracost Cloud. This enables you to test these features without impacting engineering workflows.

### Dismissing policy issues
### Dismiss or snooze blocking policy issues

Infracost FinOps and Tagging issues can be dismissed directly from the GitHub pull request UI, even if the policy is set to block pull requests. This allows engineers to ship critical changes without having to fix all issues. During non-emergency circumstances, we recommend engineers fix the issues they can, and dismiss any that they cannot fix.
Infracost FinOps and Tagging issues can be dismissed or snoozed directly from the GitHub pull request UI, even if the policy is set to block pull requests. This allows engineers to ship critical changes without having to fix all issues. During non-emergency circumstances, we recommend engineers fix the issues they can, and dismiss/snooze any that they cannot fix.

GitHub pull request comments contain information on how to dismiss issues.
GitHub pull request comments contain information on how to dismiss/snooze the issues.

<img src={useBaseUrl("img/github/desc.png")} alt="pr comment" />
<img src={useBaseUrl("img/github/desc.png")} alt="pr comment" className="img-rounded" />

Engineers can add a pull request comment `@infracost help` to get more information on how to dismiss the issues.
Engineers can add a pull request comment `@infracost help` to get more information on how to dismiss/snooze the issues.

<img src={useBaseUrl("img/github/help.png")} alt="help" />
<img src={useBaseUrl("img/github/help.png")} alt="help" className="img-rounded" />

#### Dismiss

The dismiss command makes Infracost ignore the detected blocking issues going forward. If you simply need to unblock a PR merge and intend to address the issue later, consider using the snooze command.

Dismissing a policy issue works as follows:
- The engineer adds a comment to the pull request to dismiss the issue using the command `@infracost dismiss <optional reason>`.
- The Infracost GitHub App will then read the comment and react to the comment to let the engineer know the issue is queued for dismissal.
<img src={useBaseUrl("img/github/reaction.png")} alt="reaction" />
- Infracost will then run another status check on the pull request once the issue is dismissed. This will update the Infracost comment to remove all the issues.
<img src={useBaseUrl("img/github/passing.png")} alt="passing" />
<img src={useBaseUrl("img/github/reaction.png")} alt="reaction" className="img-rounded" />
- Infracost will then run another status check on the pull request once the issue is dismissed. This will update the Infracost comment to remove all the blocking issues.
<img src={useBaseUrl("img/github/passing.png")} alt="passing" className="img-rounded" />
- Any blocking status checks will be updated to succeeded, enabling the engineer to merge the pull request.
<img src={useBaseUrl("img/github/checks.png")} alt="checks" />
<img src={useBaseUrl("img/github/checks.png")} alt="checks" className="img-rounded" />
- Dismissed issues are shown in Infracost Cloud in the policies pages. You can filter by dismissed issues to see all the issues your engineers have dismissed and their reasons.
<img src={useBaseUrl("img/github/dismissed-table.png")} alt="dismissed table" />
<img src={useBaseUrl("img/github/dismissed-table.png")} alt="dismissed table" className="img-rounded" />

#### Snooze

The snooze command allows you to unblock the merging of a PR when Infracost detects any blocking policy issues. This is useful for urgent tasks, such as bug fixes.

Snoozing a blocked PR works as follows:
- The engineer adds a comment to the pull request to snooze the issue using the command `@infracost snooze <optional reason>`.
<img src={useBaseUrl("img/github/snooze.png")} alt="snooze" className="img-rounded" />
- The Infracost GitHub App will then read the comment and react to the comment to let the engineer know the issue is queued for snoozing.
- Any blocking Infracost status checks will be updated to succeeded, enabling the engineer to merge the pull request.
<img src={useBaseUrl("img/github/snooze-checks.png")} alt="checks" className="img-rounded" />
- The next opened PR that touches the related code will display a comment with the snoozed issues and block merging, just like the original.

### GitHub Actions to App migration

Expand Down
3 changes: 3 additions & 0 deletions src/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ blockquote {
box-shadow: 5px 5px 2px 0 var(--nu50);
}

img.img-rounded {
border-radius: var(--ifm-code-border-radius);
}

@media (min-width: 769px) {
.ci-grid {
Expand Down
Binary file modified static/img/github/desc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/github/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/github/snooze-checks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/github/snooze.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f6fd861

Please sign in to comment.