Closed rsenden closed 1 year ago
Conventions aside I would prefer option 4. From the other ones I would prefer option 2, since everything is in one place. A generic list-scans command could be provided in the release module (e.g. fcli fod release list-scans).
My vote is with option 2. Here are my (possibly very flawed) justifications as rebuttles to the disadvantages mentioned:
<product> <entity> <action>
is more important than avoiding duplicate commands (eg: duplicate wait-for
)list-scans
command to the release
entity. Though most of the time, I think most customers will be thinking about listing all SAST, SCA (OSS), DAST, or MAST scans for a release, rather than thinking of getting a full list of all scans (regardless of scan type). Again, I'm just thinking about what I believe will be the most common use case here. wait-for
commands, but, to avoid potential confusion, we can suffix the two commands with the entities that they're waiting for. (eg: sast-scan wait-for-scan ::myScan
or sast-scan wait-for-import ::myImport::
. If those command names are too long, then maybe we rename them to wait-scan
and wait-import
? If we're concerned about the commands being too long, then I feel that the command completion scripts address this problem. (Though currently not available for windows/powershell).Finally (this is just my (very) humble opinion/hot-take), I think the 3-level command convention that we have (<product> <entity> <action>
) is the most prominent design characteristic that every fcli-user will have memorized and at the forefront of their minds when using fcli. If we decide the create a 4th level (which I think is far too many), then we'll want to refactor the other on-prem products (ssc, sc-sast, sc-dast) to follow the same convention so that we maintain consistency. But again, I'd like to avoid that if possible as I think that will, to a great extent, hinder the user experience.
As discussed internally, below are some potential candidates, based on current
fcli fod <entity> <action>
convention.1. Generic entities, scan type in
<action>
fcli fod scan start-sast / start-dast
fcli fod scan list
(list all scans for release, filtering options to return only SAST scans for example)fcli fod scan wait-for <sast/dast/mobile scan id>
fcli fod scan-config setup-sast / setup-dast / get-sast / get-dast
fcli fod scan-results import-sast / download-sast / download-oss
Advantages:
scan wait-for
orscan list
Disadvantages:
2. Merge all scan-type specific commands into single-scan entity
fcli fod sast-scan start / list / wait-for / setup / get-config / import-fpr / download-fpr
fcli fod oss-scan import-sbom / download-sbom
Advantages:
Disadvantages:
wait-for
sast-scan <action>
sub-commandswait-for
only be combined withstart
or also withimport
)3. Have multiple entities for each scan type
fcli fod sast-scan start / list/ wait-for
fcli fod sast-config setup / get
fcli fod sast-results import-fpr / download-fpr
fcli fod oss-results import-sbom / download-sbom
Advantages:
Disadvantages:
wait-for
fcli fod -h
sast-config
orsast-scan-config
to be precise?)4. Introduce
fcli <module> [group] <entity> <action>
conceptfcli fod sast scan start / wait-for
fcli fod sast config setup / get
fcli fod sast results import / download-fpr
fcli fod oss results import-sbom / download-sbom
Advantages:
fcli fod -h
Disadvantages:
fcli fod release list
vs 4 levels infcli fod sast scan list
)