rqm baseline
rqm baseline
rqm baseline update promotes the evidence of a run into the baseline file. It is the only command that writes the baseline, and it never runs a test: it reads a run record that rqm test wrote. rqm test --promote does the two in one step: it runs the suites and then promotes the run it just made, by the same rules as this command.
rqm test
rqm baseline update --create
rqm baseline update
rqm baseline update --run 01KJ9Z6Q3K7M4N8 --prune
What it does
The command takes the latest run, or the one named by --run, and does these things in order. It builds the project and stops at any error. It reads the baseline again and checks that the file is the one the run was evaluated against, by path and by the hash of its bytes (E-BASELINE-CHANGED). It compares the project with the inputs the run recorded, and refuses when something the evidence depends on moved (E-SNAPSHOT-CHANGED, E-POLICY-CHANGED). It plans: a requirement that the run satisfied is promoted, one that failed loses its record, and a record the run cannot speak for stays. Then it writes the new file atomically, through a temporary file that replaces the old one in one step.
A partial run never removes a record because evidence is incomplete, only a full run can. A run that failed always retracts. If the policy fingerprint of the baseline differs from the run’s, every record that the run did not refresh is removed as policy_changed, so nothing stays under a policy it was not made under.
When the plan changes nothing the file is not rewritten. Without --create a missing file is an error (E-BASELINE-MISSING), and a project without a baseline key has nowhere to promote into (E-BASELINE-NOT-CONFIGURED). A baseline written with another hash algorithm is refused (E-BASELINE-STALE-ALGO). Retractions do not make the command fail: exit 0 means the file was updated as the run allows.
Options
$ rqm baseline --help
Promote the evidence of a run into the baseline
Usage: rqm baseline [OPTIONS] <COMMAND>
Commands:
update Promote the evidence of a run into the baseline
Options:
--format <FORMAT> Output format. JSON is the stable contract [default: human] [possible values: human, json]
--strict Treat warnings as errors for the exit code. The output itself does not change
-h, --help Print help
$ rqm baseline update --help
Promote the evidence of a run into the baseline
Usage: rqm baseline update [OPTIONS]
Options:
--format <FORMAT> Output format. JSON is the stable contract [default: human] [possible values: human, json]
--run <ID> Promote this run. The latest run is used when this is not given
--create Create the baseline when the file does not exist yet
--strict Treat warnings as errors for the exit code. The output itself does not change
--prune Drop the records of requirements that are not in the project or are no longer gated
-h, --help Print help
The data of --format json is described in The JSON output.