Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: check-schema-diff
description: "Run comprehensive checks (breaking changes, missing tests, and missing documentation) on Magic Modules schema changes between the current branch and a base branch (usually main) using the local diff-processor."
name: validate-provider-changes
description: "Validate that changes to the generated providers don't introduce breaking changes or fields with missing tests or missing documentation. Use this skill when the user wants to check for breaking changes, missing tests, or missing documentation, or other problems in the downstream providers."
---

# `check-schema-diff`
# `validate-provider-changes`

> **Note to AI Agents:** You MUST read the YAML frontmatter above first. Only read the rest of this file if the `description` matches your required task.
> This skill allows you to run local breaking changes, missing tests, and missing documentation checks on Magic Modules schema changes.
> This skill allows you to run local breaking changes, missing tests, and missing documentation checks on Magic Modules schema and provider changes.

## Prerequisites

Expand All @@ -15,28 +15,34 @@ description: "Run comprehensive checks (breaking changes, missing tests, and mis

## Execution Steps

### 1. Make the script executable (if not already)
Ensure the script is executable:
### 1. Run the Provider Changes Validator

Run the script to compare your current local changes (committed or uncommitted) against the base branch (defaults to the merge base with `origin/main` or `main`):

```bash
chmod +x .agents/skills/utils/check-schema-diff/scripts/check_schema_diff.sh
./.agents/skills/utils/validate-provider-changes/scripts/validate_provider_changes.sh
```

### 2. Run the Schema Diff Checker
Run the script to compare your current local changes (committed or uncommitted) against the base branch (defaults to the merge base with `origin/main` or `main`):
To compare against a specific branch or commit (e.g. `HEAD` to check uncommitted changes against the current commit):

```bash
./.agents/skills/utils/check-schema-diff/scripts/check_schema_diff.sh
./.agents/skills/utils/validate-provider-changes/scripts/validate_provider_changes.sh HEAD
```

To compare against a specific branch or commit, pass it as an argument:
Or to compare against a base branch:

```bash
./.agents/skills/utils/check-schema-diff/scripts/check_schema_diff.sh <base_branch_or_commit>
./.agents/skills/utils/validate-provider-changes/scripts/validate_provider_changes.sh <base_branch_or_commit>
```

### 3. Analyze the Output
### 2. Analyze the Output

The tool runs three checks across both GA and Beta provider versions:

- **Breaking Changes:** Detects backwards-incompatible schema changes.
- **Missing Tests:** Identifies new or changed fields that are not covered by any acceptance tests.
- **Missing Documentation:** Identifies new fields that are not documented in the resource/datasource markdown files.

### 4. Verification & Handoff
### 3. Verification & Handoff

If any issues (breaking changes, missing tests, or missing docs) are detected, present them clearly to the user. Discuss potential mitigations and fixes before proceeding.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ DIFF_PROCESSOR_DIR="${REPO_ROOT}/tools/diff-processor"

mkdir -p "$SCRATCH_DIR"

# Always copy test-reader and issue-labeler into SCRATCH_DIR so go.mod replace directives resolve
rm -rf "${SCRATCH_DIR}/test-reader" "${SCRATCH_DIR}/issue-labeler"
cp -r "${REPO_ROOT}/tools/test-reader" "$SCRATCH_DIR/"
cp -r "${REPO_ROOT}/tools/issue-labeler" "$SCRATCH_DIR/"

# 4. Set up cleanup trap to ensure we never leave git worktrees behind
cleanup() {
echo -e "${BLUE}Cleaning up temporary files and worktrees...${NC}"
Expand Down