codeant-ai-for-open-source[bot] commented on code in PR #37583:
URL: https://github.com/apache/superset/pull/37583#discussion_r2747736202
##########
superset-frontend/webpack.config.js:
##########
@@ -205,7 +205,7 @@ if (!isDevMode) {
new ForkTsCheckerWebpackPlugin({
async: false,
typescript: {
- memoryLimit: 4096,
+ memoryLimit: 8192,
Review Comment:
**Suggestion:** There's an existing constant `TYPESCRIPT_MEMORY_LIMIT` (set
to 4096) earlier in the file; adding a different hardcoded value here creates a
single-source-of-truth bug and maintenance confusion. Reference the existing
constant here (and update that constant to the intended 8192 if you want a
global change) so the memory limit is defined in one place. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Maintainer confusion over memory default.
- ❌ Inconsistent build configuration across file.
- ⚠️ Risk of accidental regressions during future edits.
```
</details>
```suggestion
memoryLimit: TYPESCRIPT_MEMORY_LIMIT,
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open superset-frontend/webpack.config.js and inspect the top-level
constant
`TYPESCRIPT_MEMORY_LIMIT` (declared earlier in the same file). The
ForkTsCheckerWebpackPlugin configuration is at `webpack.config.js:205-216`
and currently
uses memoryLimit = 8192 (line 208).
2. Search in the same file for `TYPESCRIPT_MEMORY_LIMIT` (the file declares
a constant
that is set to 4096 in the final file state). Notice the mismatch: constant
= 4096, plugin
config = 8192.
3. Run `cd superset-frontend && npm run build`. The plugin will use the
value hardcoded at
`webpack.config.js:208` (8192) rather than the earlier constant, producing
inconsistent
configuration and confusion for maintainers trying to change the global
default.
4. Confirm confusion by attempting to change the single constant: editing
`TYPESCRIPT_MEMORY_LIMIT` alone will not affect the
ForkTsCheckerWebpackPlugin because the
plugin currently uses the hardcoded 8192 at `webpack.config.js:207-216`.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/webpack.config.js
**Line:** 208:208
**Comment:**
*Logic Error: There's an existing constant `TYPESCRIPT_MEMORY_LIMIT`
(set to 4096) earlier in the file; adding a different hardcoded value here
creates a single-source-of-truth bug and maintenance confusion. Reference the
existing constant here (and update that constant to the intended 8192 if you
want a global change) so the memory limit is defined in one place.
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.
```
</details>
--
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]