Skip to content

Add pickbox cli#9

Merged
addityasingh merged 12 commits into
mainfrom
as-add-cobra-cli
Jul 15, 2025
Merged

Add pickbox cli#9
addityasingh merged 12 commits into
mainfrom
as-add-cobra-cli

Conversation

@addityasingh
Copy link
Copy Markdown
Owner

Add pickbox cli

Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gosec found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 13, 2025

Codecov Report

Attention: Patch coverage is 25.88997% with 458 lines in your changes missing coverage. Please review.

Project coverage is 47.39%. Comparing base (32bce14) to head (e68ead4).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
cmd/pickbox/node.go 16.45% 269 Missing ⚠️
cmd/pickbox/cluster.go 26.26% 72 Missing and 1 partial ⚠️
cmd/pickbox/multi_replication.go 32.94% 57 Missing ⚠️
cmd/pickbox/script.go 58.24% 37 Missing and 1 partial ⚠️
pkg/admin/server.go 0.00% 21 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main       #9       +/-   ##
===========================================
- Coverage   68.50%   47.39%   -21.12%     
===========================================
  Files           9       13        +4     
  Lines         978     1842      +864     
===========================================
+ Hits          670      873      +203     
- Misses        286      944      +658     
- Partials       22       25        +3     
Flag Coverage Δ
combined 47.39% <25.88%> (-21.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/admin/server.go 75.18% <0.00%> (-14.10%) ⬇️
cmd/pickbox/script.go 58.24% <58.24%> (ø)
cmd/pickbox/multi_replication.go 20.24% <32.94%> (ø)
cmd/pickbox/cluster.go 26.26% <26.26%> (ø)
cmd/pickbox/node.go 16.45% <16.45%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread cmd/pickbox/cluster.go
clusterJoinCmd.Flags().StringVarP(&leaderAddr, "leader", "l", "", "Leader address (required)")
clusterJoinCmd.Flags().StringVarP(&joinNodeID, "node-id", "n", "", "Node ID to join (required)")
clusterJoinCmd.Flags().StringVarP(&joinNodeAddr, "node-addr", "a", "", "Node address (required)")
clusterJoinCmd.MarkFlagRequired("leader")

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/cluster.go
clusterJoinCmd.Flags().StringVarP(&joinNodeID, "node-id", "n", "", "Node ID to join (required)")
clusterJoinCmd.Flags().StringVarP(&joinNodeAddr, "node-addr", "a", "", "Node address (required)")
clusterJoinCmd.MarkFlagRequired("leader")
clusterJoinCmd.MarkFlagRequired("node-id")

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/cluster.go
clusterJoinCmd.Flags().StringVarP(&joinNodeAddr, "node-addr", "a", "", "Node address (required)")
clusterJoinCmd.MarkFlagRequired("leader")
clusterJoinCmd.MarkFlagRequired("node-id")
clusterJoinCmd.MarkFlagRequired("node-addr")

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/node.go
nodeStartCmd.Flags().IntVar(&dashboardPort, "dashboard-port", 9003, "Dashboard port")
nodeStartCmd.Flags().StringVarP(&joinAddr, "join", "j", "", "Address of node to join")
nodeStartCmd.Flags().BoolVarP(&bootstrapCluster, "bootstrap", "b", false, "Bootstrap new cluster")
nodeStartCmd.MarkFlagRequired("node-id")

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/node.go
nodeMultiCmd.Flags().StringVarP(&liveNodeID, "node-id", "n", "", "Node ID (required)")
nodeMultiCmd.Flags().IntVarP(&livePort, "port", "p", 8001, "Port")
nodeMultiCmd.Flags().StringVarP(&liveJoin, "join", "j", "", "Address of node to join")
nodeMultiCmd.MarkFlagRequired("node-id")

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/node.go

// Stop Raft
if app.raftManager != nil {
app.raftManager.Shutdown()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/node.go
go func() {
<-c
app.logger.Info("🛑 Received shutdown signal...")
app.Stop()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/script.go
fmt.Println("🚀 Starting 3-node cluster demo...")

// Get data directory from global flags
dataDir, _ := cmd.Flags().GetString("data-dir")

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/script.go

func runCleanup(cmd *cobra.Command, args []string) error {
// Get data directory from global flags
dataDir, _ := cmd.Flags().GetString("data-dir")

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Comment thread cmd/pickbox/script.go Fixed
Comment thread cmd/pickbox/script.go Dismissed
@addityasingh addityasingh marked this pull request as ready for review July 15, 2025 21:36
@addityasingh addityasingh merged commit ede356a into main Jul 15, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants