Repository navigation
fix(docs): parse visible HTML in README migration counts - #16089
Merged
diegosouzapw merged 1 commit intoOct 10, 2026
Merged
Conversation
Contributor
CI Coverage Report
Coverage artifact was not available for this run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and change
The strict README migration-count check can misread a quoted
>and digits in an HTML attribute as visible numbers, and does not decode HTML character references. Both cases can reject a correct migration count. The regex-based tag removal also raised CodeQL's incomplete multi-character sanitization finding in #15982.Parse the selected cell fragment with the existing direct
parse5dependency and collect text nodes. Attributes and comments no longer contribute to counts; entities are decoded before the existing digit normalization. The database-row selection, strict drift gate and missing/duplicated/ambiguous checks remain intact. This parser only reads local documentation and does not render or execute HTML.Refs #14574. Follow-up to #15982, which was merged externally while this correction was being validated. The original merged branch was not pushed again. This PR contains only the parser change and its regression tests.
Validation
Base:
f90e64a1c9921b91f40c63e039fb4521f28fa8bconrelease/v3.8.52; the original squash merge is an ancestor. Both relevant baseline files are byte-identical to the original PR head.Reinstalled exact lockfile dependencies with normal
npm ciand hooks enabled. Repeated local core/dashboard TypeScript, docs-all, file-size, cyclomatic and cognitive complexity, discovery, changelog integrity, formatting and post-commit test-masking: all passed. The 88-test sibling run above also passed with this exact toolchain.Full ESLint 10.12.0 selection: 12,631 files, zero errors/warnings/fatal results. Four disjoint groups used the unchanged rules and suppressions, all exited 0, and the combined reports cover the canonical file selector with no omissions or duplicates. Source/config/lock hashes and the final file enumeration stayed identical.
quality:gatethen passed using its supported precomputed ESLint report input: 58 metrics, 3 improvements. Cyclomatic count 3,017 is within baseline 3,218; cognitive count 1,381 is within 1,437. No baseline was relaxed.Tests added or updated
tests/unit/readme-migration-count-14574.test.ts: quoted attribute delimiters/digits, decimal/hex HTML character references, and stale visible text with correct hidden counts. All existing assertions are preserved.Coverage notes
Tests exercise the public
buildReadmeMigrationChecksvalidator and the strict tally integration. No dependency version, workflow, baseline or gate policy changes. Fresh CodeQL and CI results still govern the published head; local tests are not a claim that the scanner or the entire release is green.