ubicloud/cli-commands/gh/post/remove-all-cache-entries.rb
Jeremy Evans da5d827436 Fix issues with remove all cache entries from a project support
The previous commit generated by Claude Code had the following issues:

Significant issues:

* Duplicate query errors
* The audit log action entry used does not exist
* Added route didn't use a terminal match
* Golden files not updated
* No testing of case where there were no cache entries
* Did not test output of command in CLI test

Minor issues:

* Unnecessary args 0 call in CLI code
* Unnecessary block variables in CLI code

Most of the significant issues I wouldn't expect an AI to be aware of.
This commit fixes the above issues.

However, in general the approach will be problematic for repositories
with a large number of cache entries, since each destruction needs an
S3 query. We need to switch to an approach that uses a prog.
2025-11-18 09:35:36 +09:00

12 lines
366 B
Ruby

# frozen_string_literal: true
UbiCli.on("gh").run_on("remove-all-cache-entries") do
desc "Remove all cache entries for a GitHub repository"
banner "ubi gh installation-name/repository-name remove-all-cache-entries"
run do
@repository.remove_all_cache_entries
response("All cache entries, if they exist, are now scheduled for destruction")
end
end