-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
[JENKINS-54532] Document how to get parameters from a Run #3724
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
Changes from all commits
c6a4b46
075f462
4c6fdd6
ae778a1
cdcb613
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -143,8 +143,16 @@ | |||||
| * a custom {@link Job} type, so there's no separate registration | ||||||
| * mechanism for custom {@link Run} types. | ||||||
| * | ||||||
| * Many details of a run are contained in {@link Action} instances | ||||||
| * accessible via {@link Actionable#getAllActions} and {@link #getAction(Class)}. | ||||||
| * For example, build access to build parameters is obtained with | ||||||
| * <code>run.getAction(hudson.model.ParametersAction.class)</code> to | ||||||
| * get the build's {@link ParametersAction} object. | ||||||
| * | ||||||
| * @author Kohsuke Kawaguchi | ||||||
| * @see RunListener | ||||||
| * @see Job | ||||||
| * @see Action | ||||||
| */ | ||||||
| @ExportedBean | ||||||
| public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,RunT>> | ||||||
|
|
@@ -1441,7 +1449,9 @@ public Collection<Fingerprint> getBuildFingerprints() { | |||||
|
|
||||||
| /** | ||||||
| * Returns an input stream that reads from the log file. | ||||||
| * It will use a gzip-compressed log file (log.gz) if that exists. | ||||||
| * | ||||||
| * It will use a gzip-compressed log file (log.gz) if that exists, decompressing | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| * it on the fly to return the uncompressed data. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a fan of this being documented in the API (strictly speaking, this means JEP-210 is invalid), but at least this PR doesn't add it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah to complement #3963 I would suggest simply deleting this sentence. How or where the log text is stored is a matter of no concern to the caller of this method, and for Pipeline there is no built-in gzip support (this implementation is not used).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1, also this would become wrong indeed if we ended up merging #3966
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing it at all since there is a consensus. Not much related to the PR anyway
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| * | ||||||
| * @throws IOException | ||||||
| * @return An input stream from the log file. | ||||||
|
|
@@ -1469,6 +1479,14 @@ public Collection<Fingerprint> getBuildFingerprints() { | |||||
| return new ByteArrayInputStream(charset != null ? message.getBytes(charset) : message.getBytes()); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Returns a Reader that reads from the log file. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Stating the return type of a method (and without |
||||||
| * | ||||||
| * This is the simplest way to access the job's console log. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well…not necessarily. Depends on what you wanted to accomplish. For example, this will contain raw console notes, which might be unwanted in some contexts.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, we should not be doing arguable suggestions, especially if we return to JEP-207
Suggested change
|
||||||
| * | ||||||
| * @throws IOException Log access error | ||||||
| * @return Character-oriented log file stream as a Reader | ||||||
| */ | ||||||
| public @Nonnull Reader getLogReader() throws IOException { | ||||||
| if (charset==null) return new InputStreamReader(getLogInputStream()); | ||||||
| else return new InputStreamReader(getLogInputStream(),charset); | ||||||
|
|
||||||
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.