fix(git): preserve env-backed simple-git behavior#323
Conversation
ユーザーのシェル環境に PAGER や EDITOR 等が設定されていると、 simple-git 3.36+ の block-unsafe-operations プラグインが `Use of "PAGER" is not permitted without enabling allowUnsafePager` を投げて、ワークスペースの削除・worktree 操作等がすべて失敗する。 upstream v1.5.5 の同梱 simple-git が 3.36.0 に上がった結果、 `PAGER=less` をログインシェルで設定しているユーザーで発生していた。 simple-git が弾く env キー (PAGER/EDITOR/GIT_* 系) は このアプリの git 操作では不要なので、env に詰める前に除外する。
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 11 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8d0c976a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Revert #323: simple-git unsafe env 対応を差し戻し
…#330) * fix(desktop): simple-git 3.36+ の PAGER env ブロックを回避 ユーザーのシェル環境に PAGER や EDITOR 等が設定されていると、 simple-git 3.36+ の block-unsafe-operations プラグインが `Use of "PAGER" is not permitted without enabling allowUnsafePager` を投げて、ワークスペースの削除・worktree 操作等がすべて失敗する。 upstream v1.5.5 の同梱 simple-git が 3.36.0 に上がった結果、 `PAGER=less` をログインシェルで設定しているユーザーで発生していた。 simple-git が弾く env キー (PAGER/EDITOR/GIT_* 系) は このアプリの git 操作では不要なので、env に詰める前に除外する。 * fix(git): preserve env-backed simple-git behavior * fix(git): address PR CI failures
概要
Desktop 1.5.5 相当で入った
simple-git 3.36+の block-unsafe-operations により、ユーザーの shell / credential provider から渡される通常の env が原因で Git 操作が失敗する。代表例:
当初は unsafe な env を strip する案だったが、その方式だと
GIT_SSH_COMMAND/GIT_ASKPASS/GIT_CONFIG_*依存の clone / fetch / push / auth フローを壊す。この PR では、既存の env ベース挙動を維持したまま、
simple-git側に必要なallowUnsafe*だけを与える形に修正した。原因
simple-git 3.36+はPAGER,EDITOR,GIT_ASKPASS,GIT_SSH_COMMAND,GIT_CONFIG_*などを "unsafe" として検出するgetProcessEnvWithShellPath()で shell env を継承してsimple-gitに渡しているGIT_ASKPASSや local env をsimple-gitに渡している対応
@superset/shared/simple-git-unsafeにbuildSimpleGitUnsafeOptions()を追加GIT_CONFIG_COUNT/GIT_CONFIG_KEY_nを解析して、必要なallowUnsafe*だけを導出getSimpleGitWithShellPath()を新 helper ベースに置き換えsimpleGit()直呼びも同じ helper に統一git実行 (execGitWithShellPath*) からは env strip を除去simpleGit()直呼び clone/import 経路も同じ helper に統一期待する効果
PAGER/GIT_PAGER/EDITORが設定された shell 環境でも desktop の Git タブや worktree 操作が壊れないGIT_SSH_COMMAND/GIT_ASKPASS/GIT_CONFIG_*を使うユーザーの remote/auth フローを壊さないsimple-git 3.36+に追従できるテスト観点
PAGER/GIT_PAGER/EDITORを設定した shell で desktop の Git タブ / worktree 作成 / 削除が通るGIT_SSH_COMMANDを使う remote で fetch / push / clone が通るGIT_ASKPASS/SSH_ASKPASSを使う認証フローが通るGIT_CONFIG_GLOBAL/GIT_CONFIG_COUNTを使う環境で author / clone / fetch 挙動が変わらない