feat(JFrogCliV2): allow persisting and reusing JFrog CLI config across steps - #651
Open
SierraNL wants to merge 1 commit into
Open
feat(JFrogCliV2): allow persisting and reusing JFrog CLI config across steps#651SierraNL wants to merge 1 commit into
SierraNL wants to merge 1 commit into
Conversation
…s steps Adds opt-in inputs so downstream pipeline steps can reuse the CLI config this task creates, instead of every step needing its own JFrog Platform service connection: - configurationName: 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). - keepConfig: skips the cleanup step so the config survives after this task finishes. 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. This is the core scenario from feature request jfrog#636: run this task once at the start of a pipeline to configure JFrog CLI, keep using 'jf' in existing steps, then tear the config down at the end - without touching every step in between. Split out of jfrog#637 per reviewer feedback, as an independent PR (not stacked on any of the other split-out PRs) so it can be reviewed and merged on its own. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reasons
Split out of #637 (implementation of feature request #636) per reviewer feedback - the original PR bundled a few independent changes into one. This PR contains only the config persistence/reuse scenario. It is independent of the other two split-out PRs (#650 register-in-PATH, and a Package Alias PR) and can be reviewed/merged on its own, in any order.
Summary
Adds opt-in inputs 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: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).keepConfig(defaultfalse) - skips the cleanup step so the config survives after this task finishes.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.All new behavior is off by default, so existing pipelines using
JFrogCliV2are unaffected.Test plan
node --check tasks/JFrogCliV2/jfrogCliRun.jstasks/JFrogCliV2/task.jsonparses as valid JSONtests/resources/jfrogCliV2PersistConfig/(+ a newdescribeblock intests/tests.ts), following the existingtests/resources/<taskDir>/<scenario>.js+mockTask/runSyncTestpattern:jfrogPlatformConnectionnorconfigurationNameis provided.keepConfig, then reuses it by name viaconfigurationNamein a second task invocation (with no service connection), verifying the persist/reuse round-trip.Note on CI
The
Testsworkflow is apull_request_targetworkflow gated behind asafe to testlabel, and for fork PRs GitHub always runs the base branch's copy of that workflow file (a built-in security control against fork PRs granting themselves elevated permissions) - so a maintainer needs to add the label for the integration tests above to actually execute in CI. This can't be changed from the PR branch itself.🤖 Generated with Claude Code