Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[CI] Auto-Merge Controller fails on every scheduled run: `requests` is imported but not declared (ModuleNotFoundError)

Open Beginner friendly
#730 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
ci-cd

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

bug

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, then uv run python scripts/auto_merge_controller.py
  • pyproject.toml:121-133: the dev group has no requests
  • uv.lock: requests is depended on only by jupyterlab-server and mkdocs-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 requests to the dev group (or a dedicated ci group used by this workflow), or rewrite the script with urllib.request. The controller only does simple GET, POST and PUT calls.
  • Add a CI check that imports every scripts/*.py in 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_run and pull_request_review triggers.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fderuiter/sortify

All issues in fderuiter/sortify

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.