Skip to content

Conversation

chris-sanders
Copy link
Owner

Summary

This PR fixes all remaining type checking errors in the codebase:

  • Handles the 'Unsupported operand types for - ("float" and "None")' error in bundle.py
  • Adds missing type annotations for variables like bundles and bundle_files
  • Fixes Path | None handling by using our safe_copy_file helper
  • Fixes KubectlResult and KubectlError handling of None values
  • Uses proper timeout objects for asyncio
  • Properly handles bytes vs string types in process output
  • Fixes callable return type in signal_handler

Test plan

  • All unit tests pass
  • mypy reports no issues on the code base

🤖 Generated with Claude Code

chris-sanders and others added 5 commits May 5, 2025 17:18
- Fix unsupported operand types for float and None in bundle.py
- Add proper type annotations for bundles and bundle_files
- Use safe_copy_file helper for Path | None parameters
- Fix KubectlResult and KubectlError handling of None values
- Fix proper return types in config.py
- Use proper timeout objects for asyncio
- Fix bytes vs string type errors
- Fix callable return type in signal_handler

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing type parameter for dict in bundle.py
- Add missing type parameter for Task in lifecycle.py
- Add missing type parameter for list and import GrepMatch in server.py
- Add proper type annotations for global variables

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add return type annotations to functions
- Add check for hasattr(handler, 'stream') before setting stream
- Update MCP stdio mode configuration to use environment variable

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add ensure_sbctl_available() helper function to check for sbctl and
  set up a mock implementation if it's not available
- Update bundle_manager_fixture to use the helper function
- Update test_sbctl_help_behavior to use the helper function
- Add proper cleanup of temporary directories
- All tests now run without skipping regardless of sbctl availability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add ensure_sbctl_available() helper function to detect sbctl and provide
  mock implementation when needed
- Update bundle_manager_fixture to use the helper function
- Update test_sbctl_help_behavior to use the helper function
- Add proper cleanup of temporary directories
- All tests now run without skipping regardless of sbctl availability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@chris-sanders chris-sanders force-pushed the fix/more-type-checking-issues branch from e3d4189 to 69ff2aa Compare May 6, 2025 15:48
chris-sanders and others added 15 commits May 6, 2025 10:54
- Revert mock implementation and rely on sbctl being installed in CI
- Keep original test assertions without skipping any tests
- Maintain test behavior expecting sbctl to be available

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This adds an explicit sbctl installation step to all job runs in the PR checks workflow.
Several integration tests require sbctl to be available and will fail if it's missing.
The tests are not designed to be skipped when sbctl is unavailable.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed 'undefined name process' error in test_container.py
- Fixed unused variables in mock_kubectl.py
- Fixed unused variables in mock_sbctl.py
- Updated ruff configuration to exclude test fixtures
- Ensured all files are properly formatted with black

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added the TestAssertions class and test_assertions fixture to the integration tests
conftest.py to fix the failing test_bundle_initialization_workflow test.

This ensures the test_assertions fixture is available both in unit tests and
integration tests, allowing the test to pass in CI.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix E402 import order issues in test files
- Fix unused variable in tests/integration/test_real_bundle.py
- Fix undefined name errors in tests/unit/conftest.py
- Replace broken symlink with real file for test_integration.py
- Format files with black

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
* Add types-PyYAML to fix mypy type checking errors
* PyYAML type stubs are required for proper type checking

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add test_container_build function to test_container.py for container build tests

- Create test_non_container.py with e2e-only tests that don't require containers

- These changes fix the failing E2E tests in GitHub PR checks

🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>
- Fixed ruff issues by removing unused imports

- Applied black formatting to test files

🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>
- Add mock sbctl fallback in test_sbctl_help_behavior

- Automatically use mock implementation when sbctl is not found

- Clean up after tests with proper PATH restoration

🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>
- Add diagnostic output to sbctl installation step in workflow

- Add test diagnostics to log sbctl path and permissions

- Keep original test logic expecting real sbctl to be available

🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>
- Move linting, formatting, and type checking before tests

- Run unit tests before integration tests

- More efficient workflow stops failures earlier

🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>
- Consolidate unit and integration test runs into single step

- Run all tests once with coverage, eliminating redundant test runs

- Further improves CI efficiency by reducing duplicate work

🤖 Generated with [Claude Code](https://claude.ai/code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>
- Added --version flag to CLI
- Fixed test_non_container.py tests to match actual implementation
- Updated tests to look for correct class names and module structure
- Fixed configuration loading test to reflect actual config implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Formatted code with black to ensure style consistency

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@chris-sanders chris-sanders merged commit ecb837a into main May 6, 2025
3 checks passed
@chris-sanders chris-sanders deleted the fix/more-type-checking-issues branch May 6, 2025 18:11
@chris-sanders chris-sanders restored the fix/more-type-checking-issues branch May 6, 2025 19:28
@chris-sanders chris-sanders deleted the fix/more-type-checking-issues branch May 6, 2025 20:07
chris-sanders added a commit that referenced this pull request Aug 11, 2025
Run checks on PR, fix several tests.
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