feat(jfrog): make workspace configuration optional - #1055
Open
Edd88-pixel wants to merge 3 commits into
Open
Conversation
matifali
reviewed
Aug 18, 2026
Contributor
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.
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.
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.