-
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
Expose invoke
method & required interface for downstream plugins
#520
Conversation
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.
In making public, need javadocs with guidelines on acceptable usage
@@ -211,7 +211,7 @@ public boolean changesSince(@CheckForNull SCMRevision revision, @NonNull OutputS | |||
} | |||
} | |||
|
|||
/*package*/ interface FSFunction<V> { | |||
public interface FSFunction<V> { |
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.
If making public we should provide clear guidelines in javadocs
@@ -147,7 +147,7 @@ public SCMFile getRoot() { | |||
return commitId; | |||
} | |||
|
|||
/*package*/ <V> V invoke(final FSFunction<V> function) throws IOException, InterruptedException { | |||
public <V> V invoke(final FSFunction<V> function) throws IOException, InterruptedException { |
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.
Javadocs
@stephenc done |
Javadocs LGTM and lovingly documented 🐝 |
How does this pull request interact with #502 which seems to also be using the GitSCMFileSystem cache? |
@MarkEWaite this is just exposing a way to get access to the git cache, should not have any impact on #502 either way |
But I thought that #502 extends the locking concept for the GitSCMFileSystem cache. Won't your calls through invoke() need to honor those same locks? |
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@MarkEWaite that's the whole point... calls through |
@MarkEWaite again, that's the whole point: |
* @param <V> return type | ||
* @param function callback executed with a locked repository | ||
* @return something | ||
* @throws IOException |
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.
Java 8's javadocs will blow up for missing reasons on the exception
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.
just change to
@throws IOException if there is an I/O error
@throws InterruptedException if interrupted
LGTM (apart from the java8 javadoc error for missing reason in the |
@MarkEWaite @stephenc done |
Minor change to allow downstream plugins to access repository cache in a synchronous manner with appropriate locks.
This is necessary for enabling efficient and hopefully Jenkins-accurate git read/write in blueocean
@reviewbybees esp. @stephenc