Skip to content

test: cover GitOps delete, CCM paired filters, and shrinkwrap validation#683

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-de03
Draft

test: cover GitOps delete, CCM paired filters, and shrinkwrap validation#683
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-de03

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Daily regression-test coverage run targeting recently merged high-risk paths on main (3.2.13).

Risky behavior now covered

  • GitOps delete paramsSchemagitops_agent.delete requires agent_id (not resource_id); account-scoped deletes omit org/project query params; gitops_application.delete cascade validation comes from bodyBuilder, not paramsSchema
  • harness_delete → agent_id mappingresource_id is forwarded to agent_id for gitops_agent deletes (tool-handler layer, not just registry dispatch)
  • CCM paired-filter guardcost_recommendation_count and cost_recommendation_stats omit costCategoryDTOs when only cost_category is provided without cost_buckets (prevents silent partial filtering)
  • CCM count extractor — dispatch surfaces _error when API returns non-number data instead of silently returning { count: 0 }
  • npm-shrinkwrap CI check (fix: secure adm-zip for npm consumers (CVE-2026-39244) #670) — extracted validateNpmShrinkwrapMetadata with tests for version drift, dependency mismatch, and insecure/missing hoisted adm-zip

Test files added/updated

  • tests/registry/gitops.test.ts
  • tests/registry/registry.test.ts
  • tests/tools/tool-handlers.test.ts
  • tests/scripts/adm-zip-security-lib.test.ts

Why these tests materially reduce regression risk

These paths sit on destructive operations (GitOps agent delete), financial data scoping (CCM cost category filters), and a CVE security gate (adm-zip shrinkwrap validation). A regression in any of them would either delete the wrong resource, return misleading cost counts, or ship a vulnerable npm consumer install — all without obvious runtime errors.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other — test coverage

Checklist

  • pnpm test passes (398 tests in touched files)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes
  • pnpm docs:check passes
Open in Web View Automation 

- GitOps: paramsSchema requires agent_id on delete; account scope omits
  org/project; application delete cascade errors come from bodyBuilder
- harness_delete: maps resource_id to agent_id for gitops_agent
- CCM: cost_recommendation_count/stats skip costCategoryDTOs without buckets;
  count dispatch surfaces _error on non-number API responses
- adm-zip: extract validateNpmShrinkwrapMetadata for CI check coverage

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants