Repository navigation
fix(policy): close dead ends found in a test of the policy commands - #76
Merged
Merged
Conversation
- project show: add --project-id. The error for an ambiguous name told the user to retry with a project ID, but the command took a name only. - policy revision show, policy get --revision: say that the revision does not exist, as policy change create does. - policy change show: a closed change that edited the settings said "The change edits nothing". It now points to the published revision. - policy change delete: the hint for a change that is not open no longer talks about policy overrides. - audit event list: show why the server refused a filter or a page token, in place of "Invalid request". Co-Authored-By: Claude <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Sahilb315
marked this pull request as ready for review
November 10, 2026 12:17
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep GitHub App |
The delete of a block entry loosens the policy and publishes at once. The command now reads the rule first. For a block entry it asks in a terminal, and needs --yes when no terminal is present, as policy change publish does. The delete of a trust entry does not ask. Co-Authored-By: Claude <noreply@anthropic.com>
- project show: after a read with --project-id, the footer gives the policy command with the ID, because the name can be ambiguous. - policy change show: a closed change that edited the settings and has rule operations now also says where the settings are. - audit event list: the help for a refused request names the flags, not only the filters. A bad page token is not a filter. - policy rule delete: with --yes the command does not read the rule. - policy get: the error of a failed read has the revision number again. Co-Authored-By: Claude <noreply@anthropic.com>
arunanshub
approved these changes
Nov 10, 2026
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.



Summary
I tested
main(fd36142) against v0.10.0 on a live tenant, with about 250 command calls. This PR fixes the findings that are CLI bugs. It does not add a check for each bad input.Fixes
project show--project-idflag, asproject policy showhas. The error names the flag.policy revision show N,policy get --revision Npolicy change creategives.policy change showpolicy revision show N.policy change deleteaudit event list--resourcekind or--page-tokengave "Invalid request".policy rule delete--yeswhen no terminal is present, aspolicy change publishdoes. A trust entry does not ask.project show --project-idreads the project through thesafedep.io/project-idlabel, because theListProjectsfilter has no project ID field.Not changed, and why
--verswith an invalid range is accepted. The CLI keeps its base checks (PURL form, length, version and range not together). The server already refuses a selector that a tool would drop, so the range check belongs there.--page-tokengives a 500 onpolicy revision list,policy change listandpolicy rule list. This is a server bug.policy rule list --at-revisionabove head returns the head rules. This is server behavior.policy rule create -o jsonwrites no JSON. DEVGUIDE defines operational commands asdry/tuimessages only.7din the table,168hin plain and JSON. DEVGUIDE says that onlyRenderTablehumanizes.policy decision list -o jsonhas raw enum names. The code writes the server message on purpose.policy change edit -mneeds a terminal. The command is an editor command.Test plan
go test ./...andgo vet ./...go test ./internal/cmd/ -run Conventionsgolangci-lintpasses in CIpolicy rule deleteis not run on a live tenant. Unit tests cover it.🤖 Generated with Claude Code