[Epic] Database resource hierarchy restructuring #1020

Open
opened 2026-03-17 03:38:22 +00:00 by freemo · 4 comments
Owner

Summary

The current database types (postgres, mysql, sqlite, duckdb) are flat — they don't inherit from a common base type. This epic tracks restructuring them into a hierarchy similar to the cloud types.

Proposed Hierarchy

database (abstract base, not user-addable)
├── database-relational (abstract)
│   ├── postgres (inherits database-relational)
│   ├── mysql (inherits database-relational)
│   └── sqlite (inherits database-relational)
├── database-analytical (abstract)
│   └── duckdb (inherits database-analytical)
└── (future: database-nosql, database-graph, etc.)

Scope

  1. Create generic database base type (abstract, not user-addable)
  2. Create database-relational and database-analytical intermediate types
  3. Update postgres, mysql, sqlite, duckdb to inherit from appropriate parents
  4. Update DatabaseResourceHandler for polymorphic resolution
  5. Ensure backward compatibility (existing resources with type postgres etc. still work)

Acceptance Criteria

  • All database types inherit from a common base
  • Existing database resources are not broken by the migration
  • DatabaseResourceHandler works with hierarchical resolution
  • Tests updated and passing

Notes

  • Database types were restored from master in PR #669 to prevent their removal
  • This restructuring is intentionally deferred — the current flat model works fine
  • Consider whether database-relational vs database-analytical distinction adds value
  • PR #669: Cloud resource hierarchy (restores database types)
  • Issue #343: Cloud Infrastructure Resources
## Summary The current database types (`postgres`, `mysql`, `sqlite`, `duckdb`) are flat — they don't inherit from a common base type. This epic tracks restructuring them into a hierarchy similar to the cloud types. ## Proposed Hierarchy ``` database (abstract base, not user-addable) ├── database-relational (abstract) │ ├── postgres (inherits database-relational) │ ├── mysql (inherits database-relational) │ └── sqlite (inherits database-relational) ├── database-analytical (abstract) │ └── duckdb (inherits database-analytical) └── (future: database-nosql, database-graph, etc.) ``` ## Scope 1. Create generic `database` base type (abstract, not user-addable) 2. Create `database-relational` and `database-analytical` intermediate types 3. Update `postgres`, `mysql`, `sqlite`, `duckdb` to inherit from appropriate parents 4. Update `DatabaseResourceHandler` for polymorphic resolution 5. Ensure backward compatibility (existing resources with type `postgres` etc. still work) ## Acceptance Criteria - [ ] All database types inherit from a common base - [ ] Existing database resources are not broken by the migration - [ ] `DatabaseResourceHandler` works with hierarchical resolution - [ ] Tests updated and passing ## Notes - Database types were restored from master in PR #669 to prevent their removal - This restructuring is intentionally deferred — the current flat model works fine - Consider whether `database-relational` vs `database-analytical` distinction adds value ## Related - PR #669: Cloud resource hierarchy (restores database types) - Issue #343: Cloud Infrastructure Resources
freemo added this to the v3.6.0 milestone 2026-03-17 18:31:18 +00:00
Author
Owner

Planning Agent — Epic Hierarchy Note

This epic (#1020, Database resource hierarchy) currently has no child issues decomposed from it. Per CONTRIBUTING.md Section "Epics (Capability Unit)" Rule 4 (Full Decomposability), this epic must be broken into concrete implementation issues before work begins.

Recommended decomposition:

  1. Create abstract database base type
  2. Create database-relational and database-analytical intermediate types
  3. Update existing types (postgres, mysql, sqlite, duckdb) to inherit
  4. Update DatabaseResourceHandler for polymorphic resolution
  5. Backward compatibility migration/testing

Parent Legendary: This epic should be linked as a child of Legendary #378 (Post-MVP Deferred Work).

Action needed: @hamza.khyari — when ready to begin this work, decompose into 3-5 atomic issues with proper Metadata, Branch, Subtasks, and Definition of Done per CONTRIBUTING.md.

**Planning Agent — Epic Hierarchy Note** This epic (#1020, Database resource hierarchy) currently has no child issues decomposed from it. Per CONTRIBUTING.md Section "Epics (Capability Unit)" Rule 4 (Full Decomposability), this epic must be broken into concrete implementation issues before work begins. **Recommended decomposition**: 1. Create abstract `database` base type 2. Create `database-relational` and `database-analytical` intermediate types 3. Update existing types (`postgres`, `mysql`, `sqlite`, `duckdb`) to inherit 4. Update `DatabaseResourceHandler` for polymorphic resolution 5. Backward compatibility migration/testing **Parent Legendary**: This epic should be linked as a child of Legendary #378 (Post-MVP Deferred Work). **Action needed**: @hamza.khyari — when ready to begin this work, decompose into 3-5 atomic issues with proper Metadata, Branch, Subtasks, and Definition of Done per CONTRIBUTING.md.
Author
Owner

Planning Agent — Discussion Review

@freemo — Your decomposition recommendation from Day 39 is sound. The five-step breakdown (abstract base type → intermediate types → update existing types → polymorphic resolution → backward compatibility) follows the correct incremental approach.

However, this epic still has no child issues as of Day 42. Per CONTRIBUTING.md §Epics (Full Decomposability), work cannot begin until the epic is broken into concrete implementation issues.

Current status: v3.6.0 milestone, 21 points, Priority/Medium, no assignee. This is not blocking current milestones (v3.3.0–v3.5.0), so the lack of decomposition is acceptable for now.

Action required before v3.6.0 planning begins:

  • Decompose into 3–5 atomic issues with proper Metadata, Branch naming, Subtasks, and Definition of Done per CONTRIBUTING.md.
  • Each child issue should be independently estimable and assignable.
  • The 21-point total should be validated against the sum of child estimates.

No urgency here, but this should be decomposed before the v3.6.0 sprint starts. Adding this to the v3.6.0 planning checklist.

## Planning Agent — Discussion Review @freemo — Your decomposition recommendation from Day 39 is sound. The five-step breakdown (abstract base type → intermediate types → update existing types → polymorphic resolution → backward compatibility) follows the correct incremental approach. However, this epic still has **no child issues** as of Day 42. Per CONTRIBUTING.md §Epics (Full Decomposability), work cannot begin until the epic is broken into concrete implementation issues. **Current status:** v3.6.0 milestone, 21 points, Priority/Medium, no assignee. This is not blocking current milestones (v3.3.0–v3.5.0), so the lack of decomposition is acceptable for now. **Action required before v3.6.0 planning begins:** - Decompose into 3–5 atomic issues with proper Metadata, Branch naming, Subtasks, and Definition of Done per CONTRIBUTING.md. - Each child issue should be independently estimable and assignable. - The 21-point total should be validated against the sum of child estimates. No urgency here, but this should be decomposed before the v3.6.0 sprint starts. Adding this to the v3.6.0 planning checklist.
freemo self-assigned this 2026-03-23 03:36:43 +00:00
Author
Owner

Dependency link created: Epic #1020 now blocks Legendary #378 ("Post-MVP Deferred Work"). This establishes the correct parent-child relationship — database resource hierarchy restructuring is deferred post-MVP work.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Dependency link created: Epic #1020 now blocks Legendary #378 ("Post-MVP Deferred Work"). This establishes the correct parent-child relationship — database resource hierarchy restructuring is deferred post-MVP work. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Author
Owner

During a planning audit, this Epic was found to have child issues already created but missing Forgejo dependency links. The following child issues have now been linked to block this Epic:

Child Issues

  • #2418 — BUG-HUNT: Alembic migrations are unnecessarily complex and risky (pre-existing link)
  • #2035feat(resource): define abstract database and database-relational/database-analytical base resource types (link added)
  • #2036feat(resource): migrate postgres, mysql, and sqlite to inherit from database-relational (link added)
  • #2037feat(resource): migrate duckdb to inherit from database-analytical (link added)
  • #2039feat(resource): update DatabaseResourceHandler for polymorphic hierarchy resolution (link added)

Dependency Chain

#2035 (base types — no blockers)
  ├── blocks #2036 (relational inheritance)
  │     └── blocks #2039 (handler polymorphism)
  └── blocks #2037 (analytical inheritance)
        └── blocks #2039 (handler polymorphism)

All of the above block #1020 (this Epic)

Definition of Done

  • All child issues are closed
  • Integration between child issues verified
  • All nox stages pass
  • Coverage >= 97%

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

## Epic Planning Update — Dependency Links Restored During a planning audit, this Epic was found to have child issues already created but missing Forgejo dependency links. The following child issues have now been linked to block this Epic: ### Child Issues - [x] #2418 — BUG-HUNT: Alembic migrations are unnecessarily complex and risky *(pre-existing link)* - [ ] #2035 — `feat(resource): define abstract database and database-relational/database-analytical base resource types` *(link added)* - [ ] #2036 — `feat(resource): migrate postgres, mysql, and sqlite to inherit from database-relational` *(link added)* - [ ] #2037 — `feat(resource): migrate duckdb to inherit from database-analytical` *(link added)* - [ ] #2039 — `feat(resource): update DatabaseResourceHandler for polymorphic hierarchy resolution` *(link added)* ### Dependency Chain ``` #2035 (base types — no blockers) ├── blocks #2036 (relational inheritance) │ └── blocks #2039 (handler polymorphism) └── blocks #2037 (analytical inheritance) └── blocks #2039 (handler polymorphism) All of the above block #1020 (this Epic) ``` ### Definition of Done - [ ] All child issues are closed - [ ] Integration between child issues verified - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: Unknown | Agent: ca-epic-planner
freemo removed this from the v3.6.0 milestone 2026-04-07 02:41:01 +00:00
HAL9000 added this to the v3.6.0 milestone 2026-04-08 17:54:24 +00:00
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.

Blocks
#378 Legendary: Post-MVP Deferred Work
cleveragents/cleveragents-core
Depends on
Reference
cleveragents/cleveragents-core#1020
No description provided.