- Notifications
You must be signed in to change notification settings - Fork1k
feat: implement coder exp boundary subcommand#19771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
21 commits Select commitHold shift + click to select a range
65d5092
initial coder jail hidden subcommand
bcpeinhardt74e3d93
test not passing yet
bcpeinhardt1250770
make expected text match
bcpeinhardt2697f65
remove old test setup and update jail dependency
bcpeinhardt9911415
hide jail subcommand
bcpeinhardtc555f2f
use new jail base command and make subcommand properly hidden
bcpeinhardtf3e9964
set up basic testing file (not sure what to add yet)
bcpeinhardt5416b75
Merge branch 'main' into bcpeinhardt/coder-jail-subcommand
bcpeinhardtf371f5b
add help test
bcpeinhardte8ceab6
fix variable name
bcpeinhardtab54d76
must have forgotten to put the version back
bcpeinhardt034fe61
update for new name boundary instead of jail
bcpeinhardt53b36a3
Merge branch 'main' into bcpeinhardt/coder-jail-subcommand
bcpeinhardt7efa71b
drop go version back to 1.24.6
bcpeinhardt47fff3a
clean up test
bcpeinhardt8c2fbd5
lint fix unused root command in boundary subcommand method
bcpeinhardt7db3f5d
update comments from jail to boundary
bcpeinhardtdcc050f
Merge branch 'main' into bcpeinhardt/coder-jail-subcommand
bcpeinhardt9d791a8
use boundary main branch
bcpeinhardt630d7ea
move to exp
bcpeinhardtd01516f
fix merge conflict
bcpeinhardtFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletionscli/exp_boundary.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package cli | ||
import ( | ||
boundarycli "github.com/coder/boundary/cli" | ||
"github.com/coder/serpent" | ||
) | ||
func (*RootCmd) boundary() *serpent.Command { | ||
cmd := boundarycli.BaseCommand() // Package coder/boundary/cli exports a "base command" designed to be integrated as a subcommand. | ||
cmd.Use += " [args...]" // The base command looks like `boundary -- command`. Serpent adds the flags piece, but we need to add the args. | ||
return cmd | ||
} |
33 changes: 33 additions & 0 deletionscli/exp_boundary_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cli_test | ||
import ( | ||
"testing" | ||
"github.com/stretchr/testify/assert" | ||
boundarycli "github.com/coder/boundary/cli" | ||
"github.com/coder/coder/v2/cli/clitest" | ||
"github.com/coder/coder/v2/pty/ptytest" | ||
"github.com/coder/coder/v2/testutil" | ||
) | ||
// Actually testing the functionality of coder/boundary takes place in the | ||
// coder/boundary repo, since it's a dependency of coder. | ||
// Here we want to test basically that integrating it as a subcommand doesn't break anything. | ||
func TestBoundarySubcommand(t *testing.T) { | ||
t.Parallel() | ||
ctx := testutil.Context(t, testutil.WaitShort) | ||
inv, _ := clitest.New(t, "exp", "boundary", "--help") | ||
pty := ptytest.New(t).Attach(inv) | ||
go func() { | ||
err := inv.WithContext(ctx).Run() | ||
assert.NoError(t, err) | ||
}() | ||
// Expect the --help output to include the short description. | ||
// We're simply confirming that `coder boundary --help` ran without a runtime error as | ||
// a good chunk of serpents self validation logic happens at runtime. | ||
pty.ExpectMatch(boundarycli.BaseCommand().Short) | ||
} |
1 change: 1 addition & 0 deletionscli/root.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionsgo.mod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionsgo.sum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.