`secrets set` ignores `--workdir` and reads config.toml from the working directory
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- cli
Línea de trabajo
Start in apps/cli/src/commands/secrets/set/set.handler.ts, where loadCliConfig and loadCliProjectEnvironment are called with runtimeInfo.cwd. Compare with apps/cli/src/commands/config/config.load.ts, which uses cliSettings.workdir, and with runtimeInfo.cwd in apps/cli/src/shared/runtime/runtime-info.layer.ts. Done when the repro run with --workdir ../clean from leaky/ fails with SecretsNoArgumentsError and sends no request.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
supabase secrets set resolves supabase/config.toml by searching up from process.cwd(), so --workdir has no effect on which config it reads. The command merges that file's [edge_runtime.secrets] into its request body, so running it from a directory whose config declares local-only secrets pushes those values to the target project — even when --workdir points at a different, secret-free project directory.
config push, config diff and config pull do honour --workdir, which makes the behaviour of secrets set surprising.
To reproduce
mkdir -p leaky/supabase clean/supabase
cat > leaky/supabase/config.toml <<'EOF'
project_id = "leaky"
[edge_runtime.secrets]
LOCAL_ONLY = "http://127.0.0.1:54324"
EOF
printf 'project_id = "clean"\n' > clean/supabase/config.toml
cd leaky
supabase secrets set --project-ref <ref> --workdir ../clean --output-format json
No secrets are passed on the command line, so anything the command sends can only have come from a config file.
Expected behavior
--workdir ../clean is used, clean/supabase/config.toml declares no [edge_runtime.secrets], and the command fails with SecretsNoArgumentsError without sending a request.
Actual behavior
It reads leaky/supabase/config.toml and posts LOCAL_ONLY to the project:
{"_tag":"Error","error":{"code":"SecretsSetNetworkError","message":"failed to set secrets: TransportError"}}
(a request was built and attempted — here with outbound traffic blocked, to keep the test off a real project)
Running the identical command from clean/ instead gives:
{"_tag":"Error","error":{"code":"SecretsNoArgumentsError","message":"No arguments found. Use --env-file to read from a .env file."}}
So only the working directory decides which config is read.
Version
Reproduced on 2.118.0 and present in 2.122.0.
Where it comes from
apps/cli/src/commands/secrets/set/set.handler.ts calls loadCliConfig(runtimeInfo.cwd, …) and loadCliProjectEnvironment({ cwd: runtimeInfo.cwd, … }). runtimeInfo.cwd is process.cwd() in apps/cli/src/shared/runtime/runtime-info.layer.ts and never reflects --workdir. By contrast apps/cli/src/commands/config/config.load.ts loads from cliSettings.workdir and respects shouldSearchAncestors.
Why it matters
A natural way to keep local-only Edge Function secrets out of a hosted project is to keep them in one config.toml and run secrets set with --workdir pointed at another directory whose config has no secrets table. That doesn't work, and the merge is silent: nothing in the output names the secrets the config contributed, so the extra values are only visible afterwards in secrets list.
A fix could either honour --workdir here as the config commands do, or — separately useful — list the config-sourced names the command is about to send.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.4k
- Forks
- 537
- Merge medio
- 17 h 22 min
- PR fusionados (30 d)
- 391
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de supabase/cli
-
db schema declarative sync: no way to fail (non-zero exit) when the generated migration is destructiveQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto✨ Feature supabase/cli
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
🐛 Bug supabase/cli
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
stack: every Edge Function request starts a new worker, so the same function never reuses one and each call pays a cold startPosiblemente ocupada @7ttp la tomó hace 3 días. Abierto🐛 Bug supabase/cli
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
supabase/cli#7274 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
🐛 Bug supabase/cli
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
supabase/cli#7269 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Explicit local function bundling falls back to API bundling when Docker is unavailablePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto🐛 Bug open-for-contribution supabase/cli
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
supabase/cli#7214 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de supabase/cli
Issues similares
-
Replace discontinued crypto-js in the themePosiblemente ocupada @aelmanaa la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
PaloAltoNetworks/docusaurus-openapi-docs#1689 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
solana-foundation/solana-web3.js#4015 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
formatSearchQuery drops the :present modifier, so `email:present=true` is sent as `email=true`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
ivopogace/opencode-courier#422 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chapel-lang/chapel-vscode#158 ·
Los mantenedores suelen responder en 1 día