Resolve document publish approvers from defaults#1471
Open
SachaProbo wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
2 issues found across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
02652f9 to
52da1a0
Compare
The MCP publishDocument tool required callers to pass approver_ids and to distinguish an omitted list (rejected) from an empty one (direct publish), a null-vs-empty subtlety that is awkward for an LLM to get right. Drop approver_ids from the MCP tool and resolve a major publish's approvers from the document's default approvers instead: an approval is requested when the document has default approvers, otherwise the version is published directly. Default approvers are configured with addDocument or updateDocument. Replace a document's default approvers on every major publish that supplies an explicit list, even when the list is empty, so a direct publish through the GraphQL API clears stale approvers instead of leaving them behind (previously the empty case skipped the update). Expose the default-approver behaviour as a separate entry point, PublishVersionWithDefaultApprovers, that loads the defaults and delegates to PublishVersion. PublishVersion keeps its explicit-approver contract for the GraphQL API. Require only the publish permission to publish a version, whether or not it opens an approval quorum, and drop the now-unused request-approval action. Fold the publish steps into the publishMinor and publishMajor primitives shared by both the single and bulk publish paths, and drop the redundant InTx suffix from RequestApproval and emitDocumentEvent, which already take a transaction argument. Signed-off-by: Sacha Al Himdani <[email protected]>
52da1a0 to
6dfb33c
Compare
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.
The MCP publishDocument tool required callers to pass approver_ids and to distinguish an omitted list (rejected) from an empty one (direct publish), a null-vs-empty subtlety that is awkward for an LLM to get right.
Drop approver_ids from the MCP tool and resolve a major publish's approvers from the document's default approvers instead: an approval is requested when the document has default approvers, otherwise the version is published directly. Default approvers are configured with addDocument or updateDocument.
Replace a document's default approvers on every major publish that supplies an explicit list, even when the list is empty, so a direct publish through the GraphQL API clears stale approvers instead of leaving them behind (previously the empty case skipped the update).
Expose the default-approver behaviour as a separate entry point, PublishVersionWithDefaultApprovers, that loads the defaults and delegates to PublishVersion. PublishVersion keeps its explicit-approver contract for the GraphQL API.
Require only the publish permission to publish a version, whether or not it opens an approval quorum, and drop the now-unused request-approval action.
Fold the publish steps into the publishMinor and publishMajor primitives shared by both the single and bulk publish paths, and drop the redundant InTx suffix from RequestApproval and emitDocumentEvent, which already take a transaction argument.
Summary by cubic
Major publishes in MCP now use a document’s default approvers: if defaults exist we open an approval quorum; if not, we publish directly. GraphQL still supports explicit approvers, and major publishes update the document’s default approvers (empty clears), with only the publish permission required.
Service
+266-165PublishVersionWithDefaultApproversinpkg/proboto load defaults and delegate toPublishVersion.publishMajor/publishMinorto handle single and bulk paths and emit version-published events.ActionDocumentVersionPublish.RequestApprovalInTx→RequestApprovalandemitDocumentEventInTx→emitDocumentEvent; updated all call sites, including generated document flows and bulk publish.MCP
+7-18publishDocumenttool no longer acceptsapprover_ids; it resolves approvers from document defaults viaPublishVersionWithDefaultApprovers.specification.yamlto reflect the simpler input and new default-approver behavior.GraphQL API
+1-6publishDocumentnow always authorizes with the publish action only.Tests
+107-0Written for commit 6dfb33c. Summary will update on new commits.