Skip to content

Commit

Permalink
Remove long-deprecated path flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai committed Nov 6, 2023
1 parent 6b4fce4 commit 9b89db1
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 82 deletions.
5 changes: 0 additions & 5 deletions cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var (
Usage: "Validates a specified bitrise config.",
Action: validate,
Flags: []cli.Flag{
flPath,
flConfig,
flConfigBase64,
flInventory,
Expand Down Expand Up @@ -69,8 +68,6 @@ var (
cli.StringFlag{Name: JSONParamsKey, Usage: "Specify command flags with json string-string hash."},
cli.StringFlag{Name: JSONParamsBase64Key, Usage: "Specify command flags with base64 encoded json string-string hash."},

// deprecated
flPath,

// should deprecate
cli.StringFlag{Name: ConfigBase64Key, Usage: "base64 encoded config data."},
Expand All @@ -83,7 +80,6 @@ var (
Usage: "Export the bitrise configuration.",
Action: export,
Flags: []cli.Flag{
flPath,
flConfig,
flConfigBase64,
flFormat,
Expand All @@ -96,7 +92,6 @@ var (
Usage: "Normalize the bitrise configuration.",
Action: normalize,
Flags: []cli.Flag{
flPath,
flConfig,
flConfigBase64,
},
Expand Down
5 changes: 0 additions & 5 deletions cli/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ func export(c *cli.Context) error {
bitriseConfigBase64Data := c.String(ConfigBase64Key)

bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)
if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
log.Warn("'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}

outfilePth := c.String(OuputPathKey)
outFormat := c.String(OuputFormatKey)
Expand Down
27 changes: 0 additions & 27 deletions cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,46 @@ import (
)

const (
// CollectionPathEnvKey ...
CollectionPathEnvKey = "STEPMAN_COLLECTION"
// CIKey ...
CIKey = "ci"
// PRKey ...
PRKey = "pr"
// DebugModeKey ...
DebugModeKey = "debug"

// VersionKey ...
VersionKey = "version"
versionKeyShort = "v"

// PathKey ...
PathKey = "path"
pathKeyShort = "p"

// CollectionKey ...
CollectionKey = "collection"
collectionKeyShort = "c"

inventoryShortKey = "i"

// InventoryBase64Key ...
InventoryBase64Key = "inventory-base64"

configShortKey = "c"

// ConfigBase64Key ...
ConfigBase64Key = "config-base64"

// HelpKey ...
HelpKey = "help"
helpKeyShort = "h"

// MinimalModeKey ...
MinimalModeKey = "minimal"
// FullModeKey ...
FullModeKey = "full"

ouputFormatKeyShort = "f"
// OuputPathKey ...
OuputPathKey = "outpath"
// PrettyFormatKey ...
PrettyFormatKey = "pretty"

// IDKey ...
IDKey = "id"
idKeyShort = "i"
// ShortKey ...
ShortKey = "short"

// StepYMLKey ...
StepYMLKey = "step-yml"

//
// Stepman share

// TagKey ...
TagKey = "tag"
// GitKey ...
GitKey = "git"
// StepIDKey ...
StepIDKey = "stepid"
)

Expand Down Expand Up @@ -98,10 +75,6 @@ var (
Name: OuputFormatKey + ", " + ouputFormatKeyShort,
Usage: "Output format. Accepted: raw (default), json, yml",
}
flPath = cli.StringFlag{
Name: PathKey + ", " + pathKeyShort,
Usage: "[Deprecated!!! Use 'config'] Path where the workflow config file is located.",
}
flCollection = cli.StringFlag{
Name: CollectionKey + ", " + collectionKeyShort,
Usage: "Collection of step.",
Expand Down
5 changes: 0 additions & 5 deletions cli/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ func normalize(c *cli.Context) error {
bitriseConfigBase64Data := c.String(ConfigBase64Key)

bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)
if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
log.Warn("'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}
//

// Input validation
Expand Down
8 changes: 0 additions & 8 deletions cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ var runCommand = cli.Command{
cli.StringFlag{Name: JSONParamsBase64Key, Usage: "Specify command flags with base64 encoded json string-string hash."},
cli.StringFlag{Name: OutputFormatKey, Usage: "Log format. Available values: json, console"},

// deprecated
flPath,

// should deprecate
cli.StringFlag{Name: ConfigBase64Key, Usage: "base64 encoded config data."},
cli.StringFlag{Name: InventoryBase64Key, Usage: "base64 encoded inventory data."},
Expand Down Expand Up @@ -283,11 +280,6 @@ func processArgs(c *cli.Context) (*RunConfig, error) {

bitriseConfigBase64Data := c.String(ConfigBase64Key)
bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)
if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
log.Warn("'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}

inventoryBase64Data := c.String(InventoryBase64Key)
inventoryPath := c.String(InventoryKey)
Expand Down
5 changes: 0 additions & 5 deletions cli/step_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ func stepInfo(c *cli.Context) error {
bitriseConfigBase64Data := c.String(ConfigBase64Key)

bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)
if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
warnings = append(warnings, "'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}

format := c.String(OuputFormatKey)

Expand Down
5 changes: 0 additions & 5 deletions cli/step_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ func stepList(c *cli.Context) error {
bitriseConfigBase64Data := c.String(ConfigBase64Key)

bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)
if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
warnings = append(warnings, "'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}

format := c.String(OuputFormatKey)

Expand Down
8 changes: 0 additions & 8 deletions cli/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ var triggerCommand = cli.Command{
cli.StringFlag{Name: JSONParamsKey, Usage: "Specify command flags with json string-string hash."},
cli.StringFlag{Name: JSONParamsBase64Key, Usage: "Specify command flags with base64 encoded json string-string hash."},

// deprecated
flPath,

// should deprecate
cli.StringFlag{Name: ConfigBase64Key, Usage: "base64 encoded config data."},
cli.StringFlag{Name: InventoryBase64Key, Usage: "base64 encoded inventory data."},
Expand Down Expand Up @@ -107,11 +104,6 @@ func trigger(c *cli.Context) error {

bitriseConfigBase64Data := c.String(ConfigBase64Key)
bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)
if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
log.Warn("'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}

inventoryBase64Data := c.String(InventoryBase64Key)
inventoryPath := c.String(InventoryKey)
Expand Down
5 changes: 0 additions & 5 deletions cli/trigger_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ func triggerCheck(c *cli.Context) error {

bitriseConfigBase64Data := c.String(ConfigBase64Key)
bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)
if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
warnings = append(warnings, "'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}

inventoryBase64Data := c.String(InventoryBase64Key)
inventoryPath := c.String(InventoryKey)
Expand Down
10 changes: 2 additions & 8 deletions cli/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,9 @@ func validateInventory(inventoryPath string, inventoryBase64Data string) (*Valid
return nil, nil
}

func runValidate(bitriseConfigPath string, deprecatedBitriseConfigPath string, bitriseConfigBase64Data string, inventoryPath string, inventoryBase64Data string) (*ValidationModel, []string, error) {
func runValidate(bitriseConfigPath string, bitriseConfigBase64Data string, inventoryPath string, inventoryBase64Data string) (*ValidationModel, []string, error) {
warnings := []string{}

if bitriseConfigPath == "" && deprecatedBitriseConfigPath != "" {
warnings = append(warnings, "'path' key is deprecated, use 'config' instead!")
bitriseConfigPath = deprecatedBitriseConfigPath
}

validation := ValidationModel{}

result, err := validateBitriseYML(bitriseConfigPath, bitriseConfigBase64Data)
Expand All @@ -226,7 +221,6 @@ func validate(c *cli.Context) error {
// Expand cli.Context
bitriseConfigBase64Data := c.String(ConfigBase64Key)
bitriseConfigPath := c.String(ConfigKey)
deprecatedBitriseConfigPath := c.String(PathKey)

inventoryBase64Data := c.String(InventoryBase64Key)
inventoryPath := c.String(InventoryKey)
Expand All @@ -247,7 +241,7 @@ func validate(c *cli.Context) error {
os.Exit(1)
}

validation, warnings, err := runValidate(bitriseConfigPath, deprecatedBitriseConfigPath, bitriseConfigBase64Data, inventoryPath, inventoryBase64Data)
validation, warnings, err := runValidate(bitriseConfigPath, bitriseConfigBase64Data, inventoryPath, inventoryBase64Data)
if err != nil {
log.Print(NewValidationError(err.Error(), warnings...))
os.Exit(1)
Expand Down
1 change: 0 additions & 1 deletion cli/workflow_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var workflowListCommand = cli.Command{
return nil
},
Flags: []cli.Flag{
flPath,
flConfig,
flConfigBase64,
cli.StringFlag{
Expand Down

0 comments on commit 9b89db1

Please sign in to comment.