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

ci(cspell-bot): group words by file to reduce log size #38575

Merged
merged 6 commits into from
Mar 14, 2025

Conversation

OnkarRuikar
Copy link
Contributor

Problem

In the weekly spelling check bot, the current scheme of reporting each word on a separate line with corresponding file is generating massive logs. If someone adds a different version of lorem ipsum then it breaks the GitHub workflow with an error

GraphQL: Body is too long (maximum is 65536 characters) (createIssue)

https://github.com/mdn/content/actions/runs/13753835872/job/38458187038#step:5:876

1

Solution

Instead of having file-word combinations, have file-words combinations. That is, list a file path followed by the list of unknown words in it. It will reduce files x words lines to only files.

For example, the equivalent outcome of the failed workflow would be:

A custom CSpell reporter

@OnkarRuikar OnkarRuikar requested review from mdn-bot and a team as code owners March 11, 2025 09:56
@github-actions github-actions bot added system [PR only] Infrastructure and configuration for the project size/s [PR only] 6-50 LoC changed labels Mar 11, 2025
@OnkarRuikar OnkarRuikar requested a review from a team as a code owner March 12, 2025 05:46
@OnkarRuikar OnkarRuikar requested review from dipikabh and removed request for a team March 12, 2025 05:46
@github-actions github-actions bot added Content:Meta Content in the meta docs size/l [PR only] 501-1000 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Mar 12, 2025
Copy link
Contributor

github-actions bot commented Mar 12, 2025

Preview URLs

External URLs (1)

URL: /en-US/docs/MDN/Writing_guidelines/Writing_style_guide
Title: Writing style guide

(comment last updated: 2025-03-14 12:37:45)

@OnkarRuikar
Copy link
Contributor Author

Made some changes based on the review comments so far:

  1. Moved all the linters to dev dependencies.
  2. Added CSpell to the dev dependencies. We don't have to use npx anymore.
  3. Added three new commands to the package.json:
    • lint:typos (plain cspell command)
    • lint:typos-group-by-file (need this in the GitHub workflow)
    • lint:typos-words-only (I need this to fix cspell issues quickly)

@OnkarRuikar OnkarRuikar requested a review from bsmth March 12, 2025 05:58
@OnkarRuikar
Copy link
Contributor Author

OnkarRuikar commented Mar 12, 2025

Successful run of the changes: https://github.com/OnkarRuikar/content/actions/runs/13805014898/job/38614067158#step:6:62

This is how the new issue looks: OnkarRuikar#46


```bash
npx cspell --no-progress --gitignore --config .vscode/cspell.json "**/*.md"
yarn lint:typos
```
Copy link
Member

Choose a reason for hiding this comment

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

Regarding the root cause of this problem, as far as I can see, anything generated from here conforms with our existing cSpell lorem-ipsum dictionary: https://www.lipsum.com/feed/html

A good follow-up to this PR is:

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I held back on submitting typo fixes so that when this PR merges, you'll manually trigger the workflow and we get to test these changes live.

Update the container scroll-state queries page with passing Lorem text

Agree. There is no point in having other versions of filler texts. We can also recommend the lorem-ipsum plugin in our https://github.com/mdn/content/blob/main/.vscode/extensions.json file. I will do the writing guidelines after these issues get resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

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

Thanks, Onkar! LGTM with a comment for when we're going to fix the typos afterwards

@OnkarRuikar OnkarRuikar requested a review from bsmth March 13, 2025 02:55
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Mar 13, 2025
@dipikabh dipikabh removed their request for review March 13, 2025 17:59
@mdn mdn deleted a comment from github-actions bot Mar 14, 2025
@bsmth
Copy link
Member

bsmth commented Mar 14, 2025

I think we're good to merge now, thanks 👍🏻

@bsmth bsmth merged commit 2865d3c into mdn:main Mar 14, 2025
16 of 17 checks passed
@OnkarRuikar OnkarRuikar deleted the ci_cspell_bot branch March 15, 2025 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Meta Content in the meta docs size/l [PR only] 501-1000 LoC changed system [PR only] Infrastructure and configuration for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants