Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSDK-9288: declutter UI #4692

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
00516e9
hide help commands from subcommands
purplenicole730 Jan 7, 2025
fd7dd48
declutter login usagetext
purplenicole730 Jan 7, 2025
6b6e744
remove duplicate command
purplenicole730 Jan 7, 2025
0f2aaf4
standardize and fix usage text for organizations subcommand
purplenicole730 Jan 7, 2025
c8ce068
fix list locations command
purplenicole730 Jan 8, 2025
d023c01
fix usage text for viam command
purplenicole730 Jan 8, 2025
ef67b88
make lint
purplenicole730 Jan 8, 2025
d500403
allow only unrequired options in usage text
purplenicole730 Jan 8, 2025
9598d54
add subcommand support to createusagetext
purplenicole730 Jan 8, 2025
74d6e32
locations usage text
purplenicole730 Jan 8, 2025
217141d
make lint
purplenicole730 Jan 8, 2025
1260c94
add usagetext for profiles commands with required flags
purplenicole730 Jan 8, 2025
1e71c16
fix/standardize usagetext for data commands
purplenicole730 Jan 8, 2025
ac45897
add usagetext to dataset commands, remove unnecessary code
purplenicole730 Jan 9, 2025
2eb8d38
standardize train subcommands
purplenicole730 Jan 9, 2025
f383515
standardize machine subcommands
purplenicole730 Jan 9, 2025
51ac5e1
standardize module subcommands
purplenicole730 Jan 9, 2025
575e412
standardize package subcommands
purplenicole730 Jan 9, 2025
1d3ad89
standardize training script subcommands
purplenicole730 Jan 10, 2025
035c9da
standardize rest of commands
purplenicole730 Jan 10, 2025
7b59c42
make lint
purplenicole730 Jan 10, 2025
16a7a8f
Merge branch 'main' into RSDK-9288-declutter-UI
purplenicole730 Jan 10, 2025
c65cfc4
fix new command
purplenicole730 Jan 10, 2025
a488acc
fix new commands
purplenicole730 Jan 10, 2025
2099e42
make lint
purplenicole730 Jan 10, 2025
ffb80c1
nit
purplenicole730 Jan 10, 2025
0a7f540
nits
purplenicole730 Jan 10, 2025
2754e3e
deal with other argument-using commands
purplenicole730 Jan 10, 2025
4e621bb
consolidate flags
purplenicole730 Jan 10, 2025
05065fc
remove unnecessary flag
purplenicole730 Jan 10, 2025
3d95348
basic cleanup
purplenicole730 Jan 13, 2025
934b226
generalize format accepted values
purplenicole730 Jan 13, 2025
3a59aa2
add pr feedback
purplenicole730 Jan 16, 2025
f6d7c0e
Merge branch 'main' into RSDK-9288-declutter-UI
purplenicole730 Jan 16, 2025
4cec57f
erase comment
purplenicole730 Jan 16, 2025
ad6d741
make lint
purplenicole730 Jan 16, 2025
15e04b7
make lint
purplenicole730 Jan 16, 2025
4fe3249
make machinespartcp a function on viamclient
purplenicole730 Jan 16, 2025
74682e7
update tests
purplenicole730 Jan 16, 2025
fdfefa9
Merge branch 'main' into RSDK-9288-declutter-UI
purplenicole730 Jan 16, 2025
16528ca
merge fixes
purplenicole730 Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,030 changes: 555 additions & 475 deletions cli/app.go

Large diffs are not rendered by default.

48 changes: 26 additions & 22 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,16 @@ func (c *viamClient) listOAuthAppsAction(cCtx *cli.Context, orgID string) error
return nil
}

type listLocationsArgs struct {
Organization string
}

// ListLocationsAction is the corresponding Action for 'locations list'.
func ListLocationsAction(c *cli.Context, args emptyArgs) error {
func ListLocationsAction(c *cli.Context, args listLocationsArgs) error {
client, err := newViamClient(c)
if err != nil {
return err
}
// TODO(RSDK-9288) - this is brittle and inconsistent with how most data is passed.
// Move this to being a flag (but make sure existing workflows still work!)
orgStr := c.Args().First()
listLocations := func(orgID string) error {
locs, err := client.listLocations(orgID)
if err != nil {
Expand All @@ -620,6 +621,10 @@ func ListLocationsAction(c *cli.Context, args emptyArgs) error {
}
return nil
}
orgStr := args.Organization
if orgStr == "" {
orgStr = c.Args().First()
}
if orgStr == "" {
orgs, err := client.listOrganizations()
if err != nil {
Expand Down Expand Up @@ -754,14 +759,14 @@ func RobotsStatusAction(c *cli.Context, args robotsStatusArgs) error {

func getNumLogs(c *cli.Context, numLogs int) (int, error) {
if numLogs < 0 {
warningf(c.App.ErrWriter, "Provided negative %q value. Defaulting to %d", logsFlagCount, defaultNumLogs)
warningf(c.App.ErrWriter, "Provided negative %q value. Defaulting to %d", generalFlagCount, defaultNumLogs)
return defaultNumLogs, nil
}
if numLogs == 0 {
return defaultNumLogs, nil
}
if numLogs > maxNumLogs {
return 0, errors.Errorf("provided too high of a %q value. Maximum is %d", logsFlagCount, maxNumLogs)
return 0, errors.Errorf("provided too high of a %q value. Maximum is %d", generalFlagCount, maxNumLogs)
}
return numLogs, nil
}
Expand Down Expand Up @@ -1127,20 +1132,22 @@ func (c *viamClient) robotPartRestart(cCtx *cli.Context, args robotsPartRestartA
return nil
}

type robotsPartRunArgs struct {
type machinesPartRunArgs struct {
Organization string
Location string
Machine string
Part string
Data string
Stream time.Duration
Method string
}

// RobotsPartRunAction is the corresponding Action for 'machines part run'.
func RobotsPartRunAction(c *cli.Context, args robotsPartRunArgs) error {
// TODO(RSDK-9288) - this is brittle and inconsistent with how most data is passed.
// Move this to being a flag (but make sure existing workflows still work!)
svcMethod := c.Args().First()
// MachinesPartRunAction is the corresponding Action for 'machines part run'.
func MachinesPartRunAction(c *cli.Context, args machinesPartRunArgs) error {
svcMethod := args.Method
if svcMethod == "" {
svcMethod = c.Args().First()
}
if svcMethod == "" {
return errors.New("service method required")
}
Expand Down Expand Up @@ -1250,18 +1257,15 @@ func MachinesPartCopyFilesAction(c *cli.Context, args machinesPartCopyFilesArgs)
logger = logging.NewDebugLogger("cli")
}

return machinesPartCopyFilesAction(c, client, args, logger)
return client.machinesPartCopyFilesAction(c, args, logger)
}

func machinesPartCopyFilesAction(
c *cli.Context,
client *viamClient,
func (c *viamClient) machinesPartCopyFilesAction(
ctx *cli.Context,
flagArgs machinesPartCopyFilesArgs,
logger logging.Logger,
) error {
// TODO(RSDK-9288) - this is brittle and inconsistent with how most data is passed.
Copy link
Member

Choose a reason for hiding this comment

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

(flyby request) I know you didn't make this change but the definition of machinesPartCopyFilesAction here takes a *viamClient as an argument. Would you mind, as a quick flyby, making it a method on a viamClient instead of taking the viamClient as an argument? This would put the syntax more in line with how analogous functions elsewhere in the CLI are structured.

// Move this to being a flag (but make sure existing workflows still work!)
Comment on lines -1262 to -1263
Copy link
Member Author

Choose a reason for hiding this comment

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

Decided to keep this specific function as is, as it mirrors a well-known behavior with the cp command

args := c.Args().Slice()
args := ctx.Args().Slice()
if len(args) == 0 {
return errNoFiles
}
Expand Down Expand Up @@ -1307,14 +1311,14 @@ func machinesPartCopyFilesAction(
return err
}

globalArgs, err := getGlobalArgs(c)
globalArgs, err := getGlobalArgs(ctx)
if err != nil {
return err
}

doCopy := func() error {
if isFrom {
return client.copyFilesFromMachine(
return c.copyFilesFromMachine(
flagArgs.Organization,
flagArgs.Location,
flagArgs.Machine,
Expand All @@ -1328,7 +1332,7 @@ func machinesPartCopyFilesAction(
)
}

return client.copyFilesToMachine(
return c.copyFilesToMachine(
flagArgs.Organization,
flagArgs.Location,
flagArgs.Machine,
Expand Down
36 changes: 18 additions & 18 deletions cli/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func setup(

if dataClient != nil {
// these flags are only relevant when testing a dataClient
flags.String(dataFlagDestination, utils.ResolveFile(""), "")
flags.String(generalFlagDestination, utils.ResolveFile(""), "")
}

cCtx := cli.NewContext(NewApp(out, errOut), flags, nil)
Expand Down Expand Up @@ -788,7 +788,7 @@ func TestGetRobotPartLogs(t *testing.T) {
}
})
t.Run("max count", func(t *testing.T) {
flags := map[string]any{logsFlagCount: maxNumLogs}
flags := map[string]any{generalFlagCount: maxNumLogs}
cCtx, ac, out, errOut := setup(asc, nil, nil, nil, flags, "")

test.That(t, ac.robotsPartLogsAction(cCtx, parseStructFromCtx[robotsPartLogsArgs](cCtx)), test.ShouldBeNil)
Expand Down Expand Up @@ -889,29 +889,29 @@ func TestShellFileCopy(t *testing.T) {
t.Run("no arguments or files", func(t *testing.T) {
cCtx, viamClient, _, _ := setup(asc, nil, nil, nil, partFlags, "token")
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldEqual, errNoFiles)
})

t.Run("one file path is insufficient", func(t *testing.T) {
args := []string{"machine:path"}
cCtx, viamClient, _, _ := setup(asc, nil, nil, nil, partFlags, "token", args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldEqual, errLastArgOfFromMissing)

args = []string{"path"}
cCtx, viamClient, _, _ = setup(asc, nil, nil, nil, partFlags, "token", args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldEqual, errLastArgOfToMissing)
})

t.Run("from has wrong path prefixes", func(t *testing.T) {
args := []string{"machine:path", "path2", "machine:path3", "destination"}
cCtx, viamClient, _, _ := setup(asc, nil, nil, nil, partFlags, "token", args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldHaveSameTypeAs, copyFromPathInvalidError{})
})

Expand All @@ -925,7 +925,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlags, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)

rd, err := os.ReadFile(filepath.Join(tempDir, filepath.Base(tfs.SingleFileNested)))
Expand All @@ -944,7 +944,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlags, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)

rd, err := os.ReadFile(filepath.Join(tempDir, "foo"))
Expand All @@ -960,7 +960,7 @@ func TestShellFileCopy(t *testing.T) {
t.Log("without recursion set")
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlags, "token", partFqdn, args...)
err := machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger)
err := viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger)
test.That(t, errors.Is(err, errDirectoryCopyRequestNoRecursion), test.ShouldBeTrue)
_, err = os.ReadFile(filepath.Join(tempDir, filepath.Base(tfs.SingleFileNested)))
test.That(t, errors.Is(err, fs.ErrNotExist), test.ShouldBeTrue)
Expand All @@ -972,7 +972,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ = setupWithRunningPart(
t, asc, nil, nil, partFlagsCopy, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)
test.That(t, shelltestutils.DirectoryContentsEqual(tfs.Root, filepath.Join(tempDir, filepath.Base(tfs.Root))), test.ShouldBeNil)
})
Expand All @@ -991,7 +991,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlagsCopy, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)

rd, err := os.ReadFile(filepath.Join(tempDir, filepath.Base(tfs.SingleFileNested)))
Expand Down Expand Up @@ -1027,7 +1027,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlagsCopy, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)
test.That(t, shelltestutils.DirectoryContentsEqual(tfs.Root, filepath.Join(tempDir, filepath.Base(tfs.Root))), test.ShouldBeNil)

Expand Down Expand Up @@ -1055,7 +1055,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlags, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)

rd, err := os.ReadFile(filepath.Join(tempDir, filepath.Base(tfs.SingleFileNested)))
Expand All @@ -1073,7 +1073,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlags, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)

rd, err := os.ReadFile(randomPath)
Expand All @@ -1089,7 +1089,7 @@ func TestShellFileCopy(t *testing.T) {
t.Log("without recursion set")
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlags, "token", partFqdn, args...)
err := machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger)
err := viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger)
test.That(t, errors.Is(err, errDirectoryCopyRequestNoRecursion), test.ShouldBeTrue)
_, err = os.ReadFile(filepath.Join(tempDir, filepath.Base(tfs.SingleFileNested)))
test.That(t, errors.Is(err, fs.ErrNotExist), test.ShouldBeTrue)
Expand All @@ -1101,7 +1101,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ = setupWithRunningPart(
t, asc, nil, nil, partFlagsCopy, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)
test.That(t, shelltestutils.DirectoryContentsEqual(tfs.Root, filepath.Join(tempDir, filepath.Base(tfs.Root))), test.ShouldBeNil)
})
Expand All @@ -1120,7 +1120,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlagsCopy, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)

rd, err := os.ReadFile(filepath.Join(tempDir, filepath.Base(tfs.SingleFileNested)))
Expand Down Expand Up @@ -1156,7 +1156,7 @@ func TestShellFileCopy(t *testing.T) {
cCtx, viamClient, _, _ := setupWithRunningPart(
t, asc, nil, nil, partFlagsCopy, "token", partFqdn, args...)
test.That(t,
machinesPartCopyFilesAction(cCtx, viamClient, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
viamClient.machinesPartCopyFilesAction(cCtx, parseStructFromCtx[machinesPartCopyFilesArgs](cCtx), logger),
test.ShouldBeNil)
test.That(t, shelltestutils.DirectoryContentsEqual(tfs.Root, filepath.Join(tempDir, filepath.Base(tfs.Root))), test.ShouldBeNil)

Expand Down
1 change: 0 additions & 1 deletion cli/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func DatasetListAction(c *cli.Context, args datasetListArgs) error {
datasetIDs := args.DatasetIDs
orgID := args.OrgID

// TODO(RSDK-9288) - see if we can make this clearer to users from the outset
if orgID != "" && datasetIDs != nil {
return errors.New("must specify either dataset IDs or organization ID, got both")
}
Expand Down
4 changes: 2 additions & 2 deletions cli/ml_training.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,15 @@ func (c *viamClient) dataListTrainingJobs(orgID, status string) ([]*mltrainingpb
}

// allTrainingStatusValues returns the accepted values for the trainFlagJobStatus flag.
func allTrainingStatusValues() string {
func allTrainingStatusValues() []string {
var formattedStatuses []string
for status := range mltrainingpb.TrainingStatus_value {
formattedStatus := strings.ToLower(strings.TrimPrefix(status, trainingStatusPrefix))
formattedStatuses = append(formattedStatuses, formattedStatus)
}

slices.Sort(formattedStatuses)
return "[" + strings.Join(formattedStatuses, ", ") + "]"
return formattedStatuses
}

func defaultTrainingStatus() string {
Expand Down
14 changes: 6 additions & 8 deletions cli/module_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,10 @@ func ModuleBuildListAction(cCtx *cli.Context, args moduleBuildListArgs) error {
}

func (c *viamClient) moduleBuildListAction(cCtx *cli.Context, args moduleBuildListArgs) error {
var buildIDFilter *string
buildIDFilter := args.ID
var moduleIDFilter string
// This will use the build id if present and fall back on the module manifest if not
if cCtx.IsSet(moduleBuildFlagBuildID) {
buildIDFilter = &args.ID
} else {
// Fall back on the module manifest if build id is not present.
if buildIDFilter == "" {
manifestPath := args.Module
manifest, err := loadManifest(manifestPath)
if err != nil {
Expand All @@ -198,7 +196,7 @@ func (c *viamClient) moduleBuildListAction(cCtx *cli.Context, args moduleBuildLi
count := int32(args.Count)
numberOfJobsToReturn = &count
}
jobs, err := c.listModuleBuildJobs(moduleIDFilter, numberOfJobsToReturn, buildIDFilter)
jobs, err := c.listModuleBuildJobs(moduleIDFilter, numberOfJobsToReturn, &buildIDFilter)
if err != nil {
return err
}
Expand Down Expand Up @@ -668,7 +666,7 @@ func resolveTargetModule(c *cli.Context, manifest *moduleManifest) (*robot.Resta
modID := args.ID
// todo: use MutuallyExclusiveFlags for this when urfave/cli 3.x is stable
if (len(modName) > 0) && (len(modID) > 0) {
return nil, fmt.Errorf("provide at most one of --%s and --%s", generalFlagName, moduleBuildFlagBuildID)
return nil, fmt.Errorf("provide at most one of --%s and --%s", generalFlagName, moduleFlagID)
}
request := &robot.RestartModuleRequest{}
//nolint:gocritic
Expand All @@ -680,7 +678,7 @@ func resolveTargetModule(c *cli.Context, manifest *moduleManifest) (*robot.Resta
// TODO(APP-4019): remove localize call
request.ModuleName = localizeModuleID(manifest.ModuleID)
} else {
return nil, fmt.Errorf("if there is no meta.json, provide one of --%s or --%s", generalFlagName, moduleBuildFlagBuildID)
return nil, fmt.Errorf("if there is no meta.json, provide one of --%s or --%s", generalFlagName, moduleFlagID)
}
return request, nil
}
Expand Down
6 changes: 3 additions & 3 deletions cli/module_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestStartBuild(t *testing.T) {
StartBuildFunc: func(ctx context.Context, in *v1.StartBuildRequest, opts ...grpc.CallOption) (*v1.StartBuildResponse, error) {
return &v1.StartBuildResponse{BuildId: "xyz123"}, nil
},
}, nil, map[string]any{moduleBuildFlagPath: manifest, moduleBuildFlagVersion: "1.2.3"}, "token")
}, nil, map[string]any{moduleFlagPath: manifest, generalFlagVersion: "1.2.3"}, "token")
err := ac.moduleBuildStartAction(cCtx, parseStructFromCtx[moduleBuildStartArgs](cCtx))
test.That(t, err, test.ShouldBeNil)
test.That(t, out.messages, test.ShouldHaveLength, 1)
Expand All @@ -79,7 +79,7 @@ func TestListBuild(t *testing.T) {
},
}}, nil
},
}, nil, map[string]any{moduleBuildFlagPath: manifest}, "token")
}, nil, map[string]any{moduleFlagPath: manifest}, "token")
err := ac.moduleBuildListAction(cCtx, parseStructFromCtx[moduleBuildListArgs](cCtx))
test.That(t, err, test.ShouldBeNil)
joinedOutput := strings.Join(out.messages, "")
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestLocalBuild(t *testing.T) {

// run the build local action
cCtx, _, out, errOut := setup(&inject.AppServiceClient{}, nil, &inject.BuildServiceClient{},
nil, map[string]any{moduleBuildFlagPath: manifestPath, moduleBuildFlagVersion: "1.2.3"}, "token")
nil, map[string]any{moduleFlagPath: manifestPath, generalFlagVersion: "1.2.3"}, "token")
manifest, err := loadManifest(manifestPath)
test.That(t, err, test.ShouldBeNil)
err = moduleBuildLocalAction(cCtx, &manifest)
Expand Down
Loading
Loading