From 3bb4391b79946009ff2f2966106fc776a2bfc833 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 13:15:39 -0700 Subject: [PATCH 01/11] chore(actions): generate FOSSA report on master, and ALWAYS check for Apache license copy --- .github/workflows/generate-FOSSA-report.yml | 63 ++++++++++++++++++++ .github/workflows/license-check.yml | 65 ++++----------------- 2 files changed, 73 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/generate-FOSSA-report.yml diff --git a/.github/workflows/generate-FOSSA-report.yml b/.github/workflows/generate-FOSSA-report.yml new file mode 100644 index 0000000000000..3e7b33c1a0543 --- /dev/null +++ b/.github/workflows/generate-FOSSA-report.yml @@ -0,0 +1,63 @@ +name: Generate FOSSA report + +on: + push: + branches: + - "master" + +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.FOSSA_API_KEY != '' ) || '' }}" ]; then + echo "has-secrets=1" >> "$GITHUB_OUTPUT" + fi + + license_check: + needs: config + if: needs.config.outputs.has-secrets + name: Generate Report + runs-on: ubuntu-20.04 + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@v3 + with: + persist-credentials: false + submodules: recursive + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Generate fossa report + env: + FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} + run: | + set -eo pipefail + if [[ "${{github.event_name}}" != "pull_request" ]]; then + ./scripts/fossa.sh + exit 0 + fi + + URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" + FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') + + cat<> "$GITHUB_OUTPUT" - fi - license_check: - needs: config - if: needs.config.outputs.has-secrets name: License Check runs-on: ubuntu-20.04 steps: - - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - uses: actions/checkout@v3 - with: - persist-credentials: false - submodules: recursive - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: 8 - - name: Generate fossa report - env: - FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} - run: | - set -eo pipefail - if [[ "${{github.event_name}}" != "pull_request" ]]; then - ./scripts/fossa.sh - exit 0 - fi - - URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" - FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') - - cat< Date: Mon, 29 Jan 2024 13:18:40 -0700 Subject: [PATCH 02/11] restoring steps --- .github/workflows/license-check.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index 9e6a5d359aa3d..3f64e93556b33 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -9,14 +9,14 @@ jobs: name: License Check runs-on: ubuntu-20.04 steps: - # - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - # uses: actions/checkout@v3 - # with: - # persist-credentials: false - # submodules: recursive - # - name: Setup Java - # uses: actions/setup-java@v1 - # with: - # java-version: 8 + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@v3 + with: + persist-credentials: false + submodules: recursive + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 8 - name: Run license check run: ./scripts/check_license.sh From 2d2349a6e8060a02b88fe59b4468754c5b71eea9 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 13:32:00 -0700 Subject: [PATCH 03/11] some licenses --- .rat-excludes | 4 +++- RELEASING/verify_release.py | 18 ++++++++++++++++++ RESOURCES/STANDARD_ROLES.md | 19 +++++++++++++++++++ .../examples-init.sh | 19 +++++++++++++++++++ dockerize.Dockerfile | 17 +++++++++++++++++ docs/static/img/calendar-icon.svg | 18 ++++++++++++++++++ docs/static/img/check-icon.svg | 18 ++++++++++++++++++ superset/db_engine_specs/README.md | 19 +++++++++++++++++++ 8 files changed, 131 insertions(+), 1 deletion(-) diff --git a/.rat-excludes b/.rat-excludes index f50d6a3862082..f3cfca3153874 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -1,6 +1,5 @@ # Note: these patterns are applied to single files or directories, not full paths .gitignore -docs/README.md .gitattributes .gitkeep .coverage @@ -62,3 +61,6 @@ tsconfig.tsbuildinfo .prettierignore generator-superset/* temporary_superset_ui/* + +# docs overrides for third party logos +docs/static/img/databases/* diff --git a/RELEASING/verify_release.py b/RELEASING/verify_release.py index 067154e1901f7..546bb308d4c09 100755 --- a/RELEASING/verify_release.py +++ b/RELEASING/verify_release.py @@ -1,3 +1,21 @@ +#!/usr/bin/python3 +# +# 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. +# + import re import subprocess import sys diff --git a/RESOURCES/STANDARD_ROLES.md b/RESOURCES/STANDARD_ROLES.md index 634aab5e0a21e..2cacd5ce73dc0 100644 --- a/RESOURCES/STANDARD_ROLES.md +++ b/RESOURCES/STANDARD_ROLES.md @@ -1,3 +1,22 @@ + + ||Admin|Alpha|Gamma|SQL_LAB| |---|---|---|---|---| |Permission/role description|Admins have all possible rights, including granting or revoking rights from other users and altering other people’s slices and dashboards.|Alpha users have access to all data sources, but they cannot grant or revoke access from other users. They are also limited to altering the objects that they own. Alpha users can add and alter data sources.|Gamma users have limited access. They can only consume data coming from data sources they have been given access to through another complementary role. They only have access to view the slices and dashboards made from data sources that they have access to. Currently Gamma users are not able to alter or add data sources. We assume that they are mostly content consumers, though they can create slices and dashboards.|The sql_lab role grants access to SQL Lab. Note that while Admin users have access to all databases by default, both Alpha and Gamma users need to be given access on a per database basis.|| diff --git a/docker/docker-entrypoint-initdb.d/examples-init.sh b/docker/docker-entrypoint-initdb.d/examples-init.sh index 0eaedf2b7e8b0..bed15432535fc 100755 --- a/docker/docker-entrypoint-initdb.d/examples-init.sh +++ b/docker/docker-entrypoint-initdb.d/examples-init.sh @@ -1,3 +1,22 @@ +#!/usr/bin/env bash + +# 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. + # ------------------------------------------------------------------------ # Creates the examples database and respective user. This database location # and access credentials are defined on the environment variables diff --git a/dockerize.Dockerfile b/dockerize.Dockerfile index 923295c457100..1a23f36d11a73 100644 --- a/dockerize.Dockerfile +++ b/dockerize.Dockerfile @@ -1,3 +1,20 @@ +# +# 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. +# + FROM alpine:latest ARG DOCKERIZE_VERSION=v0.7.0 diff --git a/docs/static/img/calendar-icon.svg b/docs/static/img/calendar-icon.svg index 0116e4690f47a..52f773924ca8f 100644 --- a/docs/static/img/calendar-icon.svg +++ b/docs/static/img/calendar-icon.svg @@ -1 +1,19 @@ + diff --git a/docs/static/img/check-icon.svg b/docs/static/img/check-icon.svg index 858b2d3f3a6aa..af003c42210af 100644 --- a/docs/static/img/check-icon.svg +++ b/docs/static/img/check-icon.svg @@ -1,3 +1,21 @@ + diff --git a/superset/db_engine_specs/README.md b/superset/db_engine_specs/README.md index b8c02dc84c058..ee4c4ce9e5b25 100644 --- a/superset/db_engine_specs/README.md +++ b/superset/db_engine_specs/README.md @@ -1,3 +1,22 @@ + + # Database engine specifications Superset uses [SQLAlchemy](https://www.sqlalchemy.org/) as an abstraction layer for running queries and fetching metadata from tables (like column names and types). Unfortunately, while SQLAlchemy offers enough functionality to allow connecting Superset to dozens of databases, there are still implementation details that differ across them. Because of this, Superset has an additional abstraction on top of SQLAlchemy, called a "database engine specification" or, simply, "DB engine spec". From d074ec3e112a70d71f4739280c67115da8068889 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 13:40:08 -0700 Subject: [PATCH 04/11] more licenses --- scripts/tag_latest_release.sh | 28 +++++++++---------- .../superset-ui-core/src/utils/html.tsx | 18 ++++++++++++ .../src/validator/validateMaxValue.ts | 18 ++++++++++++ .../scripts/eslint-metrics-uploader.js | 18 ++++++++++++ .../AuditInfo/ModifiedInfo.test.tsx | 18 ++++++++++++ .../src/components/AuditInfo/index.tsx | 18 ++++++++++++ .../src/components/Tags/utils.test.tsx | 18 ++++++++++++ .../DownloadAsImage.test.tsx | 18 ++++++++++++ .../DownloadMenuItems/DownloadAsImage.tsx | 18 ++++++++++++ .../DownloadMenuItems/DownloadAsPdf.test.tsx | 18 ++++++++++++ .../menu/DownloadMenuItems/DownloadAsPdf.tsx | 18 ++++++++++++ .../DownloadMenuItems.test.tsx | 18 ++++++++++++ .../controls/ContourControl/types.ts | 18 ++++++++++++ .../controls/CurrencyControl/index.ts | 18 ++++++++++++ superset-frontend/src/types/dom-to-pdf.d.ts | 18 ++++++++++++ superset/db_engine_specs/databend.py | 10 +++++++ superset/migrations/shared/constraints.py | 16 +++++++++++ superset/migrations/shared/native_filters.py | 16 +++++++++++ tests/unit_tests/forms_tests.py | 16 +++++++++++ .../scripts/docker_build_push_test.py | 16 +++++++++++ tests/unit_tests/tags/__init__.py | 16 +++++++++++ tests/unit_tests/tags/commands/create_test.py | 16 +++++++++++ tests/unit_tests/tags/commands/update_test.py | 16 +++++++++++ tests/unit_tests/tasks/test_async_queries.py | 16 +++++++++++ 24 files changed, 404 insertions(+), 14 deletions(-) diff --git a/scripts/tag_latest_release.sh b/scripts/tag_latest_release.sh index f2ee846a63889..58f192039ba80 100755 --- a/scripts/tag_latest_release.sh +++ b/scripts/tag_latest_release.sh @@ -1,20 +1,20 @@ #! /bin/bash +# 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 # -# 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. +# 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. run_git_tag () { if [[ "$DRY_RUN" == "false" ]] && [[ "$SKIP_TAG" == "false" ]] diff --git a/superset-frontend/packages/superset-ui-core/src/utils/html.tsx b/superset-frontend/packages/superset-ui-core/src/utils/html.tsx index fffd43bda8f6e..95695ed5877f5 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/html.tsx +++ b/superset-frontend/packages/superset-ui-core/src/utils/html.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React from 'react'; import { FilterXSS, getDefaultWhiteList } from 'xss'; diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts index 24c1da1c79dde..9d22851b9b672 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts @@ -1,3 +1,21 @@ +/** + * 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. + */ import { t } from '../translation'; export default function validateMaxValue(v: unknown, max: Number) { diff --git a/superset-frontend/scripts/eslint-metrics-uploader.js b/superset-frontend/scripts/eslint-metrics-uploader.js index db10bed18b09b..6c6d4a9de92b2 100644 --- a/superset-frontend/scripts/eslint-metrics-uploader.js +++ b/superset-frontend/scripts/eslint-metrics-uploader.js @@ -1,3 +1,21 @@ +/** + * 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. + */ const { google } = require('googleapis'); const { SPREADSHEET_ID } = process.env; diff --git a/superset-frontend/src/components/AuditInfo/ModifiedInfo.test.tsx b/superset-frontend/src/components/AuditInfo/ModifiedInfo.test.tsx index af9d6913d80d9..03ee325456e8c 100644 --- a/superset-frontend/src/components/AuditInfo/ModifiedInfo.test.tsx +++ b/superset-frontend/src/components/AuditInfo/ModifiedInfo.test.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React from 'react'; import { render, screen, waitFor } from 'spec/helpers/testing-library'; import '@testing-library/jest-dom'; diff --git a/superset-frontend/src/components/AuditInfo/index.tsx b/superset-frontend/src/components/AuditInfo/index.tsx index 24223a1554a31..56e41682344f6 100644 --- a/superset-frontend/src/components/AuditInfo/index.tsx +++ b/superset-frontend/src/components/AuditInfo/index.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React from 'react'; import Owner from 'src/types/Owner'; diff --git a/superset-frontend/src/components/Tags/utils.test.tsx b/superset-frontend/src/components/Tags/utils.test.tsx index 72a1df8220af4..b6d28d60c1a74 100644 --- a/superset-frontend/src/components/Tags/utils.test.tsx +++ b/superset-frontend/src/components/Tags/utils.test.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import { tagToSelectOption } from 'src/components/Tags/utils'; describe('tagToSelectOption', () => { diff --git a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.test.tsx b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.test.tsx index 7881e2a76b5ba..e908999a9aff9 100644 --- a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.test.tsx +++ b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.test.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React, { SyntheticEvent } from 'react'; import { render, screen, waitFor } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; diff --git a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.tsx b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.tsx index 4d7d466348a38..0ef7a9bfe4fe0 100644 --- a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.tsx +++ b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsImage.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React, { SyntheticEvent } from 'react'; import { logging, t } from '@superset-ui/core'; import { Menu } from 'src/components/Menu'; diff --git a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.test.tsx b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.test.tsx index 371026e7aad14..c685d929d8f14 100644 --- a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.test.tsx +++ b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.test.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React, { SyntheticEvent } from 'react'; import { render, screen, waitFor } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; diff --git a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.tsx b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.tsx index eb3616b731e74..3d967a41fdbc5 100644 --- a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.tsx +++ b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadAsPdf.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React, { SyntheticEvent } from 'react'; import { logging, t } from '@superset-ui/core'; import { Menu } from 'src/components/Menu'; diff --git a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx index e93d7bd3edbe6..a9fa46f31ef97 100644 --- a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx +++ b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx @@ -1,3 +1,21 @@ +/** + * 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. + */ import React from 'react'; import { render, screen } from 'spec/helpers/testing-library'; import DownloadMenuItems from '.'; diff --git a/superset-frontend/src/explore/components/controls/ContourControl/types.ts b/superset-frontend/src/explore/components/controls/ContourControl/types.ts index aab03df3800e9..315e7cec57a32 100644 --- a/superset-frontend/src/explore/components/controls/ContourControl/types.ts +++ b/superset-frontend/src/explore/components/controls/ContourControl/types.ts @@ -1,3 +1,21 @@ +/** + * 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. + */ import { OptionValueType } from 'src/explore/components/controls/DndColumnSelectControl/types'; import { ControlComponentProps } from 'src/explore/components/Control'; diff --git a/superset-frontend/src/explore/components/controls/CurrencyControl/index.ts b/superset-frontend/src/explore/components/controls/CurrencyControl/index.ts index d99ab577675e8..06179283c8944 100644 --- a/superset-frontend/src/explore/components/controls/CurrencyControl/index.ts +++ b/superset-frontend/src/explore/components/controls/CurrencyControl/index.ts @@ -1,3 +1,21 @@ +/** + * 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. + */ import { CurrencyControl } from './CurrencyControl'; export { CurrencyControl as default }; diff --git a/superset-frontend/src/types/dom-to-pdf.d.ts b/superset-frontend/src/types/dom-to-pdf.d.ts index 19ecce85b4bfd..28c06163fdbe8 100644 --- a/superset-frontend/src/types/dom-to-pdf.d.ts +++ b/superset-frontend/src/types/dom-to-pdf.d.ts @@ -1,3 +1,21 @@ +/** + * 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. + */ declare module 'dom-to-pdf' { interface Image { type: string; diff --git a/superset/db_engine_specs/databend.py b/superset/db_engine_specs/databend.py index ff28ee08a37c1..9789512450b65 100644 --- a/superset/db_engine_specs/databend.py +++ b/superset/db_engine_specs/databend.py @@ -1,3 +1,13 @@ +# 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 diff --git a/superset/migrations/shared/constraints.py b/superset/migrations/shared/constraints.py index df08f841e5a91..d3bc140fd0bab 100644 --- a/superset/migrations/shared/constraints.py +++ b/superset/migrations/shared/constraints.py @@ -1,3 +1,19 @@ +# 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. from __future__ import annotations from dataclasses import dataclass diff --git a/superset/migrations/shared/native_filters.py b/superset/migrations/shared/native_filters.py index c30c7d378920f..05b9f4033fabc 100644 --- a/superset/migrations/shared/native_filters.py +++ b/superset/migrations/shared/native_filters.py @@ -1,3 +1,19 @@ +# 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. import json from collections import defaultdict from textwrap import dedent diff --git a/tests/unit_tests/forms_tests.py b/tests/unit_tests/forms_tests.py index 0ede23551ff76..4ca628805ff25 100644 --- a/tests/unit_tests/forms_tests.py +++ b/tests/unit_tests/forms_tests.py @@ -1,3 +1,19 @@ +# 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. import contextlib import tempfile from typing import Optional diff --git a/tests/unit_tests/scripts/docker_build_push_test.py b/tests/unit_tests/scripts/docker_build_push_test.py index edfd339bbc8fe..17653844aa59c 100644 --- a/tests/unit_tests/scripts/docker_build_push_test.py +++ b/tests/unit_tests/scripts/docker_build_push_test.py @@ -1,3 +1,19 @@ +# 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. import re import subprocess from unittest import mock diff --git a/tests/unit_tests/tags/__init__.py b/tests/unit_tests/tags/__init__.py index e69de29bb2d1d..d216be4ddc949 100644 --- a/tests/unit_tests/tags/__init__.py +++ b/tests/unit_tests/tags/__init__.py @@ -0,0 +1,16 @@ +# 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. \ No newline at end of file diff --git a/tests/unit_tests/tags/commands/create_test.py b/tests/unit_tests/tags/commands/create_test.py index ca31e44566ecf..b18144521a452 100644 --- a/tests/unit_tests/tags/commands/create_test.py +++ b/tests/unit_tests/tags/commands/create_test.py @@ -1,3 +1,19 @@ +# 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. import pytest from pytest_mock import MockFixture from sqlalchemy.orm.session import Session diff --git a/tests/unit_tests/tags/commands/update_test.py b/tests/unit_tests/tags/commands/update_test.py index 47ef16e4e7162..e488321228cd9 100644 --- a/tests/unit_tests/tags/commands/update_test.py +++ b/tests/unit_tests/tags/commands/update_test.py @@ -1,3 +1,19 @@ +# 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. import pytest from pytest_mock import MockFixture from sqlalchemy.orm.session import Session diff --git a/tests/unit_tests/tasks/test_async_queries.py b/tests/unit_tests/tasks/test_async_queries.py index 1e14d742da619..fa8c2efbf2332 100644 --- a/tests/unit_tests/tasks/test_async_queries.py +++ b/tests/unit_tests/tasks/test_async_queries.py @@ -1,3 +1,19 @@ +# 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. from unittest import mock import pytest From 4dcd51d2cc4a4a5b8a998728f2083215a6dc822a Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 13:46:16 -0700 Subject: [PATCH 05/11] lint --- tests/unit_tests/tags/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/tags/__init__.py b/tests/unit_tests/tags/__init__.py index d216be4ddc949..13a83393a9124 100644 --- a/tests/unit_tests/tags/__init__.py +++ b/tests/unit_tests/tags/__init__.py @@ -13,4 +13,4 @@ # "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. \ No newline at end of file +# under the License. From 44cd4a981d2f9b82bb592acf794d381a67d81204 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 13:51:42 -0700 Subject: [PATCH 06/11] fixing(?) rat-excludes --- .rat-excludes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rat-excludes b/.rat-excludes index f3cfca3153874..700da9394f9cf 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -63,4 +63,4 @@ generator-superset/* temporary_superset_ui/* # docs overrides for third party logos -docs/static/img/databases/* +superset/docs/static/img/databases/* From b291658705500f49ad93b32c239e0b14add6b059 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 13:58:15 -0700 Subject: [PATCH 07/11] more cleanup! --- .rat-excludes | 3 +-- .../scripts/tag_latest_release_test.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.rat-excludes b/.rat-excludes index 700da9394f9cf..549a8c2bd8614 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -35,7 +35,6 @@ apache_superset.egg-info # Generated doc files env/* docs/.htaccess* -docs-v2/.htaccess* .nojekyll _build/* _static/* @@ -63,4 +62,4 @@ generator-superset/* temporary_superset_ui/* # docs overrides for third party logos -superset/docs/static/img/databases/* +docs/static/img/databases/*.svg \ No newline at end of file diff --git a/tests/unit_tests/scripts/tag_latest_release_test.py b/tests/unit_tests/scripts/tag_latest_release_test.py index 7b15a1670a7b0..6dbb0eee4e979 100644 --- a/tests/unit_tests/scripts/tag_latest_release_test.py +++ b/tests/unit_tests/scripts/tag_latest_release_test.py @@ -1,3 +1,19 @@ +# 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. import subprocess from unittest import mock from unittest.mock import patch From 86fa285c7670a11739e686c8da46e227b4f497a8 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 14:04:35 -0700 Subject: [PATCH 08/11] come on rat-catcher! --- .rat-excludes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rat-excludes b/.rat-excludes index 549a8c2bd8614..cd4ac59d8d97b 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -62,4 +62,4 @@ generator-superset/* temporary_superset_ui/* # docs overrides for third party logos -docs/static/img/databases/*.svg \ No newline at end of file +databases/*.svg \ No newline at end of file From 32349887e594fdb6047e09296e13322f81188bb5 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 14:06:47 -0700 Subject: [PATCH 09/11] ugh... --- .rat-excludes | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.rat-excludes b/.rat-excludes index cd4ac59d8d97b..5d57ff75fe4a6 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -62,4 +62,9 @@ generator-superset/* temporary_superset_ui/* # docs overrides for third party logos -databases/*.svg \ No newline at end of file +docs/static/img/databases/apache-pinot.svg +docs/static/img/databases/csv.svg +docs/static/img/databases/google-big-query.svg +docs/static/img/databases/google-sheets.svg +docs/static/img/databases/postgresql.svg +docs/static/img/databases/snowflake.svg \ No newline at end of file From 0300ae7eb09d860cff360b7ee95070a2162b664d Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 14:19:28 -0700 Subject: [PATCH 10/11] more random stuff... --- .rat-excludes | 12 +++++------- docs/static/img/databases/apache-pinot.svg | 18 ++++++++++++++++++ docs/static/img/databases/csv.svg | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/.rat-excludes b/.rat-excludes index 5d57ff75fe4a6..02383d79b1b22 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -61,10 +61,8 @@ tsconfig.tsbuildinfo generator-superset/* temporary_superset_ui/* -# docs overrides for third party logos -docs/static/img/databases/apache-pinot.svg -docs/static/img/databases/csv.svg -docs/static/img/databases/google-big-query.svg -docs/static/img/databases/google-sheets.svg -docs/static/img/databases/postgresql.svg -docs/static/img/databases/snowflake.svg \ No newline at end of file +# docs overrides for third party logos we don't have the rights to +google-big-query.svg +google-sheets.svg +postgresql.svg +snowflake.svg \ No newline at end of file diff --git a/docs/static/img/databases/apache-pinot.svg b/docs/static/img/databases/apache-pinot.svg index 0d69dd4d2fb3c..d88742516b261 100644 --- a/docs/static/img/databases/apache-pinot.svg +++ b/docs/static/img/databases/apache-pinot.svg @@ -1,3 +1,21 @@ + diff --git a/docs/static/img/databases/csv.svg b/docs/static/img/databases/csv.svg index 792b90deeeb5f..88d66ead56b5a 100644 --- a/docs/static/img/databases/csv.svg +++ b/docs/static/img/databases/csv.svg @@ -1,3 +1,21 @@ + From cc1017550e9bab36901e1edd17f75e5be935c4d6 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 29 Jan 2024 14:27:28 -0700 Subject: [PATCH 11/11] more linting --- .rat-excludes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rat-excludes b/.rat-excludes index 02383d79b1b22..e7f7b47a51b26 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -65,4 +65,4 @@ temporary_superset_ui/* google-big-query.svg google-sheets.svg postgresql.svg -snowflake.svg \ No newline at end of file +snowflake.svg