Clarify replica module boundaries#104
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR cleans up the boundary between generated replica view planning and required template-link secondary-artifact materialization in ogcat. It splits ogcat.replicas into smaller modules — replica_types, replica_links, replica_context, and template_replicas — and re-homes the corresponding tests at the interfaces that now own each behavior.
Changes:
- Extract
ReplicaMode/ReplicaRole, symlink helpers, replica template context, and template-link materialization into dedicated internal modules. - Update
secondary_artifactsandtest_addmonkeypatch paths to point atogcat.template_replicas; keepogcat.replicasfocused on generated view planning. - Move template-link tests into
tests/test_template_replicas.pyandtests/test_secondary_artifacts.py, and rewritetests/test_replicas.pyagainst the lower-levelplan_replica_viewinterface.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ogcat/replicas.py | Slim down to view planning; delegate context/symlink/types to new modules. |
| src/ogcat/replica_types.py | New module hosting ReplicaMode/ReplicaRole literals. |
| src/ogcat/replica_links.py | New module with relative_symlink_target and symlink_points_to. |
| src/ogcat/replica_context.py | New module with replica_template_context and original-name helper. |
| src/ogcat/template_replicas.py | New module owning materialize_template_link_replica and its dataclass. |
| src/ogcat/secondary_artifacts.py | Re-route imports to replica_types and template_replicas. |
| tests/test_template_replicas.py | New direct tests for materialize_template_link_replica. |
| tests/test_secondary_artifacts.py | New tests for TemplateLinkSecondaryArtifact via the catalog transaction. |
| tests/test_replicas.py | Switch from catalog.plan_view to plan_replica_view; drop template-link test. |
| tests/test_add.py | Update monkeypatch targets to ogcat.template_replicas.render_storage_location. |
| docs/api/replicas.rst | Remove the now-internal replica_template_context autofunction entry. |
| docs/api/internals.rst | Document the new internal modules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ogcat.template_replicas.plan_replica_view,TemplateLinkSecondaryArtifact, andmaterialize_template_link_replica.Architecture checkpoint
ogcat.replicasnow focuses on generated replica view planning and application. Required template-link secondary artifacts depend onogcat.template_replicasdirectly, so secondary materialization no longer hangs off the generated-view module.Catalog.plan_view()remains as the public facade smoke path.Closes #89.
Checks
uv run ruff check src/ogcat/replicas.py src/ogcat/secondary_artifacts.py src/ogcat/replica_context.py src/ogcat/replica_links.py src/ogcat/replica_types.py src/ogcat/template_replicas.py tests/test_add.py tests/test_replicas.py tests/test_secondary_artifacts.py tests/test_template_replicas.pyuv run ruff format --check src/ogcat/replicas.py src/ogcat/secondary_artifacts.py src/ogcat/replica_context.py src/ogcat/replica_links.py src/ogcat/replica_types.py src/ogcat/template_replicas.py tests/test_add.py tests/test_replicas.py tests/test_secondary_artifacts.py tests/test_template_replicas.pyuv run pyrightuv run pytestuv run sphinx-build -b html docs docs/_build/html