-
Notifications
You must be signed in to change notification settings - Fork 52
MLE-26079 Trying to dynamically define regression stages #1055
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
Conversation
This is to allow anyone to run the Jenkins build using any images they want.
|
Copyright Validation Results ⏭️ Skipped (Excluded) Files
✅ All files have valid copyright headers! |
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.
Pull request overview
This PR refactors the Jenkins pipeline to dynamically generate regression test stages based on configurable MarkLogic image tags, replacing the previous hardcoded parallel stages for versions 10, 11, and 12.
Changes:
- Introduced a new pipeline parameter
MARKLOGIC_IMAGE_TAGSto allow users to specify MarkLogic image tags at build time - Replaced three static regression test stages with a dynamic stage generation approach that iterates over the provided image tags
- Consolidated duplicate test execution logic into a single reusable pattern
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| parameters { | ||
| booleanParam(name: 'regressions', defaultValue: false, description: 'indicator if build is for regressions') | ||
| string(name: 'MARKLOGIC_IMAGE_TAGS', defaultValue: 'marklogic-server-ubi:latest-11,marklogic-server-ubi:latest-12', description: 'Comma-delimited list of MarkLogic image tags including variant (e.g., marklogic-server-ubi:latest-11,marklogic-server-ubi-rootless:11.3.2). The registry/org (ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic) path will be prepended automatically.') |
Copilot
AI
Jan 29, 2026
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.
The parameter description is lengthy and may be truncated in the Jenkins UI. Consider moving the detailed explanation to pipeline documentation and keeping the description concise, such as: 'Comma-delimited list of MarkLogic image tags (e.g., marklogic-server-ubi:latest-11). Registry path is prepended automatically.'
| string(name: 'MARKLOGIC_IMAGE_TAGS', defaultValue: 'marklogic-server-ubi:latest-11,marklogic-server-ubi:latest-12', description: 'Comma-delimited list of MarkLogic image tags including variant (e.g., marklogic-server-ubi:latest-11,marklogic-server-ubi-rootless:11.3.2). The registry/org (ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic) path will be prepended automatically.') | |
| string(name: 'MARKLOGIC_IMAGE_TAGS', defaultValue: 'marklogic-server-ubi:latest-11,marklogic-server-ubi:latest-12', description: 'Comma-delimited list of MarkLogic image tags (e.g., marklogic-server-ubi:latest-11). Registry path is prepended automatically.') |
|
|
||
| parameters { | ||
| booleanParam(name: 'regressions', defaultValue: false, description: 'indicator if build is for regressions') | ||
| string(name: 'MARKLOGIC_IMAGE_TAGS', defaultValue: 'marklogic-server-ubi:latest-11,marklogic-server-ubi:latest-12', description: 'Comma-delimited list of MarkLogic image tags including variant (e.g., marklogic-server-ubi:latest-11,marklogic-server-ubi-rootless:11.3.2). The registry/org (ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic) path will be prepended automatically.') |
Copilot
AI
Jan 29, 2026
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.
The default value excludes latest-10 which was previously tested in the removed 'runtests-10-nightly' stage. If version 10 testing is still required, consider including 'marklogic-server-ubi:latest-10' in the default value or document why it was intentionally removed.
| def imageTags = params.MARKLOGIC_IMAGE_TAGS.split(',') | ||
| def imagePrefix = 'ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/' | ||
| def parallelStages = [:] | ||
|
|
||
| imageTags.each { tag -> | ||
| def fullImage = imagePrefix + tag.trim() | ||
| def stageName = "regressions-${tag.trim().replace(':', '-')}" |
Copilot
AI
Jan 29, 2026
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 the MARKLOGIC_IMAGE_TAGS parameter is empty or contains only whitespace, split(',') will return an array with an empty string, causing the pipeline to create an invalid stage. Add validation to check if the parameter is empty or only contains whitespace before processing.
| def imageTags = params.MARKLOGIC_IMAGE_TAGS.split(',') | |
| def imagePrefix = 'ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/' | |
| def parallelStages = [:] | |
| imageTags.each { tag -> | |
| def fullImage = imagePrefix + tag.trim() | |
| def stageName = "regressions-${tag.trim().replace(':', '-')}" | |
| def imageTagsParam = params.MARKLOGIC_IMAGE_TAGS | |
| if (!imageTagsParam || imageTagsParam.trim().isEmpty()) { | |
| error "MARKLOGIC_IMAGE_TAGS parameter must not be empty or whitespace-only when running regressions." | |
| } | |
| def imageTags = imageTagsParam | |
| .split(',') | |
| .collect { it.trim() } | |
| .findAll { it } | |
| if (imageTags.isEmpty()) { | |
| error "No valid image tags were found in MARKLOGIC_IMAGE_TAGS after processing. Please provide at least one non-empty, comma-separated tag." | |
| } | |
| def imagePrefix = 'ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/' | |
| def parallelStages = [:] | |
| imageTags.each { tag -> | |
| def fullImage = imagePrefix + tag | |
| def stageName = "regressions-${tag.replace(':', '-')}" |
|
|
||
| imageTags.each { tag -> | ||
| def fullImage = imagePrefix + tag.trim() | ||
| def stageName = "regressions-${tag.trim().replace(':', '-')}" |
Copilot
AI
Jan 29, 2026
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.
The stage name generation replaces colons with hyphens but doesn't handle other potentially problematic characters that might appear in image tags (e.g., slashes, special characters). Consider using a more robust sanitization approach or documenting the expected format constraints for the image tags.
| def stageName = "regressions-${tag.trim().replace(':', '-')}" | |
| def stageName = "regressions-${tag.trim().replaceAll('[^A-Za-z0-9_.-]', '-')}" |
This is to allow anyone to run the Jenkins build using any images they want.