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

Fix jgit not closed during clone #134

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

jonesbusy
Copy link
Collaborator

Should fix #103

Ensuring jgit is closed after clone

I'm not sure if there is other places

Testing done

Got CredentialsProvider when cloning many plugin.

Was not able to reproduce after this fix

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

@jonesbusy jonesbusy added the bug For changelog: Minor bug. Will be listed after features label Jul 30, 2024
@jonesbusy jonesbusy requested a review from a team as a code owner July 30, 2024 07:13
@gounthar
Copy link
Collaborator

Very interesting, I will check this on Gitpod.
Thanks,!

@gounthar gounthar merged commit 1d69e1d into jenkins-infra:main Jul 30, 2024
13 checks passed
@jonesbusy jonesbusy deleted the bugfix/jgit-not-closed branch July 30, 2024 16:05
@gounthar
Copy link
Collaborator

So far so good for me, thanks a bunch! 🤗

@gounthar
Copy link
Collaborator

For the time being, I only had one error:

Forking and cloning plugin commons-text-api locally from repo commons-text-api-plugin 
Forking the repository to personal account... 
Repository forked to personal account successfully. 
Failed to process plugin: commons-text-api 
org.eclipse.jgit.api.errors.TransportException: https://github.com/gounthar/commons-text-api-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:319)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:189)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.fetchRepository(GHService.java:141)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.forkCloneAndCreateBranch(GHService.java:74)
        at io.jenkins.tools.pluginmodernizer.core.impl.PluginModernizer.start(PluginModernizer.java:54)
        at io.jenkins.tools.pluginmodernizer.cli.Main.run(Main.java:181)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:2016)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:1987)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2272)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at io.jenkins.tools.pluginmodernizer.cli.Main.main(Main.java:42)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/gounthar/commons-text-api-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:687)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:153)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1480)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
        ... 13 common frames omitted
Forking and cloning plugin configuration-as-code locally from repo configuration-as-code-plugin 

@gounthar
Copy link
Collaborator

And another...

Forking and cloning plugin pipeline-graph-analysis locally from repo pipeline-graph-analysis-plugin 
Forking the repository to personal account... 
Repository forked to personal account successfully. 
Failed to process plugin: pipeline-graph-analysis 
org.eclipse.jgit.api.errors.TransportException: https://github.com/gounthar/pipeline-graph-analysis-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:319)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:189)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.fetchRepository(GHService.java:141)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.forkCloneAndCreateBranch(GHService.java:74)
        at io.jenkins.tools.pluginmodernizer.core.impl.PluginModernizer.start(PluginModernizer.java:54)
        at io.jenkins.tools.pluginmodernizer.cli.Main.run(Main.java:181)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:2016)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:1987)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2272)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at io.jenkins.tools.pluginmodernizer.cli.Main.main(Main.java:42)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/gounthar/pipeline-graph-analysis-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:687)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:153)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1480)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
        ... 13 common frames omitted
Forking and cloning plugin pipeline-graph-view locally from repo pipeline-graph-view-plugin 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authentication is required but no CredentialsProvider has been registered
3 participants