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


##########
scripts/change_detector.py:
##########
@@ -217,43 +254,10 @@ def main(event_type: str, sha: str, repo: str) -> None:
             files, patterns_compiled
         )
 
-    # Output results
-    output_path = os.getenv("GITHUB_OUTPUT") or "/tmp/GITHUB_OUTPUT.txt"  # 
noqa: S108
-    with open(output_path, "a") as f:
-        for check, changed in changes_detected.items():
-            # NOTE: as noted above, we assume that if 100 files are touched, 
we should
-            # trigger all checks. This is a workaround for the GitHub API 
limit of 100
-            # files. Using >= 99 because off-by-one errors are not uncommon
-            if changed or (files is not None and len(files) >= 99):
-                print(f"{check}=true", file=f)
-                print(f"Triggering group: {check}")
-
-
-def get_git_sha() -> str:
-    return os.getenv("GITHUB_SHA") or subprocess.check_output(  # noqa: S603
-        ["git", "rev-parse", "HEAD"]  # noqa: S603, S607
-    ).strip().decode("utf-8")
-
-
-if __name__ == "__main__":
-    parser = argparse.ArgumentParser(
-        description="Detect file changes based on event context"
-    )
-    parser.add_argument(
-        "--event-type",
-        default=os.getenv("GITHUB_EVENT_NAME") or "push",
-        help="The type of event that triggered the workflow",
-    )
-    parser.add_argument(
-        "--sha",
-        default=get_git_sha(),
-        help="The commit SHA for push events or PR head SHA",
-    )
-    parser.add_argument(
-        "--repo",
-        default=os.getenv("GITHUB_REPOSITORY") or "apache/superset",
-        help="GitHub repository in the format owner/repo",
-    )
-    args = parser.parse_args()
-
-    main(args.event_type, args.sha, args.repo)
+    # The 100-file API cap below treats a push/PR touching that many files as
+    # "everything changed" for the PATTERNS groups; language detection
+    # honors the same assumption so a consumer combining both outputs never
+    # sees a language silently excluded by the cap.
+    languages = (
+        sorted(set(LANGUAGE_EXTENSIONS.values()))
+        if files is not None and len(files)

Review Comment:
   **Suggestion:** `languages` is assigned but never written to 
`GITHUB_OUTPUT`, so the composite action exposes no language result and CodeQL 
cannot use this classification.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Often` ยท ๐Ÿท๏ธ `Incomplete 
implementation`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![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=add27a56c84f4e71bcdd13523ecad11e&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=add27a56c84f4e71bcdd13523ecad11e&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:** scripts/change_detector.py
   **Line:** 261:263
   **Comment:**
        *Incomplete Implementation: `languages` is assigned but never written 
to `GITHUB_OUTPUT`, so the composite action exposes no language result and 
CodeQL cannot use this classification.
   
   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%2F44895&comment_hash=ea52bd5639715752e8e796e5bc1b4a9057400da42cd0b2c33eff30b669d51558&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44895&comment_hash=ea52bd5639715752e8e796e5bc1b4a9057400da42cd0b2c33eff30b669d51558&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