Skip to content

feat(JFrogCliV2): allow persisting and reusing JFrog CLI config across steps#637

Open
SierraNL wants to merge 1 commit into
jfrog:devfrom
SierraNL:feat/jfrog-cli-v2-persist-config
Open

feat(JFrogCliV2): allow persisting and reusing JFrog CLI config across steps#637
SierraNL wants to merge 1 commit into
jfrog:devfrom
SierraNL:feat/jfrog-cli-v2-persist-config

Conversation

@SierraNL

@SierraNL SierraNL commented Jul 10, 2026

Copy link
Copy Markdown

Reasons

I created this PR as an implementation of my feature request #636

It is a combination of a few features, if you prefer seperate PR's I can split it up.

But together they give the option of doing a big migration to JFrog a lot easier, by just adding the task in the front of the pipeline, and in the end to gather and push the buildinfo and keep the rest of the pipeline in place.

Summary

  • Adds opt-in inputs to JFrogCliV2 so downstream pipeline steps (e.g. dotnet restore) can reuse the CLI config this task creates, instead of every step needing its own JFrog Platform service connection.
  • registerInPath (default false) — adds jf's directory to the agent's PATH for later steps.
  • keepConfig (default false) — skips the cleanup step so the config survives after this task finishes.
  • configurationName (optional) — reuse an existing named config instead of creating a new one; jfrogPlatformConnection becomes optional when this is set (the task fails clearly if neither is provided).
  • enablePackageAlias / packageAliasTools (default false) — installs JFrog CLI's package-alias ("Ghost Frog") shims (requires CLI ≥ 2.93.0; warns and skips on older versions) so native build tool calls route through jf for the rest of the job.
  • The resolved config name is exposed via the JFROG_CLI_CONFIG_NAME pipeline variable, intended for a paired "teardown" task at the end of the pipeline (configurationName=$(JFROG_CLI_CONFIG_NAME), keepConfig=false) to delete the persisted config.
  • Added minSupportedPackageAliasCliVersion (2.93.0) constant to jfrog-tasks-utils/utils.js, following the existing minSupported*CliVersion pattern.

All new behavior is off by default, so existing pipelines using JFrogCliV2 are unaffected.

Test plan

  • node --check on tasks/JFrogCliV2/jfrogCliRun.js and jfrog-tasks-utils/utils.js
  • Validated tasks/JFrogCliV2/task.json parses as valid JSON
  • Formatted all changed files with the project's Prettier config (.prettierrc)
  • Manual pipeline verification:
    • Default run (all new inputs at default) behaves identically to before
    • Setup/teardown pair: setup with configurationName empty, keepConfig=true, registerInPath=true; teardown with configurationName=$(JFROG_CLI_CONFIG_NAME), keepConfig=false
    • enablePackageAlias=true on a CLI version below 2.93.0 logs a warning and the task still succeeds

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

…s steps

Adds opt-in inputs so downstream pipeline steps (e.g. dotnet restore) can
reuse the CLI config this task creates instead of each step configuring
its own connection:

- registerInPath: adds jf's directory to PATH for later steps
- keepConfig: skips cleanup so the config survives after this task
- configurationName: reuse an existing named config instead of creating one
- enablePackageAlias / packageAliasTools: installs JFrog CLI's
  package-alias ("Ghost Frog") shims (CLI >= 2.93.0) so native build tool
  calls route through jf for the rest of the job

jfrogPlatformConnection is now optional (required only when
configurationName isn't set), and the resolved config name is exposed via
the JFROG_CLI_CONFIG_NAME variable for teardown tasks to reference.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@SierraNL
SierraNL force-pushed the feat/jfrog-cli-v2-persist-config branch from 4725e4a to 97ebbd9 Compare July 10, 2026 09:03
@SierraNL

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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.

1 participant