Skip to content

dump subcommand apparently nonfunctional #160

Open
@wesolows

Description

@wesolows

The dump subcommand added by 74e720c without a bug ID is undocumented and doesn't seem to work:

$ cargo run -- --help
    Finished dev [unoptimized + debuginfo] target(s) in 0.39s
     Running `target/debug/amd-host-image-builder --help`
amd-host-image-builder-generate 0.1.1

USAGE:
    amd-host-image-builder generate [FLAGS] [OPTIONS] --config <efs-configuration-filename> --output-file <output-filename> --reset-image <reset-image-filename>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
    -v, --verbose

OPTIONS:
    -B, --blobdir <blobdirs>...
    -c, --config <efs-configuration-filename>
    -o, --output-file <output-filename>
    -r, --reset-image <reset-image-filename>

Note that there is no reference to the dump subcommand. But if one does:

$ cargo run -- dump --help
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/amd-host-image-builder dump --help`
amd-host-image-builder-dump 0.1.1

USAGE:
    amd-host-image-builder dump [OPTIONS] --existing-file <input-filename>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -b, --blob-dump-directory <blob-dump-dirname>
    -i, --existing-file <input-filename>

it becomes clear that it exists. Unfortunately, it doesn't ever seem to work, always displaying the same error message regardless of what input image it's given, including those that were generated by the tool itself:

$ cargo run -- dump -i ./milan-gimlet-b-1.0.0.a.img
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/amd-host-image-builder dump -i ./milan-gimlet-b-1.0.0.a.img`
Error: value unknown

As a general rule, the introduction of a feature (in any of our software) should have the following attributes:

  1. A ticket should be filed to describe the RFE being introduced, and that ticket number should be provided in the commit message that introduces it.
  2. The feature itself should be complete when delivered. Completeness varies with the scope and nature of the feature, but might include things like documentation (a man page, README, etc), help output, and passing test cases. The feature may have future improvements planned, but it should not be integrated at all until it provides a useful and coherent set of functionality. Future improvements that are planned should each have an additional ticket filed to track the RFE.
  3. Test cases are optional for some features because some features are hard to test. However, for this particular tool they should be considered mandatory because the tool is idempotent and has no side effects: every possible invocation of the tool reads a well-defined set of inputs and is expected to produce the same set of well-defined outputs every time it receives the same inputs. New options or subcommands should not be introduced for utilities or library routines that are idempotent and side-effect-free without test cases to accompany them. If we lack adequate infrastructure to implement the required test cases or part of the output is architecturally considered to have a commitment level of "Not An Interface", that part should still have some description of how it was tested in the ticket so that reviewers can assess whether testing was adequate before approving. That can also be useful if the feature being introduced is purposefully not being documented, as it provides a place for users to discover how to use it.

This ticket covers filling those gaps in 74e720c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions