diff --git a/CHANGELOG.md b/CHANGELOG.md index ee240f3a3b..446ab3ed65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,12 @@ All notable changes to `src-cli` are documented in this file. ### Removed +## 3.35.2 + +### Fixed + +- `src batch validate` and `src batch repos` now accept `-allow-unsupported` and `-force-override-ignore` and don't fail on specs using `files` anymore. + ## 3.35.1 ### Changed diff --git a/cmd/src/batch_repositories.go b/cmd/src/batch_repositories.go index 5d62e70d9f..84dcda2c4d 100644 --- a/cmd/src/batch_repositories.go +++ b/cmd/src/batch_repositories.go @@ -36,6 +36,19 @@ Examples: apiFlags = api.NewFlags(flagSet) ) + var ( + allowUnsupported bool + allowIgnored bool + ) + flagSet.BoolVar( + &allowUnsupported, "allow-unsupported", false, + "Allow unsupported code hosts.", + ) + flagSet.BoolVar( + &allowIgnored, "force-override-ignore", false, + "Do not ignore repositories that have a .batchignore file.", + ) + handler := func(args []string) error { if err := flagSet.Parse(args); err != nil { return err @@ -44,7 +57,12 @@ Examples: ctx := context.Background() client := cfg.apiClient(apiFlags, flagSet.Output()) - svc := service.New(&service.Opts{Client: client}) + svc := service.New(&service.Opts{ + Client: client, + AllowUnsupported: allowUnsupported, + AllowIgnored: allowIgnored, + AllowFiles: true, + }) if err := svc.DetermineFeatureFlags(ctx); err != nil { return err diff --git a/cmd/src/batch_validate.go b/cmd/src/batch_validate.go index 2b79dcd930..0f4a652d6b 100644 --- a/cmd/src/batch_validate.go +++ b/cmd/src/batch_validate.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/sourcegraph/sourcegraph/lib/output" + "github.com/sourcegraph/src-cli/internal/api" "github.com/sourcegraph/src-cli/internal/batches/service" "github.com/sourcegraph/src-cli/internal/batches/ui" @@ -30,6 +31,19 @@ Examples: apiFlags := api.NewFlags(flagSet) fileFlag := flagSet.String("f", "", "The batch spec file to read.") + var ( + allowUnsupported bool + allowIgnored bool + ) + flagSet.BoolVar( + &allowUnsupported, "allow-unsupported", false, + "Allow unsupported code hosts.", + ) + flagSet.BoolVar( + &allowIgnored, "force-override-ignore", false, + "Do not ignore repositories that have a .batchignore file.", + ) + handler := func(args []string) error { ctx := context.Background() @@ -44,7 +58,10 @@ Examples: out := output.NewOutput(flagSet.Output(), output.OutputOpts{Verbose: *verbose}) ui := &ui.TUI{Out: out} svc := service.New(&service.Opts{ - Client: cfg.apiClient(apiFlags, flagSet.Output()), + Client: cfg.apiClient(apiFlags, flagSet.Output()), + AllowUnsupported: allowUnsupported, + AllowIgnored: allowIgnored, + AllowFiles: true, }) if err := svc.DetermineFeatureFlags(ctx); err != nil {