Skip to content

Fix CI quality gates and cross-platform Bash selection#1

Merged
PRINCE2-AI merged 1 commit into
mainfrom
codex/fix-devmind-ci
Jul 12, 2026
Merged

Fix CI quality gates and cross-platform Bash selection#1
PRINCE2-AI merged 1 commit into
mainfrom
codex/fix-devmind-ci

Conversation

@PRINCE2-AI

Copy link
Copy Markdown
Owner

What changed

  • format the Python codebase and resolve all Ruff findings
  • pin CI-only tooling in requirements-dev.txt
  • make Ruff and MyPy non-mutating, blocking quality gates
  • update checkout/setup-python Actions and restrict workflow permissions
  • select Git Bash explicitly on Windows instead of the WSL launcher
  • strengthen frozen-config and shell tests

Root cause

The workflow ran ruff check --fix inside CI, but remaining non-fixable lint findings stopped the job before Black, MyPy, or Pytest could run. Windows also resolved bash to the WSL launcher even when Git Bash was installed.

Validation

  • ruff check .
  • black --check .
  • mypy . (27 source files, 0 issues)
  • pytest -q (156 passed)

@PRINCE2-AI
PRINCE2-AI marked this pull request as ready for review July 12, 2026 18:00
Copilot AI review requested due to automatic review settings July 12, 2026 18:00
@PRINCE2-AI
PRINCE2-AI merged commit 82d5f9a into main Jul 12, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens CI “quality gate” behavior (non-mutating, blocking Ruff/MyPy/Black), pins CI-only tooling, and improves Windows Bash resolution by explicitly preferring Git Bash (avoiding accidental selection of the WSL launcher). It also includes broad formatting/typing cleanups and strengthens tests around tools and frozen config behavior.

Changes:

  • Make CI lint/typecheck steps non-mutating and blocking; restrict workflow permissions; install pinned dev tools via requirements-dev.txt.
  • Add Windows-aware Bash executable resolution for bash_tool.
  • Formatting, typing modernizations (PEP 604 unions), and test hardening/cleanup across the Python codebase.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools.py Adds Windows Git Bash detection for bash_tool; minor robustness tweaks in file tool path handling and typing.
tests/test_tools.py Updates tool tests to validate Bash selection and applies formatting cleanup.
tests/test_task.py Import ordering/formatting cleanup.
tests/test_rate_limiter.py Removes unused imports / formatting cleanup.
tests/test_plugins.py Removes unused imports; adjusts broken-plugin test string quoting.
tests/test_persistence.py Reorders imports and formatting cleanup.
tests/test_metrics.py Import ordering/formatting cleanup.
tests/test_main.py Simplifies “no exception” tests and formatting cleanup.
tests/test_exceptions.py Import ordering/formatting cleanup.
tests/test_cost_tracker.py Formatting cleanup in assertions and __main__ block.
tests/test_context.py Formatting cleanup in __main__ block.
tests/test_config.py Strengthens frozen-dataclass assertion by catching FrozenInstanceError specifically.
task.py Typing/formatting updates; adopts PEP 604 unions.
security.py Typing modernization and clearer multi-line error strings.
requirements-dev.txt Introduces pinned CI/dev-only tooling via a dedicated requirements file.
rate_limiter.py Formatting cleanup.
plugins.py Formatting cleanup.
persistence.py Typing modernization, improved exception chaining, and formatting cleanup.
metrics.py Typing modernization and formatting cleanup; expands one-line properties for clarity.
main.py Formatting cleanup and minor import reordering.
logger.py Formatting cleanup for regex patterns and formatter setup.
exceptions.py Formatting cleanup in exception definitions/messages.
cost_tracker.py Import ordering, typing modernization, and formatting cleanup.
context.py Typing modernization and formatting cleanup of long strings.
config.py Formatting cleanup; expands config sets for readability; no functional config intent change beyond layout.
agent.py Import ordering and formatting cleanup.
.github/workflows/ci.yml Updates workflow triggers/permissions and makes Ruff/MyPy blocking; installs dev toolchain from requirements-dev.txt.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools.py
Comment on lines +37 to +51
def _find_bash_executable() -> str:
"""Return a real Bash executable, preferring Git Bash on Windows."""
if os.name == "nt":
git_executable = shutil.which("git")
if git_executable:
git_root = Path(git_executable).resolve().parent.parent
for relative_path in ("bin/bash.exe", "usr/bin/bash.exe"):
candidate = git_root / relative_path
if candidate.is_file():
return str(candidate)

bash_executable = shutil.which("bash")
if bash_executable:
return bash_executable
raise FileNotFoundError("Bash was not found. Install Git Bash or Bash.")
Comment thread .github/workflows/ci.yml
Comment on lines +18 to 22
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
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.

2 participants