DEV-205664: Add list_data_quality_rule_template_deployments tool - #143
Draft
regmimridul wants to merge 1 commit into
Draft
regmimridul wants to merge 1 commit into
regmimridul wants to merge 1 commit into
Conversation
DEV-205664. Lists the rules currently deployed from one rule template, so the
blast radius of a template change can be seen before the change is made. This
is the read companion to update_/delete_data_quality_rule_template from
DEV-205663: an update always cascades to every deployed rule and a delete
refuses without cascade, and neither told you how many rules that is.
Wraps GET /rest/dq/1.0/ruleTemplates/{ruleTemplateName}/deployments via a new
clients.ListDQRuleTemplateDeployments. Registered behind the existing
data-quality experimental flag per TOOL_CONTRIBUTION_STANDARDS §3.2, which asks
for one shared feature name per domain rather than a flag per tool.
Three places where the ticket's acceptance criteria do not match the API, all
resolved in favour of the API and called out in the PR:
The endpoint accepts no paging parameters - listRuleTemplateDeployments in
RuleTemplatesControllerPublic takes only the template name - so it always
returns every deployment. page/page_size are honoured but applied here, after
the read. That still serves the intent of the criterion, which is to keep a
widely-deployed template from flooding the model's context; it does not save a
round trip, and the field docs say so rather than implying server-side paging.
A deployment has no id. RuleTemplateDeployment is keyed by jobName plus
deployedRuleName, which is also how the detach endpoint addresses one, so that
pair is returned as the identity instead of the "rule ID" the ticket asks for.
There is no deployment status field either. RuleTemplateDeploymentStatus
(DEPLOYED/SKIPPED/FAILED) is the outcome of a deploy call, not stored per
deployment - every row this tool returns is by definition deployed. lastRunStatus
is returned in its place and documented as the rule's latest evaluation, not a
deployment outcome, so the two are not conflated.
The tool name spells out the domain per §4.1 rather than using the ticket's
dq_ prefix, matching its list_/get_/create_data_quality_rule_template siblings.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
regmimridul
force-pushed
the
feat/DEV-205664-list-rule-template-deployments
branch
from
September 14, 2026 17:11
c14ce8b to
7d0ced4
Compare
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.
🎯 What does this PR do?
DEV-205664. Adds
list_data_quality_rule_template_deployments— a read-only MCP tool listing the rules currently deployed from one rule template, so the blast radius of a template change can be seen before the change is made.This is the read companion to
update_data_quality_rule_template/delete_data_quality_rule_templatefrom DEV-205663 (#134): an update always cascades to every deployed rule, and a delete refuses unlesscascadeis set — but neither tool could tell you how many rules that is, or which. Now you can ask first.Wraps
GET /rest/dq/1.0/ruleTemplates/{ruleTemplateName}/deploymentsthrough a newclients.ListDQRuleTemplateDeployments. Per deployment: job name, generated rule name, column, last run and its status, creator, and the Edge connection/site ids.Stacked on #134 (
feature/DEV-205663), which carries thedata-qualityflag and the sibling template tools. Merge #133 → #134 → this.Gating
Registered behind the existing
data-qualityexperimental flag, off by default, per §3.2 ofdocs/TOOL_CONTRIBUTION_STANDARDS.md— one shared feature name per domain rather than a flag per tool. Added to the gated-tool list inregister_test.go, so the existing both-direction tests cover it.Three places the acceptance criteria don't match the API
Each resolved in favour of the real contract (§8.2: derive contracts from the producing service). Flagging them explicitly because they're deviations from the ticket, not oversights:
1. The endpoint accepts no paging parameters.
listRuleTemplateDeploymentsinRuleTemplatesControllerPublictakes only the template name and returns every deployment in oneRuleTemplateDeploymentPaginatedenvelope.page/page_sizeare therefore honoured but applied client-side, after the read.That still serves what AC 9 is actually for — keeping a widely-deployed template from flooding the model's context — but it does not save a round trip, and the field descriptions say so plainly rather than implying server-side paging. If you'd rather the DQ API gained real paging, that's a dq-side change and this tool would follow it.
2. A deployment has no id.
RuleTemplateDeploymentis keyed byjobName+deployedRuleName, which is also exactly how thedetachendpoint addresses one. That pair is returned as the identity in place of the "rule ID" the AC asks for.3. There is no deployment-status field.
RuleTemplateDeploymentStatus(DEPLOYED/SKIPPED/FAILED) is the outcome of a deploy call, not something stored per deployment — every row this tool returns is by definition deployed.lastRunStatus(passing/breaking/exception/suppressed/pending_run) is returned instead, documented as the rule's latest evaluation, so a model can't mistake it for a deployment outcome.Tool name
The ticket specifies
dq_list_rule_template_deployments; this ships aslist_data_quality_rule_template_deployments. §4.1 requires spelling out domain abbreviations in the tool name, and the siblings this sits beside are alreadylist_/get_/create_data_quality_rule_template. Happy to rename if you'd rather match the ticket exactly.Behaviour worth reviewing
successwith an empty array and a message saying nothing is deployed, per AC — not a 404-shaped failure.totalis always the full count, independent of page size, so "how many rules would this affect" never depends on how the caller paged.DATA_QUALITY_DEPLOY_TEMPLATES, not plain template-read, so someone who can list templates may still be refused here.Impact Analysis
Low. Purely additive: one new tool, one new client function, one line in the gated block of
RegisterAll. No existing tool, client function or type is modified.The tool is behind
data-quality(off by default), so no existing deployment's tool list changes.chip-servicewould needdata-qualityinCOLLIBRA_MCP_EXPERIMENTALto expose it.Read-only:
ReadOnlyHint: true,DestructiveHint: false, a single GET, no confirm checkpoint. Response size is bounded bypage_size(default 25, max 200) regardless of how many deployments exist, though the upstream call is unbounded — a template with thousands of deployments still transfers them all to chip. Worth knowing if that's a realistic scale.Still open:
Permissions: []string{}(§9) — needs the real scope identifiers from the DQ team, same as #133.Verified with
gofmt -l,go build ./...,go vetandgo test ./pkg/tools/... ./cmd/chip/...— all passing, including 13 new tests covering the default page size and total reporting, the prompt-the-user guidance, paging, past-the-end, empty-deployments, field mapping, never-run deployments, unknown template, the deploy-permission message, error mapping across 401/400/422/500, page-size validation and error truncation.✅ Checklist
🤖 Generated with Claude Code