Repository navigation
feat(routing): add publish all support - #1988
Conversation
Signed-off-by: Dennis Lanov <[email protected]>
There was a problem hiding this comment.
LGTM, thanks for the contribution! Just one small fix before we merge: use presenter.PrintSmartf here instead of Printf — the former routes to stderr for structured output formats, so the prompt and abort message don't end up inside the JSON stream on --all --output json.
| } | ||
|
|
||
| func confirmPublishAll(cmd *cobra.Command) (bool, error) { | ||
| presenter.Printf(cmd, "%s [y/N]: ", publishAllPrompt) |
There was a problem hiding this comment.
| presenter.Printf(cmd, "%s [y/N]: ", publishAllPrompt) | |
| presenter.PrintSmartf(cmd, "%s [y/N]: ", publishAllPrompt) |
| } | ||
|
|
||
| if !confirmed { | ||
| presenter.Printf(cmd, "Aborted. No records were submitted for publication.\n") |
There was a problem hiding this comment.
| presenter.Printf(cmd, "Aborted. No records were submitted for publication.\n") | |
| presenter.PrintSmartf(cmd, "Aborted. No records were submitted for publication.\n") |
Signed-off-by: Dennis Lanov <[email protected]>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
tkircsi
left a comment
There was a problem hiding this comment.
Thanks a lot for contributing! Please, check the routing Publish process. I think, the unpublished filtering is not needed, because Publish is idempotent.
Signed-off-by: Dennis Lanov <[email protected]>
| return confirmPublishAll(cmd) | ||
| } | ||
|
|
||
| func confirmPublishAll(cmd *cobra.Command) (bool, error) { |
There was a problem hiding this comment.
confirmPublishAll is a duplicate of the unexported confirm in cli/cmd/install/install.go Canwe export it to a shared helper in something like cli/util/prompt.
Signed-off-by: Dennis Lanov <[email protected]>
|
@tkircsi Thanks for the review. I addressed the requested changes:
All checks are passing. Could you please take another look when you have a chance? |
Summary
all_recordspublication request to the routing APIdirctl routing publish --allwith an interactive confirmation--yesto support non-interactive bulk publication--allprompting on non-terminal stdin unless--yesis provided--stdin,--all, and--yesinput modesTesting
(cd proto && go run github.com/bufbuild/buf/cmd/[email protected] dep update)(cd proto && go run github.com/bufbuild/buf/cmd/[email protected] lint)(cd proto && go run github.com/bufbuild/buf/cmd/[email protected] generate --template buf.gen.yaml)golangci-lint run --config .golangci.yml ./cmd/routinggolangci-lint run --config .golangci.yml ./publicationgo test ./cmd/routing -count=1go test ./publication -count=1Fixes #1965