Skip to content
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

Optimize by forking Default Branch Only #730

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

shinigami-777
Copy link
Contributor

Towards #104
Set the defaultforkonly to true with GHRepositoryForkBuilder to in place of fork() (fork was also deprecated in the recent release) to optimize forking process.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@shinigami-777
Copy link
Contributor Author

The new version github-api-2.0-alpha-3 is released now. I took a try at solving the issue. But the originalRepo.createFork() returns null giving the error
Cannot invoke "org.kohsuke.github.GHRepositoryForkBuilder.organization(org.kohsuke.github.GHOrganization)" because "builder" is null
I can't seem to understand why this is happening. Please take a look.

@jonesbusy
Copy link
Collaborator

Please take a look

Adapt the unit tests maybe?

Signed-off-by: shinigami-777 <[email protected]>
Signed-off-by: shinigami-777 <[email protected]>
@shinigami-777
Copy link
Contributor Author

Adapt the unit tests maybe?

Sorry, I somehow completely overlooked this before.
Adjusted them for GHServiceTest.

@shinigami-777
Copy link
Contributor Author

@jonesbusy When I clone the main branch fresh, the tests are failing the same as this.

@jonesbusy
Copy link
Collaborator

Why not bump version until updatecli merge the PR?

We have a contributor that did it on his PR

#673

Don't expect maintainers to give you always the information.

@jonesbusy
Copy link
Collaborator

See #733

@shinigami-777
Copy link
Contributor Author

Thanks. I'm looking into it

@jonesbusy
Copy link
Collaborator

Hi, I think the method name defaultbranchonlyfork should be renamed to something like fork. That's enough since it's a private method and there will not be other way to fork

Then I think we are good to merge

Supersedes #710

@jonesbusy jonesbusy merged commit d7481c0 into jenkins-infra:main Jan 28, 2025
17 checks passed
@shinigami-777 shinigami-777 deleted the optimize-forking branch January 28, 2025 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants