| name | ci-failure-debugging |
|---|---|
| description | Debug and fix failing CI validation checks for this Python project. Use when asked to fix CI failures, debug failing PR checks, fix pylint/mypy/black/cspell/pytest errors, or when a PR validation workflow fails. |
This project's PR validation runs the following checks on Python 3.10–3.14. To debug failures, identify which step failed and follow the corresponding section below.
The validation workflow runs these steps in order:
- black — code formatting
- pylint — static analysis
- mypy — type checking (strict mode)
- cspell — spell checking
- pytest — unit tests with coverage
- pylint (samples/tests) — lint samples and tests with relaxed rules
Set up the environment first:
python -m pip install -e ".[dev,test]"Then run the specific failing check:
| Check | Command | Notes |
|---|---|---|
| pylint | pylint featuremanagement |
|
| black | black --check featuremanagement |
Use black featuremanagement to auto-fix |
| mypy | mypy featuremanagement |
Uses strict = True from mypy.ini |
| cspell | npx cspell "**" |
Config in cspell.config.yaml, custom words in project-words.txt |
| pytest | pytest tests --doctest-modules --cov-report=xml --cov-report=html |
|
| pylint (samples) | pylint --disable=missing-function-docstring,missing-class-docstring samples tests |
Requires python -m pip install -r samples/requirements.txt |
- Run
pylint featuremanagementand fix reported issues. - Do NOT add
# pylint: disablecomments unless absolutely necessary. - Do NOT add new imports or dependencies to fix warnings.
- The project disables
duplicate-codeinpyproject.toml. - Max line length is 120. Min public methods is 1. Max branches is 20. Max returns is 7.
- Run
black featuremanagementto auto-format. Line length is 120 (configured inpyproject.toml). - If CI uses
black --check, it means files need reformatting — runblacklocally to fix.
- Run
mypy featuremanagement. The project usesstrict = Truewith Python 3.10 target. - All functions must have type annotations.
- Use
Optional[X]orX | Nonefor nullable types. - Check
mypy.inifor the full configuration.
- Misspelled words: fix the typo in your code.
- Legitimate technical terms: add the word to
project-words.txt(one word per line, alphabetically sorted). - Do NOT modify
cspell.config.yamlunless adding a new ignore path.
- Run
pytest teststo reproduce. - Sync tests:
tests/test_*.py - Async tests:
tests/test_*_async.py(usepytest-asyncio) - Time window filter tests:
tests/time_window_filter/ - Telemetry tests:
tests/test_send_telemetry_appinsights.py - If adding new code, ensure both sync and async tests exist where applicable.
- This step runs with
--disable=missing-function-docstring,missing-class-docstring. - Requires sample dependencies:
python -m pip install -r samples/requirements.txt. - Fix any remaining pylint issues in
samples/andtests/directories.