Repository navigation
feat(frontend): variants and deployments in /m behind the developer view switch - #8003
Conversation
|
Caution Review failedThe pull request is closed. Summary
Merge Risk:
|
Website previewPreview URL: https://pr-8003-agenta-website-preview.mahmoud-637.workers.dev Built from |
| revisionId: revision.id, | ||
| workflowId: revision.workflow_id ?? appId, | ||
| variantId, | ||
| variantName: variant?.name ?? variant?.slug ?? revision.name ?? variantId, |
There was a problem hiding this comment.
Remove the revision.name read from the variant label.
When the variant is missing from variantById, the label falls back to revision.name. That value is not a valid display label. UI-created revisions carry the variant name ("default"). SDK-created revisions carry no name. The row then shows a wrong or empty label. Resolve the label from the variant only, then fall back to variantId.
--- "a/web/mobile/src/features/variants/useAppRevisions.ts"
+++ "b/web/mobile/src/features/variants/useAppRevisions.ts"
@@ -88,7 +88,7 @@
revisionId: revision.id,
workflowId: revision.workflow_id ?? appId,
variantId,
- variantName: variant?.name ?? variant?.slug ?? revision.name ?? variantId,
+ variantName: variant?.name ?? variant?.slug ?? variantId,
variantSlug: variant?.slug ?? revision.variant_slug ?? null,
version: Number(revision.version),
model: pickModelName(revision.data?.parameters ?? null),As per coding guidelines: "Review blocker: any .name read off a revision entity (e.g. selectors.data(id)?.name or a revision row's name) used as a display label." Also: "Never label a variant from a revision's fields."
Committable suggestion
-
IMPORTANT
Review the replacement and indentation, then test before committing.Suggested changevariantName: variant?.name ?? variant?.slug ?? revision.name ?? variantId, variantName: variant?.name ?? variant?.slug ?? variantId,
Source: Coding guidelines
| revisionId, | ||
| workflowId: appId, | ||
| variantId, | ||
| variantName: variant?.name ?? variant?.slug ?? entity.name ?? variantId, |
There was a problem hiding this comment.
Remove the entity.name read from the variant label.
This row feeds the drawer Deploy action and the deploy dialog text. The label falls back to entity.name, which is a revision field. It can hold "default" or be empty, so the dialog can name the wrong variant. Use the variant list only, then variantId.
--- "a/web/mobile/src/features/variants/useShownRevisionRow.ts"
+++ "b/web/mobile/src/features/variants/useShownRevisionRow.ts"
@@ -36,7 +36,7 @@
revisionId,
workflowId: appId,
variantId,
- variantName: variant?.name ?? variant?.slug ?? entity.name ?? variantId,
+ variantName: variant?.name ?? variant?.slug ?? variantId,
variantSlug: variant?.slug ?? entity.variant_slug ?? null,
version: Number(entity.version ?? 0),
model: pickModelName(entity.data?.parameters ?? null),As per coding guidelines: "revision.name is dead for display. Never read it as a label and never write entity names into it."
Committable suggestion
-
IMPORTANT
Review the replacement and indentation, then test before committing.Suggested changevariantName: variant?.name ?? variant?.slug ?? entity.name ?? variantId, variantName: variant?.name ?? variant?.slug ?? variantId,
Source: Coding guidelines
Railway Preview Environment
Dependent tests finished. Post /preview for manual review. Environment absence verified; retained storage requires separate provider accounting. Post |
… and build history before search
…sses in Storybook and hide the latest tag on phones
…s, v0 seed check and renamed variant names
1ce2480 to
241c572
Compare
For the release after v0.128.3. Do not merge into v0.128.3.
Context
The old app has a "Registry" page (variants and revisions of an app) and a deployments page (which revision runs in each environment). /m has neither. This PR adds both to /m as one developer view, behind the staged switch from #7985. It ships with stage
hidden, so no user sees it and the navigation has no link.Changes
variantsinDEVELOPER_VIEWS(stagehidden, label "Variants"). Route/w/[workspace_id]/p/[project_id]/variants?app=<id>, wrapped inDeveloperViewGate. The page has an app picker that writes?app=and the active tab.?env=<slug>). A history row can open the drawer or be reverted.@agenta/entities:buildAppDeploymentHistoryandpickModelName.fetchEnvironmentRevisionsListaccepts anextcursor.RevisionDetailsin@agenta/entity-uishows a dash when the author is unknown.Bugs in the old pages, fixed here (each has a test)
deploy_environmentsoredit_workflows.New user-facing text (needs Mahmoud's approval)
Tests
pnpm --filter @agenta/mobile types:checkandpnpm --filter @agenta/oss types:check: clean.pnpm --filter @agenta/mobile lint: clean (8 existing warnings).pnpm --filter @agenta/mobile test: 164 of 165 files pass (997 of 998 tests). The one failure ismembersTabRoleChange.render.test.tsx, which also fails onrelease/v0.128.3.agentPermissions.render.test.tsx, the other known failure, also fails on the release branch and passed in this run.appDeploymentHistory), the data hooks, the table, the dialogs and the screen. Storybook stories for the screen and dialogs are in@agenta/mobile/Developer.package.jsonchange. Nothing in_app,AppProviders,GlobalDrawersor the app shell imports the view. The one developer link usesprefetch={false}.Open problems
developerViews.tsgains avariantsentry. Other view PRs add their own entry in the same array, so merge order needs a manual merge there; keep every entry.What to QA
Not reachable yet. To try it, set
AGENTA_DEVELOPER_VIEWS=variantson the web container and open/m/w/<workspace>/p/<project>/variants. Once the stage ispreview, switch it on in Settings > Preferences.?app=: "Pick an app" shows. Pick an app: the address gets?app=<id>and the revisions list shows.deploy_environments: Deploy and Revert are not shown.