Skip to content

Conversation

@rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Jan 29, 2026

This is to allow anyone to run the Jenkins build using any images they want.

This is to allow anyone to run the Jenkins build using any images they want.
Copilot AI review requested due to automatic review settings January 29, 2026 13:51
@github-actions
Copy link

Copyright Validation Results
Total: 1 | Passed: 0 | Failed: 0 | Skipped: 1 | at: 2026-01-29 13:51:39 UTC | commit: 29157dc

⏭️ Skipped (Excluded) Files

  • Jenkinsfile

✅ All files have valid copyright headers!

Copy link

Copilot AI left a 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_TAGS to 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.')
Copy link

Copilot AI Jan 29, 2026

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.'

Suggested change
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.')

Copilot uses AI. Check for mistakes.

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.')
Copy link

Copilot AI Jan 29, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +178 to +184
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(':', '-')}"
Copy link

Copilot AI Jan 29, 2026

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.

Suggested change
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(':', '-')}"

Copilot uses AI. Check for mistakes.

imageTags.each { tag ->
def fullImage = imagePrefix + tag.trim()
def stageName = "regressions-${tag.trim().replace(':', '-')}"
Copy link

Copilot AI Jan 29, 2026

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.

Suggested change
def stageName = "regressions-${tag.trim().replace(':', '-')}"
def stageName = "regressions-${tag.trim().replaceAll('[^A-Za-z0-9_.-]', '-')}"

Copilot uses AI. Check for mistakes.
@rjrudin rjrudin merged commit 884f846 into develop Jan 29, 2026
4 checks passed
@rjrudin rjrudin deleted the feature/jenkins branch January 29, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants