Skip to content

fix(ci): recognize escaped regex alternatives in the docs command - #1611

Merged
xyos merged 1 commit into
aws:mainfrom
xyos:fix/docs-regex-guard
Nov 18, 2026
Merged

xyos merged 1 commit into
aws:mainfrom
xyos:fix/docs-regex-guard

Conversation

@xyos

@xyos xyos commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Problem

The failed check on #1610 reported two unguarded regexes and two stale exceptions. Both patterns in sectionMentioning() still use words.map(escapeRegExp).join('|'). Edits earlier in docs.ts moved them from lines 2227/2238 to 2233/2244.

Changes

Remove both line-number exceptions. The regex guard now recognizes the expression itself: a string[] parameter mapped through a locally declared regex escape helper, then joined with a literal |. Other sinks and the stale-entry check are unchanged. No published package changes.

Validation

  • Added a regression test that failed before the fix. It also checks raw words, a dynamic separator, a method callback, a non-array receiver, and a shadowed helper.
  • node --test scripts/sink-guards/*.test.mjs: 36 passed on Node 22.
  • Scanned the exact docs.ts from feat(blocks)!: run app tasks through package scripts instead of cdk-blocks #1610 at fe03ebb: no regex findings or weak escape helpers.
  • Did not run the package build, workspace tests, or application e2e locally; the change is confined to the CI guard and its tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The regex guard relied on two exact line numbers for sectionMentioning(). Recognize its string array mapped through a local regex escape helper and joined with a literal pipe instead. Remove both exemptions and test the boundaries of the recognized expression.
@xyos
xyos requested a review from a team as a code owner November 18, 2026 11:17
@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 51b4389

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@xyos
xyos enabled auto-merge (squash) November 18, 2026 11:24
@xyos
xyos disabled auto-merge November 18, 2026 12:00
@xyos
xyos merged commit 1ce9ce4 into aws:main Nov 18, 2026
40 of 43 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.

2 participants