Skip to content

feat(JFrogCliV2): add Package Alias (Ghost Frog) support - #652

Open
SierraNL wants to merge 1 commit into
jfrog:devfrom
SierraNL:split/3-package-alias
Open

feat(JFrogCliV2): add Package Alias (Ghost Frog) support#652
SierraNL wants to merge 1 commit into
jfrog:devfrom
SierraNL:split/3-package-alias

Conversation

@SierraNL

Copy link
Copy Markdown

Reasons

Split out of #637 per reviewer feedback - the original PR bundled a few independent changes into one. This PR contains only the Package Alias scenario. It is independent of the other two split-out PRs (#650 register-in-PATH, #651 persist/reuse config) and can be reviewed/merged on its own, in any order.

Summary

Adds an opt-in enablePackageAlias input (default false) to JFrogCliV2 that installs JFrog CLI's package-alias ("Ghost Frog") shims (requires CLI ≥ 2.93.0; warns and skips on older versions instead of failing) so native build tool calls (npm, mvn, gradle, dotnet, nuget, pip, go, docker, etc.) route through jf for the rest of the pipeline job. packageAliasTools (optional) scopes which tools get aliased.

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 tasks/JFrogCliV2/jfrogCliRun.js and jfrog-tasks-utils/utils.js
  • Validated tasks/JFrogCliV2/task.json parses as valid JSON
  • Added integration tests under tests/resources/jfrogCliV2PackageAlias/ (+ a new describe block in tests/tests.ts), following the existing tests/resources/<taskDir>/<scenario>.js + mockTask/runSyncTest pattern:
    • enablePackageAlias=true on a supported CLI version runs package-alias install and sets JFROG_CLI_GHOST_FROG.
    • enablePackageAlias=true on a CLI version below 2.93.0 logs a warning, skips Package Alias setup, and the task still succeeds.

Note on CI

The Tests workflow is a pull_request_target workflow gated behind a safe to test label, 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

Adds an opt-in 'enablePackageAlias' input (with 'packageAliasTools'
to scope which tools) that installs JFrog CLI's package-alias
("Ghost Frog") shims, so native build tool calls (npm, mvn, gradle,
dotnet, nuget, pip, go, docker, etc.) transparently route through
'jf' for the rest of the pipeline job.

Requires JFrog CLI >= 2.93.0 (jfrog-tasks-utils/utils.js:
minSupportedPackageAliasCliVersion, following the existing
minSupported*CliVersion pattern); on older versions the task warns
and skips Package Alias setup rather than failing.

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>
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