fix(help): mark mutating commands as read_only: false in schema output#535
Merged
Conversation
Several subcommands were reporting `read_only: true` in `pup --help` JSON
output despite performing server-side mutations. The root cause was that
`is_write_command_name()` was missing the verbs used by those commands.
Added the following mutation verbs:
- run (workflows run, runbooks run, synthetics tests run)
- enable / disable (feature-flags)
- edit (notebooks edit)
- upsert (software-catalog entities/kinds, costs ccm budgets/tag-descriptions)
- upload (costs ccm custom-costs upload)
- publish / unpublish (app-builder)
- comment (cases comment)
- start / stop / pause / resume (feature-flags exposure)
- generate (costs ccm tag-descriptions generate)
- unassign (users seats users unassign)
- ends_with("-create") pattern to cover batch-create (scorecards outcomes)
Fixes #528
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Several subcommands were reporting
read_only: trueinpup --helpJSON output despite performing server-side mutations. The root cause was thatis_write_command_name()insrc/main.rswas missing the verbs used by those commands.Changes
src/main.rs: Added 14 mutation verbs and one pattern tois_write_command_name()(src/main.rs:9883):run,enable,disable,edit,upsert,upload,publish,unpublish,comment,start,stop,pause,resume,generate,unassignname.ends_with("-create")pattern to coverbatch-createsrc/test_commands.rs: Added assertions for all newly added verbs intest_is_write_command_name_writes()Commands fixed
pup cases commentcommentpup workflows runrunpup runbooks runrunpup synthetics tests runrunpup feature-flags enableenablepup feature-flags disabledisablepup feature-flags exposure startstartpup feature-flags exposure stopstoppup feature-flags exposure pausepausepup feature-flags exposure resumeresumepup notebooks editeditpup software-catalog entities upsertupsertpup software-catalog kinds upsertupsertpup costs ccm budgets upsertupsertpup costs ccm custom-costs uploaduploadpup costs ccm tag-descriptions upsertupsertpup costs ccm tag-descriptions generategeneratepup app-builder publishpublishpup app-builder unpublishunpublishpup users seats users unassignunassignpup scorecards outcomes batch-createbatch-create(viaends_with("-create"))Testing
assert!cases totest_is_write_command_name_writes()insrc/test_commands.rsRelated Issues
Closes #528
🤖 Generated with Claude Code
Generated by Claude Code