-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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-48431 Support both lightweight checkout AND build parameters #772
Conversation
@MarkEWaite I'm familiar with delivering plugins that gets dependencies. |
You don't need to wait until the end of pull request jenkinsci/scm-api-plugin#78 before receiving feedback on the git plugin code. A reviewer could provide feedback based on the combination of pull requests. I have limited time for review of pull requests and many other pull requests that I consider higher priority than your request to support lightweight checkout and build parameters. I will not review your pull request for a long time. Top themes that I've prioritized include:
Other maintainers may have different priorities and different objectives. You're certainly welcome to check with @rsandell and @fcojfernandez on their priorities. |
@tgatinea were you able to generate plugin with this change? Do you have a private .hpi file to share with? I too waiting for this bug fix. I tried building these three plugins locally and generated plugins. They seems to be not working. Looks like git client is crashing inspite of downgrading it to desired version. java.lang.NullPointerException |
@hkrpavan Were you able to recompile the 3 plugins :
When I'll have time I will move to the last versions and push my code |
@tgatinea , Thanks for the reply. I could able to build these plugins (git-plugin stable-3.x) with your patch and make it working. This works good with declarative pipelines. Now i bumped into https://issues.jenkins-ci.org/browse/JENKINS-56943, though a different problem altogether. This too is part of light weight checkout while pulling resource file after Jenkinsfile pull. Something like below in jenkinsfile, agent { Started by user |
@hkrpavan I have found why git-plugin does not compile anymore. The spotbugs "mvn spotbugs:gui" complain that refspec cannot be null because String.trim() cannot be with a String null. Now, if I code something like: Then it compiles because "refspec = environment.expand(config.getRefspec())" can be null. |
@tgatinea Thank you, i could able to build git-plugin with your latest changes from top if master branch. Also, i could able to resolve my other issue by updating workflow-multibranch-plugin to point to your SCMFileSystem method. Now i could able to resolve Kubernetes resource file pull issue. |
@hkrpavan : so, let's vote and contribute both changes :-) |
I have expanded the changes to include GitSCMTelescope and GitSCMFileSystem and removed the duplication :) |
@vpod @hkrpavan |
FYI I just deployed all the bits to our production server 💪 and our job passed successfully. #898 (comment) |
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.
Hi @tgatinea ! thanks for the PR. First, you're overriding some default behaviours, so it'd be nice to have some unitary testing.
Superseded by #898 |
JENKINS-48431 Support both lightweight checkout AND build parameters
To support both lightweight checkout AND build parameters, we need to:
This leads to implement a new method into scm-api-plugin:
public static SCMFileSystem of(@nonnull Run build, @nonnull SCM scm, @checkfornull SCMRevision rev)
And it leads to implement:
public SCMFileSystem build(@nonnull Run build, @nonnull SCM scm, @checkfornull SCMRevision rev)
This method recovers from the current build the environment parameters and evaluate the SCM structure with the environment parameters.
It also does a git fetch with the refspec if the refspec is set in SCM.
It also take into account the case of a gerrit trigger with:
This is done between lines 360 to 369
Note that this modification is in relation with two other pull requests that concerns:
Note that this pull request will not work if the pull request for scm-api-plugin is not valdated
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code. If a checkbox or line does not apply to this pull request, delete it. We prefer all checkboxes to be checked before a pull request is merged=> I have tested my changes though workflow-cps-plugin under hpi
=> This pull request depends closely to the scm-api-plugin
Types of changes
What types of changes does your code introduce? Put an
x
in the boxes that apply. Delete the items in the list that do not applyFurther comments
If this is a relatively large or complex change, start the discussion by explaining why you chose the solution you did and what alternatives you considered.