Skip to content

feat(jfrog): make workspace configuration optional - #1055

Open
Edd88-pixel wants to merge 3 commits into
coder:mainfrom
Edd88-pixel:eddy/jfrog-optional-config-71
Open

feat(jfrog): make workspace configuration optional#1055
Edd88-pixel wants to merge 3 commits into
coder:mainfrom
Edd88-pixel:eddy/jfrog-optional-config-71

Conversation

@Edd88-pixel

@Edd88-pixel Edd88-pixel commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add independent options for installing and configuring the JFrog CLI in both JFrog modules while preserving the existing default behavior.
  • Make package_managers optional and use an empty value as the single source of truth for disabling package manager configuration.
  • Create coder_script.jfrog only when CLI installation, CLI configuration, package manager configuration, or code-server setup is requested.
  • Keep OAuth access-token validation active in token-only mode.
  • Fail fast with a clear error when jf is required but unavailable, and fix the code-server wait timeout counter.
  • Document token-only and preinstalled-CLI usage and add regression coverage for default, token-only, and package-manager-only modes.

Validation

  • terraform test -no-color in jfrog-token: 3 passed, 0 failed.
  • terraform test -no-color in jfrog-oauth: 13 passed, 0 failed.
  • bun test main.test.ts in jfrog-token: 11 passed, 0 failed, 36 assertions.
  • terraform validate -no-color in 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, and git diff --check: passed.
  • Both startup scripts were executed with installation disabled and jf required but unavailable; each exited with status 1 and the expected diagnostic.

Comment thread registry/coder/modules/jfrog-oauth/main.tf Outdated
Comment thread registry/coder/modules/jfrog-oauth/main.tf Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_managers optional (default {}) and prevented GOPROXY export 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 counter to 0 on every iteration, so the timeout condition can never be reached and the script may hang indefinitely if /tmp/code-server/bin/code-server never 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 counter to 0 on every iteration, so the timeout condition can never be reached and the script may hang indefinitely if /tmp/code-server/bin/code-server never 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.

Comment thread registry/coder/modules/jfrog-token/run.sh
Comment thread registry/coder/modules/jfrog-oauth/run.sh
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.

jfrog: make configuring CLI and package managers optional

4 participants