Skip to content

test(dbops): cover changeset existence validation and aliases - #686

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-594d
Closed

test(dbops): cover changeset existence validation and aliases#686
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-594d

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Adds regression tests for the database_changeset_existence resource introduced in #679. The existing test only verified the happy-path POST body shape; this PR covers the bodyBuilder validation logic that prevents malformed batch requests from reaching the DBOPS API.

Risky behavior now covered

  • Required changeset_ids — rejects missing or empty arrays before any API call
  • 100-id batch limit — guards against oversized payloads
  • Per-entry validation — rejects non-string and blank/whitespace-only ids
  • ID trimming — ensures leading/trailing whitespace is stripped before submission
  • Field aliaseschangeSetIds and change_set_ids map to the same body shape
  • Operation metadata — confirms read risk policy and skipScopeBodyInjection

Test files added/updated

  • tests/registry/dbops.test.ts — 8 new cases in database_changeset_existence get

Why these tests materially reduce regression risk

The changeset existence check is used before presenting new Liquibase changesets for review to ensure id uniqueness. Silent validation regressions could either block legitimate checks or send malformed payloads to DBOPS. These tests lock in the fail-loud contract on input normalization and bounds, matching the pattern used for other batch-validated resources (e.g. security_exemption_bulk).

Type of Change

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

Checklist

  • pnpm test passes (tests/registry/dbops.test.ts — 53 tests)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes
  • pnpm docs:check passes (not applicable — no registry/tool count changes)
Open in Web View Automation 

thisrohangupta and others added 2 commits July 22, 2026 10:54
Bumps package.json, both bundle manifests, and npm-shrinkwrap.json
(new since 3.2.12) to 3.2.14, and updates the release-metadata test
assertion to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

AI-Session-Id: 76b81db2-8027-4527-9f66-7068d3dfaff7
AI-Tool: claude-code
AI-Model: unknown
Add regression tests for database_changeset_existence bodyBuilder:
- required/non-empty changeset_ids array
- 100-id batch limit
- per-entry string validation and trimming
- changeSetIds and change_set_ids field aliases
- read operation policy and skipScopeBodyInjection metadata

The happy-path dispatch test from #679 only covered the POST body
shape; these cases guard the fail-loud validation added with the new
DBOPS changeset existence API.

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 all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ thisrohangupta
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

@thisrohangupta

Copy link
Copy Markdown
Collaborator

Closing after draft cleanup: the still-useful regression coverage is consolidated in retained #716 and the relevant focused drafts/fixes, so this branch no longer has a unique improvement worth keeping open.

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.

3 participants