Skip to content

HPCDATAMGM-2165: Create a task to populate system or user metadata#150

Open
dinhys wants to merge 13 commits intoreleases/3.24.0from
features/HPCDATAMGM-2165
Open

HPCDATAMGM-2165: Create a task to populate system or user metadata#150
dinhys wants to merge 13 commits intoreleases/3.24.0from
features/HPCDATAMGM-2165

Conversation

@dinhys
Copy link
Collaborator

@dinhys dinhys commented Mar 3, 2026

Added a new migration scheduled task to add staged metadata attribute/values to a collection or data object path specified.
The metadata to be populated will be staged in hpc_staged_metadata_attributes table, and moves to hpc_migrated_metadata_attributes table once the scheduled task completes processing it. The metadata before and after the update is recorded into hpc_data_management_audit table.
Additional change made to pass a boolean flag, allowSystemMetadata for updating the metadata into the metadata validator to allow updates of system generated metadata.

Copilot AI review requested due to automatic review settings March 3, 2026 15:51
Copy link
Contributor

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 introduces a new scheduled migration task for applying “staged” metadata (stored in hpc_staged_metadata_attributes) onto iRODS collections/data objects, auditing the before/after metadata, and then moving processed rows to hpc_migrated_metadata_attributes. It also extends metadata validation to optionally allow updating reserved system-generated metadata attributes.

Changes:

  • Add a new migration scheduler cron + task entrypoint to process staged metadata attributes.
  • Add DAO/service plumbing and Oracle tables to read staged metadata rows and move them to a “migrated” table after processing.
  • Extend HpcMetadataValidator / HpcMetadataService APIs with an allowSystemMetadata flag.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/hpc-server/hpc-scheduler-migration/.../hpc-scheduler-migration.properties Adds cron expression for the new staged-metadata scheduled task.
src/hpc-server/hpc-scheduler-migration/.../HpcScheduledTasksImpl.java Adds a new @Scheduled method to invoke staged-metadata processing.
src/hpc-server/hpc-domain-model/.../HpcDataMigration.xsd Adds HpcStagedMetadataAttribute complex type for domain model generation.
src/hpc-server/hpc-dao-impl/.../hpc_staged_metadata_attributes.sql Creates hpc_staged_metadata_attributes and hpc_migrated_metadata_attributes tables.
src/hpc-server/hpc-dao-impl/.../HpcDataMigrationDAOImpl.java Adds queries/mappers to fetch staged metadata and move/delete rows after processing.
src/hpc-server/hpc-dao-api/.../HpcDataMigrationDAO.java Adds DAO API for staged metadata fetch/cleanup.
src/hpc-server/hpc-bus-service-impl/.../HpcDataMigrationBusServiceImpl.java Adds business logic to apply staged metadata to collection/data objects and cleanup.
src/hpc-server/hpc-bus-service-impl/.../HpcDataManagementBusServiceImpl.java Updates calls to metadata update APIs to pass the new boolean flag.
src/hpc-server/hpc-bus-service-api/.../HpcDataMigrationBusService.java Adds new bus-service API method for staged metadata processing.
src/hpc-server/hpc-app-service-impl/.../HpcMetadataValidator.java Adds allowSystemMetadata parameter and adjusts validation behavior.
src/hpc-server/hpc-app-service-impl/.../HpcMetadataServiceImpl.java Threads allowSystemMetadata through collection/data-object metadata updates.
src/hpc-server/hpc-app-service-impl/.../HpcDataMigrationServiceImpl.java Adds service methods to fetch/apply/cleanup staged metadata entries + audit.
src/hpc-server/hpc-app-service-api/.../HpcMetadataService.java Updates metadata service API signatures with allowSystemMetadata.
src/hpc-server/hpc-app-service-api/.../HpcDataMigrationService.java Adds new migration service API methods for staged metadata processing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dinhys and others added 4 commits March 3, 2026 11:00
…hpc/service/impl/HpcDataMigrationServiceImpl.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…hpc/bus/impl/HpcDataMigrationBusServiceImpl.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…hpc/service/impl/HpcDataMigrationServiceImpl.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Mar 3, 2026

@dinhys I've opened a new pull request, #151, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 3, 2026 16:08
Co-authored-by: dinhys <31490208+dinhys@users.noreply.github.com>
Wrap cleanupStagedMetadataAttribute in a transaction
Copy link
Contributor

Copilot AI commented Mar 3, 2026

@dinhys I've opened a new pull request, #152, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Mar 3, 2026

@dinhys I've opened a new pull request, #153, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits March 3, 2026 16:39
…allowSystemMetadata is true

Co-authored-by: dinhys <31490208+dinhys@users.noreply.github.com>
Fix: enforce restrictMetadata for non-system attributes even when allowSystemMetadata is true
Fix: Add row-level claiming to prevent duplicate staged metadata processing in multi-node deployments
@dinhys dinhys requested review from menons and saradachintala March 3, 2026 21:17
Copy link
Collaborator Author

@dinhys dinhys left a comment

Choose a reason for hiding this comment

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

Also update the SOP to include how to check for failures. (Completed.)
Modify the reset method to update the flag back to 0 upon server restart. (Completed.)

dinhys added 2 commits March 11, 2026 15:39
metadata

Added code review item to reset in process flag upon server restart.
Copy link
Contributor

@saradachintala saradachintala left a comment

Choose a reason for hiding this comment

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

Looks good

}

} else {
// Get the metadata for this collection.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update the comment to data object.

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.

5 participants