codeant-ai-for-open-source[bot] commented on code in PR #41955:
URL: https://github.com/apache/superset/pull/41955#discussion_r3565569146
##########
superset-frontend/jest.config.js:
##########
@@ -75,7 +75,7 @@ module.exports = {
// @ant-design/colors and @ant-design/fast-color are allowed through
because
// @ant-design/icons >= 6.3 deep-imports the ESM build of
@ant-design/colors
// from its CJS output, so babel-jest must transform those files.
-
'node_modules/(?!@ant-design/(colors|fast-color)|@formatjs/.*|d3-(array|interpolate|color|time|scale|time-format|format)|internmap|@mapbox/tiny-sdf|remark-gfm|(?!@ngrx|(?!deck.gl)|d3-scale)|markdown-table|micromark-*.|decode-named-character-reference|character-entities|mdast-util-*.|unist-util-*.|ccount|escape-string-regexp|nanoid|uuid|@rjsf/*.|echarts|zrender|fetch-mock|pretty-ms|parse-ms|ol|@babel/runtime|@emotion|cheerio|cheerio/lib|parse5|dom-serializer|entities|htmlparser2|rehype-sanitize|hast-util-sanitize|unified|unist-.*|hast-.*|rehype-.*|remark-.*|mdast-.*|micromark-.*|parse-entities|property-information|space-separated-tokens|comma-separated-tokens|bail|devlop|zwitch|longest-streak|geostyler|geostyler-.*|(?!geostyler)lodash|react-error-boundary|react-json-tree|react-base16-styling|lodash-es|rbush|quickselect|react-diff-viewer-continued|storybook/*.|json-stringify-pretty-compact)',
+
'node_modules/(?!@ant-design/(colors|fast-color)|@formatjs/.*|d3-(array|interpolate|color|time|scale|time-format|format)|internmap|@mapbox/tiny-sdf|remark-gfm|(?!@ngrx|(?!deck.gl)|d3-scale)|markdown-table|micromark-*.|decode-named-character-reference|character-entities|mdast-util-*.|unist-util-*.|ccount|escape-string-regexp|nanoid|uuid|@rjsf/*.|echarts|zrender|fetch-mock|pretty-ms|parse-ms|ol|@babel/runtime|@emotion|cheerio|cheerio/lib|parse5|dom-serializer|entities|htmlparser2|rehype-sanitize|hast-util-sanitize|unified|unist-.*|hast-.*|rehype-.*|remark-.*|mdast-.*|micromark-.*|parse-entities|property-information|space-separated-tokens|comma-separated-tokens|bail|devlop|zwitch|longest-streak|geostyler|geostyler-.*|(?!geostyler)lodash|react-error-boundary|react-json-tree|react-base16-styling|lodash-es|rbush|quickselect|react-diff-viewer-continued|storybook/*.|json-stringify-pretty-compact|@x0k/json-schema-merge)',
Review Comment:
**Suggestion:** The allowlist regex for `@rjsf` packages is malformed
(`@rjsf/*.`), which is a typo in regex syntax and can fail to reliably match
all `@rjsf/*` module paths for Babel transformation. Replace it with a proper
scoped-package pattern (for example `@rjsf/.*`) so Jest consistently transpiles
`@rjsf` ESM dependencies instead of intermittently throwing module parse
errors. [typo]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- Warning: existing regex already matches @rjsf packages.
- Warning: suggestion targets stylistic pattern, not functional bug.
```
</details>
<details>
<summary><b>Steps of Reproduction โ
</b></summary>
```mdx
1. Open `superset-frontend/jest.config.js` and locate
`transformIgnorePatterns` at lines
15โ20 (as shown in the current file, with the long `node_modules/(?!...)`
pattern at line
19).
2. Inspect the subpattern `@rjsf/*.` inside the negative lookahead at
`superset-frontend/jest.config.js:19`; this is the exact code added in this
PR and
referenced in the suggestion.
3. Evaluate this subpattern as a JavaScript regular expression: `*`
quantifies the
preceding `/`, so `@rjsf/*.` matches `@rjsf/` followed by zero or more `/`
characters and
then at least one arbitrary character, which means paths like `@rjsf/core`,
`@rjsf/utils`,
and `@rjsf/validator-ajv8` (actually used imports in
`superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx:21-23`)
all match
this allowlist.
4. Because module paths under `node_modules/@rjsf/*` (e.g.
`node_modules/@rjsf/core/...`)
satisfy this regex, Jest will still treat these packages as allowed for
transformation;
there is no concrete scenario where this specific `@rjsf/*.` pattern fails
to match while
`@rjsf/.*` would succeed, so the reported issue is effectively a stylistic
preference
rather than a reproducible malfunction.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=78163d7b29454e29aaf2caeef39e7792&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=78163d7b29454e29aaf2caeef39e7792&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/jest.config.js
**Line:** 78:78
**Comment:**
*Typo: The allowlist regex for `@rjsf` packages is malformed
(`@rjsf/*.`), which is a typo in regex syntax and can fail to reliably match
all `@rjsf/*` module paths for Babel transformation. Replace it with a proper
scoped-package pattern (for example `@rjsf/.*`) so Jest consistently transpiles
`@rjsf` ESM dependencies instead of intermittently throwing module parse errors.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41955&comment_hash=de2df7ac1dcaa62592a06a0a1e2b01b5f42a2dd1133ae8a08343b6fe462f11a7&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41955&comment_hash=de2df7ac1dcaa62592a06a0a1e2b01b5f42a2dd1133ae8a08343b6fe462f11a7&reaction=dislike'>๐</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]