Skip to content

[fix] Resolve broken testset uploads#4210

Merged
jp-agenta merged 1 commit intorelease/v0.96.8from
fix/broken-testsets-upload
Apr 22, 2026
Merged

[fix] Resolve broken testset uploads#4210
jp-agenta merged 1 commit intorelease/v0.96.8from
fix/broken-testsets-upload

Conversation

@jp-agenta
Copy link
Copy Markdown
Member

@jp-agenta jp-agenta commented Apr 22, 2026

Description

POST /api/testsets/revisions/{testset_revision_id}/upload returned {"count": 0} and did not create a new revision or testcases.

Root cause

  • Upload handler built a TestsetRevisionCommit with only testset_revision_id + data, leaving testset_id, testset_variant_id, and slug unset.
  • commit_testset_revision then set every testcase.set_id = None and the DAO tried to insert a revision with NULL artifact_id / variant_id / slug.
  • commit_revision is wrapped in @suppress_exceptions(), so the NOT NULL violation was silently swallowed.

Fix

  • Router: resolve testset_id / testset_variant_id from the base revision before committing; return 404 if the revision doesn't exist.
  • Service: mirror the delta path's slug fallback (slug or uuid4().hex[-12:]) in the non-delta commit_testset_revision so direct commits without a slug also work.

Tests

  • Added acceptance tests in test_testsets_files.py covering CSV upload, JSON upload, and the unknown-revision 404 case.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Apr 22, 2026 11:54am

Request Review

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. Bug Report Something isn't working tests labels Apr 22, 2026
@jp-agenta jp-agenta merged commit 979f001 into release/v0.96.8 Apr 22, 2026
15 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-4ca2.up.railway.app/w
Image tag pr-4210-1faa061
Status Failed
Railway logs Open logs
Logs View workflow run
Updated at 2026-04-22T12:08:37.195Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Report Something isn't working size:S This PR changes 10-29 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

POST /testsets/revisions/{id}/upload silently fails when testset_id is not set on the commit

1 participant