Generated documents (asset list, risk register, SoA, ...) previously
only ever produced a new major version. Every regeneration of an
auto-built register consumed a major number, even when the change was
trivial. They now accept a minor flag and publish as
currentMajor.currentMinor+1 when set, bypassing the approval flow.
To carry the flag through cleanly, the document publish API was
refactored. The three split mutations (publishMajor, publishMinor,
requestDocumentVersionApproval) and the two bulk variants collapse
into a single publishDocument / bulkPublishDocuments, both taking the
new minor: Boolean! and a now-required changelog: String!. The same
shape flows through the CLI ("prb document publish --minor"), the MCP
tool, the n8n operations, and the Relay dialogs, where each
generated-doc dialog gains a "Publish as minor" button. Publishing
minor without an existing major is rejected with
ErrCannotPublishMinorWithoutMajor.
This is a deliberate breaking change for callers of the prior
mutations.
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
61 lines
2.6 KiB
Go
61 lines
2.6 KiB
Go
// Copyright (c) 2026 Probo Inc <hello@getprobo.com>.
|
|
//
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
// copyright notice and this permission notice appear in all copies.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
// PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
package document
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"go.probo.inc/probo/pkg/cmd/cmdutil"
|
|
"go.probo.inc/probo/pkg/cmd/document/archive"
|
|
"go.probo.inc/probo/pkg/cmd/document/create"
|
|
"go.probo.inc/probo/pkg/cmd/document/delete"
|
|
deletedraft "go.probo.inc/probo/pkg/cmd/document/delete-draft"
|
|
"go.probo.inc/probo/pkg/cmd/document/list"
|
|
listapprovaldecisions "go.probo.inc/probo/pkg/cmd/document/list-approval-decisions"
|
|
listapprovalquorums "go.probo.inc/probo/pkg/cmd/document/list-approval-quorums"
|
|
listversions "go.probo.inc/probo/pkg/cmd/document/list-versions"
|
|
"go.probo.inc/probo/pkg/cmd/document/publish"
|
|
"go.probo.inc/probo/pkg/cmd/document/unarchive"
|
|
"go.probo.inc/probo/pkg/cmd/document/update"
|
|
"go.probo.inc/probo/pkg/cmd/document/view"
|
|
viewapprovaldecision "go.probo.inc/probo/pkg/cmd/document/view-approval-decision"
|
|
viewapprovalquorum "go.probo.inc/probo/pkg/cmd/document/view-approval-quorum"
|
|
viewversion "go.probo.inc/probo/pkg/cmd/document/view-version"
|
|
)
|
|
|
|
func NewCmdDocument(f *cmdutil.Factory) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "document <command>",
|
|
Short: "Manage documents",
|
|
}
|
|
|
|
cmd.AddCommand(list.NewCmdList(f))
|
|
cmd.AddCommand(create.NewCmdCreate(f))
|
|
cmd.AddCommand(view.NewCmdView(f))
|
|
cmd.AddCommand(update.NewCmdUpdate(f))
|
|
cmd.AddCommand(delete.NewCmdDelete(f))
|
|
cmd.AddCommand(archive.NewCmdArchive(f))
|
|
cmd.AddCommand(unarchive.NewCmdUnarchive(f))
|
|
cmd.AddCommand(listversions.NewCmdListVersions(f))
|
|
cmd.AddCommand(viewversion.NewCmdViewVersion(f))
|
|
cmd.AddCommand(deletedraft.NewCmdDeleteDraft(f))
|
|
cmd.AddCommand(publish.NewCmdPublish(f))
|
|
cmd.AddCommand(listapprovalquorums.NewCmdListApprovalQuorums(f))
|
|
cmd.AddCommand(viewapprovalquorum.NewCmdViewApprovalQuorum(f))
|
|
cmd.AddCommand(listapprovaldecisions.NewCmdListApprovalDecisions(f))
|
|
cmd.AddCommand(viewapprovaldecision.NewCmdViewApprovalDecision(f))
|
|
|
|
return cmd
|
|
}
|