fix: upstream ancestry merge + address review findings#32
fix: upstream ancestry merge + address review findings#32aaditagrawal wants to merge 17 commits intomainfrom
Conversation
…ngdotgg#1121) Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Mohammed Muzammil Anwar <muzammil@pluginhive.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ync-fixes # Conflicts: # apps/desktop/src/main.ts # apps/server/src/git/Layers/GitCore.ts # apps/server/src/git/Layers/GitManager.test.ts # apps/server/src/main.test.ts # apps/server/src/serverLayers.ts # apps/web/src/appSettings.test.ts # apps/web/src/appSettings.ts # apps/web/src/components/ChatView.logic.ts # apps/web/src/components/ChatView.tsx # apps/web/src/components/Sidebar.tsx # apps/web/src/components/chat/ProviderModelPicker.browser.tsx # apps/web/src/components/chat/ProviderModelPicker.tsx # apps/web/src/components/chat/composerProviderRegistry.tsx # apps/web/src/hooks/useHandleNewThread.ts # apps/web/src/routes/_chat.settings.tsx # packages/shared/src/model.ts # scripts/dev-runner.ts
- pr-size.yml: force size:XXL when GitHub API truncates at 3000 files - GitCore: propagate fetch failures in fetchUpstreamRefForStatus so stale state is not cached for 15 seconds - GitCore: remove arbitrary .toReversed() in listRemoteNames, prefer 'upstream' remote when 'origin' is absent - GitCore: treat explicit empty filePaths array as 'stage nothing' instead of falling through to git add -A - composerDraftStore: remove duplicate replaceProviderModelOptions from merge artifact
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTwo distinct changes: a workflow file now detects truncated PR file lists and forces size label sizing when truncation occurs; a git core module adds error checking to upstream ref fetching, adjusts remote name ordering and selection logic, and refines file staging behavior for empty paths. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/server/src/git/Layers/GitCore.ts (1)
643-656:⚠️ Potential issue | 🟠 Major
remotes[0]is still not the first listed remote.The new comment says this falls back to the first listed remote, but
listRemoteNames()still goes throughparseRemoteNames(), which reorders names by descending length at Lines 115-120. In repos withoutoriginorupstream, this now picks the longest remote name instead, soresolvePushRemoteName()/fetchPullRequestBranch()can target the wrong remote.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/server/src/git/Layers/GitCore.ts` around lines 643 - 656, The fallback in resolvePrimaryRemoteName incorrectly uses listRemoteNames which calls parseRemoteNames that reorders remotes by descending length; this causes remotes[0] to be the longest name, not the first-listed remote. Fix by retrieving remotes in their original git-listed order for resolvePrimaryRemoteName (and callers like resolvePushRemoteName / fetchPullRequestBranch): either call runGitStdout("GitCore.listRemoteNames", cwd, ["remote"]) and parse the stdout without the length-based reordering, or add a new helper (e.g., parseRemoteNamesPreserveOrder) and use that in listRemoteNames or directly in resolvePrimaryRemoteName so the fallback truly uses the first listed remote.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pr-size.yml:
- Around line 182-187: The early return when files.length >= 3000 (the line
returning "size:XXL" after core.warning) bypasses the downstream label
reconciliation logic, so change the flow to set a variable/flag indicating the
computed label ("size:XXL") instead of returning early and allow the normal
label reconciliation/path to run; locate the block that currently calls
core.warning and returns "size:XXL", replace the return with assignment to the
label result or a flag, and ensure the subsequent reconciliation routine still
runs to add or remove size labels accordingly.
In `@apps/server/src/git/Layers/GitCore.ts`:
- Around line 960-973: The branch that treats an explicit empty filePaths array
skips resetting the index and leaves prior staged files; change
prepareCommitContext so that whenever filePaths is not null/undefined you first
run the reset step (use the existing GitCore.prepareCommitContext.reset
invocation) and only run GitCore.prepareCommitContext.addSelected when
filePaths.length > 0; this ensures the index is cleared for explicit []
selections and prevents stale stagedSummary/stagedPatch/commit() from including
unintended files.
In `@packages/shared/src/model.test.ts`:
- Around line 271-333: The file contains a duplicated test suite for
resolveSelectableModel; remove the second describe("resolveSelectableModel",
...) block (the duplicate that includes tests referencing
resolveSelectableModel) so the tests only exist once. Locate the duplicate
describe block that repeats the tests for resolveSelectableModel (the one with
cases like "resolves exact slug matches", "resolves case-insensitive
display-name matches", "returns null for empty input", etc.) and delete that
entire block, leaving the original test suite and any other unique tests intact.
---
Outside diff comments:
In `@apps/server/src/git/Layers/GitCore.ts`:
- Around line 643-656: The fallback in resolvePrimaryRemoteName incorrectly uses
listRemoteNames which calls parseRemoteNames that reorders remotes by descending
length; this causes remotes[0] to be the longest name, not the first-listed
remote. Fix by retrieving remotes in their original git-listed order for
resolvePrimaryRemoteName (and callers like resolvePushRemoteName /
fetchPullRequestBranch): either call runGitStdout("GitCore.listRemoteNames",
cwd, ["remote"]) and parse the stdout without the length-based reordering, or
add a new helper (e.g., parseRemoteNamesPreserveOrder) and use that in
listRemoteNames or directly in resolvePrimaryRemoteName so the fallback truly
uses the first listed remote.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 846c83b1-c85c-45b9-b8bc-35c92e3098b8
📒 Files selected for processing (3)
.github/workflows/pr-size.ymlapps/server/src/git/Layers/GitCore.tspackages/shared/src/model.test.ts
- pr-size.yml: use flag instead of early return so label reconciliation still runs when file list is truncated - GitCore.prepareCommitContext: always reset index when filePaths is provided, even if empty, to clear stale staged files - model.test.ts: remove duplicate resolveSelectableModel test block (merge artifact)
Summary
upstream/mainto sync fork divergence historysize:XXLlabel when GitHub's 3,000-file API truncation is hit, instead of applying a potentially undercounted label.toReversed()call; prefer"upstream"remote when"origin"is absentfilePathsarray as "stage nothing" instead of falling through togit add -AreplaceProviderModelOptionsfunction from merge artifactTest plan
bun typecheckpasses across all 7 packagesSummary by CodeRabbit
Release Notes