Markdown table formatting is broken in codecov bot PR comment

Please search for similar issues before creating a ticket.
All fields below are required.

Description

Description of the issue

In the codecov bot comment on GitHub PRs, one of the messages (about the Current head) breaks the formatting for the “Flags” Markdown table.

CI/CD URL

Please provide a link to the CI/CD run.

https://github.com/spinalcordtoolbox/spinalcordtoolbox/runs/4859762764?check_suite_focus=true

Codecov Output

Please provide the full output of running the uploader on your CI/CD. This will typically have the Codecov logo as ASCII.

==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (1e8637b5bdc0b03b67fda9d069fd5ea3673027cb709f06bc4bc9d120e0b086ef  codecov)
==> Running version latest
==> Running version v0.1.9
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n  -Q github-action-2.1.0 -Z -f ./cov-cli.xml -F cli-tests -C b76d8a2d1d307f8fc249601c1ed04b40108d3e09
[2022-01-18T21:52:46.745Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.14
[2022-01-18T21:52:46.751Z] ['info'] => Project root located at: /home/runner/work/spinalcordtoolbox/spinalcordtoolbox
[2022-01-18T21:52:46.753Z] ['info'] -> No token specified or token is empty
[2022-01-18T21:52:46.770Z] ['info'] Searching for coverage files...
[2022-01-18T21:52:47.282Z] ['info'] => Found 1 possible coverage files:
  ./cov-cli.xml
[2022-01-18T21:52:47.282Z] ['info'] Processing ./cov-cli.xml...
[2022-01-18T21:52:47.296Z] ['info'] Detected GitHub Actions as the CI provider.
[2022-01-18T21:52:47.297Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.1.0-uploader-0.1.14&token=*******&branch=jn%2F3654-add-codecov-threshold&build=1714988813&build_url=https%3A%2F%2Fgithub.com%2Fspinalcordtoolbox%2Fspinalcordtoolbox%2Factions%2Fruns%2F1714988813&commit=b76d8a2d1d307f8fc249601c1ed04b40108d3e09&job=Tests&pr=3655&service=github-actions&slug=spinalcordtoolbox%2Fspinalcordtoolbox&name=&tag=&flags=cli-tests&parent=
[2022-01-18T21:52:47.774Z] ['info'] Uploading...
[2022-01-18T21:52:47.999Z] ['info'] {"status":"success","resultURL":"https://codecov.io/github/spinalcordtoolbox/spinalcordtoolbox/commit/b76d8a2d1d307f8fc249601c1ed04b40108d3e09"}

==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (1e8637b5bdc0b03b67fda9d069fd5ea3673027cb709f06bc4bc9d120e0b086ef  codecov)
==> Running version latest
==> Running version v0.1.9
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n  -Q github-action-2.1.0 -Z -f ./cov-api.xml -F api-tests -C b76d8a2d1d307f8fc249601c1ed04b40108d3e09
[2022-01-18T21:52:49.368Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.14
[2022-01-18T21:52:49.375Z] ['info'] => Project root located at: /home/runner/work/spinalcordtoolbox/spinalcordtoolbox
[2022-01-18T21:52:49.379Z] ['info'] -> No token specified or token is empty
[2022-01-18T21:52:49.384Z] ['info'] Searching for coverage files...
[2022-01-18T21:52:49.893Z] ['info'] => Found 1 possible coverage files:
  ./cov-api.xml
[2022-01-18T21:52:49.893Z] ['info'] Processing ./cov-api.xml...
[2022-01-18T21:52:49.907Z] ['info'] Detected GitHub Actions as the CI provider.
[2022-01-18T21:52:49.908Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.1.0-uploader-0.1.14&token=*******&branch=jn%2F3654-add-codecov-threshold&build=1714988813&build_url=https%3A%2F%2Fgithub.com%2Fspinalcordtoolbox%2Fspinalcordtoolbox%2Factions%2Fruns%2F1714988813&commit=b76d8a2d1d307f8fc249601c1ed04b40108d3e09&job=Tests&pr=3655&service=github-actions&slug=spinalcordtoolbox%2Fspinalcordtoolbox&name=&tag=&flags=api-tests&parent=
[2022-01-18T21:52:50.329Z] ['info'] Uploading...
[2022-01-18T21:52:50.555Z] ['info'] {"status":"success","resultURL":"https://codecov.io/github/spinalcordtoolbox/spinalcordtoolbox/commit/b76d8a2d1d307f8fc249601c1ed04b40108d3e09"}

Expected Results

Please provide what you expect to have happened (e.g. a file that has missing coverage on a particular line).

We expect the table to render correctly, as shown below:

[Screenshot removed because “new users can only post one embedded media item in new posts”.]

The exact markdown for the comment in this screenshot is provided below:

Codecov Report

Merging #3655 (bbc4b1d) into master (2733ca2) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Flag Coverage Δ
api-tests 24.18% <0.00%> (-0.01%) :arrow_down:
cli-tests 56.65% <0.00%> (-0.02%) :arrow_down:

Flags with carried forward coverage won’t be shown. Click here to find out more.

Impacted Files Coverage Δ
spinalcordtoolbox/reports/qc.py 59.95% <0.00%> (-0.38%) :arrow_down:

Actual Results

Please provide what actually happened.

Instead, the message breaks the markdown immediately below it:

The exact markdown for the comment in this screenshot is provided below:

Codecov Report

Merging #3655 (b76d8a2) into master (2733ca2) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

:exclamation: Current head b76d8a2 differs from pull request most recent head bbc4b1d. Consider uploading reports for the commit bbc4b1d to get more accurate results
| Flag | Coverage Δ | |
|—|—|—|
| api-tests | 24.17% <0.00%> (-0.02%) | :arrow_down: |
| cli-tests | 56.65% <0.00%> (-0.02%) | :arrow_down: |

Flags with carried forward coverage won’t be shown. Click here to find out more.

Impacted Files Coverage Δ
spinalcordtoolbox/reports/qc.py 59.95% <0.00%> (-0.38%) :arrow_down:

Additional Information

Any additional information, configuration, or data that might be necessary to reproduce the issue.

We are using the following codecov.yml configuration:

comment:
  layout: "flags, files"

@joshuacwnewton thanks for letting us know, I believe this has been resolved now. I check this PR and the comment looks right. Let me know if I’m missing something.

Hi @tom,

Sorry, the links I shared are a bit misleading.

The issue pops up only when the

:exclamation: Current head b76d8a2 differs from pull request most recent head bbc4b1d. Consider uploading reports for the commit bbc4b1d to get more accurate results

message occurs. But, if the PR then later updates in a way that would remove that message, the formatting issue goes away as well.

It’s hard to find a PR to demonstrate this because if I link it now, it may disappear in the future. But, anecdotally it has cropped up multiple times since. The best I can do is a screenshot, heh.

@joshuacwnewton still having some trouble reproducing, I copy+pasted the <detail> section from the original post here and was able to see everything just fine here.

I also posted up an empty commit that triggered CI to get the Current head ... differs from pull request message, and the table still came out ok. What browser are you using?

I think you may have copied and pasted the comment from the “Expected Results”, rather than the “Actual Results” <details> tag.

(Sorry, my original post was a bit long, and it’s a bit hard to parse, aha.)


The formatting issue, I think, is just because there’s a missing newline between the warning:

:exclamation: Current head b76d8a2 differs from pull request most recent head bbc4b1d. Consider uploading reports for the commit bbc4b1d to get more accurate results

And the start of the markdown table:

| Flag | Coverage Δ | |
|—|—|—|
| api-tests | 24.17% <0.00%> (-0.02%) | :arrow_down: |
| cli-tests | 56.65% <0.00%> (-0.02%) | :arrow_down: |

@joshuacwnewton ahhhh got it. I pushed a change for this, can you let me if this works for you now?

Thank you for pushing a fix! I haven’t seen the message since, but it’s a tricky thing to pin down given that it comes and goes.

I’ll mark this topic as solved for now, but I’ll follow up if I happen to see it again. :>

1 Like