You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "jethac (via GitHub)" <gi...@apache.org> on 2026/08/10 02:04:32 UTC

[PR] fix(tech-debt): measure oxlint metrics against the project's ruleset [superset]

jethac opened a new pull request, #42955:
URL: https://github.com/apache/superset/pull/42955

   ### SUMMARY
   
   `superset-frontend/scripts/oxlint-metrics-uploader.js` runs bare `npx oxlint`. The project's
   config is named `oxlint.json`, not the `.oxlintrc.json` that oxlint auto-discovers, so the run
   falls back to oxlint's **default** ruleset — while every `lint` script in `package.json` passes
   `--config oxlint.json` explicitly. The numbers `tech-debt.yml` pushes to the tech-debt
   spreadsheet therefore describe a ruleset the project does not use.
   
   Measured on `master` @ `3b164e4` with oxlint 1.76.0:
   
   | | `npx oxlint` (what the uploader runs) | `npx oxlint --config oxlint.json` |
   |---|---|---|
   | total | **92** | **1470** |
   | top rule | `no-unused-vars` — 85 | `prefer-destructuring` — 567 |
   | | `erasing-op` 2, `no-control-regex` 2 | `react-hooks/exhaustive-deps` 381 |
   | | `no-shadow-restricted-names` 1 | `react/no-unstable-nested-components` 151 |
   | | `no-extra-boolean-cast` 1 | `no-console` 135 |
   | | `unicorn/no-useless-fallback-in-spread` 1 | `react/jsx-key` 80 |
   
   92% of the reported total is `no-unused-vars`, which `oxlint.json` sets to `off`. Absent from the
   series are 381 `react-hooks/exhaustive-deps` and 47 `react-hooks/rules-of-hooks` — correctness
   rules, not style.
   
   The fix passes the config explicitly rather than renaming `oxlint.json` to `.oxlintrc.json`. The
   rename removes the whole class of bug but churns every script and contributor habit, so it belongs
   in its own change if wanted.
   
   **The tracked total will step from ~92 to ~1470 on the first run after this merges. That is a
   measurement correction, not a regression** — no new violations are introduced, and no CI gate
   changes. The spreadsheet has no way to express a ruleset change, so the changeover date is worth
   annotating there; otherwise the step reads as a debt explosion. For the same reason, several
   earlier drops in that series coincide with rules leaving the tracker rather than with violations
   being fixed.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable — no UI change.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npx oxlint --format json | jq '.diagnostics | length'                       # 92
   npx oxlint --config oxlint.json --format json | jq '.diagnostics | length'  # 1470
   ```
   
   The second is what the uploader runs after this change. To exercise the script end to end,
   `npm run lint-stats` with `SPREADSHEET_ID` and `SERVICE_ACCOUNT_KEY` set; the upload itself needs
   the `GSHEET_KEY` secret, so full verification is CI-side.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #42954 
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ---
   
   ### AUTHOR'S NOTE
   
   I used Devin to figure out what the contribution guidelines were and where tech debt was being recorded. Devin helped me find the Google Sheets document. At that point I asked Devin to figure out how it was being generated, and it found this flag issue and compared for me the rules that oxlint is meant to be running versus the rules that the project is meant to be running.
   
   It looks to me to be a fairly straightforward issue.
   
   ### AI DISCLOSURE
   
   Authored with AI assistance (Devin). Per ASF generative tooling guidance the commit carries a
   `Generated-by:` trailer. The change is a single flag on an existing command line; the before/after
   counts above were measured locally on this checkout, not asserted by the model. No third-party
   copyrighted material is carried in.
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(tech-debt): measure oxlint metrics against the project's ruleset [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42955:
URL: https://github.com/apache/superset/pull/42955#issuecomment-5235107884

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(tech-debt): measure oxlint metrics against the project's ruleset [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber merged PR #42955:
URL: https://github.com/apache/superset/pull/42955


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(tech-debt): measure oxlint metrics against the project's ruleset [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42955:
URL: https://github.com/apache/superset/pull/42955#issuecomment-5235175513

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42955?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 66.41%. Comparing base ([`b413060`](https://app.codecov.io/gh/apache/superset/commit/b41306003095ed648bce1ad673c5a65861409454?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0090e0b`](https://app.codecov.io/gh/apache/superset/commit/0090e0b8187a78ccfd362e39885544ab06eeba61?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #42955   +/-   ##
   =======================================
     Coverage   66.41%   66.41%           
   =======================================
     Files        2858     2858           
     Lines      161446   161446           
     Branches    37190    37190           
   =======================================
     Hits       107222   107222           
     Misses      52187    52187           
     Partials     2037     2037           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/42955/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/42955/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.27% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/42955?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(tech-debt): measure oxlint metrics against the project's ruleset [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(tech-debt): measure oxlint metrics against the project's ruleset [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42955:
URL: https://github.com/apache/superset/pull/42955#issuecomment-5235127525

   <!-- Bito Reply -->
   The flagged issue is correct. When `oxlint` encounters linting errors, it exits with a nonzero status code, causing `execSync` to throw an exception before the output can be parsed. To resolve this, you should wrap the `execSync` call in a `try...catch` block and access the `stdout` from the error object, which contains the linting results even on failure.
   
   Here is the suggested fix:
   
   ```javascript
       let oxlintOutput;
       try {
         oxlintOutput = execSync('npx oxlint --config oxlint.json --format json', {
           encoding: 'utf8',
           maxBuffer: 50 * 1024 * 1024,
           stdio: ['pipe', 'pipe', 'ignore'],
         });
       } catch (error) {
         if (error.stdout) {
           oxlintOutput = error.stdout;
         } else {
           throw error;
         }
       }
       const results = JSON.parse(oxlintOutput);
   ```
   
   There are no other comments available in the PR to address.
   
   **superset-frontend/scripts/oxlint-metrics-uploader.js**
   ```
   let oxlintOutput;
       try {
         oxlintOutput = execSync('npx oxlint --config oxlint.json --format json', {
           encoding: 'utf8',
           maxBuffer: 50 * 1024 * 1024,
           stdio: ['pipe', 'pipe', 'ignore'],
         });
       } catch (error) {
         if (error.stdout) {
           oxlintOutput = error.stdout;
         } else {
           throw error;
         }
       }
       const results = JSON.parse(oxlintOutput);
   ```


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org