Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    based3
    @based3
    does the skipCheckout only works after the first installation of a job? Replay seems applying correctly the skipCheckout
    skipDefaultCheckout
    any process on https://issues.jenkins-ci.org/browse/JENKINS-27191 Support bare clone ?
    context: Pipeline jobs installed with a Job DSL from git (jenkins with infra-as-code)
    based3
    @based3
    Should I use the UserContent with git-server?
    Mark Waite
    @MarkEWaite
    No intent to ever have the git plugin support a bare clone as requested in https://issues.jenkins-ci.org/browse/JENKINS-27191 . Use the withCredentials wrapper to call git clone directly if you need a bare clone of a git repository. The use case is too specialized to add to the git plugin for over 250 000 installations
    based3
    @based3
    tx
    Mark Waite
    @MarkEWaite
    I wouldn't use the git server plugin myself because I think that there are too many excellent, free git servers available (like Gitea). No need to use Jenkins as a git server when impressively capable git servers are available for free
    Bassam Khouri
    @bkhouri
    Hi. The Git plugin does not appear to update the branch references. that is, if I build a job against branch A and then add one or more commits to branch A, then the next time I run the job, the build will contain the "information" from before the commits were added. I tried the "clean before checkout" and "clean after checkout", but they didn't work. The only way I found to work around this is by using the "Wipe out workspace and force clone". The repository takes about 5 minus to clone, so I was hope to avoid that is possible.
    10 replies
    Hui Jun
    @blanked
    hey I'm trying to run some tests on the git plugin but I'm facing timeout issues. I'm trying to run this test in particular - https://github.com/jenkinsci/git-plugin/blob/master/src/test/java/jenkins/plugins/git/GitSCMFileSystemTest.java. I've pulled the tags too so I'm not sure what's going on. I will really appreciate it if someone can help!
    11 replies
    Mark Waite
    @MarkEWaite
    @rishabhBudhouliya the next Jenkins weekly will include the table to divs migration. I plan to release git plugin 4.4.5 with your table to divs fix this weekend. Thanks for making that fix.
    Bassam Khouri
    @bkhouri
    Does anyone know how to trigger a Jenkins build for a git (Gerrit) review/change if and only if the commit message matches a regular expression patter? I want to run it on a Patch Set/PR before having it merge to the target branch
    1 reply
    Bruce Szalwinski
    @thelazydba_twitter
    where would i find information about the changes needed to make to a jenkins enviroment with respect to the github oauth deprecation, https://developer.github.com/changes/2020-02-14-deprecating-password-auth/?
    1 reply
    Bassam Khouri
    @bkhouri
    How can I configure a pipeline job to clones a specific refspec? now matter what I try, I can't seem to get it to clone/checkout a Gerrit Patch Set
    Mark Waite
    @MarkEWaite
    If a Gerrit patch set is contained in a git refspec, then you should be able to define the refspec to clone the repository. The "Pipeline Syntax" in the Jenkins job UI can assist you to define the advanced clone options to use the refspec from the Gerrit patch set. I don't use Gerrit, but I have several examples of custom refspecs that you might use as a reference. See my jenkins-bugs repo.
    Mark Waite
    @MarkEWaite
    @rishabhBudhouliya I'd appreciate your review of jenkinsci/git-plugin#1001. It proposes to add the ability to hide the git tag action that is inserted into job pages. The rationale is included in the pull request. I've tested interactively with Jenkins 2.263 (before tables to divs) and with Jenkins 2.266 (after tables to divs)..
    2 replies
    harasai
    @harasai
    Hi, I would like to use Git Parameter twice to clone multiple repos at various build steps. Use case is, User will select the required branches from repo A and and B. Build steps performed with repoA and uses the artifacts for build steps using repo B. Fianal artifacts will deployed to artifactory.
    Zbynek Konecny
    @zbynek
    at org.jenkinsci.plugins.gitclient.JGitAPIImpl.setupSubmoduleUrls(JGitAPIImpl.java:2530)
        at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:146)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1379)
        at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
    JGit fails to checkout repository with submodules if the recursive option is set. The Javadoc is interesting:
    Mark Waite
    @MarkEWaite
    As far as I'm concerned, the git plugin does not support submodules with JGit. There are too many corner cases in the ugliness that is git plugin support of submodules. I've considered a possible Google Summer of Code project to add one more option to the fetch and checkout commands, --recurse-submodules. That would allow users to ignore the ugly mess inside the git plugin where it is opening and reading submodule configuration files from the local workspace.
    However, that idea is lower priority for me than several other ideas.
    Zbynek Konecny
    @zbynek
    Understood. But it may be helpful to change the the default tool for repositories with submodules from jgit to command line.
    Mark Waite
    @MarkEWaite
    If the git tool chooser is being used, then it should already exclude JGit if the job enables the submodule options in the plugin. If not, that's a bug in the tool chooser implementation. If the user specifically selected JGit as the implementation, then I believe the plugin honors that choice and reports the exception to the user that it is not implemented for JGit. Did the git tool chooser select JGit with submodules enabled or did you specify JGit as the implementation yourself?
    Zbynek Konecny
    @zbynek

    the console log also contains this:

    The recommended git tool is: jgit

    so it really looks like a bug in the tool chooser.

    Mark Waite
    @MarkEWaite
    Agreed. If submodules are enabled, then the chooser should exclude JGit as a candidate. Be sure that message is not about a pipeline shared library being loaded prior to the full repository.
    Zbynek Konecny
    @zbynek
    it's from the main repository, appears right after (Declarative: Checkout SCM)
    Mark Waite
    @MarkEWaite
    Short term work around is to disable the git plugin performance enhancements from the "Manage Jenkins" -> "Configure System" page in the "Git plugin" section
    Zbynek Konecny
    @zbynek
    Thanks. What also worked for me is checking the "use credentials from parent repo" option.
    Mark Waite
    @MarkEWaite
    That's very strange. Definitely submit a bug report. When you enabled one of the submodule options, it correctly excluded JGit. When you disabled that submodule option but left the submodule option in the job definition, it included JGit as a valid tool choice?
    Zbynek Konecny
    @zbynek
    exactly; I can see parentCredentials and remoteTracking here but nothing related to recursive checkout: https://github.com/jenkinsci/git-client-plugin/blob/master/src/main/java/org/jenkinsci/plugins/gitclient/UnsupportedCommand.java#L160
    Mark Waite
    @MarkEWaite
    Nice catch! Sorry about the bug. Since JGit 5.10 is arriving within the next few weeks, this is a good time to fix that mistake.
    Zbynek Konecny
    @zbynek
    CHANDAN PRAKASH
    @b18050
    @MarkEWaite Please tell me step by step to compile git-plugin locally.
    I have installed IntelliJ IDEA , forked git repo of git-plugin and cloned it locally on my machine. I have also installed maven. How to compile from here?
    Mark Waite
    @MarkEWaite
    @b18050 Use one of the following commands (your choice, depending on your needs):
    $ mvn clean verify # Want to assure that all tests pass locally before starting work
    $ mvn clean -DskipTests install # Want to create a git.hpi that can be installed on Jenkins
    $ mvn clean -DskipTests compile # Want to compile code so that I can start work in the IDE
    $ mvn clean -DskipTests hpi:run # Want to run Jenkins interactively with the plugin installed
    $ mvn clean -Djenkins.version=2.271 hpi:run # Want to run most recent Jenkins weekly with the plugin installed
    CHANDAN PRAKASH
    @b18050
    Thanks @MarkEWaite
    Mark Waite
    @MarkEWaite
    Thanks for asking the question @b18050 . I had expected to point you to the CONTRIBUTING file that should have contained that information. Imagine my shame when I saw that it was not included in that file. I've included it now, thanks to your good question, I've fixed that in the CONTRIBUTING file
    CHANDAN PRAKASH
    @b18050
    @MarkEWaite I am sorry but I am a beginner , just want to know what OS should be preferred for this project. Ubuntu or Windows?
    Mark Waite
    @MarkEWaite
    @b18050 I use both Windows and Linux. I would recommend Linux as first choice (if you have both available) because the tests run faster on Linux than on Windows. Development is faster when the tests run faster. The jobs on ci.jenkins.io run the tests on both Windows and Linux.
    CHANDAN PRAKASH
    @b18050
    @MarkEWaite what should be the best practice to start understanding the codebase.
    Mark Waite
    @MarkEWaite
    @b18050 If you'd like to better understand the lower level code inside git client plugin, then you might work on https://issues.jenkins.io/browse/JENKINS-60940 , converting JUnit 3 tests to JUnit 4. That is likely best done from inside an IDE, performing the transformation and running the new tests in the debugger to watch how they work. If you prefer to work in the git plugin rather than the git client plugin, you could work on on of the 13 "friendly issues" on the git plugin. See https://issues.jenkins.io/secure/Dashboard.jspa?selectPageId=19342
    If you're feeling interested in learning by exploring plugin functionality in Jenkins Pipeline, you could take my add-symbols branch https://github.com/MarkEWaite/git-plugin/tree/add-symbols, review it, run its tests in a debugger, and watch how the tests behave. Then you could explore the behaviors of that change when used with the "Pipeline syntax" link that is on each pipeline job page in Jenkins. The syntax should no longer include references to $class when that pull request is ready
    CHANDAN PRAKASH
    @b18050
    @MarkEWaite Thanks, as per your suggestion, I will try to explore step by step.
    Mark Waite
    @MarkEWaite
    Another way to learn more about the code is to evaluate existing pull requests. https://github.com/jenkinsci/git-plugin/pull/930/files is a good pull request to evaluate with interesting areas to explore
    Mark Waite
    @MarkEWaite
    I've submitted a fix for JENKINS-64382 - JGit incorrectly used to clone job with submodule option enabled. Would love to have a review from @rishabhBudhouliya or @zbynek . I'll wait up to 24 hours for the review, then will merge. New automated tests fail without the fix and pass with the fix.
    Mark Waite
    @MarkEWaite
    I've also confirmed with interactive testing that I can duplicate the problem in the code before the fix and the code after the fix does not have the problem.
    Zbynek Konecny
    @zbynek
    Thanks, Mark! I didn't test interactively yet but the code looks good. If you think this needs more interactive testing before release I can try it in the coming days.
    Mark Waite
    @MarkEWaite
    image.png
    I think we're ready to release it. The draft changelog for git plugin 4.5.1 looks reasonable enough to me to justify a release.
    Mark Waite
    @MarkEWaite
    Git plugin 4.5.1 has been released with the fix @zbynek . Git client plugin 3.6.0 was released with JGit 5.10.0 about a week ago.