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

Improper markdown formatting with multi-comment plan outputs #1097

Open
dmattia opened this issue Jun 26, 2020 · 4 comments
Open

Improper markdown formatting with multi-comment plan outputs #1097

dmattia opened this issue Jun 26, 2020 · 4 comments
Labels
bug Something isn't working help wanted Good feature for contributors

Comments

@dmattia
Copy link
Contributor

dmattia commented Jun 26, 2020

We are noticing some cases where our plans appear to skip over many plans because of invalid markdown.

As an example, we recently ran atlantis over a PR that affected ~150 modules. Here is the end of one comment:

### 85. dir: `infra/datadog/agent_container/env-prod` workspace: `default`
```diff
Validated that dmattia is an admin


An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

Plan: 0 to add, 0 to change, 0 to destroy.

  • :arrow_f
</details>
<br>

**Warning**: Output length greater than max comment size. Continued in next comment.

And then in the next comment it continues with:

Continued from previous comment.
<details><summary>Show Output</summary>

```diff
orward: To **apply** this plan, comment:
    * `atlantis apply -d infra/datadog/agent_container/env-prod`
* :put_litter_in_its_place: To **delete** this plan click [here](https://atlantis.ci.transcend.io/lock?id=transcend-io%252Fmain%252Finfra%252Fdatadog%252Fagent_container%252Fenv-prod%252Fdefault)
* :repeat: To **plan** this project again, comment:
    * `atlantis plan -d infra/datadog/agent_container/env-prod`

---
### 86. dir: `infra/datadog/agent_container/env-prod/secrets` workspace: `default`
```diff
Validated that dmattia is an admin


An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

Plan: 0 to add, 0 to change, 0 to destroy.

This causes the plan to appear to jump forward and skip quite a number of outputs:

Screen Shot 2020-06-26 at 4 17 06 PM

If I go to "edit" the comment in between the jump, I can see all of the missing job outputs

@lkysow lkysow added the bug Something isn't working label Jun 26, 2020
@lkysow
Copy link
Member

lkysow commented Jun 26, 2020

So this is as a result of our logic for splitting comments being naive and assuming that we're splitting in the middle of a plan/apply output. In your case we ended up splitting in the middle of the commands output and so when we apply

```diff

it borks all the markdown.

I think the true fix here is for the markdown renderer to return a struct that describes the output better rather than just a string. Then the splitting functionality can be smarter about where it splits long comments.

@angeloskaltsikis
Copy link

It seems we are facing the current issue as well.
I really like the elegant solution that @lkysow is suggesting here and i think this will straight solve the #1021 as well.
What do you think?
I can also spend some time on this matter to make those problems go away 😄

@jamengual
Copy link
Contributor

is this still an issue with v0.19.8?

@jamengual jamengual added the waiting-on-response Waiting for a response from the user label Aug 26, 2022
@dmattia
Copy link
Contributor Author

dmattia commented Aug 29, 2022

It appears to be

@jamengual jamengual added help wanted Good feature for contributors and removed waiting-on-response Waiting for a response from the user labels Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Good feature for contributors
Projects
None yet
Development

No branches or pull requests

4 participants