Add -c flag to registry-manager to align CLI with harvest#63
Add -c flag to registry-manager to align CLI with harvest#63jordanpadams wants to merge 3 commits into
Conversation
Adds a -c <harvest-config.xml> option to registry-manager that reads the registry connection URL and auth file from the same Harvest configuration XML that the harvest tool uses, eliminating the need to pass -registry and -auth separately. The old flags are retained but emit a deprecation warning. Resolves #62 Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
- HarvestConfigReader: add private constructor (S1118), narrow throws to IOException, wrap ParserConfigurationException/SAXException (S112) - CliCommand: replace System.err with LOG.warn (S106), throw IllegalArgumentException instead of RuntimeException (S112), add @deprecated(since="1.3.0") (S6355), add getRegistryUrl/getAuthFile helpers to eliminate cfg[0]/cfg[1] duplication across 14 command files - RegistryManagerCli: NOSONAR on new System.out lines in printHelp (S106) - All 14 command files: use getRegistryUrl/getAuthFile instead of 3-line getConfigPair array dereference pattern (resolves duplication) Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
|
I agree registry-manager and harvest integration needs improvement to help the users, but I am not too sure what the -c integration means since the registry manager uses a per connection configuration, whereas harvest configuration is a per job configuration (e.g. dataset to upload) which contains the connection parameter. I guess that works as a pragmatic change for users to re-use their current harvest config when deleting data for example, but that sound a bit confusin for me. |
|
@tloubrieu-jpl I think the configs need to be more clearly described as to what is what, but all of the necessary information is already in the harvest configuration. I am hoping to rebrand that as a "registry configuration" and supports all registry-related tools (harvest, registry-mgr, registry-client). So some configuration applies to some tools, some apply to others, but they need one config file. having to run all of these tools with different configs seems very confusing and a bit painful from a user experience perspective. I only run these tools once in a while, but I forget what config and values are used for what every time I run each tool and get it wrong 50% of the time. |
|
Open to other ideas! But I think some consolidation of some kind should happen if we can. |
|
Note: Waiting to merge this PR until integration tests are working so we can verify this change is backwards compatible. |
|


🗒️ Summary
Adds a
-c <harvest-config.xml>flag toregistry-managerso operators can use the same Harvest configuration XML they already maintain, instead of passing the registry connection URL and auth file as separate-registryand-authflags.Changes:
HarvestConfigReaderutility parses the<registry auth="...">url</registry>element from a Harvest config XMLCliCommand.getConfigPair()resolves connection info from either-c(preferred) or-registry/-auth(deprecated)-registryand-authremain functional but emit a[WARN]deprecation message at runtime-authinlist-ddremoved — no longer needed when auth comes from-cgetConfigPair()printHelp()andcheckVersion()inRegistryManagerCliBefore:
After:
🤖 AI Assistance Disclosure
Estimated % of code influenced by AI: 90%
⚙️ Test Data and/or Report
Build verified with
mvn clean install -DskipTests -pl manager -amandmvn clean install -DskipTests -pl harvest -am— both pass. Manual end-to-end test against a live OpenSearch instance pending (requires real config file).♻️ Related Issues
Fixes #62
🤓 Reviewer Checklist
Reviewers: Please verify the following before approving this pull request.
Documentation and PR Content
Security & Quality
Testing & Validation
Maintenance