-
Notifications
You must be signed in to change notification settings - Fork 14.9k
feat(CI): Enforce charts metadata backward compatibility check #33180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
geido
wants to merge
9
commits into
master
Choose a base branch
from
geido/feat/ci-metadata-backward-check
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
57da943
feat(CI): Enforce charts metadata backward compatibility check
geido dafb135
Trigger Sample Change - to be reverted
geido ca4f956
fix(Workflow): Keep changed files local
geido 28af4be
fix(Workflow) Re-trigger on label
geido b3a6940
Sample Change - reverted
geido b14a387
chore(Workflow) Improve chart metadata compatibility msg
geido c26a4d3
Sample Change - retrigger error
geido 5f1c0fe
Sample Change - revert
geido c9ac7ce
chore(Workflow): Add controlPanel
geido File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: "Chart Metadata Backward Compatibility Check" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "[0-9].[0-9]*" | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review, labeled] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
backward-compatibility-check: | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
submodules: recursive | ||
|
||
- name: "Set up Git" | ||
run: | | ||
git fetch origin master | ||
|
||
- name: "Check for changes in critical files" | ||
id: check_changes | ||
run: | | ||
CHANGED_FILES=$(git diff --name-only origin/master...HEAD) | ||
echo "Changed files: $CHANGED_FILES" | ||
|
||
if echo "$CHANGED_FILES" | grep -qE '^superset-frontend/plugins/.*/(transformProps|controlPanel)'; then | ||
echo "BACKWARD_COMPATIBILITY_CHECK_FAILED=true" >> $GITHUB_ENV | ||
else | ||
echo "BACKWARD_COMPATIBILITY_CHECK_FAILED=false" >> $GITHUB_ENV | ||
fi | ||
|
||
- name: "Check for 'validation:backward-compatible' label" | ||
if: env.BACKWARD_COMPATIBILITY_CHECK_FAILED == 'true' | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const payload = context.payload.pull_request; | ||
const validationLabelPresent = !!payload.labels.find(label => label.name.includes('validation:backward-compatible')); | ||
if (!validationLabelPresent) { | ||
core.setFailed( | ||
[ | ||
"🚨 Identified potential changes to the chart metadata in `transformProps` or `controlPanel`.", | ||
"⚠️ Such changes may affect backward compatibility and cause charts dependent on previous metadata to break.", | ||
"✅ To proceed, please review your changes to confirm backward-compatibility and add the label:", | ||
"`validation:backward-compatible`", | ||
].join("\n") | ||
); | ||
} | ||
|
||
- name: "Continue with other checks" | ||
if: env.BACKWARD_COMPATIBILITY_CHECK_FAILED == 'false' | ||
run: | | ||
echo "✅ No chart metadata backward compatibility issues detected. Proceeding with further checks." |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this runs diff against master but the base might be different?