feat: show policy approvers in PR comments#6353
Draft
edbighead wants to merge 1 commit into
Draft
Conversation
cd890b3 to
f9588ab
Compare
When a conftest policy check fails, include the configured owner teams and users in the Policy Approval Status section of the PR comment so reviewers know who to contact for approval. - Add OwnerUsers/OwnerTeams fields to PolicySetResult - Add PolicyOwners.MergedWith() to valid package for shared dedup logic - Populate owner fields in conftest_client.go and project_command_runner.go - Render approver info in policy_check_results_wrapped/unwrapped.tmpl only when owners are configured (no output change otherwise) Signed-off-by: Ed Laur <eduard.laur@wolt.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f9588ab to
ddefb70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a conftest policy check fails, Atlantis posts a GitHub comment with a "Policy Approval Status" section but doesn't indicate who is allowed to approve — forcing contributors to hunt through Atlantis config to find the right team or person to contact.
This PR surfaces the configured owner teams and users directly in the PR comment for each failing policy set:
OwnerUsers []stringandOwnerTeams []stringtoPolicySetResultconftest_client.goandproject_command_runner.goby merging global (PolicySets.Owners) and per-set owners with case-insensitive deduplicationExample output (when owners are configured):
infra-teamusers:alice