Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitada20d2

Browse files
authored
feat: implement coder exp boundary subcommand (#19771)
1 parent6e4d903 commitada20d2

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

‎cli/exp_boundary.go‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package cli
2+
3+
import (
4+
boundarycli"github.com/coder/boundary/cli"
5+
"github.com/coder/serpent"
6+
)
7+
8+
func (*RootCmd)boundary()*serpent.Command {
9+
cmd:=boundarycli.BaseCommand()// Package coder/boundary/cli exports a "base command" designed to be integrated as a subcommand.
10+
cmd.Use+=" [args...]"// The base command looks like `boundary -- command`. Serpent adds the flags piece, but we need to add the args.
11+
returncmd
12+
}

‎cli/exp_boundary_test.go‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package cli_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/assert"
7+
8+
boundarycli"github.com/coder/boundary/cli"
9+
"github.com/coder/coder/v2/cli/clitest"
10+
"github.com/coder/coder/v2/pty/ptytest"
11+
"github.com/coder/coder/v2/testutil"
12+
)
13+
14+
// Actually testing the functionality of coder/boundary takes place in the
15+
// coder/boundary repo, since it's a dependency of coder.
16+
// Here we want to test basically that integrating it as a subcommand doesn't break anything.
17+
funcTestBoundarySubcommand(t*testing.T) {
18+
t.Parallel()
19+
ctx:=testutil.Context(t,testutil.WaitShort)
20+
21+
inv,_:=clitest.New(t,"exp","boundary","--help")
22+
pty:=ptytest.New(t).Attach(inv)
23+
24+
gofunc() {
25+
err:=inv.WithContext(ctx).Run()
26+
assert.NoError(t,err)
27+
}()
28+
29+
// Expect the --help output to include the short description.
30+
// We're simply confirming that `coder boundary --help` ran without a runtime error as
31+
// a good chunk of serpents self validation logic happens at runtime.
32+
pty.ExpectMatch(boundarycli.BaseCommand().Short)
33+
}

‎cli/root.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ func (r *RootCmd) AGPLExperimental() []*serpent.Command {
145145
r.promptExample(),
146146
r.rptyCommand(),
147147
r.tasksCommand(),
148+
r.boundary(),
148149
}
149150
}
150151

‎go.mod‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ require (
480480
github.com/coder/agentapi-sdk-gov0.0.0-20250505131810-560d1d88d225
481481
github.com/coder/aibridgev0.1.3
482482
github.com/coder/aisdk-gov0.0.9
483+
github.com/coder/boundaryv1.0.1-0.20250925154134-55a44f2a7945
483484
github.com/coder/previewv1.0.4
484485
github.com/dgraph-io/ristretto/v2v2.3.0
485486
github.com/fsnotify/fsnotifyv1.9.0

‎go.sum‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,8 @@ github.com/coder/aibridge v0.1.3 h1:7A9RQaHQUjtse47ShF3kBj2hMmT1R7BEFgiyByr8Vvc=
915915
github.com/coder/aibridgev0.1.3/go.mod h1:GWc0Owtlzz5iMHosDm6FhbO+SoG5W+VeOKyP9p9g9ZM=
916916
github.com/coder/aisdk-gov0.0.9 h1:Vzo/k2qwVGLTR10ESDeP2Ecek1SdPfZlEjtTfMveiVo=
917917
github.com/coder/aisdk-gov0.0.9/go.mod h1:KF6/Vkono0FJJOtWtveh5j7yfNrSctVTpwgweYWSp5M=
918+
github.com/coder/boundaryv1.0.1-0.20250925154134-55a44f2a7945 h1:hDUf02kTX8EGR3+5B+v5KdYvORs4YNfDPci0zCs+pC0=
919+
github.com/coder/boundaryv1.0.1-0.20250925154134-55a44f2a7945/go.mod h1:d1AMFw81rUgrGHuZzWdPNhkY0G8w7pvLNLYF0e3ceC4=
918920
github.com/coder/bubbleteav1.2.2-0.20241212190825-007a1cdb2c41 h1:SBN/DA63+ZHwuWwPHPYoCZ/KLAjHv5g4h2MS4f2/MTI=
919921
github.com/coder/bubbleteav1.2.2-0.20241212190825-007a1cdb2c41/go.mod h1:I9ULxr64UaOSUv7hcb3nX4kowodJCVS7vt7VVJk/kW4=
920922
github.com/coder/clistatv1.0.0 h1:MjiS7qQ1IobuSSgDnxcCSyBPESs44hExnh2TEqMcGnA=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp