Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@anthropic-ai/sdk": "0.78.0",
"@better-auth/oauth-provider": "1.6.22",
"@linear/sdk": "68.1.1",
"@modelcontextprotocol/sdk": "1.30.0",
"@modelcontextprotocol/sdk": "1.31.0",
"@notionhq/client": "5.25.2",
"@octokit/app": "16.1.2",
"@octokit/rest": "22.0.1",
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@
"remark-parse": "11.0.0",
"semver": "7.7.4",
"shell-env": "4.0.3",
"shell-quote": "1.9.0",
"shell-quote": "1.11.0",
"shiki": "3.23.0",
"simple-git": "3.36.0",
"simple-git": "4.0.2",
"streamdown": "2.5.0",
"strip-ansi": "7.2.0",
"superjson": "2.2.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { join } from "node:path";
import {
SIMPLE_GIT_UNSAFE_OPTION_FLAGS,
USER_GIT_ENV_SIMPLE_GIT_OPTIONS,
userGitSimpleGitOptions,
} from "@superset/shared/simple-git-options";
import simpleGit, { type SimpleGit } from "simple-git";
import { type SimpleGit, simpleGit } from "simple-git";

function makeBlockedGitEnv(workRoot: string): Record<string, string> {
const globalConfig = join(workRoot, "global.gitconfig");
Expand Down Expand Up @@ -84,9 +85,8 @@ describe("simple-git user env options", () => {
mkdirSync(repoPath);
execSync("git init", { cwd: repoPath, stdio: "ignore" });

const git = simpleGit(repoPath, USER_GIT_ENV_SIMPLE_GIT_OPTIONS).env(
makeBlockedGitEnv(workRoot),
);
const env = makeBlockedGitEnv(workRoot);
const git = simpleGit(repoPath, userGitSimpleGitOptions(env)).env(env);

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.

P3: This test only allowlists the keys of makeBlockedGitEnv, but the spawned git process inherits the runner's process.env as well (the same reason this test has always relied on inherited PATH). simple-git 4 throws "not permitted" on any guarded GIT_*/EDITOR/PAGER key present in the child env that is not named in allowEnvironment, so a runner or developer shell that has e.g. GIT_AUTHOR_EMAIL, GIT_SSH_COMMAND, or GIT_TERMINAL_PROMPT set will fail this test spuriously. Merge the inherited env into env so the allow list covers everything the child will see, matching how host-service's createUserSimpleGit test passes { ...process.env, ... }.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/desktop/src/lib/trpc/routers/workspaces/utils/git-client.test.ts, line 89:

<comment>This test only allowlists the keys of `makeBlockedGitEnv`, but the spawned git process inherits the runner's `process.env` as well (the same reason this test has always relied on inherited PATH). simple-git 4 throws "not permitted" on any guarded GIT_*/EDITOR/PAGER key present in the child env that is not named in `allowEnvironment`, so a runner or developer shell that has e.g. GIT_AUTHOR_EMAIL, GIT_SSH_COMMAND, or GIT_TERMINAL_PROMPT set will fail this test spuriously. Merge the inherited env into `env` so the allow list covers everything the child will see, matching how host-service's `createUserSimpleGit` test passes `{ ...process.env, ... }`.</comment>

<file context>
@@ -84,9 +85,8 @@ describe("simple-git user env options", () => {
-			makeBlockedGitEnv(workRoot),
-		);
+		const env = makeBlockedGitEnv(workRoot);
+		const git = simpleGit(repoPath, userGitSimpleGitOptions(env)).env(env);
 
 		const status = await git.raw(["status", "--short"]);
</file context>


const status = await git.raw(["status", "--short"]);
expect(status).toBe("");
Expand Down
21 changes: 9 additions & 12 deletions apps/desktop/src/lib/trpc/routers/workspaces/utils/git-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ import {
execFile,
} from "node:child_process";
import { promisify } from "node:util";
import { USER_GIT_ENV_SIMPLE_GIT_OPTIONS } from "@superset/shared/simple-git-options";
import simpleGit, { type SimpleGit, type SimpleGitOptions } from "simple-git";
import { userGitSimpleGitOptions } from "@superset/shared/simple-git-options";
import { type SimpleGit, type SimpleGitOptions, simpleGit } from "simple-git";
import { GitEnvironmentError } from "./git-errors";
import { getProcessEnvWithShellPath } from "./shell-env";

const execFileAsync = promisify(execFile);

// Superset is a local Git client, so inherited user Git config/env is expected
// behavior. simple-git 3.36 blocks these hooks by default; allow them centrally
// instead of deleting individual env vars and changing Git semantics.
const SIMPLE_GIT_OPTIONS =
USER_GIT_ENV_SIMPLE_GIT_OPTIONS satisfies Partial<SimpleGitOptions>;

// The git task worker sets this for the task it is running, so every git
// process built on that thread meanwhile dies with the task when the runner
// cancels it. The main thread never sets it.
Expand All @@ -25,12 +19,16 @@ export function setGitTaskAbortSignal(signal: AbortSignal | undefined): void {
taskAbortSignal = signal;
}

// Superset is a local Git client, so inherited user Git config/env is expected
// behavior. simple-git blocks these hooks by default; allow them centrally
// instead of deleting individual env vars and changing Git semantics.
function createUserSimpleGit(
env: Record<string, string>,
repoPath?: string,
overrides?: Partial<SimpleGitOptions>,
): SimpleGit {
const options: Partial<SimpleGitOptions> = {
...SIMPLE_GIT_OPTIONS,
...userGitSimpleGitOptions(env),
...overrides,
};
if (taskAbortSignal && !options.abort) {
Expand All @@ -52,9 +50,8 @@ export async function getSimpleGitWithShellPath(
repoPath?: string,
overrides?: Partial<SimpleGitOptions>,
): Promise<SimpleGit> {
const git = createUserSimpleGit(repoPath, overrides);
git.env(await getProcessEnvWithShellPath());
return git;
const env = await getProcessEnvWithShellPath();
return createUserSimpleGit(env, repoPath, overrides).env(env);
}

export async function execGitWithShellPath(
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@lingui/core": "6.8.0",
"@lingui/react": "6.8.0",
"@modelcontextprotocol/sdk": "1.30.0",
"@modelcontextprotocol/sdk": "1.31.0",
"@radix-ui/react-collapsible": "1.1.12",
"@radix-ui/react-scroll-area": "1.2.10",
"@sentry/nextjs": "10.68.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"expo-system-ui": "57.0.4",
"expo-updates": "57.0.24",
"expo-web-browser": "57.0.3",
"katex": "0.17.0",
"katex": "0.18.2",

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.

P2: katex jumps across a semver-major boundary (0.17.0 → 0.18.2), and the only consumer, react-native-enriched-markdown@0.6.0, declares the optional peer katex >=0.16.0 with no upper bound, so the bump installs cleanly without any compatibility check. EnrichedMarkdownText renders math in PR descriptions and AI messages, no automated test covers that path, and the PR's manual smoke tests are unrun. Verify the math-rendering path (or a render smoke test) before relying on 0.18 output in the markdown WebView.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/mobile/package.json, line 114:

<comment>katex jumps across a semver-major boundary (0.17.0 → 0.18.2), and the only consumer, react-native-enriched-markdown@0.6.0, declares the optional peer `katex >=0.16.0` with no upper bound, so the bump installs cleanly without any compatibility check. EnrichedMarkdownText renders math in PR descriptions and AI messages, no automated test covers that path, and the PR's manual smoke tests are unrun. Verify the math-rendering path (or a render smoke test) before relying on 0.18 output in the markdown WebView.</comment>

<file context>
@@ -111,7 +111,7 @@
 		"expo-updates": "57.0.24",
 		"expo-web-browser": "57.0.3",
-		"katex": "0.17.0",
+		"katex": "0.18.2",
 		"lucide-react-native": "0.562.0",
 		"posthog-react-native": "4.63.2",
</file context>

"lucide-react-native": "0.562.0",
"posthog-react-native": "4.63.2",
"react": "19.2.3",
Expand Down
31 changes: 16 additions & 15 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"tooling/*"
],
"overrides": {
"@modelcontextprotocol/sdk": "1.31.0",
"@tiptap/extension-dropcursor": "3.30.5",
"@tiptap/extension-floating-menu": "3.30.5",
"@tiptap/extension-gapcursor": "3.30.5",
Expand All @@ -86,7 +87,7 @@
"mdast-util-to-markdown": "2.1.2",
"next": "16.3.6",
"rollup": "4.62.3",
"shell-quote": "1.9.0"
"shell-quote": "1.11.0"
},
"trustedDependencies": [
"better-sqlite3",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@clack/prompts": "0.10.1",
"@modelcontextprotocol/sdk": "1.30.0",
"@modelcontextprotocol/sdk": "1.31.0",
"@superset/agent-setup": "workspace:*",
"@superset/cli-framework": "workspace:*",
"@superset/host-service": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/host-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"partysocket": "1.3.0",
"pi-acp": "0.0.34",
"semver": "7.7.4",
"simple-git": "3.36.0",
"simple-git": "4.0.2",
"superjson": "2.2.6",
"tree-kill": "1.2.2",
"zod": "4.6.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { FsWatchEvent } from "@superset/workspace-fs/host";
import simpleGit from "simple-git";
import { simpleGit } from "simple-git";
import { GitStatusStore } from "../trpc/router/git/utils/git-status-store/git-status-store";
import { GitDirectoryWatcher } from "./git-directory-watcher";
import { GitWatcher } from "./git-watcher";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function statusSnapshotFailure(
): Promise<Error> {
try {
await getGitStatusSnapshot({
git: createUserSimpleGit(worktreePath).env(env),
git: createUserSimpleGit(worktreePath, { env: env }),
worktreePath,
});
} catch (error) {
Expand Down Expand Up @@ -166,7 +166,7 @@ describe("git message locale", () => {
providerWithEnv(process.env as Record<string, string>),
)(repo);
const { snapshot } = await getGitStatusSnapshot({
git: createUserSimpleGit(repo).env(env),
git: createUserSimpleGit(repo, { env: env }),
worktreePath: repo,
});

Expand Down
7 changes: 5 additions & 2 deletions packages/host-service/src/runtime/git/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function getRemoteUrlCached(
const inFlight = remoteUrlInFlight.get(repoPath);
if (inFlight) return inFlight;

const resolving = getRemoteUrl(createUserSimpleGit(repoPath).env(env))
const resolving = getRemoteUrl(createUserSimpleGit(repoPath, { env }))
.then((url) => {
remoteUrlCache.set(repoPath, { url, resolvedAt: Date.now() });
return url;
Expand Down Expand Up @@ -76,5 +76,8 @@ export function createGitEnvResolver(provider: GitCredentialProvider) {
export function createGitFactory(provider: GitCredentialProvider): GitFactory {
const resolveEnv = createGitEnvResolver(provider);
return async (repoPath, options) =>
createUserSimpleGit(repoPath, options).env(await resolveEnv(repoPath));
createUserSimpleGit(repoPath, {
...options,
env: await resolveEnv(repoPath),
});
}
25 changes: 23 additions & 2 deletions packages/host-service/src/runtime/git/simple-git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SIMPLE_GIT_UNSAFE_OPTION_FLAGS,
USER_GIT_ENV_SIMPLE_GIT_OPTIONS,
} from "@superset/shared/simple-git-options";
import simpleGit, { type SimpleGit } from "simple-git";
import { type SimpleGit, simpleGit } from "simple-git";
import { createUserSimpleGit } from "./simple-git";

function makeBlockedGitEnv(workRoot: string): Record<string, string> {
Expand Down Expand Up @@ -85,9 +85,30 @@ describe("createUserSimpleGit", () => {
mkdirSync(repoPath);
execSync("git init", { cwd: repoPath, stdio: "ignore" });

const git = createUserSimpleGit(repoPath).env(makeBlockedGitEnv(workRoot));
const git = createUserSimpleGit(repoPath, {
env: makeBlockedGitEnv(workRoot),
});

const status = await git.raw(["status", "--short"]);
expect(status).toBe("");
});

test("passes the supplied GIT_* env through to git", async () => {
const repoPath = join(workRoot, "repo");
mkdirSync(repoPath);
execSync("git init", { cwd: repoPath, stdio: "ignore" });

const git = createUserSimpleGit(repoPath, {
env: {
...process.env,
GIT_CONFIG_COUNT: "1",
GIT_CONFIG_KEY_0: "superset.probe",
GIT_CONFIG_VALUE_0: "from-env",
},
});

expect((await git.raw(["config", "superset.probe"])).trim()).toBe(
"from-env",
);
});
});
Loading
Loading