Skip to content

[code-infra] Use vale rules from code-infra package#48173

Merged
brijeshb42 merged 3 commits into
mui:masterfrom
brijeshb42:vale-refactor
Apr 29, 2026
Merged

[code-infra] Use vale rules from code-infra package#48173
brijeshb42 merged 3 commits into
mui:masterfrom
brijeshb42:vale-refactor

Conversation

@brijeshb42
Copy link
Copy Markdown
Contributor

@brijeshb42 brijeshb42 commented Apr 1, 2026

Implements changes in mui/mui-public#1276

@brijeshb42 brijeshb42 added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Apr 1, 2026
@mui-bot
Copy link
Copy Markdown

mui-bot commented Apr 1, 2026

Netlify deploy preview

https://deploy-preview-48173--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 2bc3d61

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 2, 2026
@brijeshb42 brijeshb42 force-pushed the vale-refactor branch 2 times, most recently from f840749 to 7028099 Compare April 2, 2026 05:07
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 2, 2026
@brijeshb42 brijeshb42 force-pushed the vale-refactor branch 9 times, most recently from b9b8ffa to b011ff5 Compare April 2, 2026 05:59
Comment thread AGENTS.md Outdated
```

### Testing
### Testing JSDOM
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was just to check the error reporting. But since the workflow change is in this PR, it only gets read-only token. So vale cant add annotations to the PR.
Once this PR gets merged, annotation will get added inline.

Comment thread .github/workflows/ci.yml Outdated
if: ${{ matrix.os == 'ubuntu-latest' }}
id: vale-inputs
run: |
echo "files=$(git ls-files '*.md' '*.mdx' | paste -sd ',' -)" >> $GITHUB_OUTPUT
Copy link
Copy Markdown
Contributor Author

@brijeshb42 brijeshb42 Apr 2, 2026

Choose a reason for hiding this comment

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

If we don't do this, vale traverses the whole directory tree, including node_modules and breaks when it encounters symlinks. Even its glob flag doesnt work.
We could also update this to only consider the changed md files in the PR and not all md files.

run: |
  if [ "${{ github.event_name }}" = "pull_request" ]; then
    FILES=$(git diff --name-only --diff-filter=ACMR ${{ github.event.pull_request.base.sha }}..HEAD -- '*.md' '*.mdx' | paste -sd ',' -)
  else
    FILES=$(git ls-files '*.md' '*.mdx' | paste -sd ',' -)
  fi
  echo "files=$FILES" >> $GITHUB_OUTPUT
  echo "version=$(node -p 'require("./package.json").mui.valeVersion')" >> $GITHUB_OUTPUT

Comment thread package.json Outdated
"version": "9.0.0-beta.0",
"private": true,
"mui": {
"valeVersion": "3.12.0"
Copy link
Copy Markdown
Contributor Author

@brijeshb42 brijeshb42 Apr 2, 2026

Choose a reason for hiding this comment

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

this will not automatically update through renovate. So we can either keep it as-is (update manually or through custom renovate manager) or add @vvago/vale as a devDepedency back insted of the current pnpm dlx based usage.

@brijeshb42 brijeshb42 requested review from a team, Copilot and oliviertassinari April 2, 2026 06:11
@brijeshb42 brijeshb42 marked this pull request as ready for review April 2, 2026 06:11
Comment thread .github/workflows/ci.yml Outdated
# Required, set by GitHub actions automatically:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
token: ${{secrets.GITHUB_TOKEN}}
version: ${{ steps.vale-inputs.outputs.version }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

without flags, it logs warnings as well. So we can pass flags to filter based just on errors similar to what we do in pnpm valelint - vale --filter='.Level==\"error\"'

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates Vale configuration/rules to consume the shared rules shipped from @mui/internal-code-infra, removing the in-repo docs/mui-vale rules bundle and wiring Vale into the main CI workflow.

Changes:

  • Point Vale’s .vale.ini to use rules from @mui/internal-code-infra instead of docs/mui-vale.zip.
  • Remove the docs/mui-vale rule sources and the dedicated vale-action.yml workflow.
  • Add Vale execution to .github/workflows/ci.yml and centralize the Vale CLI version in package.json.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Adds a central mui.valeVersion and updates valelint; switches @mui/internal-code-infra to a pkg.pr.new URL.
pnpm-lock.yaml Updates lockfile entries to match the @mui/internal-code-infra source change.
.vale.ini Switches Vale package source from docs/mui-vale.zip to @mui/internal-code-infra.
.github/workflows/ci.yml Runs Vale as part of CI (Ubuntu leg) and adjusts job permissions.
.github/workflows/vale-action.yml Removes the standalone Vale workflow.
docs/mui-vale/** (multiple deletions) Removes the previously vendored MUI Vale rules/styles and related config.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +47 to +56
- name: Collect Vale inputs
if: ${{ matrix.os == 'ubuntu-latest' }}
id: vale-inputs
run: |
echo "files=$(git ls-files '*.md' '*.mdx' | paste -sd ',' -)" >> $GITHUB_OUTPUT
echo "version=$(node -p 'require("./package.json").mui.valeVersion')" >> $GITHUB_OUTPUT
- name: Vale
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: vale-cli/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The Vale step is added to ci.yml, but this workflow is configured with on.pull_request.paths-ignore: ['docs/**']. As a result, PRs that only touch docs/markdown won’t run this workflow, so Vale won’t run on the changes it’s meant to validate. Consider keeping Vale in a separate workflow that runs on all PRs (or at least on docs/**), or adjusting the CI/CI Check path filters so Vale still executes for docs-only PRs.

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.24",
"@mui/internal-bundle-size-checker": "1.0.9-canary.70",
"@mui/internal-code-infra": "0.0.4-canary.11",
"@mui/internal-code-infra": "https://pkg.pr.new/mui/mui-public/@mui/internal-code-infra@d11ec04",
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

@mui/internal-code-infra is pinned to a pkg.pr.new preview URL. Those preview artifacts are intended for temporary testing and can become unavailable over time, which would break installs and make builds less reproducible. Please switch this back to a published version/range (e.g. the canary you had before) and only use pkg.pr.new overrides locally or in short-lived test branches.

Suggested change
"@mui/internal-code-infra": "https://pkg.pr.new/mui/mui-public/@mui/internal-code-infra@d11ec04",
"@mui/internal-code-infra": "workspace:^",

Copilot uses AI. Check for mistakes.
@brijeshb42 brijeshb42 force-pushed the vale-refactor branch 3 times, most recently from 1975681 to 72b7ad0 Compare April 2, 2026 07:06
@brijeshb42 brijeshb42 force-pushed the vale-refactor branch 3 times, most recently from c85e313 to 5434e8e Compare April 2, 2026 16:35
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 2, 2026
Comment thread package.json Outdated
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 3, 2026
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 6, 2026
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 29, 2026
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented Apr 29, 2026

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Deploy preview

https://deploy-preview-48173--material-ui.netlify.app/


Check out the code infra dashboard for more information about this PR.

Copy link
Copy Markdown
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

Was there a specific reason to move this from circle to GHA?

@brijeshb42
Copy link
Copy Markdown
Contributor Author

Was there a specific reason to move this from circle to GHA?

Both had it actually. Circle has general linting and github has linting with code annotations through the cake action. If we don't need the annotation, we can just keep the circle ci one.

@Janpot
Copy link
Copy Markdown
Member

Janpot commented Apr 29, 2026

Right, I see. I don't find them particularly useful, but maybe someone on the team?

@brijeshb42
Copy link
Copy Markdown
Contributor Author

We can do a team poll to validate if we need it or not. I am assuming it'll help devex team.

@oliviertassinari
Copy link
Copy Markdown
Member

oliviertassinari commented Apr 29, 2026

Both had it actually. Circle has general linting and github has linting with code annotations

Correct.

I think both are important: It's about the rule that are warning. Rules that are error should break the CI, so easy, only Circle CI, but warnings go silent if they are not shown in the Code diff view as annotations.

@brijeshb42 brijeshb42 enabled auto-merge (squash) April 29, 2026 09:44
@brijeshb42 brijeshb42 merged commit afc6067 into mui:master Apr 29, 2026
22 checks passed
@brijeshb42 brijeshb42 deleted the vale-refactor branch April 29, 2026 09:46
JCQuintas added a commit to JCQuintas/mui-x that referenced this pull request Apr 30, 2026
The previous URL https://github.com/mui/material-ui/raw/HEAD/docs/mui-vale.zip
was removed in mui/material-ui#48173 — vale rules now live in
@mui/internal-code-infra. Match material-ui's own .vale.ini.
JCQuintas added a commit to JCQuintas/mui-x that referenced this pull request Apr 30, 2026
The previous URL https://github.com/mui/material-ui/raw/HEAD/docs/mui-vale.zip
was removed in mui/material-ui#48173 — vale rules now live in
@mui/internal-code-infra. Match material-ui's own .vale.ini.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants