Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting issues with policy check results #4623

Closed
tom-mckay opened this issue May 31, 2024 · 7 comments
Closed

Formatting issues with policy check results #4623

tom-mckay opened this issue May 31, 2024 · 7 comments
Labels
bug Something isn't working regression Bug introduced in a new version

Comments

@tom-mckay
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

I have noticed intermittent issues rendering the markdown Atlantis outputs to GitHub when a policy check failure occurs ever since upgrading from v0.27.3 to v0.28.1. I suspect this could be related to #4254 and the formatting changes it made.

I don't fully understand why yet, but it seems like adding an extra blank line between </details> and the "Policy Approval Status:" header here corrects the issue.

Screenshot of issue with details blurred for privacy:
Screenshot 2024-05-31 at 10 40 28 AM

Manually editing the post and adding the blank line as described above fixes the issue:
Screenshot 2024-05-31 at 10 43 17 AM

Screenshot 2024-05-31 at 10 43 44 AM

Reproduction Steps

Unknown at this point. The problem does not appear on every PR with failing policies.

Environment details

  • Atlantis version: v0.28.1
  • Deployment method: Helm on EKS

Atlantis server-side config file:

    repos:
    - id: /.*/
      workflow: workflow
      apply_requirements: [approved, mergeable]
      policy_check: true

    policies:
      owners:
        teams: ["...snip company specific team name..."]
      policy_sets:
        - name: policies
          path: /policies
          source: local

    metrics:
      prometheus:
        endpoint: "/metrics"

    workflows:
      workflow:
        plan:
          steps:
          - run: '...snip company specific terraform init wrapper...'
          - run: '...snip company specific terraform plan wrapper...'
        apply:
          steps:
          - run: '...snip company specific terraform apply wrapper...'
          - run: '...snip company specific logging command...'

Repo atlantis.yaml file:

version: 3
automerge: true
projects:
- dir: path/to/terraform/project
...snip more like above...
@tom-mckay tom-mckay added the bug Something isn't working label May 31, 2024
@nitrocode
Copy link
Member

cc @X-Guardian

@albertorm95
Copy link
Contributor

I can confirm that:

but it seems like adding an extra blank line between and the "Policy Approval Status:" header here corrects the issue.

fixes the issue

@nitrocode nitrocode added the regression Bug introduced in a new version label Jun 13, 2024
@joelp172
Copy link

joelp172 commented Jul 4, 2024

+1 for this. I also get this issue

@krzysztof-magosa
Copy link

Formatting is still broken, checked on 0.28.3.

@driab-procore
Copy link

Hey all. I see fix was already merged into main branch. When can we have a fixed atlantis version? This bug is critical for many workloads.

@tom-mckay
Copy link
Author

We are likely going to look into the following potential workarounds:

  • Using the ATLANTIS_MARKDOWN_TEMPLATE_OVERRIDES_DIR env var. We could potentially use this to override the bad template and resolve the problem without waiting on a fix from Atlantis.
  • Setting the ATLANTIS_DISABLE_MARKDOWN_FOLDING=true environment variable. This env var will cause a different markdown template to be used which does not use the <details> block and could workaround the problem. The downside is a reduced user experience.

@driab-procore
Copy link

driab-procore commented Aug 9, 2024

There is another related bug with formatting, an extra line should be added here

{{- if ne .PreConftestOutput "" }}
```diff
and here Otherwise, you will have corrupted output (as per picture below)

Screenshot 2024-08-09 at 15 46 51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Bug introduced in a new version
Projects
None yet
Development

No branches or pull requests

7 participants