BUILD-10591 Leverage setup-jfrog-cli summary in ci-github-actions#233
BUILD-10591 Leverage setup-jfrog-cli summary in ci-github-actions#233julien-carsique-sonarsource wants to merge 1 commit intomasterfrom
Conversation
069ec09 to
e83ff86
Compare
|
SummaryThis PR fixes the JFrog CLI configuration and adds explicit summary generation across build actions. Core Fix: All build scripts now add the Summary Generation: Build actions (npm, yarn, poetry) now capture JFrog CLI summary data via the Promote Action Updates: Added Supporting Changes: renovatebot/pre-commit-hooks upgraded (enables What reviewers should knowStart by reviewing: The changes to build scripts (e.g., Key decision to verify: The summary markdown parsing in Breaking change: The Test coverage: The author tested across multiple projects (Maven, Gradle, npm, yarn, poetry) and verified that the JFrog summary gracefully handles cases where no artifacts are published (
|
| ARTIFACTORY_BROWSE_URL="${ARTIFACTORY_URL%/*}/ui/builds/$build_name/$BUILD_NUMBER" | ||
| echo "🔗 **[Browse artifacts in Artifactory](${ARTIFACTORY_BROWSE_URL})**" >> $GITHUB_STEP_SUMMARY | ||
| echo "🐸 [Browse build \`${build_name}:${BUILD_NUMBER}\` in Artifactory](${ARTIFACTORY_BROWSE_URL})" >> $GITHUB_STEP_SUMMARY | ||
| jf_summary_dir="${JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR}/jfrog-command-summary" |
There was a problem hiding this comment.
Logic duplication: This 16-line JFrog CLI summary extraction block (the jf_summary_dir check, jf generate-summary-markdown call, and grep/awk parsing into a <details> block) is copy-pasted verbatim into build-npm/action.yml:222, build-poetry/action.yml:211, and build-yarn/action.yml:220. The only difference across the four is the config name (deploy here vs repox in the others).
Any future change to the parsing logic — e.g. if the markdown.md format changes, or the <details> structure is adjusted — requires four synchronised edits. Extract to shared/generate-jfrog-summary.sh that accepts the config name as a $1 argument, then replace each block with:
"$ACTION_PATH_SHARED/generate-jfrog-summary.sh" deploy(or repox for the other three). The env vars JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR and GITHUB_STEP_SUMMARY are already in the environment of the step, so no extra wiring is needed.
- Mark as noise
There was a problem hiding this comment.
Pull request overview
This PR updates the CI GitHub Actions build/promote workflows to explicitly generate and enrich GitHub workflow summaries using JFrog CLI command summary output, while also updating JFrog CLI configuration to be more explicit/compatible.
Changes:
- Update JFrog CLI config usage across build/promote scripts (add
--url, explicitlyjf config use ..., bump JFrog CLI to2.96.0). - Enrich workflow summaries (build links + “Published Modules” extracted from JFrog-generated
markdown.md) and wireJFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR. - Misc maintenance: spec updates, doc updates, pre-commit hook upgrade, and whitespace fixes in warnings.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| config-npm/npm_config.sh | Update JFrog CLI server config to include --url and explicitly select the server. |
| build-npm/build.sh | Update JFrog CLI config for NPM publish flow (add --url, config use). |
| build-yarn/build.sh | Update JFrog CLI config for Yarn resolve/publish flows (add --url, config use). |
| build-poetry/build.sh | Update JFrog CLI config for Poetry resolve/publish flows (add --url, config use). |
| build-maven/deploy-artifacts.sh | Switch to jf CLI and add --url to deploy server config; use jf rt u. |
| build-npm/action.yml | Enable JFrog CLI command summary output + parse/publish “Published Modules” in workflow summary. |
| build-yarn/action.yml | Same: wire command summary output dir and enrich workflow summary. |
| build-poetry/action.yml | Same: wire command summary output dir and enrich workflow summary. |
| build-maven/action.yml | Wire command summary output dir for artifact upload + enrich workflow summary. |
| build-gradle/action.yml | Update summary link text/icon consistency. |
| promote/action.yml | Add Repox URL inputs and pass ARTIFACTORY_URL into promote step. |
| promote/promote.sh | Require ARTIFACTORY_URL, update JFrog config steps, tweak workflow summary link text. |
| mise.toml + */mise.local.toml | Bump jfrog-cli to 2.96.0 and set env exclusions / warning suppression. |
| README.md | Document new promote action inputs (repox-url, repox-artifactory-url). |
| .pre-commit-config.yaml | Bump renovate pre-commit hooks rev. |
| spec/*.sh | Update specs to match updated JFrog CLI commands/version and output line counts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| jf_summary_dir="${JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR}/jfrog-command-summary" | ||
| if [[ -d "$jf_summary_dir" ]]; then | ||
| jf config use repox | ||
| jf generate-summary-markdown | ||
| if [[ -f "${jf_summary_dir}/markdown.md" ]]; then | ||
| { | ||
| echo "" | ||
| echo "<details>" | ||
| echo "<summary>Published Modules</summary>" | ||
| echo "" | ||
| grep -E '^\*\*[^*]+\*\*$' "${jf_summary_dir}/markdown.md" | sed 's/^\*\*\(.*\)\*\*$/- `\1`/' | ||
| echo "" | ||
| awk 'index($0,"<pre>") && !index($0,"</pre>"){p=1} p{print} index($0,"</pre>"){p=0}' "${jf_summary_dir}/markdown.md" | ||
| echo "</details>" | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
| fi | ||
| fi |
bwalsh434
left a comment
There was a problem hiding this comment.
Overall LGTM and nice improvement! Copilot has lots of thoughts on the Artifactory URL construction, so make sure that works in varying scenarios/repos.
…d-poetry and promote Generate the JFrog CLI job summary explicitly rather than relying on the setup-jfrog-cli post-step, which fails and conflicts with the CLI. **JFrog CLI configuration fixes (build-npm, build-yarn, build-poetry, config-npm, promote)**: - Add --url flag to 'jf config add repox' with the JFrog Platform URL (base URL without '/artifactory') - Add 'jf config use repox' (or 'deploy' for maven) after 'jf config add' to explicitly activate the server configuration - In promote.sh and build scripts, suppress 'jf config remove repox' output (redirect to /dev/null) - Make ARTIFACTORY_URL required (via :?) in promote.sh **JFrog CLI command summary (all build actions + promote)**: - Set JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR in build step env so JFrog CLI writes command summary data during execution - build-maven/deploy-artifacts.sh: also set JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR in the Artifacts upload step **Generate workflow summary (all build actions)**: - Merge JFrog CLI summary generation into 'Generate workflow summary' step (remove the separate 'Generate JFrog CLI summary' step) - Add JFrog summary support to build-maven (when mixed-privacy=true, using 'jf config use deploy') and build-gradle - Rework summary format: extract Published Modules from JFrog markdown.md (bold module names and multi-line <pre> file tree blocks) into a collapsible <details> block - Change build URL link text from 'Browse artifacts in Artifactory' to 'Browse build `name:number` in Artifactory' **promote/action.yml**: - Add repox-url and repox-artifactory-url inputs (forwarded from callers) - Add ARTIFACTORY_URL env var to the Promote artifacts step **Other**: - Upgrade renovatebot/pre-commit-hooks to 43.76.3 in .pre-commit-config.yaml - Fix trailing spaces in deprecation warning messages (cache/action.yml, config-npm/action.yml, build-npm/action.yml, build-yarn/action.yml) - Minor doc fix in build-maven/build.sh and promote/promote.sh - Update spec tests to match new command signatures and line counts (100% coverage) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e83ff86 to
5047c75
Compare
There was a problem hiding this comment.
Conclusion: One concrete test bug found: the config-npm spec will fail due to a wrong expected --url value. The logic duplication from the previous review (the 16-line JFrog summary extraction block copied verbatim into all four action.yml files) remains unaddressed.
| @@ -98,7 +98,7 @@ Describe 'set_build_env()' | |||
| The contents of file "$HOME/.npmrc" should include "registry=https://repox.jfrog.io/artifactory/api/npm/npm" | |||
| The contents of file "$HOME/.npmrc" should include "//repox.jfrog.io/artifactory/api/npm/:_authToken=reader-token" | |||
There was a problem hiding this comment.
Bug: The expected --url value here is wrong. ARTIFACTORY_URL is set to "https://repox.jfrog.io/artifactory" (line 49), and the script strips the /artifactory suffix via ${ARTIFACTORY_URL%/artifactory*}, so the actual output will be:
jf config add repox --url https://repox.jfrog.io --artifactory-url https://repox.jfrog.io/artifactory --access-token reader-token
The assertion expects --url https://repox.jfrog.io/artifactory (the full URL, unsripped). This test will fail. Either:
-
Fix the expected value to
https://repox.jfrog.io, or -
Change the fixture to
export ARTIFACTORY_URL="https://dummy.repox"(no/artifactorysuffix, matching every other spec file) and update the.npmrccontent assertions accordingly. -
Mark as noise


Summary
Generate the JFrog CLI job summary explicitly rather than relying on the
setup-jfrog-clipost-step, which fails and conflicts with the CLI.Changes
build-maven, build-npm, build-yarn, build-poetry, config-npm, promote (scripts):
--urlflag tojf config add repox, otherwise the config is not working with all the CLI commandsjf config use repoxafterjf config addto explicitly activate the server configurationbuild-maven, build-npm, build-yarn, build-poetry (action.yml):
JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIRin the build step env so JFrog CLI writes command summary data during executionGenerate workflow summarystep with an extract from JFrog CLI summaryAll build actions (workflow summary):
markdown.md: bold module names and multi-line<pre>file tree blocks, displayed in a collapsible<details>blockBrowse artifacts in Artifactory→Browse buildname:numberin Artifactorypromote/action.yml:
repox-urlandrepox-artifactory-urlinputsARTIFACTORY_URLenv var to thePromote artifactsstepOther:
renovatebot/pre-commit-hooksto43.76.3in.pre-commit-config.yaml(to support themanagerFilePatternsfield used in.github/renovate.json)cache/action.yml,config-npm/action.yml,build-npm/action.yml,build-yarn/action.yml)build-maven/build.shandpromote/promote.shTest plan
Generate JFrog CLI summarystep does not fail when no artifacts were published (graceful|| true)