Skip to content

Conversation

rjdew-progress
Copy link
Collaborator

Description

Patch 5.8.1 mlRunIngest transform for MarkLogic 12.

Checklist:

- Note: do not change the below

Copy link

@Copilot 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 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";
Copy link
Preview

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copilot uses AI. Check for mistakes.

uri: context.uri,
value: content,
context: {
permissions: hubUtils.parsePermissions(options.permissions)
Copy link
Preview

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding input validation to ensure that hubUtils.parsePermissions() can handle the permissions string format properly, as malformed permission strings could cause runtime errors.

Copilot uses AI. Check for mistakes.

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.

1 participant