Repository navigation
Conversation
|
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
A `tree` or `blob` URL does not say where the ref ends: `tree/branch/with/slash` and `tree/main/sub/dir` have the same shape. The parser kept the whole tail as the branch, so a URL pointing into a directory produced a branch that does not exist, which a clone then fails on. Git settles it, because a ref cannot be a path prefix of another ref: `refs/heads/branch` is a file where `refs/heads/branch/with/slash` needs a directory. At most one prefix of the tail is a real ref, so asking the API about the prefixes in turn has exactly one answer. Probe shortest first, so the common URL, a short branch followed by a path, answers on the first question, and reuse the commit it returns as the latest commit the parse ends with: `tree/main/sub` costs the one API call it cost before. Only a prefix the API reports absent is skipped. An unreachable server, a rejected token or a rate limit means the refs cannot be enumerated at all rather than that this one is missing, so the tail is kept whole, as before. A URL that resolves today keeps resolving when the API cannot be reached. The subfolder needs its own field rather than staying folded into the branch: rawFileLocation substitutes the latest commit for the branch once it knows it, and a subfolder carried in the branch would be dropped along with it. Two bugs found on the way: the devfile name was stripped at its first occurrence rather than its last, mangling a directory named after the devfile, and getLatestCommit indexed into the commit array unguarded, so a branch with no commit raised an ArrayIndexOutOfBoundsException past every declared handler. The parsing rows no longer reach github.com from a unit test, which also drops the suite from 5.4s to 0.9s. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Docker image build succeeded: quay.io/eclipse/che-server:pr-1089 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/cheServer/deployment", "value": {containers: [{image: "quay.io/eclipse/che-server:pr-1089", name: che}]}}]" |
|
/retest |
1 similar comment
|
/retest |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tolusha, vinokurig The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What does this PR do?
A
treeorblobURL does not say where the ref ends:tree/branch/with/slashandtree/main/sub/dirhave the same shape. The parser kept the whole tail as the branch, so a URL pointing into a directory produced a branch that does not exist, which a clone then fails on.Git settles it, because a ref cannot be a path prefix of another ref:
refs/heads/branchis a file whererefs/heads/branch/with/slashneeds a directory. At most one prefix of the tail is a real ref, so asking the API about the prefixes in turn has exactly one answer. Probe shortest first, so the common URL, a short branch followed by a path, answers on the first question, and reuse the commit it returns as the latest commit the parse ends with:tree/main/subcosts the one API call it cost before.Only a prefix the API reports absent is skipped. An unreachable server, a rejected token or a rate limit means the refs cannot be enumerated at all rather than that this one is missing, so the tail is kept whole, as before. A URL that resolves today keeps resolving when the API cannot be reached.
The subfolder needs its own field rather than staying folded into the branch: rawFileLocation substitutes the latest commit for the branch once it knows it, and a subfolder carried in the branch would be dropped along with it.
Two bugs found on the way: the devfile name was stripped at its first occurrence rather than its last, mangling a directory named after the devfile, and getLatestCommit indexed into the commit array unguarded, so a branch with no commit raised an ArrayIndexOutOfBoundsException past every declared handler.
The parsing rows no longer reach github.com from a unit test, which also drops the suite from 5.4s to 0.9s.
Screenshot/screencast of this PR
What issues does this PR fix or reference?
https://redhat.atlassian.net/browse/CRW-13626
How to test this PR?
quay.io/eclipse/che-server:pr-1089.https://github.com/vinokurig/test/tree/new/branch/path.pathsubdirectory and the cloned project is checked out to the/tree/newbranch.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or referenceandHow to test this PRcompletedRelease Notes
Reviewers
Reviewers, please comment how you tested the PR when approving it.
Summary by CodeRabbit
New Features
Bug Fixes