Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 89 additions & 13 deletions .jfrog-pipelines/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ pipelines:
default: "artifactory-dind-amd-scale-set"
description: "GitHub Actions runs-on label for all test jobs (use your self-hosted label; github.com-style ubuntu-24.04 is often unavailable on GHE)"
allowCustom: true
LOGS_TO_KIBANA:
default: "true"
description: "Forward Artifactory logs from the deployed ephemeral environment to Kibana (via Coralogix). Maps to the LOGS_TO_KIBANA parameter of the environment_setup_gen2 Jenkins job. Set 'false' to disable."
allowCustom: true
DEPLOYMENT_SIZING:
default: "large"
description: "Artifactory deployment sizing profile."
allowCustom: true
MAX_RUN_RETRIES:
default: "2"
description: "Per-workflow run-level retry budget. When a dispatched workflow run finishes with a non-success conclusion, the pipeline calls GitHub's rerun-failed-jobs API up to this many times before declaring it failed. Set 0 to disable run-level retry."
allowCustom: true
MAX_WAIT_SECONDS:
default: "14400"
description: "Maximum total seconds to wait for all dispatched workflow runs (including reruns) to complete. Default 4h to accommodate up to MAX_RUN_RETRIES reruns of slow suites."
allowCustom: true
steps:
- name: setup_cli_test
type: Bash
Expand Down Expand Up @@ -140,6 +156,8 @@ pipelines:
ACCOUNT_TYPE: "enterprise_plus"
GROUP: "ARTIFACTORY"
EXPIRY: 2d
LOGS_TO_KIBANA: "${LOGS_TO_KIBANA}"
DEPLOYMENT_SIZING: "${DEPLOYMENT_SIZING}"
EXTRA_PARAMS: "conf_artifactory_unified_version=${RT_VERSION} master_key=${MASTER_KEY}"

- name: setup_environment
Expand Down Expand Up @@ -298,6 +316,10 @@ pipelines:
GH_JF_CLI_REPO="${JFROG_CLI_GITHUB_REPO:-jfrog/jfrog-cli}"
GH_ACTIONS_RUNNER="${GHE_ACTIONS_RUNNER:-artifactory-dind-amd-scale-set}"

# Run-level retry knobs (see the readOnly env vars above).
MAX_RUN_RETRIES_RESOLVED="${MAX_RUN_RETRIES:-2}"
MAX_WAIT_RESOLVED="${MAX_WAIT_SECONDS:-14400}"

GITHUB_TOKEN_RESOLVED="${GITHUB_DISPATCH_TOKEN:-}"
if [[ -z "${GITHUB_TOKEN_RESOLVED}" ]]; then GITHUB_TOKEN_RESOLVED="${int_jfrog_cli_gh_token:-}"; fi
if [[ -z "${GITHUB_TOKEN_RESOLVED}" ]]; then GITHUB_TOKEN_RESOLVED="${int_jfrog_cli_gh_accessToken:-}"; fi
Expand All @@ -317,6 +339,8 @@ pipelines:
echo " jfrog_cli_repo : ${GH_JF_CLI_REPO}"
echo " jfrog_cli_ref : ${CLI_REF}"
echo " jfrog_url : ${JFROG_URL}"
echo " run-level retries per workflow : ${MAX_RUN_RETRIES_RESOLVED}"
echo " total wait budget (seconds) : ${MAX_WAIT_RESOLVED}"

# ── Verify repo access ───────────────────────────────────────────
REPO_CODE=$(curl -sS -o /tmp/gh_repo.json -w "%{http_code}" \
Expand Down Expand Up @@ -480,14 +504,42 @@ pipelines:
RUN_ENTRIES="${RUN_ENTRIES} ${GH_WF_FILE}:${RUN_ID}"
done

# ── Initialise per-workflow retry budgets ────────────────────────
# We can't use a bash associative array because the script may
# run under /bin/sh on some images. Use a single space-separated
# string of "name=count" entries and update it in-place.
RETRIES_LEFT=""
for ENTRY in ${RUN_ENTRIES}; do
GH_WF_FILE="${ENTRY%%:*}"
RETRIES_LEFT="${RETRIES_LEFT} ${GH_WF_FILE}=${MAX_RUN_RETRIES_RESOLVED}"
done

get_retries_left() {
local name="$1"
echo "${RETRIES_LEFT}" \
| tr ' ' '\n' \
| awk -F= -v n="${name}" '$1 == n {print $2; exit}'
}
set_retries_left() {
local name="$1"
local count="$2"
local rebuilt=""
for kv in ${RETRIES_LEFT}; do
case "${kv}" in
"${name}="*) rebuilt="${rebuilt} ${name}=${count}" ;;
*) rebuilt="${rebuilt} ${kv}" ;;
esac
done
RETRIES_LEFT="${rebuilt}"
}

# ── Poll all runs until every one completes ──────────────────────
echo ""
echo "Monitoring all workflow runs..."
MAX_WAIT=7200
echo "Monitoring all workflow runs (retry budget: ${MAX_RUN_RETRIES_RESOLVED} per workflow, total wait ${MAX_WAIT_RESOLVED}s)..."
ELAPSED=0
INTERVAL=60

while [[ ${ELAPSED} -lt ${MAX_WAIT} ]]; do
while [[ ${ELAPSED} -lt ${MAX_WAIT_RESOLVED} ]]; do
ALL_DONE=true
ANY_FAILED=false
FAILED_WORKFLOWS=""
Expand All @@ -503,37 +555,61 @@ pipelines:
"${GH_API_URL}/repos/${GH_WORKFLOWS_REPO}/actions/runs/${RUN_ID}")
STATUS=$(echo "${RUN_JSON}" | jq -r '.status // empty')
CONCLUSION=$(echo "${RUN_JSON}" | jq -r '.conclusion // empty')
RUN_ATTEMPT=$(echo "${RUN_JSON}" | jq -r '.run_attempt // 1')

if [[ "${STATUS}" != "completed" ]]; then
ALL_DONE=false
echo " [running] ${GH_WF_FILE} (${RUN_ID}): ${STATUS}"
echo " [running] ${GH_WF_FILE} (${RUN_ID}, attempt ${RUN_ATTEMPT}): ${STATUS}"
LAST_SUMMARY="${LAST_SUMMARY}${GH_WF_FILE}:${STATUS};"
elif [[ "${CONCLUSION}" != "success" ]]; then
ANY_FAILED=true
echo " [FAILED] ${GH_WF_FILE} (${RUN_ID}): ${CONCLUSION}"
FAILED_WORKFLOWS="${FAILED_WORKFLOWS} ${GH_WF_FILE}"
LAST_SUMMARY="${LAST_SUMMARY}${GH_WF_FILE}:${CONCLUSION};"
RL=$(get_retries_left "${GH_WF_FILE}")
RL="${RL:-0}"
if [[ "${RL}" -gt 0 ]]; then
NEW_RL=$((RL - 1))
echo " [retry] ${GH_WF_FILE} (${RUN_ID}, attempt ${RUN_ATTEMPT}): ${CONCLUSION} -> calling rerun-failed-jobs (retries left after this: ${NEW_RL})"
RR_CODE=$(curl -sS -o /tmp/gh_rerun.json -w "%{http_code}" -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN_RESOLVED}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"${GH_API_URL}/repos/${GH_WORKFLOWS_REPO}/actions/runs/${RUN_ID}/rerun-failed-jobs")
if [[ "${RR_CODE}" == "201" ]]; then
set_retries_left "${GH_WF_FILE}" "${NEW_RL}"
ALL_DONE=false
LAST_SUMMARY="${LAST_SUMMARY}${GH_WF_FILE}:retrying;"
else
echo " [retry] rerun-failed-jobs returned HTTP ${RR_CODE}; treating ${GH_WF_FILE} as failed"
cat /tmp/gh_rerun.json 2>/dev/null || true
ANY_FAILED=true
FAILED_WORKFLOWS="${FAILED_WORKFLOWS} ${GH_WF_FILE}"
LAST_SUMMARY="${LAST_SUMMARY}${GH_WF_FILE}:${CONCLUSION};"
fi
else
ANY_FAILED=true
echo " [FAILED] ${GH_WF_FILE} (${RUN_ID}, attempt ${RUN_ATTEMPT}): ${CONCLUSION} (no retries left)"
FAILED_WORKFLOWS="${FAILED_WORKFLOWS} ${GH_WF_FILE}"
LAST_SUMMARY="${LAST_SUMMARY}${GH_WF_FILE}:${CONCLUSION};"
fi
else
echo " [ok] ${GH_WF_FILE} (${RUN_ID}): success"
echo " [ok] ${GH_WF_FILE} (${RUN_ID}, attempt ${RUN_ATTEMPT}): success"
LAST_SUMMARY="${LAST_SUMMARY}${GH_WF_FILE}:success;"
fi
done

if [[ "${ALL_DONE}" == "true" ]]; then
echo ""
if [[ "${ANY_FAILED}" == "true" ]]; then
fail_jf_cli_tests "One or more workflow runs failed. ${LAST_SUMMARY}"
fail_jf_cli_tests "One or more workflow runs failed after exhausting retries. ${LAST_SUMMARY}"
fi
echo "All workflow runs completed successfully."
echo "All workflow runs completed successfully. ${LAST_SUMMARY}"
exit 0
fi

echo " --- sleeping ${INTERVAL}s (elapsed ${ELAPSED}s / ${MAX_WAIT}s) ---"
echo " --- sleeping ${INTERVAL}s (elapsed ${ELAPSED}s / ${MAX_WAIT_RESOLVED}s) ---"
sleep "${INTERVAL}"
ELAPSED=$((ELAPSED + INTERVAL))
done

fail_jf_cli_tests "Timed out after ${MAX_WAIT}s while waiting for workflow runs. ${LAST_SUMMARY}"
fail_jf_cli_tests "Timed out after ${MAX_WAIT_RESOLVED}s while waiting for workflow runs. ${LAST_SUMMARY}"

onSuccess:
- echo "JFrog CLI integration tests finished successfully."
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2-jf/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2-jf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2-jf",
"version": "2.105.0",
"version": "2.106.0",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
2 changes: 1 addition & 1 deletion build/npm/v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/npm/v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-cli-v2",
"version": "2.105.0",
"version": "2.106.0",
"description": "🐸 Command-line interface for JFrog Artifactory, Xray, Distribution, Pipelines and Mission Control 🐸",
"homepage": "https://github.com/jfrog/jfrog-cli",
"preferGlobal": true,
Expand Down
15 changes: 9 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module github.com/jfrog/jfrog-cli
go 1.26.3

replace (
// Should not be updated to 0.11.0+ due to default spec version change (1.6 -> 1.7, https://github.com/CycloneDX/cyclonedx-go/pull/257)
// Waiting for JPD to support the new spec version before allowing upgrade
github.com/CycloneDX/cyclonedx-go => github.com/CycloneDX/cyclonedx-go v0.10.0
// Should not be updated to 0.2.6 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372)
github.com/c-bata/go-prompt => github.com/c-bata/go-prompt v0.2.5
// Should not be updated to 0.2.0-beta.2 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372)
Expand All @@ -15,15 +18,15 @@ require (
github.com/buger/jsonparser v1.2.0
github.com/gocarina/gocsv v0.0.0-20260523204920-c264028e67ea
github.com/jfrog/archiver/v3 v3.6.3
github.com/jfrog/build-info-go v1.13.1-0.20260526201157-3dd942bd9e1f
github.com/jfrog/build-info-go v1.13.1-0.20260528065004-80409c046540
github.com/jfrog/gofrog v1.7.6
github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260527043943-fdf755c4f4c2
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260528061115-b41c87af0194
github.com/jfrog/jfrog-cli-evidence v0.9.4
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260601110159-16e27949b870
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260601130310-8d52a530da18
github.com/jfrog/jfrog-cli-evidence v0.9.5-0.20260528121456-17c6218af996
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260430094150-ce7d9b371c6f
github.com/jfrog/jfrog-cli-security v1.29.2
github.com/jfrog/jfrog-client-go v1.55.1-0.20260527095031-a0b759bcd723
github.com/jfrog/jfrog-cli-security v1.29.3
github.com/jfrog/jfrog-client-go v1.55.1-0.20260528115006-6ca9682a3255
github.com/jszwec/csvutil v1.10.0
github.com/moby/moby/api v1.54.2
github.com/spf13/viper v1.21.0
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQ
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/CycloneDX/cyclonedx-go v0.11.0 h1:GokP8FiRC+foiuwWhSSLpSD5H4hSWtGnR3wo7apkBFI=
github.com/CycloneDX/cyclonedx-go v0.11.0/go.mod h1:vUvbCXQsEm48OI6oOlanxstwNByXjCZ2wuleUlwGEO8=
github.com/CycloneDX/cyclonedx-go v0.10.0 h1:7xyklU7YD+CUyGzSFIARG18NYLsKVn4QFg04qSsu+7Y=
github.com/CycloneDX/cyclonedx-go v0.10.0/go.mod h1:vUvbCXQsEm48OI6oOlanxstwNByXjCZ2wuleUlwGEO8=
github.com/Masterminds/semver/v3 v3.5.0 h1:kQceYJfbupGfZOKZQg0kou0DgAKhzDg2NZPAwZ/2OOE=
github.com/Masterminds/semver/v3 v3.5.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
Expand Down Expand Up @@ -400,8 +400,8 @@ github.com/jellydator/ttlcache/v3 v3.4.0 h1:YS4P125qQS0tNhtL6aeYkheEaB/m8HCqdMMP
github.com/jellydator/ttlcache/v3 v3.4.0/go.mod h1:Hw9EgjymziQD3yGsQdf1FqFdpp7YjFMd4Srg5EJlgD4=
github.com/jfrog/archiver/v3 v3.6.3 h1:hkAmPjBw393tPmQ07JknLNWFNZjXdy2xFEnOW9wwOxI=
github.com/jfrog/archiver/v3 v3.6.3/go.mod h1:5V9l+Fte30Y4qe9dUOAd3yNTf8lmtVNuhKNrvI8PMhg=
github.com/jfrog/build-info-go v1.13.1-0.20260526201157-3dd942bd9e1f h1:2f9rUp14HdL8SD84/3Vu1UOmn71OIX7MxmHLW4VCjwM=
github.com/jfrog/build-info-go v1.13.1-0.20260526201157-3dd942bd9e1f/go.mod h1:CYRUCvLKfyARjoJXLWAxce1qNUxTEtbRKAARkV42vpE=
github.com/jfrog/build-info-go v1.13.1-0.20260528065004-80409c046540 h1:yJjTgSfmsBx9Q6/iiJxXQ/m0KZfFjNx8nNzaRLCM7z4=
github.com/jfrog/build-info-go v1.13.1-0.20260528065004-80409c046540/go.mod h1:CYRUCvLKfyARjoJXLWAxce1qNUxTEtbRKAARkV42vpE=
github.com/jfrog/froggit-go v1.22.0 h1:eeN5F8sOUo+h2cXkzArAu4nvSdjkDTAZtgqwrct70qg=
github.com/jfrog/froggit-go v1.22.0/go.mod h1:wRDryqyp3oe+eHgME2mpnEQmO8XBECIPagFwj0nHmdI=
github.com/jfrog/go-mockhttp v0.3.1 h1:/wac8v4GMZx62viZmv4wazB5GNKs+GxawuS1u3maJH8=
Expand All @@ -412,18 +412,18 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64 h1:bxcy1v1LXQV4T0kVU1duWQr3h7vKfHyMD1B+IuFLWUw=
github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64/go.mod h1:cKqb/JgN+XuD4RhOxvSZnyGyXw3cJsTZfQT3rk9MCho=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260527043943-fdf755c4f4c2 h1:acwlLYjjglecqjXXgj2JoM1bUhH/dDMpLpJXrBfvyqU=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260527043943-fdf755c4f4c2/go.mod h1:T5HDtDxHlUZWF4LQnmF2kiyFyd8yLOf3K618BsG0CWk=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260528061115-b41c87af0194 h1:cwppCKLitT0XBqYGQimW00qyx1ej88sY+rIjXAWNvAU=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260528061115-b41c87af0194/go.mod h1:9R90mhbczGXwW5EGlDs7F08ejQU/xdoDhYHMvzBiqgE=
github.com/jfrog/jfrog-cli-evidence v0.9.4 h1:RAqZYaH2RrzmhW+bGA7dx/yTqa4X1fZ4/5V7VVMSJtc=
github.com/jfrog/jfrog-cli-evidence v0.9.4/go.mod h1:nLSLqLIhQz1Hi2n+KjHZTyK1mcmPLevv41LjItLswmE=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260601110159-16e27949b870 h1:oRICL3VxTToKN7DqufQyOkU2HXBoTQg3F405qfulFHs=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260601110159-16e27949b870/go.mod h1:GQEGVW3wT1XPykXNsEiPQrF8/+01JvDVcGGYb5vqJuE=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260601130310-8d52a530da18 h1:tPv7XscDFAZaijVwMQNb+HmuucUMYQdjuA5frdGzhF0=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260601130310-8d52a530da18/go.mod h1:9R90mhbczGXwW5EGlDs7F08ejQU/xdoDhYHMvzBiqgE=
github.com/jfrog/jfrog-cli-evidence v0.9.5-0.20260528121456-17c6218af996 h1:jFldEXM8i2G+iQDRMQZ1ZaEMF0H+D2mgG7gTVgQcbZg=
github.com/jfrog/jfrog-cli-evidence v0.9.5-0.20260528121456-17c6218af996/go.mod h1:GhNJQSN9Xv4f0BKxurColafSBmI6V6DVdhlqRmX2+yw=
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260430094150-ce7d9b371c6f h1:M1cesbKYSznwPA76dNctjCELxGx34TSSjwoYnJm9/6Y=
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260430094150-ce7d9b371c6f/go.mod h1:JUdq/dQoNscpta62FDCAcaSVbvcCOr5VkH8UeGTG1HQ=
github.com/jfrog/jfrog-cli-security v1.29.2 h1:amL7XBPL2weVMRkNUAgqOOrfb/+dIGo5EuFm7WJO4d4=
github.com/jfrog/jfrog-cli-security v1.29.2/go.mod h1:SiBy5+maHAqKzXzVNPgV+fZo6OgIcB6A3uTko2LYbiI=
github.com/jfrog/jfrog-client-go v1.55.1-0.20260527095031-a0b759bcd723 h1:iAm9OjrnK5hPps0ZkKg7Lxdq5Y4jp3BTOB86X5iyEHk=
github.com/jfrog/jfrog-client-go v1.55.1-0.20260527095031-a0b759bcd723/go.mod h1:FHpjN1nTDoj96xd6obe27EOgGErqzU0rQgC96L3Ch9E=
github.com/jfrog/jfrog-cli-security v1.29.3 h1:cIoDn5NkhmrVANUr22H2IVwYjqeFTA+e61lb4qE+8X8=
github.com/jfrog/jfrog-cli-security v1.29.3/go.mod h1:wTdl1sSLyq+TzOPnncxBBhqCKEqF2kp9l86k+Y5E3mM=
github.com/jfrog/jfrog-client-go v1.55.1-0.20260528115006-6ca9682a3255 h1:CIOMO1Hj5N6PaIu7sJZ9bPowcibkcaWDulM2R6LHO9o=
github.com/jfrog/jfrog-client-go v1.55.1-0.20260528115006-6ca9682a3255/go.mod h1:FHpjN1nTDoj96xd6obe27EOgGErqzU0rQgC96L3Ch9E=
github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94=
github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8=
github.com/jszwec/csvutil v1.10.0 h1:upMDUxhQKqZ5ZDCs/wy+8Kib8rZR8I8lOR34yJkdqhI=
Expand Down
2 changes: 1 addition & 1 deletion utils/cliutils/cli_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "time"

const (
// General CLI constants
CliVersion = "2.105.0"
CliVersion = "2.106.0"
ClientAgent = "jfrog-cli-go"

// CLI base commands constants:
Expand Down