feat(costs): add Cloud Cost Management commands and restructure cost group#374
Draft
platinummonkey wants to merge 5 commits intomainfrom
Draft
feat(costs): add Cloud Cost Management commands and restructure cost group#374platinummonkey wants to merge 5 commits intomainfrom
platinummonkey wants to merge 5 commits intomainfrom
Conversation
…command group Renames `pup cost` → `pup costs datadog` and adds a new `pup costs ccm` subgroup backed by the internal cost-visibility-api and cost-planning-api. Changes: - src/commands/cost_ccm.rs (new): CCM commands via direct HTTP calls - custom-costs: list, get, upload (multipart PUT), delete - tag-descriptions: list, get, generate, upsert, delete - tag-metadata: list, sources, metrics, orchestrators, currency - tags: list; tag-keys: list, get - budgets: list, get, upsert (PUT), delete, validate - commitments: utilization, coverage, savings, hotspots (scalar + timeseries), list - src/util.rs: add pub fn percent_encode() (RFC 3986 unreserved chars) - src/commands/idp.rs: replace local url_encode() with util::percent_encode() - src/main.rs: rename Cost → Costs (#[command(name="costs")]), add Datadog subgroup wrapping existing commands, add full CostCcmActions enum tree - docs/, README.md, skills/, scripts/: update all references from `pup cost` to `pup costs datadog` and document new CCM subcommands Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… consistency - Add #[derive(Debug)] to HttpResponse (required for unwrap_err in tests) - Add query param doc comment to raw_request - Fix custom_costs_upload to pass version via &q instead of ?version= in path - Add negative-path unit tests for tag_desc_upsert and tag_desc_delete - Add positive-path mockito tests for raw_request query branch, tag_desc_upsert/delete (with and without cloud), and custom_costs_upload with version Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
runbooks/engine.rs and main.rs were modified locally but never staged in the previous commits. engine.rs was missing the new &[] query argument for raw_request (causing CI compile failure); main.rs was missing the cost alias. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…st 1.95) Rust 1.95 clippy now enforces collapsible_match on match arms that contain a single if block. Apply the match-guard pattern in runbooks.rs and the extra-arm pattern in tunnel.rs to satisfy the lint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…guard The previous approach moved write_all into a match guard condition to satisfy clippy::collapsible_match. Binding the result to a local variable first avoids the lint (arm body is no longer a single if block) and keeps write_all explicit in the arm body rather than as a guard side-effect. 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
Renames
pup cost→pup costs datadogand introduces a newpup costs ccmsubgroup with full Cloud Cost Management API coverage.Changes
src/commands/cost_ccm.rs(new, ~700 lines) — CCM commands via direct HTTP:custom-costs: list, get, upload (multipart PUT with random UUID boundary), deletetag-descriptions: list, get, generate, upsert (PUT), deletetag-metadata: list, tag-sources, metrics, orchestrators, currencytags: list;tag-keys: list, getbudgets: list, get, upsert (PUT), delete, validatecommitments: utilization, coverage, savings, hotspots (scalar + timeseries), listsrc/util.rs— addpub fn percent_encode()(RFC 3986 §2.3 unreserved chars); removes duplicate local encoders fromcost_ccm.rsandidp.rssrc/commands/idp.rs— replace localurl_encode()withutil::percent_encode(); add#[cfg(test)]modulesrc/main.rs— renameCost→Costs(#[command(name="costs")]), wrap existing commands inCostActions::Datadog, add fullCostActions::Ccmenum treedocs/COMMANDS.md,docs/EXAMPLES.md,README.md— document newcosts datadog/costs ccmcommand surfaceskills/dd-pup/SKILL.md,scripts/test_harness.py— update all stalepup cost→pup costs datadogreferencesTesting
cargo test: 802 tests passing (11 new incost_ccm, 7 new inutil, 2 new inidp)cargo clippy -- -D warnings: cleancargo fmt --check: cleanparse_commitment_query,budgets_getwith only--startor only--end,custom_costs_uploadwith missing file🤖 Generated with Claude Code