[JENKINS-41516] Add script console listener#7056
[JENKINS-41516] Add script console listener#7056NotMyFault merged 47 commits intojenkinsci:masterfrom
Conversation
…com/meiswjn/jenkins into feature/add-script-console-listener
Co-authored-by: Wadeck Follonier <Wadeck@users.noreply.github.com>
…com/meiswjn/jenkins into feature/add-script-console-listener
|
One more reviewer! :) |
NotMyFault
left a comment
There was a problem hiding this comment.
Tagging the reviewers that approved the previous PR #6539: NotMyFault @res0nance timja StefanSpieker
My humble apology, I must have missed this PR :(
|
No worries, thanks for the approval! Looking forward to the release 🚀 |
|
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
|
The tests added in this PR cause failures in the default branch for Windows agents: https://ci.jenkins.io/job/Core/job/jenkins/job/master/5460/testReport/jenkins.model/ Would you mind taking a look and think you can submit a fixup before next Tuesday? Otherwise, I'd revert the merge to restore the test functionality and not break the weekly release. |
|
@NotMyFault Any idea why CI passed for this PR? |
|
Line 109 in 778b8b6 So we're running every test on Linux 3 times (11, 17, and 19), but less than a third of tests on Windows? |
|
How do I even confirm a fix PR will work, if this just skips execution of the test I'm fixing? (Also, seems like a clear bug to not execute new tests.) |
But that's only used for the launchable part, isn't it Lines 113 to 116 in 778b8b6
To be fair, it passed at the end of July, I could've updated this PR before integrating it into master. |
Unsure what you mean. https://ci.jenkins.io/job/Core/job/jenkins/job/PR-7056/12/consoleFull did not run the new test on Windows, just three times on Linux. See https://ci.jenkins.io/job/Core/job/jenkins/job/PR-7056/12/execution/node/273/log/?consoleFull for the Windows output specifically. |
cc @basil if you have any input on the above ^^ |
Given that it's being executed in an unrelated PR now, this comment is probably obsolete. |
|
Thanks for reporting the issue. Launchable was enabled months ago to reduce the cost of pull request evaluation. Launchable uses results from previous tests to define a subset of Windows tests that will execute in roughly the same amount of time as the Linux builds require. The full set of Windows tests are run on the master branch after the pull request is merged. This is the first time since Launchable was enabled that we've had a test failure "escape" from a pull request merge and reach the master branch. I think that the cost savings from limiting Windows tests to approximately one hour (instead of the four hours required on the main branch) are worth this type of rare event. I agree that the test selection algorithm used by Launchable should add all new tests to the list of tests that it runs. We'll need to report that to them, since others will likely want the same thing. When there is no test result data for a test, add it to the executed set of tests. |
I've reported the issue to Launchable support and copied Kohsuke on the report so that he's aware. Thanks again for detecting the issue! |
| * {@link java.io.Writer} that calls {@link #fireScriptOutput(String, Object, Object, String, hudson.model.User)} with the | ||
| * output it writes to the wrapped {@link java.io.Writer}, and otherwise just forwards {@link #flush()} and {@link #close()}. | ||
| */ | ||
| class ListenerWriter extends Writer { |
There was a problem hiding this comment.
This is implicitly public. If you did you not mean for this to be part of the API, use @Restricted(NoExternalUse.class). Ditto other members of the interface.
There was a problem hiding this comment.
Could go either way. Realistically there are few (possibly none) possible callers of #fire… methods outside core (that possibly could want this), so it might be better to start off @Restricted and open up if necessary.
| /** | ||
| * Basic default implementation of {@link jenkins.util.ScriptListener} that just logs. | ||
| * | ||
| * @since TODO |
There was a problem hiding this comment.
Should be omitted because it is not part of the API anyway.
There was a problem hiding this comment.
I like it to quickly see when a feature was added. While I could get there via git blame, given the negligible cost, this is reasonable to have IMO.
|
Causes JENKINS-72181. |
Alternative to #6539 (but might still get reintegrated there) by @meiswjn, for now just to get a PR build/incremental deployment.
See JENKINS-41516.
Minor secondary TODOs:
DefaultScriptListenerexists)Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entriessection only if there are breaking changes or other changes which may require extra steps from users during the upgrade@Restrictedor have@since TODOJavadoc, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO")if applicable.evalto ease future introduction of Content-Security-Policy directives (see documentation on jenkins.io).Desired reviewers
@mention
Maintainer checklist
Before the changes are marked as
ready-for-merge:Proposed changelog entriesare accurate, human-readable, and in the imperative moodupgrade-guide-neededlabel is set and there is aProposed upgrade guidelinessection in the PR title. (example)lts-candidateto be considered (see query).