Conversation
… and UI APIs Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> # Conflicts: # csp_gateway/server/gateway/csp/channels.py # csp_gateway/server/web/app.py # csp_gateway/server/web/routes/state.py
- Resolve dotted attribute paths in DefaultState/DuckDBState insert so keyby can reference nested struct members (e.g. keyby='sub.id') - Make --junitxml explicit in Makefile and switch upload-artifact/publish paths to 'junit.xml' so CI test results are reported (previously '**/junit.xml' produced 0 tests in the PR comment) Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
…_channels - channels.py: docstring referenced old set_state(edge, alias, keyby, indexer) signature; correct it to set_state(field_or_edge, keyby, indexer=None) - module.py: drop dynamic_state_channels() — no longer consumed by Gateway after the state rework. State on dynamic channels is now wired via channels.set_state() inside Module.connect, which is exercised by test_dynamic_channels - test_gateway.py: drop the matching dynamic_state_channels override; suite still passes (482 server tests) Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
…pendent The prior commit (fbf0d46) wrongly removed Module.dynamic_state_channels() under the assumption it was dead code. It actually serves a real purpose: it lets a module declare which of its dynamic_channels will have state, so that *other* modules' connect() may call get_state() on that name regardless of the order in which modules are connected. This commit restores the API and fixes the underlying order dependence using the same DelayedEdge pattern already used for channel data: - module.py: re-add dynamic_state_channels() -> Optional[Set[str]] on the Module ABC, with docstring describing the order-independence guarantee. - channels.py: * Add _pending_state_element_types: Dict[str, type] and _delayed_state_edges: Dict[(field, indexer), DelayedEdge] private attrs. * Add _declare_dynamic_state(field, element_type) to pre-register a state name with its element type. * get_state: if the field is pre-declared but not yet wired, return a DelayedEdge of ts[State[T]] (lazily created and cached). * _wire_state_edge: if a DelayedEdge was previously handed out for (field, indexer), bind it to the freshly-built state node so consumers' edges resolve transparently. * set_state: clear the pending entry once the owning module wires the state for real. - factory.py: in ChannelsFactory.build(), before invoking each module's connect(), walk all enabled modules and call channels._declare_dynamic_state(name, T) for every name returned by Module.dynamic_state_channels() (T is unwrapped from List[T] when applicable). This guarantees ordering independence between get_state and set_state across modules. - test_gateway.py: * Re-add the dynamic_state_channels() override on MySetModuleDynamicChannels. * Add parametrized test_dynamic_channels_state_module_order_independence covering both [setter, getter] and [getter, setter] module orderings; both pass via DelayedEdge binding. Server suite: 484 passed, 7 skipped, 1 xfailed (was 482; +2 for the new order test). Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
rework state to remove annoyances and inconsistensies, prep for Stage and UI APIs
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Add new Stage construct
Contributor
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
==========================================
- Coverage 87.38% 87.12% -0.27%
==========================================
Files 142 146 +4
Lines 14635 15625 +990
==========================================
+ Hits 12789 13613 +824
- Misses 1846 2012 +166 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
StatereworkStage