Skip to content

feat(controlplane): add workflow_template_id column to workflows table#3154

Merged
javirln merged 2 commits into
chainloop-dev:mainfrom
javirln:javier/pfm-6051-workflow-workflowtemplate-relationship
May 27, 2026
Merged

feat(controlplane): add workflow_template_id column to workflows table#3154
javirln merged 2 commits into
chainloop-dev:mainfrom
javirln:javier/pfm-6051-workflow-workflowtemplate-relationship

Conversation

@javirln
Copy link
Copy Markdown
Member

@javirln javirln commented May 27, 2026

Summary

Add an optional nullable workflow_template_id UUID column to the Workflow entity so template-created workflows can reference their source WorkflowTemplate. The column will be populated from the platform side when a workflow is created from a template.

javirln added 2 commits May 27, 2026 11:33
Add an optional nullable UUID column to the Workflow entity so
template-created workflows can reference their source WorkflowTemplate.

Assisted-by: Claude Code
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>

Chainloop-Trace-Sessions: 43e15867-d061-4ef2-9b69-ad069dbcab98
Assisted-by: Claude Code
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
@javirln javirln requested a review from migmartri May 27, 2026 09:37
@chainloop-platform
Copy link
Copy Markdown
Contributor

chainloop-platform Bot commented May 27, 2026

AI Session Analysis

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟡 73% 1 ✅ 0 9% AI / 91% Human 5 +21 / -10 18m54s

🟡 73% — 9% AI — ✅ All policies passing

May 27, 2026 09:17 UTC · 18m54s · $9.80 · 172 in / 42.6k out · claude-code 2.1.139 (claude-opus-4-6)

View session details ↗

Change Summary

  • Adds optional workflow_template_id foreign-key column to the Workflow table via a new Ent schema field
  • Generates and applies a clean Atlas SQL migration to sync the schema
  • Reverts an unintended descriptor.ts change and go.sum additions introduced during the session

AI Session Overall Score

🟡 73% — Solid schema change with clean execution, but missing targeted tests for the new column.

AI Session Analysis Breakdown

🟢 90% · solution-quality

🟢 AI proactively reverted unintended descriptor.ts change, keeping scope and diff clean. · High Impact

🟢 82% · context-and-planning

🟢 After user narrowed scope, AI produced a revised focused plan and exited plan mode before editing. · High Impact

🟡 Initial 8-step plan targeted a full entity creation workflow rather than the requested single-column addition. · Low Severity

🟡 78% · scope-discipline

No notes.

🟡 72% · user-trust-signal

🟠 User had to interrupt mid-session to redirect AI from a complex plan to a simple column addition. · Medium Severity

💡 State scope constraints upfront to avoid AI overbuilding before a correction is needed.

🟡 62% · alignment

🔴 AI planned a full WorkflowTemplate entity with proto/biz/service layers before user corrected scope to a single column. · High Severity

💡 Clarify task scope before building full architectural plans; prefer minimal interpretation for simple data-model requests.

🟠 AI committed go.sum changes the user had not requested, requiring an explicit undo. · Medium Severity

💡 Avoid committing lock/sum files unless the user explicitly requests dependency updates.

🟡 58% · verification

🟢 Full unit test suite ran and passed with zero failures after the schema change. · High Impact

🔴 No new tests added for the workflow_template_id column despite it being a testable schema change. · High Severity

💡 Add a test that creates a Workflow with a non-nil WorkflowTemplateID and verifies persistence and retrieval.

🟠 User never explicitly confirmed the new column appears correctly in the database after migration. · Medium Severity

💡 Ask the user to verify the new field in the database or via a query before closing the PR.


File Attribution

█░░░░░░░░░░░░░░░░░░░ 9% AI / 91% Human

Status Attribution File Lines
modified human app/controlplane/pkg/data/ent/migrate/schema.go +9 / -8
modified human go.sum +6 / -0
modified human app/controlplane/pkg/data/ent/migrate/migrations/atlas.sum +2 / -1
modified ai app/controlplane/pkg/data/ent/schema/workflow.go +2 / -1
created human app/controlplane/pkg/data/ent/migrate/migrations/20260527093110.sql +2 / -0

Policies (4)

Status Policy Material Messages
✅ Passed ai-config-ai-agents-allowed ai-coding-session-43e158 -
✅ Passed ai-config-no-dangerous-commands ai-coding-session-43e158 -
✅ Passed ai-config-no-secrets ai-coding-session-43e158 -
✅ Passed ai-config-mcp-servers-allowed ai-coding-session-43e158 -

Powered by Chainloop and Chainloop Trace

@javirln javirln requested review from a team and jiparis May 27, 2026 09:38
@javirln javirln changed the title Javier/pfm 6051 workflow workflowtemplate relationship feat(controlplane): add workflow_template_id column to workflows table May 27, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Re-trigger cubic

@javirln javirln merged commit f43ea19 into chainloop-dev:main May 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants