From 3fb5bd1094028bdfb5cd038b415790bbf30ab7ee Mon Sep 17 00:00:00 2001 From: "cto-new[bot]" <140088366+cto-new[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 16:09:03 +0000 Subject: [PATCH] Replace python dependency in entrypoint and quiet repo credential logs --- scripts/entrypoint.sh | 83 +++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b4cbb72..9897e3b 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -93,13 +93,13 @@ get_auth_url() { log "Initializing Shopify AI App Builder..." -# Log repository configuration details -log "Repository Configuration:" -log " URL: ${REPO_URL:-'NOT SET'}" -log " Branch: ${REPO_BRANCH:-'NOT SET'}" -log " Directory: ${REPO_DIR}" -log " GitHub Username: ${GITHUB_USERNAME:-'NOT SET'}" -log " GitHub PAT: ${GITHUB_PAT:+SET (hidden)}${GITHUB_PAT:-NOT SET}" +# Log repository configuration details only when cloning is enabled +if [ -n "$REPO_URL" ]; then + log "Repository Configuration:" + log " URL: ${REPO_URL}" + log " Branch: ${REPO_BRANCH}" + log " Directory: ${REPO_DIR}" +fi # Only clone/pull if REPO_URL is set if [ -n "$REPO_URL" ]; then @@ -107,13 +107,6 @@ if [ -n "$REPO_URL" ]; then log "Repository directory: $REPO_DIR" log "Default branch: $REPO_BRANCH" - # Check if authentication credentials are available - if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_PAT" ]; then - log "GitHub authentication credentials found for user: $GITHUB_USERNAME" - else - log "WARNING: No GitHub authentication credentials found. Private repository access may fail." - fi - # Check if git is available if ! command -v git &> /dev/null; then log "ERROR: git is not available in the container" @@ -229,43 +222,41 @@ ensure_root_opencode_config() { log "Writing OpenCode config: ${config_path} (baseURL=${OPENCODE_OLLAMA_BASE_URL}, model=${OPENCODE_OLLAMA_MODEL})" - python3 - <<'PY' > "$config_path" -import json, os + node - <<'NODE' > "$config_path" +const baseUrl = (process.env.OPENCODE_OLLAMA_BASE_URL || "https://ollama.plugincompass.com").replace(/\/+$/, ""); +const modelId = process.env.OPENCODE_OLLAMA_MODEL || "qwen3:0.6b"; +const apiKey = (process.env.OPENCODE_OLLAMA_API_KEY || "").trim(); +const providerName = process.env.OPENCODE_OLLAMA_PROVIDER || "ollama"; -base_url = (os.environ.get("OPENCODE_OLLAMA_BASE_URL") or "https://ollama.plugincompass.com").rstrip("/") - -model_id = os.environ.get("OPENCODE_OLLAMA_MODEL") or "qwen3:0.6b" -api_key = (os.environ.get("OPENCODE_OLLAMA_API_KEY") or "").strip() -provider_name = os.environ.get("OPENCODE_OLLAMA_PROVIDER") or "ollama" - -provider_cfg = { - "options": { - "baseURL": base_url, - }, - "models": { - model_id: { - "id": model_id, - "name": model_id, - "tool_call": True, - "temperature": True, - } +const providerConfig = { + options: { + baseURL: baseUrl, + }, + models: { + [modelId]: { + id: modelId, + name: modelId, + tool_call: true, + temperature: true, }, + }, +}; + +if (apiKey) { + providerConfig.options.apiKey = apiKey; } -if api_key: - provider_cfg["options"]["apiKey"] = api_key +const config = { + $schema: "https://opencode.ai/config.json", + model: `${providerName}/${modelId}`, + small_model: `${providerName}/${modelId}`, + provider: { + [providerName]: providerConfig, + }, +}; -cfg = { - "$schema": "https://opencode.ai/config.json", - "model": f"{provider_name}/{model_id}", - "small_model": f"{provider_name}/{model_id}", - "provider": { - provider_name: provider_cfg, - }, -} - -print(json.dumps(cfg, indent=2)) -PY +process.stdout.write(`${JSON.stringify(config, null, 2)}\n`); +NODE chmod 600 "$config_path" 2>/dev/null || true }