chore: Removes Chromatic workflow and dependencies (#27232)

This commit is contained in:
Michael S. Molina 2024-02-23 13:31:58 -05:00 committed by GitHub
parent 62cf0365e9
commit 6d8870125f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 10 additions and 2704 deletions

View File

@ -1,72 +0,0 @@
# .github/workflows/chromatic.yml
# see https://www.chromatic.com/docs/github-actions
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Workflow name
name: 'Chromatic Storybook Master'
# Event for the workflow
# Only run if changes were made in superset-frontend folder of repo on merge to Master
on:
# This will trigger when a branch merges to master when the PR has changes in the frontend folder updating the chromatic baseline
push:
branches:
- master
paths:
- "superset-frontend/**"
# List of jobs
jobs:
config:
runs-on: "ubuntu-latest"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
- name: "Check for secrets"
id: check
shell: bash
run: |
if [ -n "${{ (secrets.CHROMATIC_PROJECT_TOKEN != '') || '' }}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi
chromatic-deployment:
needs: config
if: needs.config.outputs.has-secrets
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Install dependencies
run: npm ci
working-directory: superset-frontend
# 👇 Build and publish Storybook to Chromatic
- name: Build and publish Storybook to Chromatic
id: chromatic-master
uses: chromaui/action@v10
# Required options for the Chromatic GitHub Action
with:
# 👇 Location of package.json from root of mono-repo
workingDir: superset-frontend
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
autoAcceptChanges: true # 👈 Option to accept all changes when merging to master

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,6 @@
"build-instrumented": "cross-env NODE_ENV=production BABEL_ENV=instrumented webpack --mode=production --color",
"build-storybook": "storybook build",
"check-translation": "prettier --check ../superset/translations/**/LC_MESSAGES/*.json",
"chromatic": "npx chromatic --skip 'dependabot/**' --only-changed",
"clean-translation": "prettier --write ../superset/translations/**/LC_MESSAGES/*.json",
"core:cover": "cross-env NODE_ENV=test jest --coverage --coverageThreshold='{\"global\":{\"statements\":100,\"branches\":100,\"functions\":100,\"lines\":100}}' --collectCoverageFrom='[\"packages/**/src/**/*.{js,ts}\", \"!packages/superset-ui-demo/**/*\"]' packages",
"cover": "cross-env NODE_ENV=test jest --coverage",
@ -57,7 +56,6 @@
"plugins:build": "node ./scripts/build.js",
"plugins:build-assets": "node ./scripts/copyAssets.js",
"plugins:build-storybook": "cd packages/superset-ui-demo && npm run build-storybook",
"plugins:chromatic": "cd packages/superset-ui-demo && npm run chromatic",
"plugins:create-conventional-version": "npm run prune && lerna version --conventional-commits --create-release github --no-private --yes",
"plugins:create-minor-version": "npm run prune && lerna version minor --no-private --yes",
"plugins:create-patch-version": "npm run prune && lerna version patch --no-private --yes",
@ -283,7 +281,6 @@
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-jsx-remove-data-test-id": "^2.1.3",
"babel-plugin-lodash": "^3.3.4",
"chromatic": "^6.7.4",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^5.2.1",
"css-loader": "^6.8.1",

View File

@ -62,7 +62,6 @@
"@babel/preset-typescript": "^7.23.3",
"@storybook/react-webpack5": "^7.6.13",
"babel-loader": "^8.1.0",
"chromatic": "^5.4.0",
"fork-ts-checker-webpack-plugin": "^5.0.7",
"ts-loader": "^7.0.4",
"typescript": "^4.5.4"

View File

@ -90,9 +90,6 @@ export default function createQueryStory({
</div>
);
};
story.parameters = {
chromatic: { disable: true },
};
story.args = {
host: 'localhost:8088',
mode: keys[0],

View File

@ -40,7 +40,7 @@ export default {
],
};
export const configureCORS = ({
export const ConfigureCORS = ({
host,
selectEndpoint,
customEndpoint,
@ -84,18 +84,14 @@ export const configureCORS = ({
</div>
);
};
configureCORS.parameters = {
chromatic: { disable: true },
};
configureCORS.args = {
ConfigureCORS.args = {
host: 'localhost:8088',
selectEndpoint: '/api/v1/chart/data',
customEndpoint: '',
methodOption: 'POST', // TODO disable when custonEndpoint and selectEndpoint are empty
postPayloadContents: JSON.stringify({ form_data: bigNumberFormData }),
};
configureCORS.argTypes = {
ConfigureCORS.argTypes = {
host: {
control: 'text',
description: 'Set Superset App host for CORS request',
@ -122,4 +118,4 @@ configureCORS.argTypes = {
description: 'Set POST payload contents',
},
};
configureCORS.storyName = 'Verify CORS';
ConfigureCORS.storyName = 'Verify CORS';