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

Persist ReplayFlowFactoryAction#sandbox #968

Merged

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Jan 6, 2025

In CBCI HA scenarios, the Queue.Item (and its actions) can be rescheduled in another Jenkins replica. In such case it is required to persist the sandbox field, otherwise the reschedule will run without sandbox.

In a regular OSS Jenkins, you can hit the problem is you disable concurrent build execution and arrange for a build to be queued, then restart the controller, as demonstrated in the provided test.

Testing done

Tested in CBCI HA context.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

In CBCI HA scenarios, the Queue.Item (and its actions) can be rescheduled in another Jenkins replica. In such case it is required to persist the `sandbox` field, otherwise the reschedule will run without sandbox.
@Vlatombe Vlatombe requested a review from a team as a code owner January 6, 2025 09:48
@Vlatombe Vlatombe changed the title Persist ReplayFlowFactoryAction#sandbox Persist ReplayFlowFactoryAction#sandbox Jan 6, 2025
@@ -52,7 +52,7 @@ class ReplayFlowFactoryAction extends InvisibleAction implements CpsFlowFactoryA

private String replacementMainScript;
private final Map<String,String> replacementLoadedScripts;
private transient final boolean sandbox;
private final boolean sandbox;
Copy link
Member Author

Choose a reason for hiding this comment

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

Could avoid persisting it in build.xml as well, though unlike replacementMainScript the size impact is negligible.

@Vlatombe Vlatombe marked this pull request as draft January 6, 2025 13:12
@Vlatombe Vlatombe marked this pull request as ready for review January 6, 2025 13:51
@jglick jglick added the bug label Jan 6, 2025
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Looks good, other than questions about test style. Current Windows failures look like flakes.

@jglick jglick enabled auto-merge January 6, 2025 14:49
@jglick jglick merged commit d705fc7 into jenkinsci:master Jan 6, 2025
17 checks passed
@Vlatombe Vlatombe deleted the replayflowfactoryaction-sandbox-persistent branch January 6, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants