This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch geido/feat/ci-metadata-backward-check
in repository https://gitbox.apache.org/repos/asf/superset.git

commit e217aec8d1ab5c9a36ecbd36ee8804dcdd44c2d3
Author: Diego Pucci <[email protected]>
AuthorDate: Fri Apr 18 12:03:27 2025 +0300

    feat(CI): Enforce charts metadata backward compatibility check
---
 .../workflows/metadata-backward-compatibility.yml  | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/.github/workflows/metadata-backward-compatibility.yml 
b/.github/workflows/metadata-backward-compatibility.yml
new file mode 100644
index 0000000000..c37a922841
--- /dev/null
+++ b/.github/workflows/metadata-backward-compatibility.yml
@@ -0,0 +1,44 @@
+name: Enforce Metadata Backward Compatibility Check
+
+on:
+  pull_request:
+    types: [opened, synchronize, reopened, labeled]
+
+jobs:
+  check_backward_compatibility:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Check out code
+        uses: actions/checkout@v4
+
+      - name: Get list of changed files
+        id: files
+        run: |
+          echo "CHANGED_FILES=$(git diff --name-only origin/${{ 
github.base_ref }}...HEAD)" >> $GITHUB_ENV
+
+      - name: Check for changes to transformProps.ts
+        id: check_transform
+        run: |
+          echo "${CHANGED_FILES}" | grep -qE 
'superset-frontend/plugins/.+/transformProps\.ts' && echo "touched=true" >> 
$GITHUB_OUTPUT || echo "touched=false" >> $GITHUB_OUTPUT
+
+      - name: Check for confirmation label
+        if: steps.check_transform.outputs.touched == 'true'
+        uses: actions/github-script@v7
+        with:
+          script: |
+            const labels = await github.rest.issues.listLabelsOnIssue({
+              issue_number: context.issue.number,
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+            });
+
+            const hasLabel = labels.data.some(label => label.name === 
'backward-compatibility-confirmed');
+
+            if (!hasLabel) {
+                core.setFailed(
+                '❗️⚠️ Detected changes to critical chart metadata (e.g., 
transformProps.ts).\n' +
+                'Please ensure backward compatibility is maintained before 
merging.\n' +
+                'To proceed, add the label: "backward-compatibility-confirmed" 
to this PR.'
+                );
+            }

Reply via email to