When authoring an orb and writing a command with no parameters (i.e. completely omitted from the file) then the RC010 check fails with the following error message:
(in test file review.bats, line 205)
`ORB_COMPONENT_PARAMETERS_COUNT=$(yq '.parameters | keys | .[]' "$i")' failed
Error: Cannot get keys of !!null, keys only works for maps and arrays
This is because it is not checking if there are parameters to get and yq fails if you reference a non existent key.
Expected behavior:
The check should be skipped for parameters
Additional Information:
If you specify parameters: {} then RC010 works fine but then you fail during the orb-tools/pack job with the following:
Error: ERROR IN CONFIG FILE:
[#/commands/tag_new_version] 0 subschemas matched instead of one
1. [#/commands/tag_new_version] expected type: String, found: Mapping
| Command may be a string reference to another command
2. [#/commands/tag_new_version/parameters] minimum size: [1], found: [0]
| Parameters given to a step.
| SCHEMA:
| minProperties: 1
| INPUT:
| {}
Exited with code exit status 255
Orb version: 12.0
What happened:
When authoring an orb and writing a command with no
parameters
(i.e. completely omitted from the file) then the RC010 check fails with the following error message:This is because it is not checking if there are parameters to get and
yq
fails if you reference a non existent key.Expected behavior:
The check should be skipped for parameters
Additional Information:
If you specify
parameters: {}
then RC010 works fine but then you fail during theorb-tools/pack
job with the following: