-
Notifications
You must be signed in to change notification settings - Fork 83
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 #78
Conversation
36ea4c3
to
acbaed5
Compare
@bitwiseman Could you have a look? Thanks by advance |
@tgatinea Does this have downstream changes in the |
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.
I'm also wondering if some other methods need to be deprecated?
* @throws InterruptedException if the attempt to create a {@link SCMFileSystem} was interrupted. | ||
*/ | ||
@CheckForNull | ||
public static SCMFileSystem of(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) |
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.
Ah, so there's an Item owner
version of this and Run build
version.
It looks like most of this method is identical to Run build
version. Would it make sense to have a common private method that they call into that calls the appropriate b.build()
depending on type?
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.
I tried to think of a good way to try and deduplicate this code without much success as both supports
and builder.build
has multiple implementations.
Yes Run
does implement Item
however I am unsure how to the write method to deduplicate.
as supports
has several more implementations and of
also includes SCMSource.class, SCMHead.class
@bitwiseman I made no change on the I introduce the new "public SCMFileSystem build(@nonnull Run build, ..." and "public static SCMFileSystem of(@nonnull Run build,..." because of the "lightweight checkout" functionality does not work if parameters are set into the SCM configuration (e.g. ${GERRIT_REFSPEC} in the refspec). I use the SCM git, that's where I have coded the evaluation of the environment parameters (See git-plugin: jenkinsci/git-plugin#772) As I have added new method to the class, I guess that I don't have any impact on |
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.
The overall idea of the change seems ok, but right now there is a breaking change, which is not ok for a widely-used plugin like this.
@tgatinea not sure whether your still active or if you would prefer if I opened a new PR to the main repo. |
@jetersen I'm not familiar with the process to deliver into master branch. |
No, now we play the waiting game once again 😅 |
@dwnusbaum @bitwiseman any chance we can land this to get the ball going? |
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.
Current state looks good to me, and I glanced at the downstream PRs that use the new API and they look fine conceptually as well. Do the consumer or implementation guides need to be updated? I didn't see anything obvious, but would be good to double-check. Would it be useful to add tests here for any of the new methods? I checked for existing tests that exercise SCMFileSystem.build
or SCMFileSystem.of
but did not see any, but maybe could be useful to at least test that SCMFileSystem.build(Run, ...)
uses SCMFileSystem.build(Item, ...)
as a default implementation.
This is useful and I am interested in this, is anyone planning on moving this forward? |
@jetersen, Today, I have installed latest plugin version, and the problem is back ...
can you give me more information/status about this "old" ticket ? |
Is this related to #160? |
Yes @jglick |
I think this is irrelevant now that #160 has been merged, so I am closing it. |
JENKINS-48431 To support both lightweight checkout AND build parameters, we need to:
This leads to implement a new method :
This new method offer the capacity to recover the environments parameter of the build as the current build is propagated through the new method.
Note that this modification is in relation with two other pull requests that concerns: