kksingh000 commented on PR #44895:
URL: https://github.com/apache/superset/pull/44895#issuecomment-5955812362
Pushed a commit that reuses the `PATTERNS` group names rather than
introducing a separate mapping:
```python
GROUP_LANGUAGE_EXTENSIONS: dict[str, dict[str, str]] = {
"python": {".py": "python"},
"frontend": {".js": "javascript", ".jsx": "javascript", ".ts":
"javascript", ".tsx": "javascript", ".mjs": "javascript", ".cjs": "javascript"},
}
```
One scoping decision worth flagging: I did not rename `PATTERNS["frontend"]`
itself to `javascript`. That exact key is consumed directly by
`.github/actions/change-detector/action.yml`'s own `frontend` output plus
`superset-e2e.yml`, `superset-frontend.yml`, `codeql-analysis.yml`,
`docker.yml`, and `superset-translations.yml` -- all gating CI jobs by
directory/area ("anything under `superset-frontend/` changed"), not by
language. Renaming the key would silently change behavior for all of those,
well outside this PR's scope, so `PATTERNS["frontend"]` and its existing
consumers are untouched. Only the new language-detection code
(`GROUP_LANGUAGE_EXTENSIONS` / `detect_languages`) adopts the
javascript-oriented naming you asked for. Happy to do the full rename as its
own reviewed PR if you'd still like `frontend` renamed everywhere -- just
didn't want to bundle a wider, harder-to-review change into this one without
checking first.
While implementing this I also ran into two bugs beyond what the bots
flagged: the file as previously committed had a genuine unclosed parenthesis
partway through `main()`, so it didn't parse at all (`ast.parse`/`py_compile`
fails on it) -- the entire GITHUB_OUTPUT write loop, `get_git_sha()`, and the
`__main__` entrypoint were missing and are now restored. Separately,
`action.yml` had no `languages` entry in its `outputs:` block, so even a
correctly emitted step output wouldn't have propagated out of the composite
action to callers -- added it, which is also what CodeAnt's bot flagged and has
now auto-verified as resolved against `5ee996b`.
Verified locally this time: the full `change_detector_test.py` suite (17/17,
including 3 new tests covering the PATTERNS-name reuse, the 99-file cap, and
that `main()` actually writes `languages` to GITHUB_OUTPUT), `ruff check` clean
on both touched `.py` files, and `action.yml` validated as proper YAML.
--
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]