-
Notifications
You must be signed in to change notification settings - Fork 354
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
JENKINS-48737 Fixing lightweight pull request checkouts, also for files in subdirectories #174
Merged
jetersen
merged 9 commits into
jenkinsci:master
from
seb-lie:fix_lightweight_checkouts_2.4.2
Apr 7, 2019
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
86d08c6
Fixing lightweight pull request checkouts with files in subdirectories
seb-lie 449f881
optimized imports to address Checkstyle errors
seb-lie 9a5bbca
Reverted "optimized imports to address Checkstyle errors"
seb-lie 13a2d6a
Pulled up ref determination into old place as suggested by casz
seb-lie 5062669
fix browse path endpoint
jetersen cacc5e7
CR additions
jetersen 52b803a
unused import
jetersen 9563965
clear logic
jetersen 7769001
support lightweight checkout on same repo in bitbucket cloud
jetersen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
34 changes: 34 additions & 0 deletions
34
...a/com/cloudbees/jenkins/plugins/bitbucket/server/client/BitbucketServerAPIClientTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.cloudbees.jenkins.plugins.bitbucket.server.client; | ||
|
||
import com.damnhandy.uri.template.UriTemplate; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import static com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.API_BROWSE_PATH; | ||
|
||
public class BitbucketServerAPIClientTest { | ||
|
||
@Test | ||
public void repoBrowsePathFolder() { | ||
String expand = UriTemplate | ||
.fromTemplate(API_BROWSE_PATH) | ||
.set("owner", "test") | ||
.set("repo", "test") | ||
.set("path", "folder/Jenkinsfile") | ||
.set("at", "fix/test") | ||
.expand(); | ||
Assert.assertEquals("/rest/api/1.0/projects/test/repos/test/browse/folder/Jenkinsfile?at=fix%2Ftest", expand); | ||
} | ||
|
||
@Test | ||
public void repoBrowsePathFile() { | ||
String expand = UriTemplate | ||
.fromTemplate(API_BROWSE_PATH) | ||
.set("owner", "test") | ||
.set("repo", "test") | ||
.set("path", "Jenkinsfile") | ||
.expand(); | ||
Assert.assertEquals("/rest/api/1.0/projects/test/repos/test/browse/Jenkinsfile", expand); | ||
} | ||
|
||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing out whether this is even possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup only possible when the PR is coming from the same repository.
Atlassian is the one to blame for having an issue open for six years and counting.