feat(JFrogCliV2): allow persisting and reusing JFrog CLI config across steps - #637
feat(JFrogCliV2): allow persisting and reusing JFrog CLI config across steps#637SierraNL wants to merge 1 commit into
Conversation
|
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>
4725e4a to
97ebbd9
Compare
|
I have read the CLA Document and I hereby sign the CLA |
|
I think it would be better to split this into multiple PRs, as you’ve already mentioned in the description. There are a few independent changes here, and separating them would make the review easier and help us focus on one piece of functionality at a time. Could you split the PR into logical, separate PRs? I see that the tests are failing, can you please take a look at them too? |
|
Splitting this into 3 independent PRs per the review feedback above - each is a separate, self-contained slice of this diff and can be reviewed/merged in any order:
Each now has an integration test under On the CI failures: they're not test failures in the code - the Closing this one in favor of the split PRs. 🤖 Generated with Claude Code |
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
JFrogCliV2so 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(defaultfalse) — addsjf's directory to the agent's PATH for later steps.keepConfig(defaultfalse) — 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;jfrogPlatformConnectionbecomes optional when this is set (the task fails clearly if neither is provided).enablePackageAlias/packageAliasTools(defaultfalse) — installs JFrog CLI'spackage-alias("Ghost Frog") shims (requires CLI ≥ 2.93.0; warns and skips on older versions) so native build tool calls route throughjffor the rest of the job.JFROG_CLI_CONFIG_NAMEpipeline 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.minSupportedPackageAliasCliVersion(2.93.0) constant tojfrog-tasks-utils/utils.js, following the existingminSupported*CliVersionpattern.All new behavior is off by default, so existing pipelines using
JFrogCliV2are unaffected.Test plan
node --checkontasks/JFrogCliV2/jfrogCliRun.jsandjfrog-tasks-utils/utils.jstasks/JFrogCliV2/task.jsonparses as valid JSON.prettierrc)configurationNameempty,keepConfig=true,registerInPath=true; teardown withconfigurationName=$(JFROG_CLI_CONFIG_NAME),keepConfig=falseenablePackageAlias=trueon a CLI version below2.93.0logs a warning and the task still succeeds