runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.52k stars 1.02k forks source link

Formatting issues with policy check results #4623

Open tom-mckay opened 1 month ago

tom-mckay commented 1 month ago

Community Note


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 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...
nitrocode commented 3 weeks ago

cc @X-Guardian

albertorm95 commented 3 weeks ago

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

joelp172 commented 1 day ago

+1 for this. I also get this issue