feat(resource): update DatabaseResourceHandler for polymorphic hierarchy resolution #2039

Open
opened 2026-04-03 03:10:57 +00:00 by freemo · 3 comments
Owner

Metadata

  • Branch: feat/v360/db-handler-polymorphic
  • Commit Message: feat(resource): update DatabaseResourceHandler for polymorphic hierarchy resolution
  • Milestone: v3.6.0
  • Parent Epic: #1020

Background

With the database resource type hierarchy in place (abstract database, database-relational, database-analytical base types, and concrete types inheriting from them), the DatabaseResourceHandler must be updated to resolve resources polymorphically — i.e., a handler registered for database-relational should match postgres, mysql, and sqlite resources via inheritance lookup, following the same pattern used in the cloud resource handler.

Expected Behavior

  • DatabaseResourceHandler resolves resource types by walking the inheritance chain
  • A handler registered for database matches all database subtypes
  • A handler registered for database-relational matches postgres, mysql, sqlite
  • A handler registered for database-analytical matches duckdb
  • Existing handler registrations for concrete types (postgres, mysql, etc.) continue to work (most-specific wins)

Acceptance Criteria

  • DatabaseResourceHandler uses polymorphic type resolution (walks inheritance chain)
  • Handler registered for database-relational matches all relational subtypes
  • Handler registered for database-analytical matches all analytical subtypes
  • Most-specific handler wins when multiple handlers match
  • Existing concrete-type handler registrations still work
  • Behave BDD unit tests added for polymorphic resolution scenarios
  • nox passes with coverage ≥ 97%

Dependencies

  • Blocked by: #2036 (relational types must inherit before handler can resolve them)
  • Blocked by: #2037 (analytical types must inherit before handler can resolve them)
  • Blocks: #(backward compatibility verification issue)

Subtasks

  • Update DatabaseResourceHandler to walk the type inheritance chain during resolution
  • Implement most-specific-wins resolution order
  • Write Behave feature tests for polymorphic resolution (relational, analytical, concrete)
  • Run nox and confirm all stages pass

Definition of Done

  • All subtasks completed
  • Tests written and passing
  • All nox stages pass
  • Coverage ≥ 97%

Automated by CleverAgents Bot
Supervisor: Unknown | Agent: ca-epic-planner

## Metadata - **Branch**: `feat/v360/db-handler-polymorphic` - **Commit Message**: `feat(resource): update DatabaseResourceHandler for polymorphic hierarchy resolution` - **Milestone**: v3.6.0 - **Parent Epic**: #1020 ## Background With the database resource type hierarchy in place (abstract `database`, `database-relational`, `database-analytical` base types, and concrete types inheriting from them), the `DatabaseResourceHandler` must be updated to resolve resources polymorphically — i.e., a handler registered for `database-relational` should match `postgres`, `mysql`, and `sqlite` resources via inheritance lookup, following the same pattern used in the cloud resource handler. ## Expected Behavior - `DatabaseResourceHandler` resolves resource types by walking the inheritance chain - A handler registered for `database` matches all database subtypes - A handler registered for `database-relational` matches `postgres`, `mysql`, `sqlite` - A handler registered for `database-analytical` matches `duckdb` - Existing handler registrations for concrete types (`postgres`, `mysql`, etc.) continue to work (most-specific wins) ## Acceptance Criteria - [ ] `DatabaseResourceHandler` uses polymorphic type resolution (walks inheritance chain) - [ ] Handler registered for `database-relational` matches all relational subtypes - [ ] Handler registered for `database-analytical` matches all analytical subtypes - [ ] Most-specific handler wins when multiple handlers match - [ ] Existing concrete-type handler registrations still work - [ ] Behave BDD unit tests added for polymorphic resolution scenarios - [ ] `nox` passes with coverage ≥ 97% ## Dependencies - Blocked by: #2036 (relational types must inherit before handler can resolve them) - Blocked by: #2037 (analytical types must inherit before handler can resolve them) - Blocks: #(backward compatibility verification issue) ## Subtasks - [ ] Update `DatabaseResourceHandler` to walk the type inheritance chain during resolution - [ ] Implement most-specific-wins resolution order - [ ] Write Behave feature tests for polymorphic resolution (relational, analytical, concrete) - [ ] Run `nox` and confirm all stages pass ## Definition of Done - [ ] All subtasks completed - [ ] Tests written and passing - [ ] All nox stages pass - [ ] Coverage ≥ 97% --- **Automated by CleverAgents Bot** Supervisor: Unknown | Agent: ca-epic-planner
freemo added this to the v3.6.0 milestone 2026-04-03 03:23:04 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium (confirmed)
  • Milestone: v3.6.0 (confirmed — database resource hierarchy)
  • MoSCoW: Should Have — The polymorphic handler resolution is the key behavioral feature of the database resource hierarchy. Without it, the hierarchy is just structural; with it, handlers can match by inheritance chain.
  • Parent Epic: #1020 (confirmed correct)
  • Dependencies: Blocked by #2036 and #2037

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium (confirmed) - **Milestone**: v3.6.0 (confirmed — database resource hierarchy) - **MoSCoW**: Should Have — The polymorphic handler resolution is the key behavioral feature of the database resource hierarchy. Without it, the hierarchy is just structural; with it, handlers can match by inheritance chain. - **Parent Epic**: #1020 (confirmed correct) - **Dependencies**: Blocked by #2036 and #2037 --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium
  • Milestone: v3.6.0
  • MoSCoW: Should Have — already correctly labeled; polymorphic hierarchy resolution for database resources
  • Parent Epic: #1020 (Database resource hierarchy restructuring)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium - **Milestone**: v3.6.0 - **MoSCoW**: Should Have — already correctly labeled; polymorphic hierarchy resolution for database resources - **Parent Epic**: #1020 (Database resource hierarchy restructuring) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium (unchanged)
  • Milestone: v3.6.0 (already assigned)
  • MoSCoW: Should Have — Updating DatabaseResourceHandler for polymorphic hierarchy resolution is required to make the database hierarchy restructuring functional. Depends on #2035, #2036, #2037.
  • Parent Epic: #1020 (Database resource hierarchy restructuring)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified ✅ - **Priority**: Medium (unchanged) - **Milestone**: v3.6.0 (already assigned) - **MoSCoW**: Should Have — Updating `DatabaseResourceHandler` for polymorphic hierarchy resolution is required to make the database hierarchy restructuring functional. Depends on #2035, #2036, #2037. - **Parent Epic**: #1020 (Database resource hierarchy restructuring) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2039
No description provided.