SEZ9 opened a new pull request, #12300: URL: https://github.com/apache/seatunnel/pull/12300
Closes #12296 ### Purpose of this pull request The Python sources under `seatunnel-cli/` never ran in any workflow: - no job invokes `pytest`; - the `setup-python` step in `.github/workflows/backend.yml` exists only to run the change-detection script; - the `benchmarks` path filter matches `seatunnel-benchmarks/**` and `tools/benchmarks/**`, not `seatunnel-cli/**`. A pull request touching the CLI therefore reported a green Build check that covered none of the code it changed. This adds `.github/workflows/cli.yml`, a standalone workflow path-filtered to `seatunnel-cli/**` (plus the workflow file itself), so it costs nothing on unrelated pull requests: - **Test** — installs the package with its dev extras and runs `python -m pytest tests -v` on Python 3.10 and 3.13, i.e. the floor declared by `requires-python` and a current release. `fail-fast: false`, so one version failing still reports the other. - **Lint** — runs `ruff check .`. `python -m pytest` rather than `pytest` is deliberate: it puts the working directory on `sys.path`, which the tests rely on to import the `benchmark` package. That package ships next to `seatunnel_cli` but is not part of the installed distribution, so plain `pytest` would not find it. The suite is offline and needs no network access or model credentials. #### On the lint scope The ruff rule selection is recorded in `[tool.ruff.lint]` in `pyproject.toml`, not passed on the command line, so a contributor running `ruff check` locally sees exactly what CI sees. It enables the error-level rules only: syntax errors (`E9`), invalid comparisons and tests (`F63`, `F7`) and undefined names (`F82`). I would have liked to enable more, and measured what that would cost before deciding not to: - `ruff check` with the full default rule set reports **18 findings** — unused imports, unused locals, f-strings without placeholders, one ambiguous variable name `l`. All are in `seatunnel_cli/`, none in the tests. Real dead code, worth removing, but removing it means editing product logic in a pull request whose subject is CI. - `black --check` would reformat **17 of 23 files, about 3.2k lines** — the sources have never been run through black, even though it is listed as a dev dependency. I verified this is not version drift: black 24.10, 25.9 and 26.5 all report essentially the same set. Bundling either into this change would bury a 100-line workflow under thousands of lines of mechanical diff. So the gate starts at the level the code already passes, and I will follow up with a separate clean-up change that fixes the 18 findings, formats the tree, and widens the selection. Happy to reorder if reviewers would rather see the clean-up land first. ### Does this PR introduce _any_ user-facing change? No. CI configuration and a lint rule selection only; no runtime code is touched. ### How was this patch tested? The CLI suite is Python, so unlike a Java change this one could be executed locally, and was: - `python -m pytest tests -q` from `seatunnel-cli/` — **129 passed, 3 subtests passed**. - `ruff check .` with the committed `[tool.ruff.lint]` selection — **All checks passed** (ruff 0.16.7). - `pip install -e . --dry-run` — editable install metadata resolves with the new `[tool.ruff.lint]` table present. - Every `.py` file under `seatunnel-cli/` re-parsed with `ast.parse(..., feature_version=(3, 10))` to check the 3.10 matrix leg for syntax the floor does not accept. All files parse. Two things local runs cannot prove, and the workflow's own first run is the real check for them: the local interpreter is 3.14 rather than a matrix version, and `pip install -e '.[dev]'` was not exercised end-to-end offline, so a dev dependency that does not build on 3.10 or 3.13 would only surface in CI. ### Check list * [x] If any new Jar binary package adding in your PR, please add License Notice according [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md) * [x] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs * [x] If you are contributing the connector code, please check that the following files are updated: 1. Update change log that in connector document. For more details you can refer to [connector-v2](https://github.com/apache/seatunnel/tree/dev/docs/en/connector-v2) 2. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it 3. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml) * [ ] Update the [`release-note`](https://github.com/apache/seatunnel/blob/dev/release-note.md). — not done: this changes CI configuration only and has no user-facing behaviour to note. Happy to add an entry if maintainers want CI changes recorded there. -- 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]
