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

fix(ci): improve logging in the reviewdog workflow #37292

Merged
merged 3 commits into from
Dec 28, 2024

Conversation

OnkarRuikar
Copy link
Contributor

@OnkarRuikar OnkarRuikar commented Dec 20, 2024

Summary

At the moment, it is hard to figure out what went wrong when the reviewdog workflow fails to post comments on a PR.

Solution

When the workflow fails, dump the prettier—-check logs. Also, provide the Prettier playground link so driveby GitHub online contributors can format files without setting up a local dev environment.

Note: The PR also adds words used in workflows to the cSpell ignore list.

Testing

The code has been tested in:

The new logs look like as follows:

Please fix all the linting issues mentioned in the following logs and in the PR review comments.

🪵 Logs from markdownlint:
yarn run v1.22.22
$ /home/runner/work/content/content/node_modules/.bin/markdownlint-cli2 --fix files/en-us/web/html/element/summary/index.md
markdownlint-cli2 v0.16.0 (markdownlint v0.36.1)
Finding: files/en-us/web/html/element/summary/index.md !node_modules !.git !.github !tests
Linting: 1 file(s)
Summary: 1 error(s)
files/en-us/web/html/element/summary/index.md:30 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h4; Actual: h5]
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

🪵 Logs from front-matter linter:
1 0

error: Error: files/en-us/web/html/element/summary/index.md
Front matter boolean schema is false
'page-type' property must be equal to one of the allowed values:
guide, landing-page, html-attribute, html-attribute-value, html-element

🪵 Logs from Prettier formatter:
yarn run v1.22.22
$ /home/runner/work/content/content/node_modules/.bin/prettier --check files/en-us/web/html/element/summary/index.md
Checking formatting...
[warn] files/en-us/web/html/element/summary/index.md
[warn] Code style issues found in the above file. Run Prettier with --write to fix.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

You can use Prettier playground to format the files online: https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBiABABwIYGd7oIwCWATnOgGbEA2FAFnOSADQgSYnS7KjamkIAdwAK-BDxTYaQ7AE8ebAEalsYANZwYAZWwBbOABliUOMkrTccZao1btOMCYDmyGKQCu1kFb3E3nt5wAB6YTMQGsNIAKkxQ-MRwkhY0Vmy4LnQAih4Q8OaW3gBWuMHamXA5eWZIKWkgAI6[58](https://github.com/OnkarRuikar/content/actions/runs/12428086076/job/34699041382?pr=43#step:12:59)CKCmJIgeAC0pnAAJv2sIO7YtC4AwhB6etjInTQ0QxlQznQAgjDuxEoeLUzGpgWp3vQwejQA6vTE8LiOcNoSN8QAbjdyc2C4iiAvXgCSUAGsG0YFIxE4ayB2hgcjoR3qmEEVguqkwcyRSSYLzMbBMVlIMFa2GcMwR3hwpAJcxmpHUfWEUCGSJMMAuxD6MHoyAAHAAGNjkJpkODE0mzWqFNgwbBKdmc7lIABMbA8VmisuSUpAcD0Sn6Az6hmwKw8JLgADEIKQZpsXHNsLsICAAL4uoA

Error: Process completed with exit code 1.

@OnkarRuikar OnkarRuikar requested review from a team as code owners December 20, 2024 08:51
@OnkarRuikar OnkarRuikar requested review from pepelsbey and removed request for a team December 20, 2024 08:51
@github-actions github-actions bot added system [PR only] Infrastructure and configuration for the project size/s [PR only] 6-50 LoC changed labels Dec 20, 2024
@pepelsbey pepelsbey removed their request for review December 21, 2024 11:10
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try this. Thanks!

@Josh-Cena Josh-Cena merged commit 52131aa into mdn:main Dec 28, 2024
8 of 9 checks passed
@OnkarRuikar OnkarRuikar deleted the ci_reviewdog branch December 28, 2024 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/s [PR only] 6-50 LoC changed system [PR only] Infrastructure and configuration for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants