refactor(server): break cfstore.py into recceiver/cf/ subpackage#160
Merged
Conversation
simon-ess
approved these changes
May 8, 2026
Contributor
simon-ess
left a comment
There was a problem hiding this comment.
Seems an improvement to me!
jacomago
approved these changes
May 8, 2026
537b40a to
9133c8a
Compare
321fedc to
c89d65e
Compare
Also fixes the hardcoded "iocid" string literal to CFPropertyName.IOC_ID.
CFProcessor now speaks domain types at every callsite with no raw dict handling. mock_client.py is removed.
Extract _setup_cf_properties, _apply_env_vars, _register_aliases, _remove_aliases, and _process_new_channels to bring all five flagged (by Sonar) methods within the complexity threshold.
c89d65e to
56c2641
Compare
Fix _merge_property_lists mutable default argument — safe in practice since the set is only read, but still wrong form.
str enum inheritance silently allowed enum members to be used wherever strings were expected, masking boundary crossings and causing inconsistent .value usage across the codebase.
Factory methods mixed owner (a runtime concern) with property type and value (domain constants), making the API semantically confusing. Direct construction via CFProperty(CFPropertyName.X.value, owner, value) is already the established pattern for IOC properties in create_ioc_properties; this makes the whole file consistent.
runtime_checkable is only available in typing from Python 3.8, but was imported without the typing_extensions fallback that Protocol has. Since no isinstance check against ChannelFinderAdapter exists anywhere, the decorator serves no purpose.
Config tests and processor tests had no reason to share a file. Moves make_adapter to conftest.py so both test modules can use it without duplication.
…to adapter The pipe-joining and 600-char URL chunking loop belonged to the CF query format, not to the processor. The adapter boundary now speaks lists; the wire detail is contained in PyCFClientAdapter.
…turn List[str] The only consumer immediately extracted p["name"] from every dict. Moving that extraction into the adapter removes the raw CF wire shape from the processor and makes the return type self-documenting.
IOC is an acronym — the mixed-case form was inconsistent with CFPropertyName.IOC_ID, IOC_NAME, etc. The ioc_id property becomes id since the class name already carries the IOC context.
make_adapter was duplicated between test_processors.py and cf/conftest.py; moved to tests/unit/conftest.py as the single source. make_ioc and a new make_channel (generalising make_active_channel with name, recceiver_id, and active params) now live in tests/unit/cf/conftest.py for shared use across all cf tests.
- IOCInfo docstring: "ioc_id property" -> ".id property" - test_model.py: rename test_ioc_id_combines_host_and_port to test_id_combines_host_and_port - test_processor.py: drop unused adapter binding in test_is_no_op_when_no_active_channels - cf/conftest.py: introduce DEFAULT_RECCEIVER_ID constant so make_channel's default and make_processor_with_mock share a single source of truth - adapter.py: replace magic 600 with _CF_NAME_QUERY_LIMIT constant and comment
56c2641 to
6ea5a5a
Compare
|
jacomago
approved these changes
May 11, 2026
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.



No behaviour changes.