Skip to content

ci: fix the lint findings that stop CI before any test runs - #122

Open
nk0952 wants to merge 1 commit into
embeddedos-org:masterfrom
nk0952:ci-unblock-lint-gate
Open

ci: fix the lint findings that stop CI before any test runs#122
nk0952 wants to merge 1 commit into
embeddedos-org:masterfrom
nk0952:ci-unblock-lint-gate

Conversation

@nk0952

@nk0952 nk0952 commented Sep 10, 2026

Copy link
Copy Markdown

Summary

CI on master is red, and it fails at the Lint (ruff) step in all nine matrix legs. Everything after that step - yamllint, mypy, Run test suite - is skipped. So the red X isn't a failing test being reported; CI hasn't got as far as running one.

That has been hiding a real regression. python -m pytest tests/ fails 9 tests in tests/unit/test_index_sync.py on master right now, and CI has never mentioned it.

This clears the lint and type findings sitting between the workflow and its own test step.

Type of Change

  • ci - CI/CD pipeline changes

Changes

ruff check . reports four findings on master, all in test files:

  • tests/ebuild/test_build_dir_resolution.py:31 - F811, import shutil appears twice
  • tests/unit/test_ci_gate.py:214,215 - E402, two imports sitting below module-level code
  • tests/ebuild/test_package_recipe.py:117 - W292, no newline at end of file

Fixing those gets the job as far as Type check (mypy), which then fails on ebuild/plugins/__init__.py:46:

error: Argument 2 to "get" of "Deprecated" has incompatible type "list[Never]"; expected "EntryPoints"  [arg-type]
note: Error code "arg-type" not covered by "type: ignore[attr-defined]" comment

The # type: ignore there names the wrong error code, so it was never silencing anything. I spelled out the pre-3.10 entry_points() mapping shape with cast rather than widening the ignore. That branch only runs on Python 3.8/3.9, which the matrix doesn't cover, so behaviour is unchanged either way.

Testing

Python 3.11.15, pip install -e ".[dev]", ruff 0.16.6. I ran each CI step by hand with the same flags ci.yml uses:

step master this branch + #119
ruff check . 4 errors pass pass
yamllint . pass pass pass
mypy ... 2 errors 1 error pass (107 files)
pytest tests/ 9 failed, 669 passed 9 failed, 669 passed 678 passed, 0 failed
  • All existing tests pass - 669 before, 669 after, no expectations changed
  • Manual testing performed - each workflow step run individually

Nothing outside the cast touches a shipped code path.

Related Issues

The 9 remaining failures are test_index_sync.py, which open PR #119 fixes. I've left those alone rather than duplicate that work - landing both gives a green gate, which is the last column above.

Additional Notes

Two things I noticed but didn't fold in, since they look like maintainer calls:

  1. ci.yml installs its linters unpinned. A new ruff release can turn the gate red with no change to this repo, which may well be how this arrived. Pinning them, or moving them into the dev extra in pyproject.toml, would make the gate reproducible.
  2. .coveragerc sets fail_under = 100 against a suite measuring ~24%, and ci.yml works around it with --cov-fail-under=0 plus a comment calling it a maintainer decision. Probably worth settling in one place.

Every leg of the CI matrix on master fails at the "Lint (ruff)" step
(run #455, all nine legs), so yamllint, mypy and the test suite never
run. The red X on master is not a failing test being reported -- CI has
not got as far as running one in a long time.

That is not academic. `python -m pytest tests/` fails 9 tests in
tests/unit/test_index_sync.py on master today, and CI has never said so.

ruff reports four findings, all in test files:

  tests/ebuild/test_build_dir_resolution.py:31  F811  import shutil twice
  tests/unit/test_ci_gate.py:214,215            E402  imports below code
  tests/ebuild/test_package_recipe.py:117       W292  no newline at EOF

With those fixed the job gets as far as mypy, which fails on
ebuild/plugins/__init__.py:46. The `# type: ignore[attr-defined]` there
names the wrong error code, so it was never silencing the arg-type error
the same line raises. I spelled out the pre-3.10 entry_points() mapping
shape with cast instead of widening the ignore. That branch only runs on
Python 3.8/3.9, which the matrix does not cover, so runtime behaviour is
unchanged either way.

The 9 index-sync failures that remain are PR embeddedos-org#119's, and I have not
duplicated it. With both applied the suite is 678 passed, 0 failed.

Checked on Python 3.11.15 with ruff 0.16.6, running each CI step by
hand: ruff and yamllint clean, mypy down from 2 errors to 1, pytest
unchanged at 669 passed with no test expectations touched.

Signed-off-by: Nitesh Kumar <nk0952@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant