Skip to content

feat(coderd): add organization saved workflow routes - #337

Merged
ibetitsmike merged 30 commits into
mainfrom
mike/issue-322-saved-workflows-c
Nov 15, 2026
Merged

ibetitsmike merged 30 commits into
mainfrom
mike/issue-322-saved-workflows-c

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Coder Agents opened this PR on behalf of @ibetitsmike.

Part of #322. Stacked on #336 (user routes). Third of four PRs: storage, user routes, organization routes and ACL (this one), then run_workflow by name.

What changed

  • Organization-tier saved workflow routes behind experiment fork-workflows, at /api/v2/chats/fork/organizations/{organization}/workflows[/{workflow}]: list, create, get, patch, delete. Plus GET /acl, GET /acl/available and PATCH /acl. They mirror the organization agent definition routes and reuse the organization skill ACL types and helpers.
  • A new organization workflow is shared with the Everyone group, like a new organization skill or agent definition. created_by is the caller and user_id is empty.
  • Only callers with organization skill create, update, delete or share rights (organization admins by default) can write or share. Members read through the ACL. A member who cannot read a workflow gets 404 on read, update and delete. A reader gets 403 on update and delete. The ACL routes return 404 to anyone who cannot share.
  • SDK client methods for all eight routes.
  • Generated swagger. docs/ output is left out for the reason given in feat(coderd): add user saved workflow routes #336.

Assumption for the lead: a plain member cannot publish to the organization tier, because this mirrors agent definitions and organization skills. #327 mentions a member sharing a workflow. If that should be allowed, it needs an RBAC decision.

Tests

  • flock ~/.fork-go.lock go test ./coderd/ -run 'TestFork(User|Organization)SavedWorkflows' -count=1 -v: all 5 subtests pass. The organization tests cover admin CRUD, conflict and invalid input, the tier split from a personal workflow of the same name, member read via Everyone, member writes refused with 403, ACL narrowing, 404 for non-readers, 403 for readers, ACL routes hidden from readers, the available-candidates route, a bad ACL update, and the experiment off.
  • flock ~/.fork-go.lock make gen GEN_SKIP_GOLDEN=1: pass. Swag reordered two enum blocks this run. I restored the original order so the generated diff only adds the new routes and types.
  • golangci-lint run --fix=false ./coderd/ ./codersdk/: no findings in the files of this PR.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

$> Coder Agents acted on behalf of @ibetitsmike.\n\n@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T18:15:23.281226Z d0dcfda Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 86d32dc499

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: bb043a5377

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 3e93b005df

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 831eeefbe2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/ARCHITECTURE.md Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 3a5e7895dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

…workflows-a

# Conflicts:
#	coderd/database/forkdb/sqlc.yaml
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

Merged main forward through the stack. @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 6b34048171

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: ac7ef9d5b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: c43cddb3cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…workflows-b

# Conflicts:
#	coderd/database/forkdb/sqlc.yaml
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

Merged -b forward, after main (with #335) went into -b. The org insert sets created_by from httpmw.APIKey(r).UserID and the request type has no such field. c43cddb sends a raw POST from the org admin with created_by and user_id set to another member, and asserts that created_by is the org admin and user_id is nil. It also tests a null phase element on the org route.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: f156cd8a09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 81e1a1f1bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Base automatically changed from mike/issue-322-saved-workflows-b to main November 15, 2026 17:55
…workflows-c

# Conflicts:
#	coderd/fork_chat_routes.go
#	coderd/fork_saved_workflows.go
#	coderd/fork_saved_workflows_test.go
#	coderd/x/chatd/ARCHITECTURE.md
#	codersdk/fork_saved_workflows.go
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

#336 merged. The base is now main and main is merged in. Conflicts from the squash merge were resolved to C's side. The one exception is ARCHITECTURE.md, which keeps #344's changes. fork-ci is green on this head.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: d0dcfda30f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit 895036c into main Nov 15, 2026
9 checks passed
@ibetitsmike
ibetitsmike deleted the mike/issue-322-saved-workflows-c branch November 15, 2026 18:47
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

Merged as 895036c (squash, --match-head-commit d0dcfda30f59d1091213e5191b0b842d46b13561). Its parent is b4340bd, the main I verified.

Gates on head d0dcfda, checked by script right before the merge:

  1. Head and main (b4340bd) equal the SHAs I verified.
  2. All check runs on the head passed. fork-ci run 43744001754 succeeded on this exact head.
  3. Codex receipt on d0dcfda: "Didn't find any major issues".
  4. No unresolved review threads.
  5. Not behind main.
  6. Independent Opus review on this exact head: merge OK, no P1 or P2. It ran go test ./coderd/ -run 'TestForkUserSavedWorkflows|TestForkOrganizationSavedWorkflows', go test ./coderd/database/dbauthz/ -run TestSavedWorkflowRBAC and go test ./coderd/database/forkdb/ -run TestSavedWorkflows, all PASS, plus a temporary probe of cross-org access, auditor read and scoped API keys, which also passed. Three P3 items (early schema length check, unicode.Cf in phase names, committing the probe cases as tests) move to feat(chatd): run saved workflows by name #338.

The previous deploy (b4340bd) was live before this merge. Not exercised: the routes against the running server, make gen drift was not rerun by the reviewer (CI schema check passed), and no UI uses these routes yet (#326, #327).

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.

1 participant