Skip to content

fix(docs): parse visible HTML in README migration counts - #16089

Merged
diegosouzapw merged 1 commit into
release/v3.8.52from
fix/readme-html-migration-count-1009
Oct 10, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.52from
fix/readme-html-migration-count-1009

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

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 parse5 dependency 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: f90e64a1c9921b91f40c63e039fb4521f28fa8bc on release/v3.8.52; the original squash merge is an ancestor. Both relevant baseline files are byte-identical to the original PR head.

  • Against this base, the new regressions fail before the parser change: 12 PASS / 2 FAIL. After the change: 14 PASS / 0 FAIL / 0 SKIP.
  • A current count hidden in an attribute/comment cannot mask stale visible text; this negative control stays green.
  • All 88 adjacent documentation-validator tests passed again on this follow-up commit and base: 88 PASS / 0 FAIL / 0 SKIP. The identical patch also passed those tests before the external merge.
  • Independent review of the two-file patch: Standards 0 findings; Spec 0 findings, with an independently executed 14/14 test run. The patch is unchanged after that review.

Reinstalled exact lockfile dependencies with normal npm ci and 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:gate then 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 buildReadmeMigrationChecks validator 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.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

@diegosouzapw
diegosouzapw merged commit d8e163a into release/v3.8.52 Oct 10, 2026
31 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant