-
Notifications
You must be signed in to change notification settings - Fork 53
MLE-24230 Added wait function #1003
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
|
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 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 |
Copilot
AI
Oct 20, 2025
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending the current develop branch build.
|
Going to reopen this |
Using new ml-gradle task