Skip to content

Conversation

@SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Nov 13, 2025

Summary

This PR adds integration tests for workflow configuration persistence via the config store and enhances the ConfigurationAdapter to gracefully handle incompatible stored configurations.

Fixes #525 - this worked before, but now we do validation in the adapter instead of relying on the UI components.

Changes

1. Enhanced DashboardBackend to support configurable transport

  • Added transport parameter accepting 'kafka' or 'none'
  • Allows testing without Kafka when it's not needed
  • Uses NullTransport for tests that only need the controller/config store

2. Added integration tests for workflow config persistence

File: tests/integration/config_persistence_test.py

3. Enhanced ConfigurationAdapter to detect incompatible params

File: src/ess/livedata/dashboard/configuration_adapter.py

Modified initial_parameter_values to:

  • Check for field overlap between stored params and current model fields
  • If no overlap detected (complete incompatibility) → return {} to trigger defaults
  • If partial/full overlap → return stored params (Pydantic handles missing fields)

This ensures schema changes between workflow versions don't break the dashboard - it gracefully falls back to defaults when configs are completely incompatible.

Motivation

These tests verify the critical flow where:

  1. Starting a workflow via WorkflowController stores params in the config store
  2. Recreating the adapter via the controller reads those params back correctly
  3. Incompatible configs (from old workflow versions) don't break the dashboard

SimonHeybrock and others added 3 commits November 13, 2025 10:59
This test verifies that starting a workflow via the WorkflowController
stores workflow params in the config store, and that recreating the
adapter via the controller reads those params back correctly.

Changes:
- Enhanced DashboardBackend to support configurable transport ('kafka' or 'none')
  to allow testing without Kafka services when not needed
- Added three integration tests:
  1. test_workflow_params_stored_and_retrieved_via_config_store
     - Verifies complete persistence flow from start_workflow to adapter creation
  2. test_adapter_filters_removed_sources
     - Verifies adapter filters out sources not in workflow spec
  3. test_config_persists_across_adapter_recreations
     - Verifies consistent behavior across multiple adapter recreations

Tests use null transport (no Kafka required) since they only test
the config store persistence mechanism through the controller.

Original prompt: In a new worktree (branch off main), please add a new
integration test that checks if starting a workflow via the controller
stores workflow params in the config store, and if recreating the adapter
via the controller reads those params back correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
When stored configuration params have no field overlap with the current
parameter model (indicating complete incompatibility, e.g., from a
different workflow version), the adapter now returns an empty dict to
fall back to defaults rather than propagating invalid data to the UI.

Changes:
- Modified ConfigurationAdapter.initial_parameter_values to check for
  field overlap between stored params and current model fields
- If no overlap is detected, returns {} to trigger default values
- Partial overlaps are handled by Pydantic (ignores extra, uses defaults)
- Added test_incompatible_config_falls_back_to_defaults to verify behavior

This ensures that schema changes between workflow versions don't break
the dashboard - it gracefully falls back to defaults when configs are
completely incompatible.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-project-automation github-project-automation bot moved this to In progress in Development Board Nov 13, 2025
@SimonHeybrock SimonHeybrock moved this from In progress to Selected in Development Board Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Selected

Development

Successfully merging this pull request may close these issues.

Ensure incompatible config does not prevent ConfigurationWidget from operating

2 participants