chore(cli): rename build options to ephemeral parameters in cli (#15030)

This PR aims to rename `build-option` to `ephemeral-parameters` based on
#10488 conversation.

`build-option` has been renamed `ephemeral-parameter` and can be used to
define a value for an ephemeral parameter in the template.

`build-options` has been renamed `prompt-ephemeral-parameters` and can
be used to prompt the user to put values for the ephemeral parameters in
the template.

---------

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
Co-authored-by: defelmnq <yvincent@coder.com>
This commit is contained in:
Vincent Vielle
2024-10-16 23:54:12 +02:00
committed by GitHub
parent 512cbf1682
commit 02f6203dc7
16 changed files with 270 additions and 58 deletions

View File

@ -115,7 +115,7 @@ func TestStart(t *testing.T) {
workspaceBuild := coderdtest.CreateWorkspaceBuild(t, client, workspace, database.WorkspaceTransitionStop)
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspaceBuild.ID)
inv, root := clitest.New(t, "start", workspace.Name, "--build-options")
inv, root := clitest.New(t, "start", workspace.Name, "--prompt-ephemeral-parameters")
clitest.SetupConfig(t, member, root)
doneChan := make(chan struct{})
pty := ptytest.New(t).Attach(inv)
@ -140,7 +140,7 @@ func TestStart(t *testing.T) {
}
<-doneChan
// Verify if build option is set
// Verify if ephemeral parameter is set
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()
@ -154,7 +154,7 @@ func TestStart(t *testing.T) {
})
})
t.Run("BuildOptionFlags", func(t *testing.T) {
t.Run("EphemeralParameterFlags", func(t *testing.T) {
t.Parallel()
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
@ -170,7 +170,7 @@ func TestStart(t *testing.T) {
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspaceBuild.ID)
inv, root := clitest.New(t, "start", workspace.Name,
"--build-option", fmt.Sprintf("%s=%s", ephemeralParameterName, ephemeralParameterValue))
"--ephemeral-parameter", fmt.Sprintf("%s=%s", ephemeralParameterName, ephemeralParameterValue))
clitest.SetupConfig(t, member, root)
doneChan := make(chan struct{})
pty := ptytest.New(t).Attach(inv)
@ -183,7 +183,7 @@ func TestStart(t *testing.T) {
pty.ExpectMatch("workspace has been started")
<-doneChan
// Verify if build option is set
// Verify if ephemeral parameter is set
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()