MLE-23043: 5.8.1 patch for MarkLogic 12#8027
Open
rjdew-progress wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR applies a patch to the MarkLogic Data Hub mlRunIngest transform for MarkLogic 12 compatibility. The patch includes several improvements to the ingest process including permission handling, code structure, and error handling.
- Adds proper permission handling with default permissions and parsing
- Restructures content object creation with improved formatting
- Simplifies conditional logic in the error handling section
|
|
||
| let jobId = params["job-id"]; | ||
| let options = params.options ? JSON.parse(params.options) : {}; | ||
| options.permissions = options.permissions || "data-hub-common,read,data-hub-common,update"; |
There was a problem hiding this comment.
The hardcoded permission string should be extracted to a constant or configuration to improve maintainability and make it easier to change permissions across the codebase.
Suggested change
| options.permissions = options.permissions || "data-hub-common,read,data-hub-common,update"; | |
| options.permissions = options.permissions || DEFAULT_PERMISSIONS; |
| uri: context.uri, | ||
| value: content, | ||
| context: { | ||
| permissions: hubUtils.parsePermissions(options.permissions) |
There was a problem hiding this comment.
Consider adding input validation to ensure that hubUtils.parsePermissions() can handle the permissions string format properly, as malformed permission strings could cause runtime errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Patch 5.8.1 mlRunIngest transform for MarkLogic 12.
Checklist:
- Note: do not change the below