oscal-compass / compliance-trestle

An opinionated tooling platform for managing compliance as code, using continuous integration and NIST's OSCAL standard.
https://oscal-compass.github.io/compliance-trestle
Apache License 2.0
168 stars 61 forks source link

`trestle author catalog-generate` command has misleading `-n` option documentation and only works for one particular catalog json file #1639

Open Ma1h01 opened 4 months ago

Ma1h01 commented 4 months ago

Describe the bug

There are two potential issues regarding the trestle author catalog-generate command:

  1. The documentation shows that the -n option looks for the name of the catalog model in the trestle workspace. But it, in fact, looks for the sub-directory of catalogs/ that contains the catalog JSON file we want to generate markdowns from.
  2. The command only works for the catalog file named specifically catalog.json. Any other names would cause an error.

To Reproduce

Steps to reproduce the behavior:

  1. Initalizae a trestle workspace
  2. Import a catalog JSON file to the catalogs/, and ensure it is NOT named catalog.json
  3. Create a directory md/ in the root to store the markdowns
  4. Run trestle author catalog-generate -n catalog -o md/ to reproduce the first issue.
  5. Run trestle author catalog-generate -n . -o md/ to reproduce the second issue.

Expected behavior

The -n option documentation should match what it is looking for.
The command should also work on catalog JSON files named other than catalog.json

Screenshots / Logs.

Environment

jpower432 commented 2 months ago

The described functionality is working as intended. The directory name under catalogs is meant to represent the catalog name. This is the same functionality for all of the authored models. In light of this, can you describe what you are looking in terms of an enhancement?