HDDS-15081. Add Internal Scaffold#10146
Conversation
f4e2a22 to
7095b46
Compare
There was a problem hiding this comment.
Pull request overview
Introduces an internal, hidden ozone local CLI scaffold to support future local single-node Ozone runtime commands.
Changes:
- Adds
OzoneLocalCLI entrypoint with a hiddenrunplaceholder subcommand. - Introduces a
LocalOzoneRuntimeinterface defining the local runtime contract. - Adds unit tests verifying picocli metadata and help output behavior for the new command.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/OzoneLocal.java | Adds the hidden ozone local command skeleton and hidden run placeholder subcommand. |
| hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/LocalOzoneRuntime.java | Defines a runtime contract interface for future local single-node runtime implementations. |
| hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/package-info.java | Introduces package-level documentation for the new org.apache.hadoop.ozone.local package. |
| hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/local/TestOzoneLocal.java | Adds unit tests for command metadata, subcommand registration, and help output hiding behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assertEquals(0, exitCode); | ||
| assertTrue(help.contains("Usage: ozone local")); | ||
| assertFalse(help.contains("run")); |
There was a problem hiding this comment.
The assertion assertFalse(help.contains("run")) is fairly broad and can become brittle if the root help text later includes the substring "run" for unrelated reasons (eg, wording like "running" / "runtime" in a description or option). Consider tightening this to check for a subcommand listing entry (eg, a line/section that specifically enumerates subcommands) or asserting via picocli metadata that the hidden subcommand is not rendered in the usage output.
| assertEquals(0, exitCode); | |
| assertTrue(help.contains("Usage: ozone local")); | |
| assertFalse(help.contains("run")); | |
| boolean runSubcommandListed = help.lines() | |
| .map(String::stripLeading) | |
| .anyMatch(line -> line.equals("run") | |
| || line.startsWith("run ") | |
| || line.startsWith("run\t")); | |
| assertEquals(0, exitCode); | |
| assertTrue(help.contains("Usage: ozone local")); | |
| assertFalse(runSubcommandListed); |
|
Thanks @henrybear327 for the patch, @ivandika3 for creating the label! |
What changes were proposed in this pull request?
Introduce
ozone localcommand skeleton.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15081
How was this patch tested?
With unit test.