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

GitHub Markdown syntax is not respecting YAML output - specifically lists #2241

Closed
snorlaX-sleeps opened this issue May 3, 2022 · 3 comments · Fixed by #2337
Closed

GitHub Markdown syntax is not respecting YAML output - specifically lists #2241

snorlaX-sleeps opened this issue May 3, 2022 · 3 comments · Fixed by #2337
Labels
bug Something isn't working

Comments

@snorlaX-sleeps
Copy link
Contributor

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

When running a plan which contains YAML output, the GitHub markdown syntax is incorrectly highlighting YAML lists as Terraform changes.

This causes large red rows to appear in the middle of YAML docs and not actually highlighting a change.
This is most noticeable with the helm_release resource, as it displays both the old and new values in the plan output, where both sets show the same incorrect "changes".

I believe this is due to the fact that YAML uses - to mark a list item, which is the character Terraform uses in plans to indicate an item to be removed

Reproduction Steps

  • Have a YAML based object in your plan, e.g a Helm release with a local values file
  • Have the Atlantis GitHub markdown syntax enabled: ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT

Environment details

  • atlantis:latest which has the workspacing fix (not actually a release I believe)
  • K8s v1.21
  • Using GitHub

Atlantis Flags:

  • ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT

Additional Context

Example section of the output with incorrect formatting

image

@snorlaX-sleeps snorlaX-sleeps added the bug Something isn't working label May 3, 2022
@ax-nmac
Copy link

ax-nmac commented May 16, 2022

We are hitting the same issue and its causing confusion for our users. With the adoption of Kubernetes in alot of places we will be seeing more and more yaml in our plans, as I'm sure many others will as well.

@dupuy26
Copy link
Contributor

dupuy26 commented Jun 24, 2022

The problem is not limited to YAML (although it is most common there). I have also seen a case where some Base64 encoded data was in the output, and a + at the beginning of a line (without even whitespace in front of it!) triggered the diff markdown to flag it as an addition...

I feel like there must be a regex somewhere that needs an ^ ? to allow at most one space before the + or - for it to be considered a diff marker...and checking for at least one space after the + or - would be even better.

Screen Shot 2022-06-24 at 13 19 00

@pauloconnor
Copy link
Contributor

This is the regex, but the problem is that Terraform output doesn't have the + and - at the start of the line - it's indented

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

Successfully merging a pull request may close this issue.

4 participants