bito-code-review[bot] commented on code in PR #42939:
URL: https://github.com/apache/superset/pull/42939#discussion_r3791250402
##########
superset-frontend/scripts/build.js:
##########
@@ -60,26 +60,29 @@ function getPackages(packagePattern, tsOnly = false) {
// Find packages in both @superset-ui and @apache-superset scopes
const supersetUiPackages = [
...new Set(
- fastGlob
- .sync([
+ globSync(
+ [
`./node_modules/@superset-ui/${pattern}/src/**/*.${
tsOnly ? '{ts,tsx}' : '{ts,tsx,js,jsx}'
}`,
- ])
- .map(x => x.split('/')[3])
+ ],
+ { followSymlinks: true },
+ )
+ .map(x => x.split('/')[2])
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Wrong array index for path split</b></div>
<div id="fix">
The split index regressed from [3] to [2]. For paths like
`./node_modules/@superset-ui/package/src/file.ts`, index 3 extracts the package
name while index 2 extracts `@superset-ui`. This causes incorrect package
matching.
</div>
</div>
<small><i>Code Review Run #537e35</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset-frontend/scripts/build.js:
##########
@@ -60,26 +60,29 @@ function getPackages(packagePattern, tsOnly = false) {
// Find packages in both @superset-ui and @apache-superset scopes
const supersetUiPackages = [
...new Set(
- fastGlob
- .sync([
+ globSync(
+ [
`./node_modules/@superset-ui/${pattern}/src/**/*.${
tsOnly ? '{ts,tsx}' : '{ts,tsx,js,jsx}'
}`,
- ])
- .map(x => x.split('/')[3])
+ ],
+ { followSymlinks: true },
+ )
+ .map(x => x.split('/')[2])
.filter(x => !META_PACKAGES.has(x)),
),
];
const apachePackages = [
...new Set(
- fastGlob
- .sync([
+ globSync(
+ [
`./node_modules/@apache-superset/${pattern}/src/**/*.${
tsOnly ? '{ts,tsx}' : '{ts,tsx,js,jsx}'
}`,
- ])
- .map(x => x.split('/')[3]),
+ ],
+ { followSymlinks: true },
+ ).map(x => x.split('/')[2]),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Wrong array index in apachePackages</b></div>
<div id="fix">
Same path extraction bug as line 71: uses index [2] instead of [3],
extracting @apache-superset instead of package name for apache scope packages.
</div>
</div>
<small><i>Code Review Run #537e35</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]