bito-code-review[bot] commented on PR #42511:
URL: https://github.com/apache/superset/pull/42511#issuecomment-5101089643
<!-- Bito Reply -->
The flagged issue is correct. In
`superset-frontend/scripts/bundle-size-summary.js`, the script silently skips
missing entrypoints at line 148 (`if (!entrypoint) return;`), which allows the
CI to pass even if critical bundles are missing from the webpack stats. To
resolve this, you should validate that all `TRACKED_ENTRYPOINTS` exist in the
`entrypoints` object and exit with an error if any are missing.
Here is the corrected implementation for the `main` function in
`superset-frontend/scripts/bundle-size-summary.js`:
```javascript
const results = [];
TRACKED_ENTRYPOINTS.forEach(name => {
const entrypoint = entrypoints[name];
if (!entrypoint) {
console.error(`Required entrypoint "${name}" missing from stats.json`);
process.exit(1);
}
results.push({
name: `${name} entrypoint (JS)`,
unit: 'bytes',
value: entrypointSizeByExt(entrypoint, '.js'),
});
results.push({
name: `${name} entrypoint (CSS)`,
unit: 'bytes',
value: entrypointSizeByExt(entrypoint, '.css'),
});
});
```
Would you like me to check the other comments on this PR and implement fixes
for them as well?
**superset-frontend/scripts/bundle-size-summary.js**
```
const results = [];
TRACKED_ENTRYPOINTS.forEach(name => {
const entrypoint = entrypoints[name];
if (!entrypoint) {
console.error(`Required entrypoint "${name}" missing from stats.json`);
process.exit(1);
}
results.push({
name: `${name} entrypoint (JS)`,
unit: 'bytes',
value: entrypointSizeByExt(entrypoint, '.js'),
});
results.push({
name: `${name} entrypoint (CSS)`,
unit: 'bytes',
value: entrypointSizeByExt(entrypoint, '.css'),
});
});
```
--
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]