Allow initial document minor publishing

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-05-26 02:13:46 +00:00
committed by Bryan Frimin
parent 6dfdd7ca49
commit b721179974
5 changed files with 108 additions and 11 deletions

View File

@@ -70,7 +70,7 @@ func NewCmdPublish(f *cmdutil.Factory) *cobra.Command {
Long: `Publish the latest draft of a document.
By default, the draft is published as a new major version. Pass --minor to
publish as a minor version (the document must already have a major version).
publish as a minor version.
When --approver is set (one or more profile IDs), an approval is requested
instead of publishing immediately. Approvers are ignored with --minor.`,
Args: cobra.ExactArgs(1),

View File

@@ -541,10 +541,8 @@ func (s DocumentService) generateChangelog(
// PublishVersion is the single entry point for publishing a document
// version. The behaviour depends on req.Minor and req.ApproverIDs:
// - Minor=true: publish the existing draft as a minor bump (currentMajor.
// currentMinor+1). ApproverIDs are ignored. Errors with
// ErrCannotPublishMinorWithoutMajor when the document has never been
// published.
// - Minor=true: publish the existing draft as a minor version. ApproverIDs
// are ignored.
// - Minor=false with ApproverIDs: open an approval quorum on the draft as
// a pending major bump (currentMajor+1.0). Result.Quorum is set.
// - Minor=false without ApproverIDs: publish the draft immediately as a
@@ -2826,10 +2824,6 @@ func (s *DocumentService) publishMinorVersionInTx(
return document, documentVersion, nil
}
if document.CurrentPublishedMajor == nil || document.CurrentPublishedMinor == nil {
return nil, nil, &ErrCannotPublishMinorWithoutMajor{}
}
document.CurrentPublishedMajor = &documentVersion.Major
document.CurrentPublishedMinor = &documentVersion.Minor

View File

@@ -6321,7 +6321,7 @@ components:
description: Document ID
minor:
type: boolean
description: When true, publish the draft as a minor version (currentMajor.currentMinor+1) and ignore approver_ids; the document must already have a published major version. When false, publish as a new major version; if approver_ids are provided, an approval is requested instead.
description: When true, publish the draft as a minor version and ignore approver_ids. When false, publish as a new major version; if approver_ids are provided, an approval is requested instead.
approver_ids:
type: array
items: