Skip to content

fix(controlplane): exclude soft-deleted rows when finding a project version by name#3237

Merged
migmartri merged 1 commit into
mainfrom
worktree-unified-dancing-salamander
Jun 24, 2026
Merged

fix(controlplane): exclude soft-deleted rows when finding a project version by name#3237
migmartri merged 1 commit into
mainfrom
worktree-unified-dancing-salamander

Conversation

@migmartri

@migmartri migmartri commented Jun 24, 2026

Copy link
Copy Markdown
Member

Looking up a project version by name did not exclude soft-deleted rows. When a version name had been deleted and recreated, the lookup matched both the soft-deleted and the active row, causing the workflow run list to fail when filtering by that version.

This change scopes the lookup to non-deleted versions so the active version is returned, consistent with the other project-version queries in the same repository.

Closes #3236

AI disclosure

This change was produced with the assistance of Claude Code.

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri

Review in cubic

@chainloop-platform

chainloop-platform Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

AI Session Analysis

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 86% 1 ✅ 0 100% AI / 0% Human 2 +30 / -2 13m21s

🟢 86% — 100% AI — ✅ All policies passing

Jun 24, 2026 01:18 UTC · 13m21s · $8.32 · 72.4k in / 69.4k out · claude-code 2.1.186 (claude-opus-4-8)

View session details ↗

Change Summary

Adds a regression test for a deleted-and-recreated project version with the same name. Updates FindByProjectAndVersion to ignore soft-deleted rows so workflow run filtering returns the active version.

AI Session Overall Score

🟢 86% — One-shot bugfix run verified well, with only unrequested issue workflow drift.

AI Session Analysis Breakdown

🟢 94% · solution-quality

🟢 Fix addressed the data-query root cause instead of patching callers. · High Impact

🟢 92% · scope-discipline

No notes.

🟢 90% · verification

🟢 New regression failed first, then passed after the query fix. · High Impact

🟢 86% · context-and-planning

🟢 User front-loaded the issue link and a tests-first constraint. · Medium Impact

🟡 70% · alignment

🟠 AI kept going into GitHub issue and PR workflow after the requested tests-first bugfix was done. · Medium Severity

💡 In one-shot runs, stop after the requested fix unless the user explicitly asks for issue or PR follow-up.

abstained · user-trust-signal

🟡 One-shot session had no user follow-up, so trust signal and manual confirmation stayed unobserved. · Low Severity


File Attribution

████████████████████ 100% AI / 0% Human

Status Attribution File Lines
modified ai app/controlplane/pkg/biz/projectversion_integration_test.go +29 / -0
modified ai app/controlplane/pkg/data/projectversion.go +1 / -2

Policies (4)

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

Powered by Chainloop and Chainloop Trace

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@migmartri migmartri requested a review from a team June 24, 2026 01:32
…ersion by name

FindByProjectAndVersion did not filter out soft-deleted project version rows.
When a version name was deleted and recreated, the lookup matched both the
soft-deleted and the active row, returning a "not singular" error and crashing
the workflow run list when filtering by that version.

Closes #3236

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

Chainloop-Trace-Sessions: ecd1a33f-90f2-459f-9510-a5267ef123bd
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri merged commit f4cb19b into main Jun 24, 2026
14 of 15 checks passed
@migmartri migmartri deleted the worktree-unified-dancing-salamander branch June 24, 2026 01:39
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.

Workflow run list crashes when filtering by a recreated project version

2 participants