feat(jfrog): make workspace configuration optional - #1055
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the jfrog-token and jfrog-oauth Terraform modules so consumers can obtain scoped/OAuth access tokens without necessarily running workspace startup configuration (installing/configuring jf and/or configuring package managers), while preserving default behavior for existing users.
Changes:
- Added independent flags to control JFrog CLI installation, CLI configuration, and package-manager configuration (defaulting to current behavior).
- Made
package_managersoptional (default{}) and preventedGOPROXYexport when package-manager configuration is disabled. - Updated READMEs and added/updated regression tests for default behavior and token-only mode.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| registry/coder/modules/jfrog-token/run.sh | Adds install/configure/package-manager toggles and an early-exit path when CLI configuration is disabled. |
| registry/coder/modules/jfrog-token/README.md | Documents token-only usage and bumps example version to 1.3.0. |
| registry/coder/modules/jfrog-token/main.tf | Introduces new toggle variables, makes package_managers optional, and gates run_on_start/GOPROXY. |
| registry/coder/modules/jfrog-token/main.test.ts | Updates TypeScript tests for optional package_managers and new script gating. |
| registry/coder/modules/jfrog-token/jfrog-token.tftest.hcl | Adds plan-time regression coverage for defaults and token-only mode. |
| registry/coder/modules/jfrog-oauth/run.sh | Mirrors run.sh toggles and early-exit path for the OAuth module. |
| registry/coder/modules/jfrog-oauth/README.md | Documents access-token-only mode and updates offline/air-gapped guidance for the new install toggle. |
| registry/coder/modules/jfrog-oauth/main.tf | Adds toggle variables, makes package_managers optional, and gates run_on_start/GOPROXY. |
| registry/coder/modules/jfrog-oauth/jfrog-oauth.tftest.hcl | Updates required-vars test and adds token-only plan regression coverage. |
Suppressed comments (2)
registry/coder/modules/jfrog-oauth/run.sh:150
- The code-server wait loop above resets
counterto 0 on every iteration, so the timeout condition can never be reached and the script may hang indefinitely if/tmp/code-server/bin/code-servernever appears. This impacts the code-server path that runs immediately before this new early-exit check.
if [ "${CONFIGURE_CLI}" != "true" ]; then
exit 0
fi
registry/coder/modules/jfrog-token/run.sh:149
- The code-server wait loop above resets
counterto 0 on every iteration, so the timeout condition can never be reached and the script may hang indefinitely if/tmp/code-server/bin/code-servernever appears. This impacts the code-server path that runs immediately before this new early-exit check.
if [ "${CONFIGURE_CLI}" != "true" ]; then
exit 0
fi
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
matifali
left a comment
There was a problem hiding this comment.
Please test the module end-to-end, and we can merge it. Our current tests don't cover the end-to-end testing flow. The code looks good to me.
matifali
left a comment
There was a problem hiding this comment.
LGTM. @DevelopmentCats can you also review it?
@Edd88-pixel have you tested this end 2 end?
|
Yes, I've already tested it. |

Why
The JFrog modules always ran workspace setup, installed or configured
jf, and required package manager configuration even when callers only needed an access token for another Terraform resource.Closes #71.
Changes
package_managersoptional and use an empty value as the single source of truth for disabling package manager configuration.coder_script.jfrogonly when CLI installation, CLI configuration, package manager configuration, or code-server setup is requested.jfis required but unavailable, and fix the code-server wait timeout counter.Validation
terraform test -no-colorinjfrog-token: 3 passed, 0 failed.terraform test -no-colorinjfrog-oauth: 13 passed, 0 failed.bun test main.test.tsinjfrog-token: 11 passed, 0 failed, 36 assertions.terraform validate -no-colorin both modules: passed.go run ./cmd/readmevalidation: passed for contributor, module, template, and skill READMEs.bun run fmt:ci,bash -n, ShellCheck at warning severity, andgit diff --check: passed.jfrequired but unavailable; each exited with status 1 and the expected diagnostic.