codeant-ai-for-open-source[bot] commented on code in PR #42955:
URL: https://github.com/apache/superset/pull/42955#discussion_r3746138049


##########
superset-frontend/scripts/oxlint-metrics-uploader.js:
##########
@@ -79,11 +79,18 @@ async function runOxlintAndProcess() {
   try {
     // Run OXC with JSON format
     console.log('Running OXC linter...');
-    const oxlintOutput = execSync('npx oxlint --format json', {
-      encoding: 'utf8',
-      maxBuffer: 50 * 1024 * 1024, // 50MB buffer for large outputs
-      stdio: ['pipe', 'pipe', 'ignore'], // Ignore stderr to avoid error output
-    });
+    // `oxlint.json` is not the `.oxlintrc.json` oxlint auto-discovers, so the
+    // config has to be passed explicitly or the run reports oxlint's defaults
+    // instead of the project's ruleset. Matches the `lint` scripts in
+    // package.json.
+    const oxlintOutput = execSync(
+      'npx oxlint --config oxlint.json --format json',

Review Comment:
   **Suggestion:** When the configured ruleset reports any error-level 
violations, Oxlint exits nonzero and `execSync` throws before `JSON.parse` and 
the Google Sheets upload run. Unlike the existing ESLint invocation, this call 
does not recover `error.stdout`, so the metrics job exits without recording the 
violations it is intended to measure. Catch the nonzero exit and parse its JSON 
stdout, or invoke Oxlint with an option that permits lint failures while still 
returning the diagnostics. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Technical-debt metrics are not uploaded when Oxlint finds errors.
   - ⚠️ Google Sheets history misses configured Oxlint violations.
   - ⚠️ Workflow runs continue failing despite `continue-on-error`.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d3f1ece52aa549c89e19320302d73515&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d3f1ece52aa549c89e19320302d73515&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/scripts/oxlint-metrics-uploader.js
   **Line:** 87:87
   **Comment:**
        *Api Mismatch: When the configured ruleset reports any error-level 
violations, Oxlint exits nonzero and `execSync` throws before `JSON.parse` and 
the Google Sheets upload run. Unlike the existing ESLint invocation, this call 
does not recover `error.stdout`, so the metrics job exits without recording the 
violations it is intended to measure. Catch the nonzero exit and parse its JSON 
stdout, or invoke Oxlint with an option that permits lint failures while still 
returning the diagnostics.
   
   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%2F42955&comment_hash=18a8d5baacbe786bbc05a228245ea2c5687881e05c8e6518ef17686c6cfa6db0&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42955&comment_hash=18a8d5baacbe786bbc05a228245ea2c5687881e05c8e6518ef17686c6cfa6db0&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]

Reply via email to