Repository navigation
fix(#71): build cross-fork compare commit URLs from their repository - #138
Open
fullsend-ai-coder[bot] wants to merge 1 commit into
Open
fullsend-ai-coder[bot] wants to merge 1 commit into
fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
A cross-fork compare reads the fork's objects in place, without copying them into the base repository. Its files' URLs already named the fork, but the commit objects (commits, base_commit, merge_base_commit) built every URL from the base repository, so following url, commit.url, commit.tree.url or a parent URL of a fork-only commit answered 404. _build_compare now takes the base side's fork as well as the head side's, and builds commits' URLs from the head side's repository and base_commit's and merge_base_commit's from the base side's (the merge base is an ancestor of the base commit). Comparisons with no fork side are unchanged. This is option 1 from the issue, as the maintainer chose. The new test compares with the fork on the head side and then on the base side, and follows each commit's URLs as the comparing user. The bug is recorded in docs/bugs/fixed and indexed in PLAN.md. Note: pre-commit could not fetch its hook repositories in the sandbox (TLS verification failure). ruff-check v0.17.3 was run directly and passed; whitespace, end-of-file and secret scans also passed. In the full suite, two unrelated tests fail in the sandbox: test_runner_shutdown (fails on main too) and test_security_headers (no built frontend/dist). Closes #71 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 2:59 PM UTC · Completed 3:06 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.02 |
|
Risk Assessment: moderate (2/5) DetailsTargeted bug fix with complete acceptance criteria and test coverage, moderately elevated due to modifying existing compare URL behavior without a feature flag toggle. |
|
Looks good to me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds the commit URLs in a cross-fork compare from the repository that holds each commit. A cross-fork compare reads the fork's objects in place and copies nothing into the base repository. Its
filesURLs already pointed at the fork. Butcommits,base_commitandmerge_base_commitbuilt every URL (url,html_url,comments_url,commit.url,commit.tree.url, parent URLs) from the base repository. Following any of them for a fork-only commit returned 404.This is option 1 from the issue, the approach the maintainer chose.
Changes
src/app/api/commits.py:_build_comparenow takesbase_forkas well ashead_fork.commits(andfiles, as before) use the head side's repository: the head fork when the head side is one.base_commituses the base side's repository: the base fork when the base side is one.merge_base_commitis an ancestor of the base commit, so it uses the same repository.tests/test_compare_and_label_edges.py: newtest_cross_fork_commit_urls_lead_to_the_repository_that_holds_them. It runs the compare with the fork on the head side, then on the base side. It checks that each commit's URLs name the repository that holds the commit. As the comparing user, it then followsurl,commit.url,commit.tree.urland the parent URLs ofcommits,base_commitandmerge_base_commit, and expects 200.comments_urlis only checked for the right repository, not followed: the emulator has no commit-comments route for any repository.docs/bugs/fixed/cross-fork-compare-commit-urls-name-the-base-repository.mdandPLAN.md: work-ledger record of the bug and fix.Testing
tests/test_compare_and_label_edges.pyandtests/test_compare_api.pyall pass.tests/actions/test_runner_shutdown.py::test_a_shutdown_signal_fails_the_running_step_and_stops_its_processesalso fails on unmodifiedmainin the sandbox.tests/test_security_headers.py::test_admin_ui_and_unreserved_admin_path_include_security_headersfails because the frontenddistwasn't built in the sandbox.ruff checkv0.17.3 (the pinned hook version) directly and it passed. Trailing-whitespace and end-of-file checks and a gitleaks secret scan also passed.Follow-up
Option 2 is left as a possible follow-up:
get_commitand the git commit/tree routes would resolve a fork-only commit through the fork network, keeping GitHub's base-repository URL shape.🤖 Generated with Claude Code
Closes #71
Post-script verification
agent/71-cross-fork-commit-urls)0454bace16539f60483343fc2079d8b7d7a6ebc7..HEAD)