Skip to content
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

Label parsing robustness fix #8448

Merged
merged 6 commits into from
Sep 2, 2023

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Aug 31, 2023

Amends #8395

In case an extension of Slave overrides readResolve but does not call its super implementation, this
recover from it, and issue a warning to raise a bug against the impacted plugin.

See JENKINS-XXXXX.

Testing done

Proposed changelog entries

  • Prevent incorrect readResolve implementations from breaking agent label parsing.

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

… its super implementation

recover from it, and issue a warning to raise a bug against the impacted plugin.
@Vlatombe Vlatombe added the bug For changelog: Minor bug. Will be listed after features label Aug 31, 2023
@Vlatombe Vlatombe added major-bug For changelog: Major bug. Will be highlighted on the top of the changelog and removed bug For changelog: Minor bug. Will be listed after features labels Aug 31, 2023
@Vlatombe Vlatombe requested a review from a team August 31, 2023 11:45
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
@daniel-beck daniel-beck added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Aug 31, 2023
Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional feedback for consideration:

diff --git a/test/src/test/java/jenkins/model/NodesRestartTest.java b/test/src/test/java/jenkins/model/NodesRestartTest.java
index 837bed98d7..707fd4c649 100644
--- a/test/src/test/java/jenkins/model/NodesRestartTest.java
+++ b/test/src/test/java/jenkins/model/NodesRestartTest.java
@@ -18,8 +18,8 @@ public class NodesRestartTest {
     public RestartableJenkinsRule s = new RestartableJenkinsRule();
 
     // The point of this implementation is to override readResolve so that Slave#readResolve doesn't get called.
-    public static class DummyDumbSlave extends Slave {
-        public DummyDumbSlave(@NonNull String name, String remoteFS, ComputerLauncher launcher) throws Descriptor.FormException, IOException {
+    public static class DummyAgent extends Slave {
+        public DummyAgent(@NonNull String name, String remoteFS, ComputerLauncher launcher) throws Descriptor.FormException, IOException {
             super(name, remoteFS, launcher);
         }
 
@@ -33,7 +33,7 @@ public class NodesRestartTest {
     public void checkNodeRestart() throws Exception {
         s.then(r -> {
             assertThat(r.jenkins.getNodes(), hasSize(0));
-            var node = new DummyDumbSlave("my-node", "temp", r.createComputerLauncher(null));
+            var node = new DummyAgent("my-node", "temp", r.createComputerLauncher(null));
             r.jenkins.addNode(node);
             assertThat(r.jenkins.getNodes(), hasSize(1));
         });

@Vlatombe
Copy link
Member Author

Vlatombe commented Sep 1, 2023

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

@Vlatombe Vlatombe added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Sep 1, 2023
@Vlatombe Vlatombe merged commit e79ac42 into jenkinsci:master Sep 2, 2023
18 checks passed
@Vlatombe Vlatombe deleted the labelAtomSet-robustness branch September 8, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-bug For changelog: Major bug. Will be highlighted on the top of the changelog ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback regression-fix Pull request that fixes a regression in one of the previous Jenkins releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants