Skip to content

Commit e968b71

Browse files
authored
Merge branch 'master' into mavenFlexpack
2 parents 0ef65b4 + 1ced927 commit e968b71

File tree

8 files changed

+71
-42
lines changed

8 files changed

+71
-42
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
name: Prepare Minor Release
12
on:
23
workflow_dispatch:
34
inputs:
45
ref:
5-
description: The branch to prepare the release for
6+
description: Release from
67
default: "master"
78

89
jobs:
910
prepare-minor-release:
1011
uses: ./.github/workflows/prepare-release.yml
11-
name: Prepare minor release
12+
name: Prepare Minor Release
13+
secrets: inherit
1214
with:
1315
version: "minor"
1416
ref: ${{ inputs.ref }}

.github/workflows/prepare-patch-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: Prepare Patch Release
12
on:
23
workflow_dispatch:
34
inputs:
@@ -8,7 +9,8 @@ on:
89
jobs:
910
prepare-patch-release:
1011
uses: ./.github/workflows/prepare-release.yml
11-
name: Prepare patch release
12+
name: Prepare Patch Release
13+
secrets: inherit
1214
with:
1315
version: "patch"
1416
ref: ${{ inputs.ref }}

.github/workflows/prepare-release.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: Prepare Release
12
on:
23
workflow_call:
34
inputs:
@@ -17,7 +18,7 @@ permissions:
1718

1819
jobs:
1920
prepare-release:
20-
name: Prepare ${{ inputs.version }} from ${{ inputs.ref }}
21+
name: Prepare ${{ inputs.version }} From ${{ inputs.ref }}
2122
runs-on: ubuntu-latest
2223
steps:
2324
- name: Checkout repository
@@ -31,8 +32,8 @@ jobs:
3132
- name: Compute current version
3233
id: compute-current-version
3334
run: |
34-
./build/build.sh
35-
current_version=$(./jf --version)
35+
current_version=$(go run main.go -v)
36+
current_version=${current_version//[^0-9.+]/}
3637
echo "current_version=${current_version}" >> $GITHUB_OUTPUT
3738
3839
- name: Compute next version
@@ -74,25 +75,23 @@ jobs:
7475
- name: Create pull request
7576
run: gh pr create --title "Bump version to ${{ steps.compute-next-version.outputs.next_version }}" --body "Bump version to ${{ steps.compute-next-version.outputs.next_version }}"
7677
env:
77-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
GH_TOKEN: ${{ secrets.CLI_ACTION_TOKEN }}
7879

7980
- name: Get PR number
8081
id: get-pr-number
8182
run: |
8283
PR_NUMBER=$(gh pr list --head "${{ steps.branch.outputs.branch_name }}" --json number --jq '.[0].number')
8384
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
8485
env:
85-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
GH_TOKEN: ${{ secrets.CLI_ACTION_TOKEN }}
8687

87-
- name: Comment PR with link and version
88+
- name: Annotate workflow with PR link and version
8889
run: |
89-
PR_URL=$(gh pr view ${{ steps.get-pr-number.outputs.pr_number }} --json url --jq .url)
90-
gh pr comment ${{ steps.get-pr-number.outputs.pr_number }} --body "Prepared release version ${{ steps.compute-next-version.outputs.next_version }}. PR: ${PR_URL}"
91-
env:
92-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
PR_URL="${{ github.server_url }}/${{ github.repository }}/pull/${{ steps.get-pr-number.outputs.pr_number }}"
91+
echo "::notice title=Release prepared::Prepared release version ${{ steps.compute-next-version.outputs.next_version }}. PR: ${PR_URL}"
9392
9493
- name: Skip from release notes
9594
run: |
9695
gh pr edit ${{ steps.get-pr-number.outputs.pr_number }} --add-label "ignore for release"
9796
env:
98-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
GH_TOKEN: ${{ secrets.CLI_ACTION_TOKEN }}

artifactory_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5173,6 +5173,24 @@ func TestConfigAddWithStdinAccessToken(t *testing.T) {
51735173
details, err := config.GetSpecificConfig(tests.ServerId, false, false)
51745174
assert.NoError(t, err)
51755175
assert.Equal(t, "accesstoken", details.AccessToken)
5176+
assert.Equal(t, false, details.DisableTokenRefresh)
5177+
}
5178+
5179+
func TestConfigAddWithDisableRefreshToken(t *testing.T) {
5180+
initArtifactoryTest(t, "")
5181+
5182+
err := configCli.WithoutCredentials().Exec("add", tests.ServerId, "--artifactory-url="+*tests.JfrogUrl+tests.
5183+
ArtifactoryEndpoint, "--access-token=password", "--disable-token-refresh=true")
5184+
assert.NoError(t, err)
5185+
5186+
defer func() {
5187+
assert.NoError(t, configCli.WithoutCredentials().Exec("rm", tests.ServerId, "--quiet"))
5188+
}()
5189+
5190+
details, err := config.GetSpecificConfig(tests.ServerId, false, false)
5191+
assert.NoError(t, err)
5192+
assert.Equal(t, "password", details.AccessToken)
5193+
assert.Equal(t, true, details.DisableTokenRefresh)
51765194
}
51775195

51785196
func pipeStdinSecret(t *testing.T, secret string) func() {

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ require (
1919
github.com/jfrog/build-info-go v1.11.0
2020
github.com/jfrog/gofrog v1.7.6
2121
github.com/jfrog/jfrog-cli-artifactory v0.7.3-0.20250919153452-dd92b2c8f024
22-
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20250918084044-2eb3f15d08c1
22+
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20250924075232-db72a3ec8f50
2323
github.com/jfrog/jfrog-cli-platform-services v1.10.0
2424
github.com/jfrog/jfrog-cli-security v1.21.7
25-
github.com/jfrog/jfrog-client-go v1.55.1-0.20250922120823-e64346ea079b
25+
github.com/jfrog/jfrog-client-go v1.55.1-0.20250923151105-826d1e79e64c
2626
github.com/jszwec/csvutil v1.10.0
2727
github.com/manifoldco/promptui v0.9.0
2828
github.com/stretchr/testify v1.11.1
@@ -40,7 +40,7 @@ require (
4040
github.com/BurntSushi/toml v1.5.0 // indirect
4141
github.com/CycloneDX/cyclonedx-go v0.9.2 // indirect
4242
github.com/Microsoft/go-winio v0.6.2 // indirect
43-
github.com/ProtonMail/go-crypto v1.1.6 // indirect
43+
github.com/ProtonMail/go-crypto v1.3.0 // indirect
4444
github.com/VividCortex/ewma v1.2.0 // indirect
4545
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
4646
github.com/andybalholm/brotli v1.2.0 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ github.com/CycloneDX/cyclonedx-go v0.9.2/go.mod h1:vcK6pKgO1WanCdd61qx4bFnSsDJQ6
4343
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
4444
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
4545
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
46-
github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw=
47-
github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
46+
github.com/ProtonMail/go-crypto v1.3.0 h1:ILq8+Sf5If5DCpHQp4PbZdS1J7HDFRXz/+xKBiRGFrw=
47+
github.com/ProtonMail/go-crypto v1.3.0/go.mod h1:9whxjD8Rbs29b4XWbB8irEcE8KHMqaR2e7GWU1R+/PE=
4848
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
4949
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
5050
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
@@ -363,14 +363,14 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL
363363
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
364364
github.com/jfrog/jfrog-cli-artifactory v0.7.3-0.20250919153452-dd92b2c8f024 h1:LWmb50WFKV8V59jmB8+/KD3TI26KmNrJnMwSf/0CEuU=
365365
github.com/jfrog/jfrog-cli-artifactory v0.7.3-0.20250919153452-dd92b2c8f024/go.mod h1:N1nn6tNbyAjtdhLp89tO1CstT+iWcQSzAJGvAml7Deg=
366-
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20250918084044-2eb3f15d08c1 h1:Gu9GT06M9OH7E7rhNYF1tXoaMQhZOmzpaBDmJcwkUgc=
367-
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20250918084044-2eb3f15d08c1/go.mod h1:nir0kLxfelcpFsXHVztjCxFIoONWyMbTXnL5dyHcZHI=
366+
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20250924075232-db72a3ec8f50 h1:LGho+LPFqLy+VD/utgWDLmpL6FgxcBco3buvnMl+hJU=
367+
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20250924075232-db72a3ec8f50/go.mod h1:W7rfoQaNKGuJWtsw7/yUNmSdiPoJgcV5U04TzXZa7Ak=
368368
github.com/jfrog/jfrog-cli-platform-services v1.10.0 h1:O+N/VAF+QjFvq9xkHpmzKLcdl9aJu3IP204Su0L14rw=
369369
github.com/jfrog/jfrog-cli-platform-services v1.10.0/go.mod h1:qbu4iqBST9x8LgD8HhzUm91iOB3vHqtoGmaxOnmw0ok=
370370
github.com/jfrog/jfrog-cli-security v1.21.7 h1:WE3sSTpCTc051sIted08Moz5yY+0DK8tuJG/fbe+iaQ=
371371
github.com/jfrog/jfrog-cli-security v1.21.7/go.mod h1:AYckVBA3qNmCku1MrBLpQwbr9eAZ91U/3zMa88gckD8=
372-
github.com/jfrog/jfrog-client-go v1.55.1-0.20250922120823-e64346ea079b h1:e26MG4YmrtwUdfmpKPXqrB1i894y6BbS1f4RRHuhprk=
373-
github.com/jfrog/jfrog-client-go v1.55.1-0.20250922120823-e64346ea079b/go.mod h1:tJlcnGoJAqiScMRT2qOUPUzpVUrhpxkGiLg/BWZ7PtE=
372+
github.com/jfrog/jfrog-client-go v1.55.1-0.20250923151105-826d1e79e64c h1:eD8kalHfqcJLX55Oj+DQpe61qU3zs2GgEgrg1tSKLsA=
373+
github.com/jfrog/jfrog-client-go v1.55.1-0.20250923151105-826d1e79e64c/go.mod h1:xYik+5731f7IKdJN9SVWhBwiaj2pXkzVUpxoPoA6kak=
374374
github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94=
375375
github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8=
376376
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW34dhU4az1GN0pTPADwNmvoRSeoZ6PItiqnY=

utils/cliutils/commandsflags.go

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,13 @@ const (
123123

124124
// *** Artifactory Commands' flags ***
125125
// Base flags
126-
url = "url"
127-
platformUrl = "platform-url"
128-
user = "user"
129-
password = "password"
130-
accessToken = "access-token"
131-
serverId = "server-id"
126+
url = "url"
127+
platformUrl = "platform-url"
128+
user = "user"
129+
password = "password"
130+
accessToken = "access-token"
131+
serverId = "server-id"
132+
disableTokenRefresh = "disable-token-refresh"
132133

133134
passwordStdin = "password-stdin"
134135
accessTokenStdin = "access-token-stdin"
@@ -520,17 +521,18 @@ const (
520521
licenseCount = "license-count"
521522

522523
// *** Config Commands' flags ***
523-
configPrefix = "config-"
524-
configPlatformUrl = configPrefix + url
525-
configRtUrl = "artifactory-url"
526-
configDistUrl = "distribution-url"
527-
configXrUrl = "xray-url"
528-
configMcUrl = "mission-control-url"
529-
configPlUrl = "pipelines-url"
530-
configAccessToken = configPrefix + accessToken
531-
configUser = configPrefix + user
532-
configPassword = configPrefix + password
533-
configInsecureTls = configPrefix + InsecureTls
524+
configPrefix = "config-"
525+
configPlatformUrl = configPrefix + url
526+
configRtUrl = "artifactory-url"
527+
configDistUrl = "distribution-url"
528+
configXrUrl = "xray-url"
529+
configMcUrl = "mission-control-url"
530+
configPlUrl = "pipelines-url"
531+
configAccessToken = configPrefix + accessToken
532+
configUser = configPrefix + user
533+
configPassword = configPrefix + password
534+
configInsecureTls = configPrefix + InsecureTls
535+
configDisableRefreshAccessToken = configPrefix + disableTokenRefresh
534536

535537
// *** Project Commands' flags ***
536538
projectPath = "path"
@@ -1560,6 +1562,10 @@ var flagsMap = map[string]cli.Flag{
15601562
Name: InsecureTls,
15611563
Usage: "[Default: false] Set to true to skip TLS certificates verification, while encrypting the Artifactory password during the config process.` `",
15621564
},
1565+
configDisableRefreshAccessToken: cli.BoolFlag{
1566+
Name: disableTokenRefresh,
1567+
Usage: "[Default: false] Set to true to disable automatic refresh of access tokens.` `",
1568+
},
15631569
projectPath: cli.StringFlag{
15641570
Name: projectPath,
15651571
Usage: "[Default: ./] Full path to the code project.` `",
@@ -1729,11 +1735,12 @@ var flagsMap = map[string]cli.Flag{
17291735
var commandFlags = map[string][]string{
17301736
AddConfig: {
17311737
interactive, EncPassword, configPlatformUrl, configRtUrl, configDistUrl, configXrUrl, configMcUrl, configPlUrl, configUser, configPassword, configAccessToken, sshKeyPath, sshPassphrase, ClientCertPath,
1732-
ClientCertKeyPath, BasicAuthOnly, configInsecureTls, Overwrite, passwordStdin, accessTokenStdin, OidcTokenID, OidcProviderName, OidcAudience, OidcProviderType, ApplicationKey,
1738+
ClientCertKeyPath, BasicAuthOnly, configInsecureTls, Overwrite, passwordStdin, accessTokenStdin, OidcTokenID,
1739+
OidcProviderName, OidcAudience, OidcProviderType, ApplicationKey, configDisableRefreshAccessToken,
17331740
},
17341741
EditConfig: {
17351742
interactive, EncPassword, configPlatformUrl, configRtUrl, configDistUrl, configXrUrl, configMcUrl, configPlUrl, configUser, configPassword, configAccessToken, sshKeyPath, sshPassphrase, ClientCertPath,
1736-
ClientCertKeyPath, BasicAuthOnly, configInsecureTls, passwordStdin, accessTokenStdin,
1743+
ClientCertKeyPath, BasicAuthOnly, configInsecureTls, passwordStdin, accessTokenStdin, configDisableRefreshAccessToken,
17371744
},
17381745
DeleteConfig: {
17391746
deleteQuiet,

utils/cliutils/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ func CreateServerDetailsFromFlags(c *cli.Context) (details *coreConfig.ServerDet
341341
details.ServerId = os.Getenv(coreutils.ServerID)
342342
}
343343
details.InsecureTls = c.Bool(InsecureTls)
344+
details.DisableTokenRefresh = c.Bool(disableTokenRefresh)
344345
return
345346
}
346347

0 commit comments

Comments
 (0)