Skip to content

Added CLI e2e Pipeline#3312

Open
neha-mishraa wants to merge 2 commits intojfrog:masterfrom
neha-mishraa:master
Open

Added CLI e2e Pipeline#3312
neha-mishraa wants to merge 2 commits intojfrog:masterfrom
neha-mishraa:master

Conversation

@neha-mishraa
Copy link

@neha-mishraa neha-mishraa commented Jan 20, 2026

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the master branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

Copy link
Contributor

@agrasth agrasth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: Added CLI e2e Pipeline

Issues & Concerns

1. Hardcoded Repository Reference (Line 11)

path: neha-mishraa/jfrog-cli

This should reference jfrog/jfrog-cli not a personal fork. This is critical - the pipeline won't work on the main repository.

2. Hardcoded Master Key (Lines 110, 121)

master_key=0098a3db926121d657955ebb9461483c

Hardcoded cryptographic keys are a security risk. This should be:

  • Stored in a secure integration/secret
  • Passed via environment variable
  • Never committed to version control

3. Mixed Authentication Methods (Lines 333, 834)

  • Most tests use jfrog.adminToken=${OAUTH_TOKEN}
  • npm test (line 834) uses jfrog.user=admin --jfrog.password=password

Why the inconsistency? The commented line 833 shows it should use the token.

4. Commented Code (Lines 219-240)

Large block of commented-out project creation code. Either:

  • Remove if not needed
  • Uncomment if needed
  • Add a comment explaining why it's disabled

5. Missing docker_cli_tests Dependency

The docker_cli_tests step runs independently but isn't included in the teardown_env input dependencies. If Docker tests are the last to finish, teardown might happen too early.

6. Resource Validation

Lines 267-270 validate ARTIFACTORY_URL but several other steps don't validate the OAuth token resource before use. Consider adding consistent validation across all test steps.

7. Hard Timeouts

Line 470: 600-second timeout for Artifactory startup. This might be too short for slower environments or too long for fast ones. Consider making this configurable.

Suggestions

  1. Extract Common Setup: Go installation is repeated in every step. Consider a shared setup step or a custom base image.

  2. Version Variables: Extract all tool versions (Go 1.21.5, Java 11, Maven 3.8.8, etc.) to pipeline-level variables for easier maintenance.

  3. Add Documentation: Consider adding a README or comments explaining:

    • How to run the pipeline
    • Required integrations
    • Environment variables
    • What each test step validates
  4. Test Ordering: Some tests could potentially run in parallel (e.g., pip and pipenv, Go and Maven). Consider if the sequential execution is intentional.

  5. Logging Levels: Line 557 sets JFROG_CLI_LOG_LEVEL: DEBUG only for Artifactory tests. Should this be consistent across all tests?

@github-actions
Copy link
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


- name: jfrog_cli
type: GitRepo
configuration:
path: neha-mishraa/jfrog-cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected to use the forked one not the upstream one(jfrog/jfrog-cli) ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update this with new name of integration and and path once I have that created - so keeping it as is for now

ACCOUNT_TYPE: "enterprise_plus"
GROUP: "ARTIFACTORY"
EXPIRY: 2d
EXTRA_PARAMS: "conf_artifactory_unified_version=${RT_VERSION} master_key=0098a3db926121d657955ebb9461483c"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these hard-coded values, are safe to use like this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default being passed while creation of a d2c not a sensitive value

Comment on lines +213 to +234
# # Create pipegh project in target Artifactory
# echo "Creating pipegh project in ${ART_URL}..."

# RESPONSE=$(curl -s -w "\n%{http_code}" --connect-timeout 30 --max-time 60 -X POST "${ART_URL}/access/api/v1/projects" \
# -H "Authorization: Bearer ${OAUTH_TOKEN}" \
# -H "Content-Type: application/json" \
# -d '{"display_name":"cliTests","description":"The tests for JFrog CLI","admin_privileges":{"manage_members":true,"manage_resources":true,"index_resources":true},"storage_quota_bytes":1073741824,"project_key":"pipegh"}')

# HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
# RESPONSE_BODY=$(echo "$RESPONSE" | sed '$d')

# echo "HTTP Status: $HTTP_CODE"

# if [[ "$HTTP_CODE" == "201" ]]; then
# echo ">>> Project 'pipegh' created successfully"
# elif [[ "$HTTP_CODE" == "409" ]]; then
# echo ">>> Project 'pipegh' already exists"
# else
# echo ">>> Failed to create project. HTTP Status: $HTTP_CODE"
# echo "Response: $RESPONSE_BODY"
# echo "Warning: Continuing with setup anyway..."
# fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not needed can we remove it? any specific reason these are here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will check this - might have left

@reshmifrog reshmifrog self-requested a review February 12, 2026 07:49
@reshmifrog
Copy link
Contributor

@neha-mishraa please add a proper description explaining what this PR does, what was the problem and what is the solution we are going ahead with to resolve the problem.

@@ -0,0 +1,1302 @@
resources:
- name: jfrog_cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please share the forked repo PR where this has been tested.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reshmifrog please refer the document as to what this PR does - https://docs.google.com/document/d/12XEmCxxMpq4CgbgVELKcQkuGLmvj0ksLkGE6vYegqV4/edit?usp=sharing
also the forked repo is here neha-mishraa:master

description: "Artifactory URL to use for tests (required)"
allowCustom: true
JOIN_KEY:
default: "0098a3db926121d657955ebb9461483c"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we hard-coding this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default being passed while creation of a d2c not a sensitive value

fi

# Install JFrog CLI
echo "Installing JFrog CLI, Version: 2.54.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we installing 2.54.0 version of cli , it should be latest right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took reference from other yamls - you can suggest which version explicitly do we need to check - AFAIK the cli functions are used from code base and not the version so...


# Install JFrog CLI Access Plugin
echo "Installing JFrog CLI Access Plugin, Version: 7.66.0"
jfrog plugin install access@v7.66.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we installing the 7.66.0 version of plugin?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took reference from other yamls - you can suggest which version explicitly do we need to check with it

jfrog plugin install access@v7.66.0

# Generate tokens
JOIN_KEY="${JOIN_KEY:-0098a3db926121d657955ebb9461483c}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not hard-code these values, you can add these as secrets in jfrog-cli repo and use it instead of hard-coding.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default being passed while creation of a d2c not a sensitive value - it is for local infra will not be reachable from here

exit 1
}

# Fixed parsing - extract everything after JF_ACCESS_ADMIN_TOKEN=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's store it as a secret and then use it and please check this everywhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not referenced anywhere and is a masked value in pipelines and os created on the fly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants