`secrets set` ignores `--workdir` and reads config.toml from the working directory
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- cli
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 2.4k
- フォーク
- 537
- 平均マージ
- 18時間 2分
- マージ済み PR(30日)
- 387
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
supabase/cli のほかの issue
-
db schema declarative sync: no way to fail (non-zero exit) when the generated migration is destructive再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン✨ Feature supabase/cli
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
Windows: Supabase CLI start fails when no Supabase containers exist対応中かも @Coly010 が 1 日前に担当しました。 オープン🐛 Bug supabase/cli
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Supabase CLI 2.122.0 prunes local Docker network before database container creation on Windows/WSL2対応中かも @jgoux が 2 日前に担当しました。 オープン🐛 Bug supabase/cli
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug supabase/cli
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
stack: every Edge Function request starts a new worker, so the same function never reuses one and each call pays a cold start対応中かも @7ttp が 2 日前に担当しました。 オープン🐛 Bug supabase/cli
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
fix(worker): keep normal prepare waiting states failure-free対応中かも @LichKing-2234 が今日担当しました。 オープンagent:codex priority:P1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AgoraIO-Extensions/agent-infra#3745 ·
メンテナーはふだん 1 日以内に返信
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framing対応中かも @Eapp1e が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
makecindy/cindy#7973 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
lingdojo/kana-dojo#33337 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
code-yeongyu/senpi#4917 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信