Skip to content

Workflows save action: cleanups from #411 review #413

Closed

Description

@ibetitsmike

Coder Agents acted on behalf of @ibetitsmike.

Follow-up cleanups from the Codex round-4 review of #411 (head 620a311). These were dropped on #411 so the reviewed head could merge. None is a P1. The server enforces saved-workflow permissions through dbauthz, so finding 1 is a UI staleness issue, not an authorization gap.

  • useForkWorkflowSave.tsx: hold the Organization submission while a cached permission check refetches, and reset the tier when the Organization choice disappears during a refetch.
  • ForkWorkflowSaveDialog.tsx: correct the form-adapter comment. argsSchema and phases are hard-coded empty, not taken from run data.
  • useForkWorkflowSave.tsx: remove the unused saveTarget and saved.organizationId from the hook state.
  • useForkWorkflowSave.tsx: derive SaveTier from SavedWorkflowScope["tier"] instead of redeclaring it.

Acceptance: a unit test that fails without the refetch hold, the targeted vitest run passes, and fork-ci and Codex pass on the head.

Activity

  1. ibetitsmike commented on Nov 21, 2026

    @ibetitsmike
    OwnerAuthor

    Coder Agents acted on behalf of @ibetitsmike.

    Two more items from the #411 Codex review of 7e20b19, dropped there to converge the review loop:

    • Keep the saved state of the run-card Save action when the tool card collapses. Today a collapse unmounts ForkWorkflowSaveAction, so Save shows again, and a re-submit gets a name conflict from the server (no duplicate is created).
    • Prefill the save dialog name when the run has no title. Runs have no title yet (codersdk/fork_workflow_runs.go), so production prefill is empty. Options: a backend run title, or a default derived from the script.
  2. ibetitsmike commented on Nov 21, 2026

    @ibetitsmike
    OwnerAuthor

    Coder Agents acted on behalf of @ibetitsmike.

    • ForkSavedWorkflowsPage.test.tsx: the test "does not push a duplicate entry when the shown organization is reselected" (site: Save workflow action on the run card #411 head 646334b) passes even without the org.id !== organization.id guard. It reads window.history.length, which the test router does not change. Make it behavioral (go Back and assert the previous org shows), and prove that it fails without the guard, or record that the guard is purely defensive.
  3. ibetitsmike commented on Nov 21, 2026

    @ibetitsmike
    OwnerAuthor

    Coder Agents acted on behalf of @ibetitsmike.

    • ForkWorkflowTool.tsx (EndedForkWorkflowTool): when the one-shot detail request for an already-completed card fails after its retries, Save disappears until a remount. Show the failed load with a retry action. From the site: Save workflow action on the run card #411 Codex review of 646334b.
  4. added a commit that references this issue on Nov 21, 2026
    14126d1
  5. ibetitsmike commented on Nov 21, 2026

    @ibetitsmike
    OwnerAuthor

    Coder Agents acted on behalf of @ibetitsmike.

    PR #417 is open for this issue (head 14126d1, based on main 0287e36). It adds the refetch hold, fixes the comments and the unused state, and derives SaveTier. The regression test fails with the old hold expression (negative control). Waiting for fork-ci and Codex.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions