Skip to content

Commit e7d46f4

Browse files
committed
resolved conflicts
2 parents 1b44a75 + b72bb08 commit e7d46f4

File tree

19 files changed

+1045
-42
lines changed

19 files changed

+1045
-42
lines changed

.github/scripts/prepare-cli-release

Lines changed: 630 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# prepare-cli-release
2+
3+
Helper script that locally mirrors the GitHub Actions **Prepare Release** workflow. It bumps the CLI version, updates deps, builds, pushes a branch, and opens a PR.
4+
5+
## Prerequisites
6+
- Python 3.8+ (runs the script).
7+
- Go toolchain available (or provide `--go-home` to a GOROOT).
8+
- `gh` CLI authenticated for `jfrog/jfrog-cli` (or export `GH_TOKEN`/`GITHUB_TOKEN`).
9+
- Git workspace clean enough to create/push a branch.
10+
- Make/build tooling used by `make update-all` and `build/build.sh`.
11+
12+
## Steps the script performs
13+
1) Compute current version: `go run main.go -v`
14+
2) Compute next version from the latest release tag via `gh release view`
15+
3) Create branch `bump-ver-from-<current>-to-<next>` from `--ref` (default `master`)
16+
4) Run `build/bump-version.sh <next>` with `BUMP_VERSION_SKIP_GIT=true`
17+
5) Run `make update-all`
18+
6) Build/check binary via `./build/build.sh` and `./jf --version`
19+
7) Commit and push the branch
20+
8) Open a PR titled `Bump version to <next>`
21+
9) Annotate workflow and add the `ignore for release` label
22+
23+
## Usage
24+
Run from the repo root (the script checks for `go.mod` with module `github.com/jfrog/jfrog-cli`):
25+
26+
```bash
27+
.github/scripts/prepare-cli-release --version minor --ref master
28+
```
29+
30+
### Key flags
31+
- `--version {minor,patch}`: bump type (default: `minor`).
32+
- `--ref <branch>`: base branch to start from (default: `master`).
33+
- `--starting-step <step>`: resume from a specific step; earlier steps are skipped but required values are recomputed when needed.
34+
- `--gh-token <token>`: GitHub token; otherwise uses `GH_TOKEN`/`GITHUB_TOKEN` or existing `gh` auth.
35+
- `--dry-run`: print the planned actions and computed versions; no mutations.
36+
- `--go-home <path>`: set `GOROOT` and prepend its `bin` to `PATH`.
37+
38+
### Common flows
39+
- Minor release from master:
40+
```bash
41+
.github/scripts/prepare-cli-release --version minor --ref master
42+
```
43+
- Patch release from a maintenance branch:
44+
```bash
45+
.github/scripts/prepare-cli-release --version patch --ref release/3.2
46+
```
47+
- Dry run to preview:
48+
```bash
49+
.github/scripts/prepare-cli-release --version minor --dry-run
50+
```
51+
- Resume after a previous partial run (e.g., start at dependency update):
52+
```bash
53+
.github/scripts/prepare-cli-release --starting-step update-dependencies
54+
```
55+
56+
## Outputs
57+
- Branch: `bump-ver-from-<current>-to-<next>` pushed to `origin`.
58+
- PR: Created against the base branch with title/body `Bump version to <next>`.
59+
- Workflow notice printed with PR link and version.
60+
61+
## Troubleshooting tips
62+
- Auth errors from `gh`: ensure `gh auth status` succeeds or pass `--gh-token`.
63+
- Go not found: install Go or provide `--go-home /path/to/go`.
64+
- Push failures: verify remote `origin` exists and you have permission to push.
65+
- Missing tools: ensure `make`, `build/bump-version.sh`, and `build/build.sh` are executable in the repo root.
66+

artifactory/cli.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ func transferFilesCmd(c *cli.Context) error {
11731173
includeReposPatterns, excludeReposPatterns := getTransferIncludeExcludeRepos(c)
11741174
newTransferFilesCmd.SetIncludeReposPatterns(includeReposPatterns)
11751175
newTransferFilesCmd.SetExcludeReposPatterns(excludeReposPatterns)
1176+
newTransferFilesCmd.SetIncludeFilesPatterns(getIncludeFilesPatterns(c))
11761177
newTransferFilesCmd.SetIgnoreState(c.Bool(cliutils.IgnoreState))
11771178
newTransferFilesCmd.SetProxyKey(c.String(cliutils.ProxyKey))
11781179
return newTransferFilesCmd.Run()
@@ -1189,6 +1190,14 @@ func getTransferIncludeExcludeRepos(c *cli.Context) (includeReposPatterns, exclu
11891190
return
11901191
}
11911192

1193+
func getIncludeFilesPatterns(c *cli.Context) []string {
1194+
const patternSeparator = ";"
1195+
if c.IsSet(cliutils.IncludeFiles) {
1196+
return strings.Split(c.String(cliutils.IncludeFiles), patternSeparator)
1197+
}
1198+
return nil
1199+
}
1200+
11921201
func getTransferIncludeExcludeProjects(c *cli.Context) (includeProjectsPatterns, excludeProjectsPatterns []string) {
11931202
const patternSeparator = ";"
11941203
if c.IsSet(cliutils.IncludeProjects) {

artifactory/cli_test.go

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package artifactory
22

33
import (
44
"bytes"
5-
"github.com/jfrog/jfrog-cli-artifactory/cliutils/flagkit"
65
"path/filepath"
76
"testing"
87

8+
"github.com/jfrog/jfrog-cli-artifactory/cliutils/flagkit"
9+
910
commonCliUtils "github.com/jfrog/jfrog-cli-core/v2/common/cliutils"
1011
"github.com/jfrog/jfrog-cli-core/v2/common/spec"
1112
"github.com/jfrog/jfrog-cli/utils/cliutils"
@@ -154,3 +155,46 @@ func TestCreateUploadConfiguration(t *testing.T) {
154155
})
155156
}
156157
}
158+
159+
// Test cases for getIncludeFilesPatterns
160+
var getIncludeFilesPatternsTestCases = []struct {
161+
name string
162+
flags []string
163+
expectedPatterns []string
164+
}{
165+
{
166+
name: "no flag set",
167+
flags: []string{},
168+
expectedPatterns: nil,
169+
},
170+
{
171+
name: "single pattern",
172+
flags: []string{cliutils.IncludeFiles + "=org/company/*"},
173+
expectedPatterns: []string{"org/company/*"},
174+
},
175+
{
176+
name: "multiple patterns",
177+
flags: []string{cliutils.IncludeFiles + "=org/company/*;com/example/*"},
178+
expectedPatterns: []string{"org/company/*", "com/example/*"},
179+
},
180+
{
181+
name: "three patterns",
182+
flags: []string{cliutils.IncludeFiles + "=path1/*;path2/*;path3/*"},
183+
expectedPatterns: []string{"path1/*", "path2/*", "path3/*"},
184+
},
185+
{
186+
name: "pattern with deep nesting",
187+
flags: []string{cliutils.IncludeFiles + "=a/b/c/d/e/*"},
188+
expectedPatterns: []string{"a/b/c/d/e/*"},
189+
},
190+
}
191+
192+
func TestGetIncludeFilesPatterns(t *testing.T) {
193+
for _, testCase := range getIncludeFilesPatternsTestCases {
194+
t.Run(testCase.name, func(t *testing.T) {
195+
context, _ := tests.CreateContext(t, testCase.flags, []string{})
196+
patterns := getIncludeFilesPatterns(context)
197+
assert.Equal(t, testCase.expectedPatterns, patterns)
198+
})
199+
}
200+
}

artifactory_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,13 @@ func TestReleaseBundleImportOnPrem(t *testing.T) {
276276

277277
func TestReleaseBundleV2Download(t *testing.T) {
278278
buildNumber := "5"
279+
initArtifactoryTest(t, "")
280+
initLifecycleTest(t, signingKeyOptionalArtifactoryMinVersion)
279281
defer func() {
280282
deleteReceivedReleaseBundle(t, deleteReleaseBundleV2ApiUrl, tests.LcRbName1, buildNumber)
281283
inttestutils.DeleteBuild(serverDetails.ArtifactoryUrl, tests.RtBuildName1, artHttpDetails)
282284
cleanArtifactoryTest()
283285
}()
284-
initArtifactoryTest(t, "")
285-
initLifecycleTest(t, signingKeyOptionalArtifactoryMinVersion)
286286

287287
runRt(t, "upload", "testdata/a/a1.in", tests.RtRepo1, "--build-name="+tests.RtBuildName1, "--build-number="+buildNumber)
288288
runRt(t, "build-publish", tests.RtBuildName1, buildNumber)

build/npm/v2-jf/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/npm/v2-jf/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jfrog-cli-v2-jf",
3-
"version": "2.86.0",
3+
"version": "2.87.0",
44
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
55
"homepage": "https://github.com/jfrog/jfrog-cli",
66
"preferGlobal": true,

build/npm/v2/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/npm/v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jfrog-cli-v2",
3-
"version": "2.86.0",
3+
"version": "2.87.0",
44
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
55
"homepage": "https://github.com/jfrog/jfrog-cli",
66
"preferGlobal": true,

buildtools/cli.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ func GetCommands() []cli.Command {
358358
},
359359
{
360360
Name: "conan",
361+
Hidden: true,
361362
Flags: cliutils.GetCommandFlags(cliutils.Conan),
362363
Usage: conan.GetDescription(),
363364
HelpName: corecommon.CreateUsage("conan", conan.GetDescription(), conan.Usage),

0 commit comments

Comments
 (0)