Conversation
|
Copyright Validation Results ⏭️ Skipped (Excluded) Files
✅ All files have valid copyright headers! |
There was a problem hiding this comment.
Pull Request Overview
This PR replaces a fixed 90-second sleep with a dynamic wait function that polls MarkLogic's readiness endpoint, allowing the pipeline to proceed as soon as MarkLogic is ready (up to 2 minutes maximum). The change reduces unnecessary wait time while providing better visibility through request logging.
Key changes:
- Removed fixed 90-second sleep after Docker Compose startup
- Added
waitUntilMarkLogicIsReady()function that polls the/v1/pingendpoint with 5-second intervals - Applied the wait function to all four pipeline stages (ML 12 main, ML 11, ML 12 nightly, ML 10 nightly)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Jenkinsfile
Outdated
| script { | ||
| timeout(time: 120, unit: 'SECONDS') { | ||
| waitUntil(initialRecurrencePeriod: 5000) { | ||
| try { | ||
| sh 'echo "Checking if MarkLogic is ready..."' | ||
| sh 'curl -i --anyauth --user admin:admin -X GET http://localhost:8000/v1/ping' | ||
| return true | ||
| } catch(exception){ | ||
| return false |
There was a problem hiding this comment.
Hardcoded credentials 'admin:admin' are exposed in plain text. Consider using Jenkins credentials binding to securely inject authentication credentials.
| script { | |
| timeout(time: 120, unit: 'SECONDS') { | |
| waitUntil(initialRecurrencePeriod: 5000) { | |
| try { | |
| sh 'echo "Checking if MarkLogic is ready..."' | |
| sh 'curl -i --anyauth --user admin:admin -X GET http://localhost:8000/v1/ping' | |
| return true | |
| } catch(exception){ | |
| return false | |
| withCredentials([usernamePassword(credentialsId: 'ml-admin-credentials', usernameVariable: 'ML_USERNAME', passwordVariable: 'ML_PASSWORD')]) { | |
| script { | |
| timeout(time: 120, unit: 'SECONDS') { | |
| waitUntil(initialRecurrencePeriod: 5000) { | |
| try { | |
| sh 'echo "Checking if MarkLogic is ready..."' | |
| sh 'curl -i --anyauth --user ${ML_USERNAME}:${ML_PASSWORD} -X GET http://localhost:8000/v1/ping' | |
| return true | |
| } catch(exception){ | |
| return false | |
| } |
ce728af to
9e6ccf6
Compare
|
@SameeraPriyathamTadikonda Does this look okay? I took your function from the ragplus repository and modified to look for a 204 No Content. |
stevebio
left a comment
There was a problem hiding this comment.
think this is much better.
c8715c4 to
2e42fb9
Compare
Using new ml-gradle task
2e42fb9 to
fa34941
Compare
BillFarber
left a comment
There was a problem hiding this comment.
Pending the current develop branch build.
|
Going to reopen this |
Using new ml-gradle task