Repository navigation
perf(server): stop re-running git for every project each minute #13689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0982bae
fdec31a
64ac741
575b3af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3038,9 +3038,13 @@ const makeWsRpcLayer = ( | |
| [WS_METHODS.sourceControlPublishRepository]: (input) => | ||
| observeRpcEffect( | ||
| WS_METHODS.sourceControlPublishRepository, | ||
| sourceControlRepositories | ||
| .publishRepository(input) | ||
| .pipe(Effect.tap(() => refreshGitStatus(input.cwd))), | ||
| sourceControlRepositories.publishRepository(input).pipe( | ||
| // A new remote can change the cached identity. Only the `cwd` entry | ||
| // refreshes, so after a publish from a linked worktree the project | ||
| // root entry waits for its TTL. | ||
| Effect.tap(() => repositoryIdentityResolver.resolve(input.cwd, { refresh: true })), | ||
| Effect.tap(() => refreshGitStatus(input.cwd)), | ||
|
Comment on lines
+3041
to
+3046
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: rg -n 'publishRepository|pullRequestMatchesProject|branchPullRequest|remote add|addRemote|worktreePath|workspaceRoot' apps/server/src/project apps/server/src/git apps/server/src/sourceControl apps/server/src/orchestration/ThreadPullRequestReactor.ts apps/server/src/ws.ts
sed -n '3025,3060p' apps/server/src/ws.ts
sed -n '90,175p' apps/server/src/orchestration/ThreadPullRequestReactor.tsRepository: pingdotgg/t3code Length of output: 37776 🏁 Script executed: set -eu
printf '%s\n' '--- RepositoryIdentityResolver ---'
sed -n '1,220p' apps/server/src/project/RepositoryIdentityResolver.ts
printf '%s\n' '--- publish implementation ---'
sed -n '360,475p' apps/server/src/sourceControl/SourceControlRepositoryService.ts
printf '%s\n' '--- PR matching and discovery ordering ---'
sed -n '1,175p' apps/server/src/orchestration/ThreadPullRequestReactor.ts
sed -n '215,248p' apps/server/src/orchestration/ThreadPullRequestReactor.ts
printf '%s\n' '--- publish diff against requested base ---'
git diff --unified=30 2a9832b8019039f812706639c11ccc24ce4c4e05 af6d0a34bad1acb9d0d9f6cea41ca8c996ec9981 -- apps/server/src/ws.ts apps/server/src/project/RepositoryIdentityResolver.ts apps/server/src/orchestration/ThreadPullRequestReactor.ts apps/server/src/sourceControl/SourceControlRepositoryService.tsRepository: pingdotgg/t3code Length of output: 30109 🏁 Script executed: set -eu
printf '%s\n' '--- GitManager remote mutation ---'
rg -n -A55 -B20 'ensureRemote|const ensureRemote|ensureRemote:' apps/server/src/git/GitManager.ts
printf '%s\n' '--- GitManager PR discovery ---'
sed -n '2120,2315p' apps/server/src/git/GitManager.ts
printf '%s\n' '--- project snapshot identity/workspace binding ---'
sed -n '3000,3085p' apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
printf '%s\n' '--- publish route declaration and input contract ---'
rg -n -A20 -B15 'sourceControlPublishRepository' apps/server/src/ws.ts apps/server/src -g '*.ts' | head -180Repository: pingdotgg/t3code Length of output: 26924 🏁 Script executed: set -eu
printf '%s\n' '--- ensureRemote bindings ---'
rg -n -S -A35 -B15 'ensureRemote' apps/server/src packages 2>/dev/null | head -240
printf '%s\n' '--- publish input contract ---'
rg -n -S -A35 -B15 'SourceControlPublishRepositoryInput|sourceControlPublishRepository' . -g '*.ts' | head -220Repository: pingdotgg/t3code Length of output: 39283 Refresh the project identity after publishing from a linked worktree.
PR discovery can detect the PR through the new remote, then reject it because Refresh or invalidate the project's 🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Real but narrow, and documented at ws.ts:3042 and in the PR body. Publish is only offered without an origin (GitActionsControl.tsx:1633), so a repo with no remote has a null root identity that re-resolves within 1 minute (RepositoryIdentityResolver.ts:21), and an existing upstream still wins after publish (RepositoryIdentityResolver.ts:61). Only a repo whose remotes all have other names waits up to 15 minutes, and the publish RPC has no project id to map a worktree cwd to its root, so we are keeping this as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The finding remains valid for a repository whose remotes all have non- ✏️ Learnings added
You are interacting with an AI system. |
||
| ), | ||
| { | ||
| "rpc.aggregate": "source-control", | ||
| }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.