You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reorganized commerce mixins from a monolithic file into a modular package structure with separate modules for each mixin type (render, template, terminate)
Moved TerminateMixin, RenderMixin, TemplateMixin and their async counterparts (AsyncTerminateMixin, AsyncRenderMixin, AsyncTemplateMixin) into individual module files within mpt_api_client/resources/commerce/mixins/
Created mpt_api_client/resources/commerce/mixins/__init__.py to re-export all mixins, maintaining backward compatibility and the public API
Reorganized unit tests from a single test file into separate test modules within tests/unit/resources/commerce/mixins/ directory, with dedicated test files for each mixin type
Updated pyproject.toml to remove linter suppression rule for the old test location
All mixin functionality and behavior remain unchanged; this is purely a structural refactoring to improve code organization and maintainability
This change refactors the monolithic mixin module into a modular structure with separate files for RenderMixin, TemplateMixin, and TerminateMixin (along with async variants). Each mixin is now in its own focused module under mpt_api_client/resources/commerce/mixins/ with an __init__.py re-exporting the public API. Tests are reorganized to match this structure, and a linter suppression rule is removed from the configuration.
New modules split from monolithic mixins file, each containing synchronous and asynchronous mixin classes with render, template, and terminate resource operations respectively.
Re-exports all six mixin classes (RenderMixin, AsyncRenderMixin, TemplateMixin, AsyncTemplateMixin, TerminateMixin, AsyncTerminateMixin) from submodules via __all__.
Old Monolithic Mixins File mpt_api_client/resources/commerce/mixins.py
Deleted; functionality moved to separate mixin modules.
Test Suite Reorganization tests/unit/resources/commerce/mixins/test_render_mixin.py, tests/unit/resources/commerce/mixins/test_template_mixin.py, tests/unit/resources/commerce/mixins/test_terminate_mixin.py
New focused test modules for individual mixin classes, replacing consolidated test coverage.
Old Consolidated Tests tests/unit/resources/commerce/test_mixins.py
Deleted; tests moved to mixin-specific modules.
Configuration pyproject.toml
Removed linter suppression rule for tests/unit/resources/*/test_mixins.py.
[MPT-16423] Moved Render and Template to mixin #163: Both PRs refactor the same mixin classes (RenderMixin, TemplateMixin, TerminateMixin) from a monolithic structure into modular form with updated service integrations.
The PR title contains exactly one Jira issue key in the required MPT-XXXX format at the beginning.
Test Coverage Required
✅ Passed
Code files were modified (6 changes including mixin reorganization) and test files were included (3 new test files created, 1 removed). Check criteria met.
Single Commit Required
✅ Passed
The pull request contains exactly one commit titled 'MPT-16437 Reorganise resource commerce mixins structure', meeting clean git history requirements.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
Warning
Review ran into problems
🔥 Problems
Errors were encountered while retrieving linked issues.
Errors (1)
MPT-16437: Cannot read properties of undefined (reading 'map')
Comment @coderabbitai help to get the list of available commands and usage tips.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes MPT-16437
TerminateMixin,RenderMixin,TemplateMixinand their async counterparts (AsyncTerminateMixin,AsyncRenderMixin,AsyncTemplateMixin) into individual module files withinmpt_api_client/resources/commerce/mixins/mpt_api_client/resources/commerce/mixins/__init__.pyto re-export all mixins, maintaining backward compatibility and the public APItests/unit/resources/commerce/mixins/directory, with dedicated test files for each mixin typepyproject.tomlto remove linter suppression rule for the old test location