Skip to content

Commit ee721f0

Browse files
authored
Merge branch 'dev' into core-clean
2 parents 7423eb3 + 3029fdc commit ee721f0

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed

artifactory/utils/commandsummary/markdownConfig.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package commandsummary
33
import (
44
"encoding/json"
55
"fmt"
6+
"net/http"
7+
"net/url"
8+
"strings"
9+
610
"github.com/jfrog/jfrog-client-go/http/httpclient"
711
clientUtils "github.com/jfrog/jfrog-client-go/utils"
812
"github.com/jfrog/jfrog-client-go/utils/errorutils"
913
"github.com/jfrog/jfrog-client-go/utils/io/httputils"
10-
"net/http"
11-
"net/url"
12-
"strings"
1314
)
1415

1516
// Static struct to hold the Markdown configuration values
@@ -62,7 +63,7 @@ func (mg *MarkdownConfig) SetScanResultsMapping(resultsMap map[string]ScanResult
6263

6364
// Initializes the command summary values that effect Markdown generation
6465
func InitMarkdownGenerationValues(serverUrl string, platformMajorVersion int) (err error) {
65-
entitled, err := checkExtendedSummaryEntitled(serverUrl)
66+
entitled, err := CheckExtendedSummaryEntitled(serverUrl)
6667
if err != nil {
6768
return
6869
}
@@ -72,7 +73,7 @@ func InitMarkdownGenerationValues(serverUrl string, platformMajorVersion int) (e
7273
return
7374
}
7475

75-
func checkExtendedSummaryEntitled(serverUrl string) (bool, error) {
76+
func CheckExtendedSummaryEntitled(serverUrl string) (bool, error) {
7677
// Parse and validate the URL
7778
parsedUrl, err := url.Parse(serverUrl)
7879
if err != nil || !parsedUrl.IsAbs() {

common/commands/configfile.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ func handleInteractiveConfigCreation(configFile *ConfigFile, confType project.Pr
171171
return configFile.configGradle()
172172
case project.Terraform:
173173
return configFile.setDeployer(false)
174+
case project.Cocoapods:
175+
return configFile.setDeployerResolver()
174176
}
175177
return
176178
}

common/project/projectconfig.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const (
3939
Dotnet
4040
Build
4141
Terraform
42+
Cocoapods
4243
)
4344

4445
type ConfigType string
@@ -62,6 +63,7 @@ var ProjectTypes = []string{
6263
"dotnet",
6364
"build",
6465
"terraform",
66+
"cocoapods",
6567
}
6668

6769
func (projectType ProjectType) String() string {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/jedib0t/go-pretty/v6 v6.5.9
1515
github.com/jfrog/build-info-go v1.10.3
1616
github.com/jfrog/gofrog v1.7.6
17-
github.com/jfrog/jfrog-client-go v1.47.3
17+
github.com/jfrog/jfrog-client-go v1.47.4
1818
github.com/magiconair/properties v1.8.7
1919
github.com/manifoldco/promptui v0.9.0
2020
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
@@ -96,7 +96,7 @@ require (
9696
gopkg.in/warnings.v0 v0.1.2 // indirect
9797
)
9898

99-
// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240918081224-1c584cc334c7
99+
// replace github.com/jfrog/jfrog-client-go => github.com/eyalbe4/jfrog-client-go v1.28.1-0.20241103083749-45c13ff7fe16
100100

101101
// replace github.com/jfrog/build-info-go => github.com/galusben/build-info-go v0.0.0-20240930113238-ac3b31030284
102102

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ github.com/jfrog/build-info-go v1.10.3 h1:9nqBdZD6xkuxiOvxg+idZ79QLFWQNuucvKkl8X
9696
github.com/jfrog/build-info-go v1.10.3/go.mod h1:JcISnovFXKx3wWf3p1fcMmlPdt6adxScXvoJN4WXqIE=
9797
github.com/jfrog/gofrog v1.7.6 h1:QmfAiRzVyaI7JYGsB7cxfAJePAZTzFz0gRWZSE27c6s=
9898
github.com/jfrog/gofrog v1.7.6/go.mod h1:ntr1txqNOZtHplmaNd7rS4f8jpA5Apx8em70oYEe7+4=
99-
github.com/jfrog/jfrog-client-go v1.47.3 h1:99/JSSgU0rvnM2zWYos2n+Gz1IYLCUoIorE4Xco+Dew=
100-
github.com/jfrog/jfrog-client-go v1.47.3/go.mod h1:NepfaidmK/xiKsVC+0Ur9sANOqL6io8Y7pSaCau7J6o=
99+
github.com/jfrog/jfrog-client-go v1.47.4 h1:4FAuDDvoDRy9LEFe1WwUO5prBXkgyhaWGEZ0vXYL/Z4=
100+
github.com/jfrog/jfrog-client-go v1.47.4/go.mod h1:NepfaidmK/xiKsVC+0Ur9sANOqL6io8Y7pSaCau7J6o=
101101
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
102102
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
103103
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=

plugins/components/conversionlayer.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77

88
"github.com/jfrog/gofrog/datastructures"
99
"github.com/jfrog/jfrog-cli-core/v2/docs/common"
10-
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
1110
"github.com/jfrog/jfrog-client-go/utils/errorutils"
1211
"github.com/urfave/cli"
1312
)
@@ -80,7 +79,7 @@ func convertCommand(cmd Command, namespaces ...string) (cli.Command, error) {
8079
if err != nil {
8180
return cli.Command{}, err
8281
}
83-
return cli.Command{
82+
cliCmd := cli.Command{
8483
Name: cmd.Name,
8584
Flags: convertedFlags,
8685
Aliases: cmd.Aliases,
@@ -93,9 +92,12 @@ func convertCommand(cmd Command, namespaces ...string) (cli.Command, error) {
9392
BashComplete: common.CreateBashCompletionFunc(),
9493
SkipFlagParsing: cmd.SkipFlagParsing,
9594
Hidden: cmd.Hidden,
95+
}
96+
if cmd.Action != nil {
9697
// Passing any other interface than 'cli.ActionFunc' will fail the command.
97-
Action: getActionFunc(cmd),
98-
}, nil
98+
cliCmd.Action = getActionFunc(cmd)
99+
}
100+
return cliCmd, nil
99101
}
100102

101103
func removeEmptyValues(slice []string) []string {
@@ -112,8 +114,8 @@ func removeEmptyValues(slice []string) []string {
112114
func createCommandUsages(cmd Command, convertedStringFlags map[string]StringFlag, namespaces ...string) (usages []string, err error) {
113115
// Handle manual usages provided.
114116
if cmd.UsageOptions != nil {
115-
for _, manualUsage := range cmd.UsageOptions.Usage {
116-
usages = append(usages, fmt.Sprintf("%s %s", coreutils.GetCliExecutableName(), manualUsage))
117+
if cmd.UsageOptions.Usage != nil {
118+
usages = append(usages, cmd.UsageOptions.Usage...)
117119
}
118120
if cmd.UsageOptions.ReplaceAutoGeneratedUsage {
119121
return

plugins/components/conversionlayer_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"testing"
77

8-
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
98
"github.com/stretchr/testify/assert"
109
"github.com/urfave/cli"
1110
)
@@ -20,11 +19,6 @@ func TestCreateCommandUsages(t *testing.T) {
2019
strFlag := NewStringFlag("flag", "", SetMandatory())
2120

2221
override := []string{"usage override", "usage override 2", "usage override 3"}
23-
expectedOverride := []string{
24-
fmt.Sprintf("%s %s", coreutils.GetCliExecutableName(), "usage override"),
25-
fmt.Sprintf("%s %s", coreutils.GetCliExecutableName(), "usage override 2"),
26-
fmt.Sprintf("%s %s", coreutils.GetCliExecutableName(), "usage override 3"),
27-
}
2822

2923
tests := []struct {
3024
name string
@@ -93,7 +87,7 @@ func TestCreateCommandUsages(t *testing.T) {
9387
UsageOptions: &UsageOptions{Usage: override},
9488
},
9589
stringFlags: map[string]StringFlag{optStrFlag.Name: optStrFlag},
96-
expected: append(expectedOverride,
90+
expected: append(override,
9791
fmt.Sprintf("%s [command options] <%s> <%s>", expectedPrefix, "first argument", "second"),
9892
fmt.Sprintf("%s [command options] --%s=<%s> <%s>", expectedPrefix, optStrFlag.Name, optStrFlag.HelpValue, "first argument"),
9993
),
@@ -107,7 +101,7 @@ func TestCreateCommandUsages(t *testing.T) {
107101
UsageOptions: &UsageOptions{Usage: override, ReplaceAutoGeneratedUsage: true},
108102
},
109103
stringFlags: map[string]StringFlag{optStrFlag.Name: optStrFlag, strFlag.Name: strFlag},
110-
expected: expectedOverride,
104+
expected: override, // override is not expected to be changed upon using UsageOptions
111105
},
112106
}
113107

0 commit comments

Comments
 (0)