Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
8365d3b
Support multiple products and only copy/compile files for those produ…
melinath Jun 26, 2026
9a32d06
Update breaking changes docs and create version 8 upgrade guide (#18110)
c2thorn Jun 26, 2026
6469167
Add ANY_RESERVATION_THEN_FAIL reservation affinity to container modul…
pwitkiewicz Jun 26, 2026
3afa421
Added review pause for melinath (#18113)
melinath Jun 26, 2026
8491e25
Updated migration tool to support eap (#18109)
shuyama1 Jun 26, 2026
54f5e8b
test(magician): add interceptingRunner to reroute sandbox executions …
majedalfaraj Jun 26, 2026
ad6c021
compute: add target_type and target_forwarding_rules to google_comput…
vr-ibm Jun 26, 2026
67838c0
Add vacation update (#18119)
rileykarson Jun 29, 2026
4a7954a
Migrate `expandAdvancedMachineFeatures`, `flattenAdvancedMachineFeatu…
nsamartsev Jun 29, 2026
3f2e48b
Revert "feat(vertexai): add google_vertex_ai_online_evaluator resourc…
guvenenb Jun 29, 2026
fea0fa5
retry Cloud Scheduler 409 sync mutate cannot be queued (#17750)
bluebasil Jun 29, 2026
109ce50
feat(compute): Promote instanceLifecyclePolicy.onRepair.allowChanging…
chayankumar999 Jun 30, 2026
a6c2ea4
Fixed boundary error in SamplePrimaryResourceId (#18112)
melinath Jun 30, 2026
7efdd5c
Fix ogg version field in ggdeployment full test (#18123)
swethamagesh14 Jun 30, 2026
8e9b3cb
Add exadataInfrastructure field and sample to ExascaleDbStorageVault …
virgulati2003 Jun 30, 2026
2c4bbb1
feat(storagetransfer): add private_network_service to azure_blob_stor…
favoretti Jun 30, 2026
d484bf7
feat(vertexai): add customizationConfigs to google_vertex_ai_reasonin…
amenegola Jun 30, 2026
bea8023
Add new TagBindingCollection resource (#17930)
amukul-25 Jun 30, 2026
8282a40
storage: rapid storage example (#17964)
gurusai-voleti Jun 30, 2026
2e6e87a
Fix Terraform timeout during cluster creation (#18143)
rpgoog Jul 1, 2026
92556ab
Tag Schedule as autogen v2 (#18060)
slevenick Jul 1, 2026
e2e6b5a
refactor: extract FlattenProjectIamCustomRole from Read function (#18…
vr-ibm Jul 1, 2026
884a23a
vertexai: add google_vertex_ai_semantic_governance_policy_engine (bet…
Matt-Ryan Jul 1, 2026
3fe46fd
apigee: add regression test for google_apigee_organization billing_ty…
xuchenma Jul 1, 2026
d3b85a1
Add exascaleDbStorageVault and storageManagementType fields to CloudV…
virgulati2003 Jul 1, 2026
4f449c1
Add google_chronicle_environmentgroup resource to chronicle (#17712)
epopcop Jul 1, 2026
bce6545
feat(chronicle): promote environment resource to GA (#18178)
epopcop Jul 6, 2026
baad1c7
build(deps): bump golang.org/x/net from 0.48.0 to 0.55.0 in /.ci/magi…
dependabot[bot] Jul 6, 2026
4137b52
agentregistry: Resolve computed name field GA launch blockers (#18157)
belovezhalin Jul 6, 2026
b7a1a24
Update review vacations (#18183)
rileykarson Jul 6, 2026
7878f77
Diff processor skill (#18107)
melinath Jul 6, 2026
270125b
Align Filestore instance opeation timeouts with the service defined t…
bsteinberg Jul 6, 2026
21357a4
Time_sleep resource is added to wait for 120 seconds after the applic…
wrathtoliar Jul 6, 2026
2b1d273
feat: (storage) deprecated cache value (#18083)
gurusai-voleti Jul 6, 2026
9f0cdbf
Update ManagedZone.yaml to contain ransom suffix for dns_name (#18086)
shellyvilenko Jul 6, 2026
dda05b1
appengine: Add app_engine_bundled_services and make fields immutable …
riddhi-shivhare Jul 6, 2026
ad5550e
Add service team mandatory review (#18191)
rileykarson Jul 6, 2026
924817b
Add google_chronicle_soardomain resource to chronicle (#17714)
epopcop Jul 6, 2026
7c55e19
Fix row_affinity configuration in Bigtable app profiles (#18031)
gdcolella Jul 6, 2026
291e71b
google_chronicle_rule: suppress trailing-newline permadiff on `text` …
tsushanth Jul 6, 2026
94504b0
added node pool maintenance policy (#17190)
yliaog Jul 6, 2026
d038252
Add Google Cloud Network Connectivity CustomHardwareInstance resource…
shengquan-ni Jul 7, 2026
3a06d86
Fallback to async timeouts if top level timeouts are not specified (#…
SirGitsalot Jul 7, 2026
4117ded
Update enrolled_teams.yml (#18208)
melinath Jul 7, 2026
8ffc043
Add IAM policy support for google_iap_agent_registry_endpoint (#18201)
JamesDuncanNz Jul 7, 2026
a0551a7
feat(firestore): Support for skip wait on Firestore field resource (#…
IchordeDionysos Jul 7, 2026
1ceefe9
compute: fix preview=false updates for OrganizationSecurityPolicyRule…
sumanth-g31 Jul 7, 2026
030a2ef
privilegedaccessmanager: fix permadiff on entitlements with no approv…
toga4 Jul 7, 2026
6cda9eb
fix(magician): rename functions to match Google's developer's word li…
majedalfaraj Jul 7, 2026
ebf94d1
Add psc_auto_connection_policy_enabled and output-only fields to Clou…
hannahjiang-0415 Jul 7, 2026
ceac39f
Fix terraform type mismatch on nested Eventarc Trigger conditions (#1…
marcgovi Jul 7, 2026
1dc1c84
Add recurring maintenance window (#17899)
Ewa-M Jul 7, 2026
ce80163
Configure consistent root and async timeouts for Oracle Database reso…
virgulati2003 Jul 7, 2026
4d5fa96
`project`: fix `labels` permadiff (#18209)
BBBmau Jul 7, 2026
f2a9d06
Example Migration Cleanup (#18215)
shuyama1 Jul 7, 2026
256ad34
provider reference for deletion_policy (#18219)
c2thorn Jul 7, 2026
1e0750f
Add IAP Agent, MCP Server and Endpoint resources to GA provider (#18088)
swamitagupta Jul 7, 2026
3acd7d1
Add catalogPublishingEnabled to Dataplex dataDocumentationSpec (#18135)
nikitha-nuthi Jul 7, 2026
bbcd319
Add support for enforce_new_sql_network_architecture flag in google_s…
wyiyang-stack Jul 7, 2026
0d3f87e
Add inspect_config.min_likelihood_per_info_type field to data_loss_pr…
patrickmoy Jul 8, 2026
9f80edf
New data source: google_data_catalog_taxonomy (#18147)
vr-ibm Jul 8, 2026
68ee821
Add google_vector_search_index resource (#18004)
kkanska Jul 8, 2026
bbd81b2
Terraform Support for Chronicle DataExport (#17973)
avbanerjee Jul 8, 2026
369ab17
Add support for Chronicle Findings Refinement Deployment resource in …
nimam Jul 8, 2026
be1ab85
add CATALOG_TYPE_FEDERATED support to google_biglake_iceberg_catalog …
fuzmish Jul 8, 2026
33cc7dc
remove Examples-based test guide (#18230)
shuyama1 Jul 8, 2026
9f95c45
test(magician): refactor test-terraform-vcr to use testing sandbox (#…
majedalfaraj Jul 8, 2026
84eeeb9
Bugfix/add missing update mask for additional_options in datastream m…
farrukh-t Jul 9, 2026
97f8bc5
compute: add list resources (batch 4 — proxies, URL maps, snapshots) …
BBBmau Jul 9, 2026
5159b3e
Add list resource for google_dns_managed_zone (#18133)
vr-ibm Jul 9, 2026
faca318
Reject empty segments in JWT validators (#18082)
naruto-lgtm Jul 9, 2026
ed14a1a
Add singular/plural Exascale DB Storage Vault data sources and update…
virgulati2003 Jul 9, 2026
c121fdb
feat: Add GKE CustomNodeInit support (#17743)
zicongmei Jul 9, 2026
abd9ece
Update class_methods documentation for Vertex AI Reasoning Engine (#1…
guvenenb Jul 9, 2026
4c5858c
fix (compute): `enable_proxy_protocol` not being disableable on `goog…
ricardgardella Jul 9, 2026
2b7627b
Add shuyama1 to reviewers (#18244)
rileykarson Jul 9, 2026
2811735
Bigquery tvf submission (#17892)
ashutoshshiva-maker Jul 9, 2026
d023ea5
Update review vacations for c2thorn
c2thorn Jul 9, 2026
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
42 changes: 42 additions & 0 deletions .agents/skills/utils/check-schema-diff/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
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."
---

# `check-schema-diff`

> **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.

## Prerequisites

- You must be operating in the `magic-modules` root directory.
- You must have `go` installed and configured.

## Execution Steps

### 1. Make the script executable (if not already)
Ensure the script is executable:
```bash
chmod +x .agents/skills/utils/check-schema-diff/scripts/check_schema_diff.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`):
```bash
./.agents/skills/utils/check-schema-diff/scripts/check_schema_diff.sh
```

To compare against a specific branch or commit, pass it as an argument:
```bash
./.agents/skills/utils/check-schema-diff/scripts/check_schema_diff.sh <base_branch_or_commit>
```

### 3. 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
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.
347 changes: 347 additions & 0 deletions .agents/skills/utils/check-schema-diff/scripts/check_schema_diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,347 @@
#!/usr/bin/env bash
#
# check_schema_diff.sh
#
# Automates local schema difference checks (breaking changes, missing tests,
# and missing documentation) for Magic Modules by comparing the current
# working tree against a base branch (e.g., main).
#
# Usage:
# ./.agents/skills/utils/check-schema-diff/scripts/check_schema_diff.sh [base_ref]
#

set -e

# Define color codes for pretty printing
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

echo -e "${BLUE}=== Magic Modules Schema Diff Checker ===${NC}"

# 1. Validate environment
if [ ! -d "mmv1" ] || [ ! -d "tools/diff-processor" ]; then
echo -e "${RED}Error: This script must be run from the root of the magic-modules repository.${NC}"
exit 1
fi

# 2. Determine base ref
BASE_REF="$1"
if [ -z "$BASE_REF" ]; then
# Try to find the merge base with origin/main, fallback to main, fallback to origin/master
BASE_REF=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || echo "main")
fi

echo -e "${BLUE}Comparing current changes against base ref: ${YELLOW}${BASE_REF}${NC}"

# 3. Set up paths
REPO_ROOT=$(pwd)
SCRATCH_DIR="${REPO_ROOT}/scratch/schema-diff-check"
PROVIDER_CACHE="${REPO_ROOT}/scratch/provider-cache"
DIFF_PROCESSOR_DIR="${REPO_ROOT}/tools/diff-processor"

mkdir -p "$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}"
if [ -d "$SCRATCH_DIR/mm-base-worktree" ]; then
git worktree remove --force "$SCRATCH_DIR/mm-base-worktree" 2>/dev/null || true
fi
}
trap cleanup EXIT

# Helper function to check if the docs JSON output has missing docs
has_missing_docs() {
local json="$1"
if command -v jq &> /dev/null; then
# Returns 0 (true) if there are missing docs, 1 (false) otherwise
echo "$json" | jq -e '(.Resource | length > 0) or (.DataSource | length > 0)' >/dev/null 2>&1
return $?
else
# Simple Python fallback to check if either list is non-empty
python3 -c "
import sys, json
data = json.loads(sys.argv[1])
resources = data.get('Resource') or []
datasources = data.get('DataSource') or []
if len(resources) > 0 or len(datasources) > 0:
sys.exit(0)
sys.exit(1)
" "$json" 2>/dev/null
return $?
fi
}

# 5. Build current mmv1 binary in the current context (once for all checks)
echo -e "${BLUE}Building current mmv1 binary...${NC}"
if [ -f "MODULE.bazel" ] && command -v bazel &> /dev/null; then
bazel build //mmv1
MM_BINARY="$(pwd)/bazel-bin/mmv1/mmv1_/mmv1"
else
(
cd mmv1
go build -o ../bin/mmv1 .
)
MM_BINARY="$(pwd)/bin/mmv1"
fi

# 6. Create temporary worktree for base commit (once for all checks)
echo -e "${BLUE}Creating temporary worktree for base commit ${YELLOW}${BASE_REF}${BLUE}...${NC}"
WORKTREE_DIR="$SCRATCH_DIR/mm-base-worktree"
rm -rf "$WORKTREE_DIR"
git worktree add --detach "$WORKTREE_DIR" "$BASE_REF"



run_version_checks() {
local VERSION="$1"
local VERSION_UPPER=$(echo "$VERSION" | tr '[:lower:]' '[:upper:]')
local TARGET_DIFF_PROC="$SCRATCH_DIR/diff-proc-${VERSION}"
local PROVIDER_REPO
local PROVIDER_CACHE
local REAL_PACKAGE_NAME
local REAL_FOLDER_NAME

if [ "$VERSION" = "ga" ]; then
PROVIDER_REPO="https://github.com/hashicorp/terraform-provider-google.git"
PROVIDER_CACHE="${REPO_ROOT}/scratch/provider-cache-ga"
REAL_PACKAGE_NAME="github.com/hashicorp/terraform-provider-google"
REAL_FOLDER_NAME="google"
else
PROVIDER_REPO="https://github.com/hashicorp/terraform-provider-google-beta.git"
if [ -d "${REPO_ROOT}/scratch/provider-cache" ] && [ ! -d "${REPO_ROOT}/scratch/provider-cache-beta" ]; then
PROVIDER_CACHE="${REPO_ROOT}/scratch/provider-cache"
else
PROVIDER_CACHE="${REPO_ROOT}/scratch/provider-cache-beta"
fi
REAL_PACKAGE_NAME="github.com/hashicorp/terraform-provider-google-beta"
REAL_FOLDER_NAME="google-beta"
fi

# Prepare isolated diff-processor directory
rm -rf "$TARGET_DIFF_PROC"
mkdir -p "$TARGET_DIFF_PROC"
(cd "$DIFF_PROCESSOR_DIR" && tar cf - --exclude=old --exclude=new --exclude=bin .) | (cd "$TARGET_DIFF_PROC" && tar xf -)

# Ensure we have a cached downstream provider clone
if [ ! -d "$PROVIDER_CACHE" ]; then
echo -e "${BLUE}[${VERSION_UPPER}] Cloning downstream provider into cache...${NC}"
git clone --depth 500 "$PROVIDER_REPO" "$PROVIDER_CACHE" >/dev/null 2>&1
else
echo -e "${BLUE}[${VERSION_UPPER}] Updating cached downstream provider...${NC}"
(
cd "$PROVIDER_CACHE"
git fetch --depth 500 origin main >/dev/null 2>&1
git reset --hard origin/main >/dev/null 2>&1
)
fi

# Find downstream commit matching base ref
echo -e "${BLUE}[${VERSION_UPPER}] Finding downstream commit matching base ref ${YELLOW}${BASE_REF}${BLUE}...${NC}"
local MATCHING_COMMIT=""
for MM_SHA in $(git log --format="%H" -n 100 "$BASE_REF"); do
MATCHING_COMMIT=$(cd "$PROVIDER_CACHE" && git log --grep="\[upstream:${MM_SHA}\]" --format="%H" -n 1)
if [ -n "$MATCHING_COMMIT" ]; then
echo -e "${GREEN}[${VERSION_UPPER}] Found matching provider commit: ${YELLOW}${MATCHING_COMMIT}${GREEN} (for MM commit ${MM_SHA:0:8})${NC}"
break
fi
done

if [ -z "$MATCHING_COMMIT" ]; then
echo -e "${YELLOW}[${VERSION_UPPER}] Warning: No matching provider commit found in recent ancestors of ${BASE_REF}; using provider HEAD.${NC}"
MATCHING_COMMIT=$(cd "$PROVIDER_CACHE" && git rev-parse HEAD)
fi

# Prepare old and new directories in diff-processor
echo -e "${BLUE}[${VERSION_UPPER}] Preparing diff-processor environment...${NC}"
cp -R "$PROVIDER_CACHE" "$TARGET_DIFF_PROC/old"
cp -R "$PROVIDER_CACHE" "$TARGET_DIFF_PROC/new"
(cd "$TARGET_DIFF_PROC/old" && git checkout "$MATCHING_COMMIT" >/dev/null 2>&1)
(cd "$TARGET_DIFF_PROC/new" && git checkout "$MATCHING_COMMIT" >/dev/null 2>&1)

# Generate base and current provider code in parallel
echo -e "${BLUE}[${VERSION_UPPER}] Generating base and current provider code...${NC}"
(
cd mmv1
$MM_BINARY --output "$TARGET_DIFF_PROC/old" --version "$VERSION" --base "${WORKTREE_DIR}/mmv1"
) &
local OLD_GEN_PID=$!

(
cd mmv1
$MM_BINARY --output "$TARGET_DIFF_PROC/new" --version "$VERSION"
) &
local NEW_GEN_PID=$!

wait $OLD_GEN_PID
wait $NEW_GEN_PID

# Perform package substitutions for side-by-side compilation
echo -e "${BLUE}[${VERSION_UPPER}] Preparing provider code for compilation...${NC}"
(
cd "$TARGET_DIFF_PROC"

# Old package substitution
(
cd old/
if [ -d "$REAL_FOLDER_NAME" ] && [ "$REAL_FOLDER_NAME" != "google" ]; then
mv "$REAL_FOLDER_NAME" google
fi
local fake_package_name=google/provider/old

if [ "$(uname)" = "Darwin" ]; then
find . -type f -name "*.go" -exec sed -i "" "s~${REAL_PACKAGE_NAME}/${REAL_FOLDER_NAME}~${fake_package_name}/google~g" {} +
sed -i "" "s|${REAL_PACKAGE_NAME}|${fake_package_name}|g" go.mod
else
find . -type f -name "*.go" -exec sed -i "s~${REAL_PACKAGE_NAME}/${REAL_FOLDER_NAME}~${fake_package_name}/google~g" {} +
sed -i "s|${REAL_PACKAGE_NAME}|${fake_package_name}|g" go.mod
fi
) &
local OLD_SUB_PID=$!

# New package substitution
(
cd new/
if [ -d "$REAL_FOLDER_NAME" ] && [ "$REAL_FOLDER_NAME" != "google" ]; then
mv "$REAL_FOLDER_NAME" google
fi
local fake_package_name=google/provider/new

if [ "$(uname)" = "Darwin" ]; then
find . -type f -name "*.go" -exec sed -i "" "s~${REAL_PACKAGE_NAME}/${REAL_FOLDER_NAME}~${fake_package_name}/google~g" {} +
sed -i "" "s|${REAL_PACKAGE_NAME}|${fake_package_name}|g" go.mod
else
find . -type f -name "*.go" -exec sed -i "s~${REAL_PACKAGE_NAME}/${REAL_FOLDER_NAME}~${fake_package_name}/google~g" {} +
sed -i "s|${REAL_PACKAGE_NAME}|${fake_package_name}|g" go.mod
fi
) &
local NEW_SUB_PID=$!

wait $OLD_SUB_PID
wait $NEW_SUB_PID

# Tidy and build diff-processor
echo -e "${BLUE}[${VERSION_UPPER}] Compiling diff-processor tool...${NC}"
go mod tidy >/dev/null 2>&1
mkdir -p bin/
go build -o ./bin/diff-processor .
)

local HAS_ERR=0

# Run breaking changes check
echo -e "\n${BLUE}=== Running Breaking Changes Check (${VERSION_UPPER}) ===${NC}"
set +e
local BREAKING_OUTPUT=$("$TARGET_DIFF_PROC/bin/diff-processor" breaking-changes 2>&1)
local BREAKING_EXIT_CODE=$?
set -e

if [ $BREAKING_EXIT_CODE -ne 0 ]; then
echo -e "${RED}[${VERSION_UPPER}] Error: diff-processor breaking-changes failed:${NC}"
echo "$BREAKING_OUTPUT"
return $BREAKING_EXIT_CODE
fi

if [ -n "$BREAKING_OUTPUT" ] && [ "$BREAKING_OUTPUT" != "[]" ] && [ "$BREAKING_OUTPUT" != "null" ]; then
echo -e "${RED}[${VERSION_UPPER}] Breaking changes detected!${NC}"
if command -v jq &> /dev/null; then
echo "$BREAKING_OUTPUT" | jq .
else
echo "$BREAKING_OUTPUT" | python3 -m json.tool
fi
HAS_ERR=1
else
echo -e "${GREEN}[${VERSION_UPPER}] No breaking changes detected!${NC}"
fi

# Run missing tests check
echo -e "\n${BLUE}=== Running Missing Tests Check (${VERSION_UPPER}) ===${NC}"
set +e
local TESTS_OUTPUT=$("$TARGET_DIFF_PROC/bin/diff-processor" detect-missing-tests "$TARGET_DIFF_PROC/new/google/services" 2>&1)
local TESTS_EXIT_CODE=$?
set -e

if [ $TESTS_EXIT_CODE -ne 0 ]; then
echo -e "${RED}[${VERSION_UPPER}] Error: diff-processor detect-missing-tests failed:${NC}"
echo "$TESTS_OUTPUT"
return $TESTS_EXIT_CODE
fi

if [ -n "$TESTS_OUTPUT" ] && [ "$TESTS_OUTPUT" != "{}" ] && [ "$TESTS_OUTPUT" != "null" ]; then
echo -e "${YELLOW}[${VERSION_UPPER}] Missing tests detected!${NC}"
if command -v jq &> /dev/null; then
echo "$TESTS_OUTPUT" | jq .
else
echo "$TESTS_OUTPUT" | python3 -m json.tool
fi
HAS_ERR=1
else
echo -e "${GREEN}[${VERSION_UPPER}] No missing tests detected!${NC}"
fi

# Run missing documentation check
echo -e "\n${BLUE}=== Running Missing Documentation Check (${VERSION_UPPER}) ===${NC}"
set +e
local DOCS_OUTPUT=$("$TARGET_DIFF_PROC/bin/diff-processor" detect-missing-docs "$TARGET_DIFF_PROC/new" 2>&1)
local DOCS_EXIT_CODE=$?
set -e

if [ $DOCS_EXIT_CODE -ne 0 ]; then
echo -e "${RED}[${VERSION_UPPER}] Error: diff-processor detect-missing-docs failed:${NC}"
echo "$DOCS_OUTPUT"
return $DOCS_EXIT_CODE
fi

if has_missing_docs "$DOCS_OUTPUT"; then
echo -e "${YELLOW}[${VERSION_UPPER}] Missing documentation detected!${NC}"
if command -v jq &> /dev/null; then
echo "$DOCS_OUTPUT" | jq .
else
echo "$DOCS_OUTPUT" | python3 -m json.tool
fi
HAS_ERR=1
else
echo -e "${GREEN}[${VERSION_UPPER}] No missing documentation detected!${NC}"
fi

return $HAS_ERR
}

echo -e "${BLUE}Running GA and Beta schema diff checks in parallel...${NC}"

run_version_checks ga > "$SCRATCH_DIR/check-ga.log" 2>&1 &
GA_PID=$!

run_version_checks beta > "$SCRATCH_DIR/check-beta.log" 2>&1 &
BETA_PID=$!

set +e
wait $GA_PID
GA_STATUS=$?

wait $BETA_PID
BETA_STATUS=$?
set -e

echo -e "\n${BLUE}=====================================================${NC}"
echo -e "${BLUE}=== GA Provider Schema Diff Results ===${NC}"
echo -e "${BLUE}=====================================================${NC}"
cat "$SCRATCH_DIR/check-ga.log"

echo -e "\n${BLUE}=====================================================${NC}"
echo -e "${BLUE}=== Beta Provider Schema Diff Results ===${NC}"
echo -e "${BLUE}=====================================================${NC}"
cat "$SCRATCH_DIR/check-beta.log"

# 7. Final status report
echo -e "\n${BLUE}===========================================${NC}"
if [ $GA_STATUS -ne 0 ] || [ $BETA_STATUS -ne 0 ]; then
echo -e "${RED}=== Schema change checks failed! ===${NC}"
exit 1
else
echo -e "${GREEN}=== All schema change checks passed successfully! ===${NC}"
exit 0
fi
Loading
Loading