feat: add approval policies and server-task approvals support#426
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The approval policies list endpoint requires the skip and take query parameters; the generic paginated helper omits them, so GetAll was rejected with HTTP 400 by the server. Route GetAll through Get with a max take instead. Verified end-to-end against a live instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mik-ky
approved these changes
Jul 15, 2026
mik-ky
left a comment
Contributor
There was a problem hiding this comment.
Tested locally. Looks good 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds Go client support for the Octopus Approvals feature (server-side gated by
OctopusApprovalsFeatureToggle), which was built in the server and TypeScript client but never ported here. Precursor for SI-260 / SI-222 (Terraform provider support) and a planned approvals CLI.Changes
pkg/approvalpolicies/— the reusable approval-policy configuration resource (Settings > Approvals):ApprovalPolicyresource withTag/Idscoping (ApprovalPolicyTagScope,ApprovalPolicyIdScope), approving users/teams,MinimumApproversRequired,AllowSelfApproval,IsDisabled.GetByID,Get(paginated),GetAll,Add,Update,DeleteByID— modernnewclientfunctional style (no root-document link; routes built from a{spaceId}template).pkg/approvals/— the runtime side (for reading approval status and submitting decisions, e.g. from a CLI):ServerTaskApproval+ChangeRequest, the richer by-taskServerTaskApprovalDetail, andApproval(individualApproved/Rejected+ notes) with theApprovalStatusandChangeRequestApprovalStateenums.GetByTaskID(nullable envelope →(nil,nil)),GetByID,Get,GetAll,ListApprovals(bare array),GetApprovalByID,AddApproval,UpdateApproval.Faithful to the API contract:
AllowSelfApproval/IsDisabledare exposed directly (no inversion), and no BFF endpoints are included.Testing
go test ./pkg/approvalpolicies/... ./pkg/approvals/...).GetAllomitted the server-requiredskip/takequery parameters (HTTP 400).🤖 Generated with Claude Code