Add option to fork default branch only#1995
Conversation
|
I've run into a testing issue with GHRepositoryForkBuilderTest. The tests are failing when using the personal account because the mock server can't handle branch API requests. Here's the error:
I've seen a similar issue before with owner validation. After removing that check, this error appeared instead. Now I can either skip the branch validation (but then we won't properly test the defaultBranchOnly feature) or add mock responses for my account (which seems like an awkward solution). I noticed in the docs that using hub4j-test-org is the recommended way to run tests. Could I get access to that organization? This seems like it would solve the problem and follow the project's testing guidelines. Let me know if there are other approaches I should consider. Thanks for your guidance! |
|
Invite sent. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1995 +/- ##
============================================
+ Coverage 83.26% 83.60% +0.33%
- Complexity 2355 2377 +22
============================================
Files 233 234 +1
Lines 7230 7250 +20
Branches 379 382 +3
============================================
+ Hits 6020 6061 +41
+ Misses 973 955 -18
+ Partials 237 234 -3 ☔ View full report in Codecov by Sentry. |
|
You're doing great with this PR. I like the builder and you have working tests, you're most of the way there. Thanks for sticking with it! Regarding code coverage: First, you can make Second, to get line 92 and 94, you're going to need to:
Does this make sense? |
|
I have the same kind of problems in #1994. |
|
No problem, @Alaurant knows your codebase much better than I do. |
|
@gounthar |
|
No worries. I had discussed this with @gounthar earlier and offered to help with the implementation. Just for providing another option to get this done. |
src/test/java/org/kohsuke/github/GHRepositoryForkBuilderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/kohsuke/github/GHRepositoryForkBuilderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/kohsuke/github/GHRepositoryForkBuilderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/kohsuke/github/GHRepositoryForkBuilderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/kohsuke/github/GHRepositoryForkBuilderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/kohsuke/github/GHRepositoryForkBuilderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/kohsuke/github/GHRepositoryForkBuilderTest.java
Outdated
Show resolved
Hide resolved
|
Sorry, I can't believe I totally missed this message. Thanks for handling it |

Description
Fixes #1993 , based on Repository create a fork API
Before submitting a PR:
@linkJavaDoc entries to the relevant documentation on https://docs.github.com/en/rest .mvn -D enable-ci clean install sitelocally. If this command doesn't succeed, your change will not pass CI.main. You will create your PR from that branch.When creating a PR: