Skip to content

fix: Resolve indentation and duplicate definition errors blocking tests#211

Merged
bashandbone merged 1 commit intofeat/di_monorepofrom
fix-syntax-indentation-errors-8699010726555801512
Mar 10, 2026
Merged

fix: Resolve indentation and duplicate definition errors blocking tests#211
bashandbone merged 1 commit intofeat/di_monorepofrom
fix-syntax-indentation-errors-8699010726555801512

Conversation

@bashandbone
Copy link
Contributor

This PR targets the syntax and indentation issues uncovered during testing in this refactoring branch, resolving blocking test suite execution.

Changes Made:

  • Config Analyzer Service Tests (tests/unit/engine/services/test_config_analyzer.py):

    • Repaired indentation problems in test classes.
    • Rectified unmatched parenthesis errors inside the mock config_analyzer setup.
  • Embedding Configuration Categories (src/codeweaver/providers/config/categories/embedding.py):

    • Resolved major merge conflict residuals and duplicate block duplications that broke module parsing completely.
    • Ensured correct properties inside AsymmetricEmbeddingProviderSettings class (dimension_tuple, datatype_tuple, dimension, datatype properties)

Outstanding Issues & Observations:

  • CLI Configuration Validation Mock Issues: While working through failing unit tests, I've observed that the TestConfigValidation::test_invalid_provider_rejected test case in tests/unit/cli/test_config_command.py fails with the message Failed: DID NOT RAISE any of (<class 'codeweaver.core.exceptions.CodeWeaverError'>, <class 'ValueError'>, <class 'pydantic_core._pydantic_core.ValidationError'>). Attempting to trigger this by dynamically instantiating CodeWeaverEngineSettings via Python interpreter locally results in an AttributeError: 'Unset' object has no attribute 'embedding' error. I believe this test is fundamentally mismatched against how Pytest's mocks bypass actual pydantic_settings instantiation validation in mock_settings_dependency.

Next Steps:

  • Re-examine the behavior of CodeWeaverEngineSettings inside unit tests versus its behavior inside the CLI's _get_settings injection. If mock_settings_dependency overrides settings globally for the CLI scope, the validation logic never triggers. Removing or isolating TestConfigValidation out of the auto-mock'd contexts may be necessary to properly test that pydantic flags the error.

PR created automatically by Jules for task 8699010726555801512 started by @bashandbone

- Fixed indentation error in `tests/unit/engine/services/test_config_analyzer.py` on line 543 inside the `TestMatryoshkaImpactEstimation` class.
- Fixed an unmatched parentheses error in `tests/unit/engine/services/test_config_analyzer.py` on line 203.
- Refactored `AsymmetricEmbeddingProviderSettings` in `src/codeweaver/providers/config/categories/embedding.py` to fix overlapping/duplicate method definitions for `dimension_tuple`, `datatype_tuple`, `validate_model_compatibility`, `dimension`, and `datatype`.
- Fixed a syntax error introduced during a previous unmerged PR inside `src/codeweaver/providers/config/categories/embedding.py` on line 851.

Note:
- The tests under `tests/unit/cli/test_config_command.py` still exhibit failures due to `CodeWeaverEngineSettings` mock behavior completely bypassing the actual validation exception `pydantic` would raise (`ValidationError`). This behavior makes `test_invalid_provider_rejected` fail, and should be evaluated further.

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 10, 2026 16:34
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


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

@bashandbone bashandbone merged commit 2397c98 into feat/di_monorepo Mar 10, 2026
6 checks passed
@bashandbone bashandbone deleted the fix-syntax-indentation-errors-8699010726555801512 branch March 10, 2026 17:42
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