[chore] Clean up and unify (some of) the revision request field names#4470
[chore] Clean up and unify (some of) the revision request field names#4470jp-agenta wants to merge 3 commits into
Conversation
Rename the wrapper field on revision commit/log request bodies so each matches the snake_case form of its enclosing request class. Outliers fixed: - /workflows/revisions/commit: workflow_revision -> workflow_revision_commit - /workflows/revisions/log: workflow -> workflow_revisions_log - /applications/revisions/log: application -> application_revisions_log - /evaluators/revisions/log: evaluator -> evaluator_revisions_log - /environments/revisions/log: environment -> environment_revisions_log - /queries/revisions/log: query_revisions -> query_revisions_log - /testsets/revisions/log: testset_revision -> testset_revisions_log Updates the FastAPI request models, the routers that read those fields, and the handwritten callers in: - web/packages/agenta-entities/src/workflow/api/api.ts (commit bodies only; query/response uses of workflow_revision remain unchanged) - sdks/python/agenta/sdk/managers/shared.py (history/ahistory log bodies) - 11 workflow acceptance tests + 1 SDK workflow acceptance test (commit + log bodies) Fern-generated clients regenerated separately.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Railway Preview Environment
Updated at 2026-05-28T07:36:56.231Z |
…nify-revision-request-fields
…nify-revision-request-fields
There was a problem hiding this comment.
Pull request overview
This PR standardizes the top-level wrapper field names in several revision commit/log request bodies so they match the snake_case form of their enclosing FastAPI request model names, and updates a subset of in-repo callers/tests accordingly.
Changes:
- Renamed request wrapper fields for
/workflows/revisions/commitand multiple*/revisions/logendpoints (workflows, applications, evaluators, environments, queries, testsets). - Updated FastAPI request models + routers to read the renamed wrapper fields.
- Updated handwritten callers (TS frontend workflow API, Python SDK history/ahistory) and acceptance tests to send the new wrapper keys.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| web/packages/agenta-entities/src/workflow/api/api.ts | Updates workflow revision commit request bodies to use workflow_revision_commit. |
| sdks/python/oss/tests/pytest/acceptance/workflows/test_embeds_integration.py | Updates workflow commit acceptance-test payloads to use workflow_revision_commit. |
| sdks/python/agenta/sdk/managers/shared.py | Updates application revisions log payload wrapper to application_revisions_log (sync + async). |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_revisions_queries.py | Updates workflow commit payload wrappers in revision query acceptance tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_revisions_basics.py | Updates workflow commit payload wrapper in basic revisions test. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_retrieval_info.py | Updates workflow commit payload wrappers in retrieval-info acceptance tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_lineage.py | Updates workflow revisions log payload wrapper to workflow_revisions_log. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_embeds.py | Updates workflow commit payload wrappers used by embed resolution tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_embeds_string.py | Updates workflow commit payload wrappers used by string-embed tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_embeds_security.py | Updates workflow commit payload wrappers used by embed security tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_embeds_retrieve_resolve.py | Updates workflow commit payload wrappers used by retrieve/resolve embed tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_embeds_legacy.py | Updates workflow commit payload wrappers used by legacy embed tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_embeds_errors.py | Updates workflow commit payload wrappers used by embed error-handling tests. |
| api/oss/tests/pytest/acceptance/workflows/test_workflow_embeds_cross_entity.py | Updates workflow commit payload wrappers used by cross-entity embed tests. |
| api/oss/src/apis/fastapi/workflows/router.py | Reads workflow_revision_commit and workflow_revisions_log from request bodies. |
| api/oss/src/apis/fastapi/workflows/models.py | Renames request model fields to workflow_revision_commit and workflow_revisions_log. |
| api/oss/src/apis/fastapi/testsets/router.py | Reads testset_revisions_log from request body. |
| api/oss/src/apis/fastapi/testsets/models.py | Renames log request wrapper field to testset_revisions_log. |
| api/oss/src/apis/fastapi/queries/router.py | Reads query_revisions_log from request body. |
| api/oss/src/apis/fastapi/queries/models.py | Renames log request wrapper field to query_revisions_log. |
| api/oss/src/apis/fastapi/evaluators/router.py | Reads evaluator_revisions_log from request body. |
| api/oss/src/apis/fastapi/evaluators/models.py | Renames log request wrapper field to evaluator_revisions_log. |
| api/oss/src/apis/fastapi/environments/router.py | Reads environment_revisions_log from request body (also minor formatting change). |
| api/oss/src/apis/fastapi/environments/models.py | Renames log request wrapper field to environment_revisions_log. |
| api/oss/src/apis/fastapi/applications/router.py | Reads application_revisions_log from request body (also minor formatting change). |
| api/oss/src/apis/fastapi/applications/models.py | Renames log request wrapper field to application_revisions_log. |
Comments suppressed due to low confidence (8)
api/oss/src/apis/fastapi/workflows/models.py:251
- This rename makes
POST /workflows/revisions/commitreject the legacy wrapper keyworkflow_revision, which is still used by existing clients in this repo (e.g. generated TS client). To avoid an immediate breaking change, consider accepting the old key as a validation alias while keeping the new field name in the OpenAPI schema.
class WorkflowRevisionCommitRequest(BaseModel):
workflow_revision_commit: WorkflowRevisionCommit = Field(
description=(
"Revision to append to a variant's history. Requires `workflow_variant_id` "
"and optional `message`; `data` carries the new configuration."
),
)
api/oss/src/apis/fastapi/workflows/models.py:369
- This rename makes
POST /workflows/revisions/logreject the legacy wrapper keyworkflow, which is still used by existing clients. If you want a non-breaking transition, accept the old key via a Pydanticvalidation_aliaswhile documenting/serializing the new name.
class WorkflowRevisionsLogRequest(BaseModel):
workflow_revisions_log: WorkflowRevisionsLog = Field(
description=(
"Log query. Supply `workflow_id`, `workflow_variant_id`, or "
"`workflow_revision_id` to scope the log, and an optional `depth`."
),
)
api/oss/src/apis/fastapi/applications/models.py:174
POST /applications/revisions/logwill now reject the legacy wrapper keyapplication. Since existing clients still sendapplication, consider accepting it as avalidation_aliasto prevent a hard break while transitioning toapplication_revisions_log.
class ApplicationRevisionsLogRequest(BaseModel):
"""Request body for `POST /applications/revisions/log`.
Returns the ordered list of revisions committed to a variant, newest first.
Each entry carries commit metadata and the full revision record.
"""
application_revisions_log: ApplicationRevisionsLog = Field(
description=(
"Filter for the log. Typically set `application_variant_id` to list "
"the revision history of a single variant; optionally set "
"`application_revision_id` + `depth` to walk back a bounded number "
"of commits from a specific revision."
),
)
api/oss/src/apis/fastapi/testsets/models.py:280
POST /testsets/revisions/logwill now reject the legacy wrapper keytestset_revision. If backwards compatibility is desired, accept the old key as avalidation_aliaswhile keeping the new field name for documentation.
class TestsetRevisionsLogRequest(BaseModel):
testset_revisions_log: TestsetRevisionsLog = Field(
description="Scope for the log: one of `testset_id`, `testset_variant_id`, or `testset_revision_id`. Optional `depth` limits how far back to walk.",
)
include_testcases: Optional[bool] = Field(
default=None,
description="Include full testcase objects for each returned revision.",
)
api/oss/src/apis/fastapi/workflows/models.py:251
- This rename makes
POST /workflows/revisions/commitreject the legacy wrapper keyworkflow_revision, which is still used by existing clients in this repo (e.g. generated TS client). To avoid an immediate breaking change, consider accepting the old key as a validation alias while keeping the new field name in the OpenAPI schema.
class WorkflowRevisionCommitRequest(BaseModel):
workflow_revision_commit: WorkflowRevisionCommit = Field(
description=(
"Revision to append to a variant's history. Requires `workflow_variant_id` "
"and optional `message`; `data` carries the new configuration."
),
)
api/oss/src/apis/fastapi/workflows/models.py:369
- This rename makes
POST /workflows/revisions/logreject the legacy wrapper keyworkflow, which is still used by existing clients. If you want a non-breaking transition, accept the old key via a Pydanticvalidation_aliaswhile documenting/serializing the new name.
class WorkflowRevisionsLogRequest(BaseModel):
workflow_revisions_log: WorkflowRevisionsLog = Field(
description=(
"Log query. Supply `workflow_id`, `workflow_variant_id`, or "
"`workflow_revision_id` to scope the log, and an optional `depth`."
),
)
api/oss/src/apis/fastapi/applications/models.py:174
POST /applications/revisions/logwill now reject the legacy wrapper keyapplication. Since existing clients still sendapplication, consider accepting it as avalidation_aliasto prevent a hard break while transitioning toapplication_revisions_log.
class ApplicationRevisionsLogRequest(BaseModel):
"""Request body for `POST /applications/revisions/log`.
Returns the ordered list of revisions committed to a variant, newest first.
Each entry carries commit metadata and the full revision record.
"""
application_revisions_log: ApplicationRevisionsLog = Field(
description=(
"Filter for the log. Typically set `application_variant_id` to list "
"the revision history of a single variant; optionally set "
"`application_revision_id` + `depth` to walk back a bounded number "
"of commits from a specific revision."
),
)
api/oss/src/apis/fastapi/testsets/models.py:280
POST /testsets/revisions/logwill now reject the legacy wrapper keytestset_revision. If backwards compatibility is desired, accept the old key as avalidation_aliaswhile keeping the new field name for documentation.
class TestsetRevisionsLogRequest(BaseModel):
testset_revisions_log: TestsetRevisionsLog = Field(
description="Scope for the log: one of `testset_id`, `testset_variant_id`, or `testset_revision_id`. Optional `depth` limits how far back to walk.",
)
include_testcases: Optional[bool] = Field(
default=None,
description="Include full testcase objects for each returned revision.",
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Stacked on #4469.
Renames the wrapper field on revision commit/log request bodies so each matches the snake_case form of its enclosing request class:
/workflows/revisions/commitworkflow_revisionworkflow_revision_commit/workflows/revisions/logworkflowworkflow_revisions_log/applications/revisions/logapplicationapplication_revisions_log/evaluators/revisions/logevaluatorevaluator_revisions_log/environments/revisions/logenvironmentenvironment_revisions_log/queries/revisions/logquery_revisionsquery_revisions_log/testsets/revisions/logtestset_revisiontestset_revisions_logUpdates the FastAPI request models, the routers that read those fields, and the handwritten callers:
web/packages/agenta-entities/src/workflow/api/api.ts— commit bodies only; query/response uses ofworkflow_revisionare intentionally unchanged.sdks/python/agenta/sdk/managers/shared.py— history/ahistory log bodies.Fern-generated clients are regenerated separately.
Test plan
🤖 Generated with Claude Code