Skip to content

Add ResourceIdentity coverage detection to diff comment#18324

Open
vr-ibm wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:identity-coverage-ci
Open

Add ResourceIdentity coverage detection to diff comment#18324
vr-ibm wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:identity-coverage-ci

Conversation

@vr-ibm

@vr-ibm vr-ibm commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds automated detection of missing ResourceIdentity coverage on CRUD methods and import tests. When a PR introduces or modifies resources that lack full identity coverage, the diff comment will now include a "Missing ResourceIdentity coverage" section listing:

  • Which CRUD methods are missing ResourceIdentity for each resource
  • Whether the resource is missing an import identity test

Changes

tools/diff-processor

  • Added detect-missing-identity command that scans provider services for resources missing ResourceIdentity on CRUD methods and missing import identity tests
  • Added detector/identity.go with detection logic
  • Added detector/identity_test.go with unit tests

.ci/magician

  • Added MissingIdentityInfo struct and MissingIdentity field to diffCommentData
  • Added detectMissingIdentity function that invokes the diff-processor command
  • Updated DIFF_COMMENT.md.tmpl with a new section for missing identity coverage
  • Added override-missing-identity label support to suppress the section
  • Added template rendering tests for the identity section

Release Note Template for Downstream PRs (will be copied)

Adds a new diff-processor subcommand that detects resources declaring
ResourceIdentity but missing SetResourceIdentityAttributes calls in
Create/Read/Update functions, or missing import identity tests
(TestAcc*_importBlockWithResourceIdentity).

Only resources changed in the PR (from schema diff) are checked,
avoiding false positives on existing resources.

This helps prevent PRs from introducing ResourceIdentity blocks without
full CRUD coverage.
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jul 17, 2026
@vr-ibm
vr-ibm force-pushed the identity-coverage-ci branch from a7e6510 to 88798ba Compare July 17, 2026 22:52
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jul 17, 2026
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 88798ba:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@vr-ibm
vr-ibm requested a review from BBBmau July 17, 2026 23:04
@vr-ibm
vr-ibm marked this pull request as ready for review July 17, 2026 23:04
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