Repository navigation
test(security): the security and crypto tests run on the process, clock and GitHub fakes, and the scan gate, the lease revoke and git signing leave commands - #2573
Merged
Conversation
…ck and GitHub fakes, and the scan gate, the lease revoke and git signing leave commands The tests of #1332's files no longer patch a process-layer, clock, settings or `github.ssh` name. They use `process_fake`, real git in temporary repositories, the `clock` fixture, the GitHub API fake, the `config` fixture and a PATH that holds only the programs they need. Three pieces of logic leave `commands/`: - `gate_report` in `security/pipeline.py` gives the `--fail-on` verdict of a scan report as data. - `revoke_lease` in `security/vault_lease.py` revokes one lease and maps each refusal to its error. - `configure_git_signing` in `crypto/ssh_keys.py` writes the SSH signing settings to git config. The commands print the same lines and exit with the same status.
Owner
Author
|
Test evidence:
Pending a person: review the diff in tuicr ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The security and crypto tests of #1332's files no longer patch a process-layer, clock, settings or
github.sshname, and three pieces of logic leavecommands/.Logic that leaves
commands/(the commands print the same lines and exit with the same status):gate_reportinsrc/devops_cli/security/pipeline.pygives the--fail-onverdict of a scan report as aGateVerdict: the scanners that failed, the named scanners that did not run, and whether a gating finding is at or above the threshold.devops scan reportprints the errors and exits._evaluate_fail_on,_check_failed_scannersand_check_explicit_scanners_not_runare deleted.revoke_lease(broker, lease_id)insrc/devops_cli/security/vault_lease.pybuilds the session's lease registry with the broker's token, revokes one lease, and maps a rejected token to the broker's status error and any other refusal to aVaultLeaseErrorwith the masked lease id and the status._revoke_leaseis deleted fromdevops vault.configure_git_signing(key_path, repo_dir=None)insrc/devops_cli/crypto/ssh_keys.pywrites the SSH signing settings to the global git config and to the local config of a repository. Thedevops sshcommands print the message.Tests on the merged fakes:
process_fake(refactor(cli): one process runner owns execution, process groups and dry-run #775) answers dive, zizmor, the dependency remediator's upgrades, difftastic and Helm.GIT_CONFIG_GLOBALundertmp_path, checks the remediation branch and git signing. A command test that registers or rotates a key changes totmp_path, so it never turns on commit signing in the checkout that runs it.clockfixture (refactor(cli): tests control time: time-machine fakes wall-clock reads, and retry and rate-limit waits return at once and are recorded #1320) sets the TLS expiry and the dates of thedevops sshtests.configfixture, or the global config file itself, gives the settings; no test patchesload_settingsorCONFIG_PATH.PATHthat holds only the programs a test needs replaces each patch ofcheck_binaryandshutil.which.DEVOPS_CLI_DRY_RUNandset_dry_runreplace each patch ofis_dry_run.tests/security/test_scan_gate.py,tests/security/test_vault_lease_revoke.py, and a real-git test ofconfigure_git_signingintests/test_ssh.py. The dive symlink test no longer passes in silence when the symlink cannot be made.Closes #2543
Change:
openspec/changes/archive/2026-10-29-2543-security-process-fakes/