[CI] Auto-Merge Controller fails on every scheduled run: `requests` is imported but not declared (ModuleNotFoundError)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 86/100
Research direction
Start with scripts/auto_merge_controller.py and .github/workflows/auto-merge-controller.yml; the issue identifies the undeclared requests import and the workflow’s dev-only sync. Check the dependency groups in pyproject.toml, then reproduce with uv sync --frozen --group dev and run the controller import. Done when the controller starts without ModuleNotFoundError in the workflow’s environment.
Written by the indexing model from the issue text.
Description
Summary
scripts/auto_merge_controller.py does import requests, but requests is not declared in [project.dependencies] or in the dev dependency group. The workflow installs only uv sync --frozen --group dev, so the script crashes on import every time it runs. In the lock file, requests is reachable only through mkdocs-material (docs group) and jupyterlab-server (notebooks group). That is also why tests/test_auto_merge_controller.py passes in CI (--all-groups) but errors under a plain dev sync.
Location
scripts/auto_merge_controller.py:16:import requests.github/workflows/auto-merge-controller.yml:40-49:uv sync --frozen --group dev, thenuv run python scripts/auto_merge_controller.pypyproject.toml:121-133: thedevgroup has norequestsuv.lock:requestsis depended on only byjupyterlab-serverandmkdocs-material
Evidence / reproduction
$ UV_PROJECT_ENVIRONMENT=/tmp/venvdev uv sync --frozen --group dev
$ GITHUB_TOKEN=x GITHUB_REPOSITORY=a/b /tmp/venvdev/bin/python scripts/auto_merge_controller.py
import requests
ModuleNotFoundError: No module named 'requests'
Actions history (gh run list --workflow auto-merge-controller.yml -L 100): 78 of 78 schedule runs failed, all at the "Run Auto-Merge Controller" step (for example run 39271503105). The 21 workflow_run runs were all skipped. The workflow also runs every 15 minutes (cron: '*/15 * * * *'), so it adds about 96 failed runs per day.
Locally, uv sync --group dev followed by pytest also gives ERROR tests/test_auto_merge_controller.py - ImportError.
Expected vs actual
- Expected: the controller runs and processes the queue.
- Actual: it crashes on import and never merges anything.
Suggested fix
- Add
requeststo thedevgroup (or a dedicatedcigroup used by this workflow), or rewrite the script withurllib.request. The controller only does simple GET, POST and PUT calls. - Add a CI check that imports every
scripts/*.pyin the same environment its workflow uses. - Look at the security gaps in #728 before re-enabling auto-merge.
- Consider dropping the 15-minute cron in favour of
workflow_runandpull_request_reviewtriggers.
Severity
high
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- Avg merge
- 16h 3m
- Merged PRs (30d)
- 255
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fderuiter/sortify
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in fderuiter/sortify
Similar issues
-
Edit tool converts CRLF files to LFPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
huggingface/tau#774 ·
Maintainers usually reply within 1 day
-
show ignores the row limit when a column or table name contains "limit"Possibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 2 days
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
eclipse-score/inc_someip_gateway#356 ·
Maintainers usually reply within 2 days