From f69d36839deb22a8be7614dff9e6d7fd84f54ecc Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 11:10:59 -0400 Subject: [PATCH 01/15] add shadcnn MIT LICENSE + add SPDX lc headers to ui/ files --- LICENSE | 1 + app/frontend/src/components/ui/accordion.tsx | 3 +++ app/frontend/src/components/ui/alert-dialog.tsx | 3 +++ app/frontend/src/components/ui/alert.tsx | 3 +++ app/frontend/src/components/ui/aspect-ratio.tsx | 3 +++ app/frontend/src/components/ui/badge.tsx | 3 +++ app/frontend/src/components/ui/breadcrumb.tsx | 3 +++ app/frontend/src/components/ui/button.tsx | 3 +++ app/frontend/src/components/ui/card.tsx | 3 +++ app/frontend/src/components/ui/collapsible.tsx | 3 +++ app/frontend/src/components/ui/command.tsx | 3 +++ app/frontend/src/components/ui/dialog.tsx | 3 +++ app/frontend/src/components/ui/drawer.tsx | 3 +++ app/frontend/src/components/ui/dropdown-menu.tsx | 3 +++ app/frontend/src/components/ui/form.tsx | 3 +++ app/frontend/src/components/ui/input.tsx | 3 +++ app/frontend/src/components/ui/label.tsx | 3 +++ app/frontend/src/components/ui/menubar.tsx | 5 ++++- app/frontend/src/components/ui/navigation-menu.tsx | 3 +++ app/frontend/src/components/ui/popover.tsx | 3 +++ app/frontend/src/components/ui/progress.tsx | 3 +++ app/frontend/src/components/ui/scroll-area.tsx | 3 +++ app/frontend/src/components/ui/select.tsx | 3 +++ app/frontend/src/components/ui/separator.tsx | 3 +++ app/frontend/src/components/ui/skeleton.tsx | 3 +++ app/frontend/src/components/ui/spinner.tsx | 3 +++ app/frontend/src/components/ui/stepper.tsx | 3 +++ app/frontend/src/components/ui/table.tsx | 3 +++ app/frontend/src/components/ui/textarea.tsx | 3 +++ app/frontend/src/components/ui/tooltip.tsx | 3 +++ 30 files changed, 89 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 23e63805..6059935c 100644 --- a/LICENSE +++ b/LICENSE @@ -198,4 +198,5 @@ distributed as part of the software: - Django [License available here](https://github.com/django/django/blob/main/LICENSE) - Docker [License available here](https://github.com/docker/docs/blob/main/LICENSE) +- shadcn/ui [License available here](https://github.com/shadcn/ui/blob/main/LICENSE.md) - Third Party Libraries used in Frontend Product [License available here](app/frontend/third-party-licenses.txt) \ No newline at end of file diff --git a/app/frontend/src/components/ui/accordion.tsx b/app/frontend/src/components/ui/accordion.tsx index 797f551c..eee44dde 100644 --- a/app/frontend/src/components/ui/accordion.tsx +++ b/app/frontend/src/components/ui/accordion.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as AccordionPrimitive from "@radix-ui/react-accordion"; import { ChevronDown } from "lucide-react"; diff --git a/app/frontend/src/components/ui/alert-dialog.tsx b/app/frontend/src/components/ui/alert-dialog.tsx index 7e9f7a52..ad303088 100644 --- a/app/frontend/src/components/ui/alert-dialog.tsx +++ b/app/frontend/src/components/ui/alert-dialog.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" diff --git a/app/frontend/src/components/ui/alert.tsx b/app/frontend/src/components/ui/alert.tsx index 7a5425db..2ad41370 100644 --- a/app/frontend/src/components/ui/alert.tsx +++ b/app/frontend/src/components/ui/alert.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "../../lib/utils"; diff --git a/app/frontend/src/components/ui/aspect-ratio.tsx b/app/frontend/src/components/ui/aspect-ratio.tsx index c4abbf37..6b1f22be 100644 --- a/app/frontend/src/components/ui/aspect-ratio.tsx +++ b/app/frontend/src/components/ui/aspect-ratio.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio" const AspectRatio = AspectRatioPrimitive.Root diff --git a/app/frontend/src/components/ui/badge.tsx b/app/frontend/src/components/ui/badge.tsx index 8715086f..f2bbcdad 100644 --- a/app/frontend/src/components/ui/badge.tsx +++ b/app/frontend/src/components/ui/badge.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + /* this shadcnn badge component has been updated to be more specific to a status badge component and should not be used for the other badges in the application */ diff --git a/app/frontend/src/components/ui/breadcrumb.tsx b/app/frontend/src/components/ui/breadcrumb.tsx index b487e5ba..0606ca60 100644 --- a/app/frontend/src/components/ui/breadcrumb.tsx +++ b/app/frontend/src/components/ui/breadcrumb.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { ChevronRight, MoreHorizontal } from "lucide-react"; diff --git a/app/frontend/src/components/ui/button.tsx b/app/frontend/src/components/ui/button.tsx index e4f754e5..13cbd676 100644 --- a/app/frontend/src/components/ui/button.tsx +++ b/app/frontend/src/components/ui/button.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { cva, type VariantProps } from "class-variance-authority"; diff --git a/app/frontend/src/components/ui/card.tsx b/app/frontend/src/components/ui/card.tsx index e897db6e..36a9bd92 100644 --- a/app/frontend/src/components/ui/card.tsx +++ b/app/frontend/src/components/ui/card.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { cn } from "../../lib/utils"; diff --git a/app/frontend/src/components/ui/collapsible.tsx b/app/frontend/src/components/ui/collapsible.tsx index a23e7a28..989bb3b3 100644 --- a/app/frontend/src/components/ui/collapsible.tsx +++ b/app/frontend/src/components/ui/collapsible.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as CollapsiblePrimitive from "@radix-ui/react-collapsible" const Collapsible = CollapsiblePrimitive.Root diff --git a/app/frontend/src/components/ui/command.tsx b/app/frontend/src/components/ui/command.tsx index 7936e515..722e984e 100644 --- a/app/frontend/src/components/ui/command.tsx +++ b/app/frontend/src/components/ui/command.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { type DialogProps } from "@radix-ui/react-dialog"; import { Command as CommandPrimitive } from "cmdk"; diff --git a/app/frontend/src/components/ui/dialog.tsx b/app/frontend/src/components/ui/dialog.tsx index 91fdef77..df4f159b 100644 --- a/app/frontend/src/components/ui/dialog.tsx +++ b/app/frontend/src/components/ui/dialog.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; diff --git a/app/frontend/src/components/ui/drawer.tsx b/app/frontend/src/components/ui/drawer.tsx index ac053485..50791cce 100644 --- a/app/frontend/src/components/ui/drawer.tsx +++ b/app/frontend/src/components/ui/drawer.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { Drawer as DrawerPrimitive } from "vaul"; diff --git a/app/frontend/src/components/ui/dropdown-menu.tsx b/app/frontend/src/components/ui/dropdown-menu.tsx index 9d393e91..1456dbca 100644 --- a/app/frontend/src/components/ui/dropdown-menu.tsx +++ b/app/frontend/src/components/ui/dropdown-menu.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; import { Check, ChevronRight, Circle } from "lucide-react"; diff --git a/app/frontend/src/components/ui/form.tsx b/app/frontend/src/components/ui/form.tsx index 2758e3a7..7c29acc7 100644 --- a/app/frontend/src/components/ui/form.tsx +++ b/app/frontend/src/components/ui/form.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; import { Slot } from "@radix-ui/react-slot"; diff --git a/app/frontend/src/components/ui/input.tsx b/app/frontend/src/components/ui/input.tsx index 9162fcb5..ca7b4ba5 100644 --- a/app/frontend/src/components/ui/input.tsx +++ b/app/frontend/src/components/ui/input.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { cn } from "../../lib/utils"; diff --git a/app/frontend/src/components/ui/label.tsx b/app/frontend/src/components/ui/label.tsx index 38ed561d..b64ea835 100644 --- a/app/frontend/src/components/ui/label.tsx +++ b/app/frontend/src/components/ui/label.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; import { cva, type VariantProps } from "class-variance-authority"; diff --git a/app/frontend/src/components/ui/menubar.tsx b/app/frontend/src/components/ui/menubar.tsx index 107f38f7..82b49267 100644 --- a/app/frontend/src/components/ui/menubar.tsx +++ b/app/frontend/src/components/ui/menubar.tsx @@ -1,8 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react" import * as MenubarPrimitive from "@radix-ui/react-menubar" import { Check, ChevronRight, Circle } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../../lib/utils"; const MenubarMenu = MenubarPrimitive.Menu diff --git a/app/frontend/src/components/ui/navigation-menu.tsx b/app/frontend/src/components/ui/navigation-menu.tsx index 7525f23d..7a101d00 100644 --- a/app/frontend/src/components/ui/navigation-menu.tsx +++ b/app/frontend/src/components/ui/navigation-menu.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"; import { cva } from "class-variance-authority"; diff --git a/app/frontend/src/components/ui/popover.tsx b/app/frontend/src/components/ui/popover.tsx index 90e150cf..5488879b 100644 --- a/app/frontend/src/components/ui/popover.tsx +++ b/app/frontend/src/components/ui/popover.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as PopoverPrimitive from "@radix-ui/react-popover"; diff --git a/app/frontend/src/components/ui/progress.tsx b/app/frontend/src/components/ui/progress.tsx index e2ec376a..94beb13a 100644 --- a/app/frontend/src/components/ui/progress.tsx +++ b/app/frontend/src/components/ui/progress.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as ProgressPrimitive from "@radix-ui/react-progress"; diff --git a/app/frontend/src/components/ui/scroll-area.tsx b/app/frontend/src/components/ui/scroll-area.tsx index 38ba8f7e..b21466b6 100644 --- a/app/frontend/src/components/ui/scroll-area.tsx +++ b/app/frontend/src/components/ui/scroll-area.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; diff --git a/app/frontend/src/components/ui/select.tsx b/app/frontend/src/components/ui/select.tsx index 1f44bda0..4a0622cc 100644 --- a/app/frontend/src/components/ui/select.tsx +++ b/app/frontend/src/components/ui/select.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as SelectPrimitive from "@radix-ui/react-select"; import { Check, ChevronDown, ChevronUp } from "lucide-react"; diff --git a/app/frontend/src/components/ui/separator.tsx b/app/frontend/src/components/ui/separator.tsx index c099db61..0e645fc9 100644 --- a/app/frontend/src/components/ui/separator.tsx +++ b/app/frontend/src/components/ui/separator.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as SeparatorPrimitive from "@radix-ui/react-separator"; import { cn } from "../../lib/utils"; diff --git a/app/frontend/src/components/ui/skeleton.tsx b/app/frontend/src/components/ui/skeleton.tsx index 6e10fe23..afa65298 100644 --- a/app/frontend/src/components/ui/skeleton.tsx +++ b/app/frontend/src/components/ui/skeleton.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import { cn } from "../../lib/utils"; function Skeleton({ diff --git a/app/frontend/src/components/ui/spinner.tsx b/app/frontend/src/components/ui/spinner.tsx index ebea8760..0de1942f 100644 --- a/app/frontend/src/components/ui/spinner.tsx +++ b/app/frontend/src/components/ui/spinner.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import React from "react"; export const Spinner: React.FC = () => { diff --git a/app/frontend/src/components/ui/stepper.tsx b/app/frontend/src/components/ui/stepper.tsx index 2fa0d8e2..e95b6676 100644 --- a/app/frontend/src/components/ui/stepper.tsx +++ b/app/frontend/src/components/ui/stepper.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + "use client"; import * as React from "react"; diff --git a/app/frontend/src/components/ui/table.tsx b/app/frontend/src/components/ui/table.tsx index d038ce48..04503f9e 100644 --- a/app/frontend/src/components/ui/table.tsx +++ b/app/frontend/src/components/ui/table.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { cn } from "../../lib/utils"; diff --git a/app/frontend/src/components/ui/textarea.tsx b/app/frontend/src/components/ui/textarea.tsx index 1583748f..a12feafd 100644 --- a/app/frontend/src/components/ui/textarea.tsx +++ b/app/frontend/src/components/ui/textarea.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import { cn } from "../../lib/utils"; diff --git a/app/frontend/src/components/ui/tooltip.tsx b/app/frontend/src/components/ui/tooltip.tsx index 7c0f2be0..b10d06bf 100644 --- a/app/frontend/src/components/ui/tooltip.tsx +++ b/app/frontend/src/components/ui/tooltip.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (c) 2023 shadcn +// SPDX-License-Identifier: MIT + import * as React from "react"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; From 55e552ff192f41a327786f5ab350e6303f1258d5 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 11:13:40 -0400 Subject: [PATCH 02/15] check workflows to work without auto commit + instead add PR comments --- .github/workflows/backend-license-checker.yml | 32 +++++------ .../frontend-lint-license-checker.yml | 56 +++++++++---------- app/api/docker_control/admin.py | 4 +- app/frontend/src/api/modelsDeployedApis.ts | 3 +- 4 files changed, 46 insertions(+), 49 deletions(-) diff --git a/.github/workflows/backend-license-checker.yml b/.github/workflows/backend-license-checker.yml index d7cb5ae1..4e36d58f 100644 --- a/.github/workflows/backend-license-checker.yml +++ b/.github/workflows/backend-license-checker.yml @@ -71,23 +71,23 @@ jobs: echo "Extracted Files:" echo "$FILES" - # Run the `add_spdx_header.py` script to fix missing SPDX headers - - name: Run SPDX Header Script - if: env.FILES != '' - run: | - set +e - python add_spdx_header.py # Run the script to add SPDX headers to the missing files - exit 0 + # # Run the `add_spdx_header.py` script to fix missing SPDX headers + # - name: Run SPDX Header Script + # if: env.FILES != '' + # run: | + # set +e + # python add_spdx_header.py # Run the script to add SPDX headers to the missing files + # exit 0 - # Commit the changes made by `add_spdx_header.py` - - name: Commit changes - if: env.FILES != '' - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_user_name: SPDX-Bot - commit_user_email: bot@example.com - commit_message: '🚨✨AUTOMATED COMMIT | Added missing SPDX license headers automatically' - branch: ${{ github.head_ref }} + # # Commit the changes made by `add_spdx_header.py` + # - name: Commit changes + # if: env.FILES != '' + # uses: stefanzweifel/git-auto-commit-action@v5 + # with: + # commit_user_name: SPDX-Bot + # commit_user_email: bot@example.com + # commit_message: '🚨✨AUTOMATED COMMIT | Added missing SPDX license headers automatically' + # branch: ${{ github.head_ref }} # Extract and clean file paths - name: Extract File Paths diff --git a/.github/workflows/frontend-lint-license-checker.yml b/.github/workflows/frontend-lint-license-checker.yml index 2bcdbd94..d9c13846 100644 --- a/.github/workflows/frontend-lint-license-checker.yml +++ b/.github/workflows/frontend-lint-license-checker.yml @@ -40,34 +40,34 @@ jobs: set +e npm run lint || true # Run lint and allow the workflow to continue even if there are warnings/errors - # Check if GPG key exists - - name: Check if GPG key exists - run: | - if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then - echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV - else - echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV - fi - - # Import GPG key if it exists - - name: Import GPG key if it exists - if: env.GPG_KEY_EXISTS == 'true' - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} - git_user_signingkey: true - git_commit_gpgsign: true - - # Auto-commit changes using stefanzweifel/git-auto-commit-action - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_user_name: CleanBot - commit_user_email: your-email@example.com - commit_message: '🚨✨ AUTOMATED COMMIT | Applied Code Formatting, Cleanup and added SPDX license headers' - commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }} - branch: ${{ github.head_ref }} + # # Check if GPG key exists + # - name: Check if GPG key exists + # run: | + # if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then + # echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV + # else + # echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV + # fi + + # # Import GPG key if it exists + # - name: Import GPG key if it exists + # if: env.GPG_KEY_EXISTS == 'true' + # uses: crazy-max/ghaction-import-gpg@v6 + # with: + # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + # passphrase: ${{ secrets.GPG_PASSPHRASE }} + # git_user_signingkey: true + # git_commit_gpgsign: true + + # # Auto-commit changes using stefanzweifel/git-auto-commit-action + # - name: Commit changes + # uses: stefanzweifel/git-auto-commit-action@v5 + # with: + # commit_user_name: CleanBot + # commit_user_email: your-email@example.com + # commit_message: '🚨✨ AUTOMATED COMMIT | Applied Code Formatting, Cleanup and added SPDX license headers' + # commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }} + # branch: ${{ github.head_ref }} # Run ESLint and Capture Output - name: Run ESLint and Capture Output diff --git a/app/api/docker_control/admin.py b/app/api/docker_control/admin.py index 2c79060a..7ddb2004 100644 --- a/app/api/docker_control/admin.py +++ b/app/api/docker_control/admin.py @@ -1,6 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC + from django.contrib import admin diff --git a/app/frontend/src/api/modelsDeployedApis.ts b/app/frontend/src/api/modelsDeployedApis.ts index 9bfaf4dc..9b88009a 100644 --- a/app/frontend/src/api/modelsDeployedApis.ts +++ b/app/frontend/src/api/modelsDeployedApis.ts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC + import axios from "axios"; import { customToast } from "../components/CustomToaster"; import { NavigateFunction } from "react-router-dom"; From 9bf533f2e483b80732c5ae49b9e7a3c664131f47 Mon Sep 17 00:00:00 2001 From: anirudTT Date: Thu, 31 Oct 2024 15:14:05 +0000 Subject: [PATCH 03/15] =?UTF-8?q?=F0=9F=9A=A8=E2=9C=A8AUTOMATED=20COMMIT?= =?UTF-8?q?=20|=20Final=20SPDX=20license=20header=20additions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/docker_control/admin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/api/docker_control/admin.py b/app/api/docker_control/admin.py index 7ddb2004..328a885a 100644 --- a/app/api/docker_control/admin.py +++ b/app/api/docker_control/admin.py @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC + from django.contrib import admin From d51123e8d97fd0f568e9a23d37339e1036091618 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 11:18:47 -0400 Subject: [PATCH 04/15] test backend GH -- to remove auto commit --- .github/workflows/backend-license-checker.yml | 34 -- .../frontend-lint-license-checker.yml | 352 +++++++++--------- app/api/docker_control/admin.py | 4 - 3 files changed, 176 insertions(+), 214 deletions(-) diff --git a/.github/workflows/backend-license-checker.yml b/.github/workflows/backend-license-checker.yml index 4e36d58f..77252a90 100644 --- a/.github/workflows/backend-license-checker.yml +++ b/.github/workflows/backend-license-checker.yml @@ -71,24 +71,6 @@ jobs: echo "Extracted Files:" echo "$FILES" - # # Run the `add_spdx_header.py` script to fix missing SPDX headers - # - name: Run SPDX Header Script - # if: env.FILES != '' - # run: | - # set +e - # python add_spdx_header.py # Run the script to add SPDX headers to the missing files - # exit 0 - - # # Commit the changes made by `add_spdx_header.py` - # - name: Commit changes - # if: env.FILES != '' - # uses: stefanzweifel/git-auto-commit-action@v5 - # with: - # commit_user_name: SPDX-Bot - # commit_user_email: bot@example.com - # commit_message: '🚨✨AUTOMATED COMMIT | Added missing SPDX license headers automatically' - # branch: ${{ github.head_ref }} - # Extract and clean file paths - name: Extract File Paths if: env.FILES != '' @@ -126,19 +108,3 @@ jobs: } else { console.log("No SPDX license issues found."); } - - - name: Run SPDX Header Script Again - run: | - set +e - echo "Running SPDX header script again on all files in the repository" - python ./add_spdx_header.py - exit 0 - - # Commit the changes made by the second run of `add_spdx_header.py` - - name: Commit changes from second run - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_user_name: SPDX-Bot - commit_user_email: bot@example.com - commit_message: '🚨✨AUTOMATED COMMIT | Final SPDX license header additions' - branch: ${{ github.head_ref }} \ No newline at end of file diff --git a/.github/workflows/frontend-lint-license-checker.yml b/.github/workflows/frontend-lint-license-checker.yml index d9c13846..37d83f25 100644 --- a/.github/workflows/frontend-lint-license-checker.yml +++ b/.github/workflows/frontend-lint-license-checker.yml @@ -1,176 +1,176 @@ -name: Front-End Linter SPDX Licenses Checker - -on: - push: - branches: - - main - pull_request: - branches: - - "main" - - "staging" - types: - - opened - - reopened - - synchronize - - assigned - - review_requested - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Install dependencies - working-directory: app/frontend - run: npm install - - - name: Run ESLint with Auto-fix - working-directory: app/frontend - run: | - set +e - npm run lint || true # Run lint and allow the workflow to continue even if there are warnings/errors - - # # Check if GPG key exists - # - name: Check if GPG key exists - # run: | - # if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then - # echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV - # else - # echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV - # fi - - # # Import GPG key if it exists - # - name: Import GPG key if it exists - # if: env.GPG_KEY_EXISTS == 'true' - # uses: crazy-max/ghaction-import-gpg@v6 - # with: - # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - # passphrase: ${{ secrets.GPG_PASSPHRASE }} - # git_user_signingkey: true - # git_commit_gpgsign: true - - # # Auto-commit changes using stefanzweifel/git-auto-commit-action - # - name: Commit changes - # uses: stefanzweifel/git-auto-commit-action@v5 - # with: - # commit_user_name: CleanBot - # commit_user_email: your-email@example.com - # commit_message: '🚨✨ AUTOMATED COMMIT | Applied Code Formatting, Cleanup and added SPDX license headers' - # commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }} - # branch: ${{ github.head_ref }} - - # Run ESLint and Capture Output - - name: Run ESLint and Capture Output - working-directory: app/frontend - id: run_eslint - run: | - set +e - output=$(npm run lint --silent 2>&1) - exit_code=$? - echo "$output" - clean_output=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g') # Remove ANSI escape codes - echo "CLEAN_OUTPUT<> $GITHUB_ENV - echo "$clean_output" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - grouped_errors="" - current_file="" - errors_for_file="" - has_errors=false - missing_lc_headers=false - lc_flagged_files="" - - while IFS= read -r line; do - if echo "$line" | grep -q '^\s*\/'; then - if [ "$has_errors" = true ]; then - grouped_errors+="$current_file\n$errors_for_file\n------------------------------------------------------------------------------------------------------------------------------------------\n" - errors_for_file="" - has_errors=false - fi - current_file=$(echo "$line" | sed 's/\n//g') - elif echo "$line" | grep -q 'error'; then - errors_for_file+=" $line\n" - has_errors=true - - if echo "$line" | grep -q 'missing header'; then - missing_lc_headers=true - errors_for_file+="!Flagged: LC header missing\n" - lc_flagged_files+="${current_file}\n" - fi - fi - done <<< "$clean_output" - - if [ "$has_errors" = true ]; then - grouped_errors+="$current_file\n$errors_for_file\n" - fi - - if [ -n "$grouped_errors" ]; then - echo "Errors found." - echo "GROUPED_ERRORS<> $GITHUB_ENV - echo -e "$grouped_errors" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - echo "HAS_ERRORS=true" >> $GITHUB_ENV - else - echo "No relevant errors found." - echo "HAS_ERRORS=false" >> $GITHUB_ENV - fi - - if [ "$missing_lc_headers" = true ]; then - echo "LC headers missing in one or more files." - echo "MISSING_LC_HEADERS=true" >> $GITHUB_ENV - echo "LC_FLAGGED_FILES<> $GITHUB_ENV - echo -e "$(echo -e "$lc_flagged_files" | sed '/^\s*$/d')" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - else - echo "MISSING_LC_HEADERS=false" >> $GITHUB_ENV - fi - - exit 0 - - # Comment on PR with ESLint Errors and LC Headers - - name: Comment on PR with ESLint Errors and LC Headers - if: env.HAS_ERRORS == 'true' - uses: actions/github-script@v7 - with: - script: | - const lintErrors = process.env.GROUPED_ERRORS; - const issueNumber = context.payload.pull_request.number; - const owner = context.repo.owner; - const repo = context.repo.repo; - - let commentBody = ""; - - if (process.env.MISSING_LC_HEADERS === 'true') { - const flaggedFiles = process.env.LC_FLAGGED_FILES.trim(); - commentBody += `## 🚨 SPDX-License Header Errors\n\nThe following files are missing the required license headers:\n\n\`\`\`\n${flaggedFiles}\n\`\`\`\nPlease ensure each of these files includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Thank you!`; - } - - if (lintErrors) { - commentBody += `## Frontend Project: ESLint Errors\n\`\`\`\n${lintErrors}\n\`\`\`\nPlease review and resolve the ESLint errors.`; - } - - if (commentBody.trim() && issueNumber) { - await github.rest.issues.createComment({ - issue_number: issueNumber, - owner: owner, - repo: repo, - body: commentBody - }); - } else { - console.log("No relevant errors to report."); - } - - name: Fail the Workflow if LC Headers Are Missing - if: env.MISSING_LC_HEADERS == 'true' - run: | - echo "Failing the workflow because LC headers are missing." - exit 1 \ No newline at end of file +# name: Front-End Linter SPDX Licenses Checker + +# on: +# push: +# branches: +# - main +# pull_request: +# branches: +# - "main" +# - "staging" +# types: +# - opened +# - reopened +# - synchronize +# - assigned +# - review_requested + +# jobs: +# lint: +# runs-on: ubuntu-latest + +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# with: +# token: ${{ secrets.GITHUB_TOKEN }} + +# - name: Set up Node.js +# uses: actions/setup-node@v3 +# with: +# node-version: '16' + +# - name: Install dependencies +# working-directory: app/frontend +# run: npm install + +# - name: Run ESLint with Auto-fix +# working-directory: app/frontend +# run: | +# set +e +# npm run lint || true # Run lint and allow the workflow to continue even if there are warnings/errors + +# # # Check if GPG key exists +# # - name: Check if GPG key exists +# # run: | +# # if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then +# # echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV +# # else +# # echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV +# # fi + +# # # Import GPG key if it exists +# # - name: Import GPG key if it exists +# # if: env.GPG_KEY_EXISTS == 'true' +# # uses: crazy-max/ghaction-import-gpg@v6 +# # with: +# # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} +# # passphrase: ${{ secrets.GPG_PASSPHRASE }} +# # git_user_signingkey: true +# # git_commit_gpgsign: true + +# # # Auto-commit changes using stefanzweifel/git-auto-commit-action +# # - name: Commit changes +# # uses: stefanzweifel/git-auto-commit-action@v5 +# # with: +# # commit_user_name: CleanBot +# # commit_user_email: your-email@example.com +# # commit_message: '🚨✨ AUTOMATED COMMIT | Applied Code Formatting, Cleanup and added SPDX license headers' +# # commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }} +# # branch: ${{ github.head_ref }} + +# # Run ESLint and Capture Output +# - name: Run ESLint and Capture Output +# working-directory: app/frontend +# id: run_eslint +# run: | +# set +e +# output=$(npm run lint --silent 2>&1) +# exit_code=$? +# echo "$output" +# clean_output=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g') # Remove ANSI escape codes +# echo "CLEAN_OUTPUT<> $GITHUB_ENV +# echo "$clean_output" >> $GITHUB_ENV +# echo "EOF" >> $GITHUB_ENV + +# grouped_errors="" +# current_file="" +# errors_for_file="" +# has_errors=false +# missing_lc_headers=false +# lc_flagged_files="" + +# while IFS= read -r line; do +# if echo "$line" | grep -q '^\s*\/'; then +# if [ "$has_errors" = true ]; then +# grouped_errors+="$current_file\n$errors_for_file\n------------------------------------------------------------------------------------------------------------------------------------------\n" +# errors_for_file="" +# has_errors=false +# fi +# current_file=$(echo "$line" | sed 's/\n//g') +# elif echo "$line" | grep -q 'error'; then +# errors_for_file+=" $line\n" +# has_errors=true + +# if echo "$line" | grep -q 'missing header'; then +# missing_lc_headers=true +# errors_for_file+="!Flagged: LC header missing\n" +# lc_flagged_files+="${current_file}\n" +# fi +# fi +# done <<< "$clean_output" + +# if [ "$has_errors" = true ]; then +# grouped_errors+="$current_file\n$errors_for_file\n" +# fi + +# if [ -n "$grouped_errors" ]; then +# echo "Errors found." +# echo "GROUPED_ERRORS<> $GITHUB_ENV +# echo -e "$grouped_errors" >> $GITHUB_ENV +# echo "EOF" >> $GITHUB_ENV +# echo "HAS_ERRORS=true" >> $GITHUB_ENV +# else +# echo "No relevant errors found." +# echo "HAS_ERRORS=false" >> $GITHUB_ENV +# fi + +# if [ "$missing_lc_headers" = true ]; then +# echo "LC headers missing in one or more files." +# echo "MISSING_LC_HEADERS=true" >> $GITHUB_ENV +# echo "LC_FLAGGED_FILES<> $GITHUB_ENV +# echo -e "$(echo -e "$lc_flagged_files" | sed '/^\s*$/d')" >> $GITHUB_ENV +# echo "EOF" >> $GITHUB_ENV +# else +# echo "MISSING_LC_HEADERS=false" >> $GITHUB_ENV +# fi + +# exit 0 + +# # Comment on PR with ESLint Errors and LC Headers +# - name: Comment on PR with ESLint Errors and LC Headers +# if: env.HAS_ERRORS == 'true' +# uses: actions/github-script@v7 +# with: +# script: | +# const lintErrors = process.env.GROUPED_ERRORS; +# const issueNumber = context.payload.pull_request.number; +# const owner = context.repo.owner; +# const repo = context.repo.repo; + +# let commentBody = ""; + +# if (process.env.MISSING_LC_HEADERS === 'true') { +# const flaggedFiles = process.env.LC_FLAGGED_FILES.trim(); +# commentBody += `## 🚨 SPDX-License Header Errors\n\nThe following files are missing the required license headers:\n\n\`\`\`\n${flaggedFiles}\n\`\`\`\nPlease ensure each of these files includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Thank you!`; +# } + +# if (lintErrors) { +# commentBody += `## Frontend Project: ESLint Errors\n\`\`\`\n${lintErrors}\n\`\`\`\nPlease review and resolve the ESLint errors.`; +# } + +# if (commentBody.trim() && issueNumber) { +# await github.rest.issues.createComment({ +# issue_number: issueNumber, +# owner: owner, +# repo: repo, +# body: commentBody +# }); +# } else { +# console.log("No relevant errors to report."); +# } +# - name: Fail the Workflow if LC Headers Are Missing +# if: env.MISSING_LC_HEADERS == 'true' +# run: | +# echo "Failing the workflow because LC headers are missing." +# exit 1 \ No newline at end of file diff --git a/app/api/docker_control/admin.py b/app/api/docker_control/admin.py index 328a885a..7ddb2004 100644 --- a/app/api/docker_control/admin.py +++ b/app/api/docker_control/admin.py @@ -1,7 +1,3 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC - from django.contrib import admin From 66bec637c90a3508f1e46d17664d845a6dbf19f8 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 11:58:34 -0400 Subject: [PATCH 05/15] re run now to check if PR comments are added --- .github/workflows/backend-license-checker.yml | 51 ++++++++----------- check_copyright_config.yaml | 29 +++++++++++ 2 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 check_copyright_config.yaml diff --git a/.github/workflows/backend-license-checker.yml b/.github/workflows/backend-license-checker.yml index 77252a90..8c72bcbe 100644 --- a/.github/workflows/backend-license-checker.yml +++ b/.github/workflows/backend-license-checker.yml @@ -1,4 +1,4 @@ -name: Backend-Models SPDX Licenses Checker +name: Check SPDX Licenses on: workflow_dispatch: @@ -19,17 +19,12 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5.0.0 with: cache: "pip" python-version: "3.8" - - # Install the copyright checking tool - name: Install copyright check tool run: pip install git+https://github.com/espressif/check-copyright.git@master - - # Check SPDX licenses - name: Check SPDX licenses id: check_spdx_licenses run: | @@ -42,13 +37,10 @@ jobs: echo "EOF" >> $GITHUB_ENV echo "EXIT_CODE=$exit_code" >> $GITHUB_ENV exit 0 - - name: Debug Extracted Files run: | echo "Extracted Files:" echo "$CLEAN_OUTPUT" - - # Extract files needing SPDX header addition - name: Extract Files id: extract_files run: | @@ -65,7 +57,6 @@ jobs: echo "EOF" >> $GITHUB_ENV echo "Extracted Files: $files" exit 0 - - name: Debug Extracted Files run: | echo "Extracted Files:" @@ -75,36 +66,36 @@ jobs: - name: Extract File Paths if: env.FILES != '' run: | + # Extract lines starting with './' but ignore any paths following "Modified files:" until a stop marker files_clean=$(echo "$FILES" | awk '/^Modified files:/ {ignore = 1} /^Above is a list of files/ {ignore = 0} !ignore && /^\.\// {print}' | sort | uniq) + # Save the cleaned files into a new environment variable 'FILES_CLEAN' echo "FILES_CLEAN<> $GITHUB_ENV echo "$files_clean" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - echo "Extracted Paths: $files_clean" - + echo "Extracted Paths: $files_clean" - name: Debug Extracted Paths run: | echo "Extracted Paths:" echo "$FILES_CLEAN" echo "---------------------------------" - - # Post a comment on the PR or Issue if there are SPDX issues - name: Comment on PR or Issue if: env.FILES_CLEAN != '' uses: actions/github-script@v7 with: - script: | - const formattedOutput = process.env.FILES_CLEAN; - const issueNumber = context.payload.pull_request.number; - const owner = context.repo.owner; - const repo = context.repo.repo; - if (formattedOutput) { - const commentBody = `Our automated SPDX license verification process has discovered that the following files are missing a license header:\n\`\`\`\n${formattedOutput}\n\`\`\`\nPlease ensure each indicated file includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Thank you.`; - await github.rest.issues.createComment({ - issue_number: issueNumber, - owner: owner, - repo: repo, - body: commentBody - }); - } else { - console.log("No SPDX license issues found."); - } + script: | + const formattedOutput = process.env.FILES_CLEAN; + const issueNumber = context.issue.number || context.payload.pull_request.number; + const owner = context.repo.owner; + const repo = context.repo.repo; + if (formattedOutput) { + const commentBody = `Our automated SPDX license verification process has discovered that the following files are missing a license header:\n\`\`\`\n${formattedOutput}\n\`\`\`\nPlease ensure each indicated file includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Your attention and cooperation in updating these files are greatly appreciated. Thank you.`; + await github.rest.issues.createComment({ + issue_number: issueNumber, + owner: owner, + repo: repo, + body: commentBody + }); + core.setFailed("SPDX license issues found."); + } else { + console.log("No SPDX license issues found."); + } \ No newline at end of file diff --git a/check_copyright_config.yaml b/check_copyright_config.yaml new file mode 100644 index 00000000..013e0c9a --- /dev/null +++ b/check_copyright_config.yaml @@ -0,0 +1,29 @@ +DEFAULT: + perform_check: yes + allowed_licenses: + - Apache-2.0 + - MIT + - GPL-3.0-only + license_for_new_files: Apache-2.0 + new_notice_python: | + """ + SPDX-FileCopyrightText: © {years} Tenstorrent AI ULC + + SPDX-License-Identifier: {license} + """ + new_notice_dockerfile: | + # SPDX-FileCopyrightText: © {years} Tenstorrent AI ULC + # SPDX-License-Identifier: {license} + new_notice_shell: | + # SPDX-FileCopyrightText: © {years} Tenstorrent AI ULC + # SPDX-License-Identifier: {license} + include: + - "*.py" + - "*.dockerfile" + - "*.sh" +ignore: + perform_check: no + include: + - .github/* + - /CONTRIBUTING.md + - /MAINTAINERS.md From 4ce7d83356fe7944d9c756bd5fbcbea5c379e383 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 12:02:14 -0400 Subject: [PATCH 06/15] check on docker file --- app/api/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/api/Dockerfile b/app/api/Dockerfile index 1a0a33b2..ed7b6d1f 100644 --- a/app/api/Dockerfile +++ b/app/api/Dockerfile @@ -1,6 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 -# -# SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC + FROM python:3.12.5-slim-bookworm From 0ae8438e7d9431c7f34acdc6efa0637d30e2b315 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 12:05:59 -0400 Subject: [PATCH 07/15] try again --- check_copyright_config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_copyright_config.yaml b/check_copyright_config.yaml index 013e0c9a..8235613f 100644 --- a/check_copyright_config.yaml +++ b/check_copyright_config.yaml @@ -21,6 +21,8 @@ DEFAULT: - "*.py" - "*.dockerfile" - "*.sh" + - "**/Dockerfile" + ignore: perform_check: no include: From 9fdcc460a778e9e7a279631f61befb431573f635 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 21:43:32 -0400 Subject: [PATCH 08/15] uncomment+ remove fix option for frontend GH --- .../frontend-lint-license-checker.yml | 352 +++++++++--------- app/frontend/package.json | 3 +- 2 files changed, 178 insertions(+), 177 deletions(-) diff --git a/.github/workflows/frontend-lint-license-checker.yml b/.github/workflows/frontend-lint-license-checker.yml index 37d83f25..d9c13846 100644 --- a/.github/workflows/frontend-lint-license-checker.yml +++ b/.github/workflows/frontend-lint-license-checker.yml @@ -1,176 +1,176 @@ -# name: Front-End Linter SPDX Licenses Checker - -# on: -# push: -# branches: -# - main -# pull_request: -# branches: -# - "main" -# - "staging" -# types: -# - opened -# - reopened -# - synchronize -# - assigned -# - review_requested - -# jobs: -# lint: -# runs-on: ubuntu-latest - -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# token: ${{ secrets.GITHUB_TOKEN }} - -# - name: Set up Node.js -# uses: actions/setup-node@v3 -# with: -# node-version: '16' - -# - name: Install dependencies -# working-directory: app/frontend -# run: npm install - -# - name: Run ESLint with Auto-fix -# working-directory: app/frontend -# run: | -# set +e -# npm run lint || true # Run lint and allow the workflow to continue even if there are warnings/errors - -# # # Check if GPG key exists -# # - name: Check if GPG key exists -# # run: | -# # if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then -# # echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV -# # else -# # echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV -# # fi - -# # # Import GPG key if it exists -# # - name: Import GPG key if it exists -# # if: env.GPG_KEY_EXISTS == 'true' -# # uses: crazy-max/ghaction-import-gpg@v6 -# # with: -# # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} -# # passphrase: ${{ secrets.GPG_PASSPHRASE }} -# # git_user_signingkey: true -# # git_commit_gpgsign: true - -# # # Auto-commit changes using stefanzweifel/git-auto-commit-action -# # - name: Commit changes -# # uses: stefanzweifel/git-auto-commit-action@v5 -# # with: -# # commit_user_name: CleanBot -# # commit_user_email: your-email@example.com -# # commit_message: '🚨✨ AUTOMATED COMMIT | Applied Code Formatting, Cleanup and added SPDX license headers' -# # commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }} -# # branch: ${{ github.head_ref }} - -# # Run ESLint and Capture Output -# - name: Run ESLint and Capture Output -# working-directory: app/frontend -# id: run_eslint -# run: | -# set +e -# output=$(npm run lint --silent 2>&1) -# exit_code=$? -# echo "$output" -# clean_output=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g') # Remove ANSI escape codes -# echo "CLEAN_OUTPUT<> $GITHUB_ENV -# echo "$clean_output" >> $GITHUB_ENV -# echo "EOF" >> $GITHUB_ENV - -# grouped_errors="" -# current_file="" -# errors_for_file="" -# has_errors=false -# missing_lc_headers=false -# lc_flagged_files="" - -# while IFS= read -r line; do -# if echo "$line" | grep -q '^\s*\/'; then -# if [ "$has_errors" = true ]; then -# grouped_errors+="$current_file\n$errors_for_file\n------------------------------------------------------------------------------------------------------------------------------------------\n" -# errors_for_file="" -# has_errors=false -# fi -# current_file=$(echo "$line" | sed 's/\n//g') -# elif echo "$line" | grep -q 'error'; then -# errors_for_file+=" $line\n" -# has_errors=true - -# if echo "$line" | grep -q 'missing header'; then -# missing_lc_headers=true -# errors_for_file+="!Flagged: LC header missing\n" -# lc_flagged_files+="${current_file}\n" -# fi -# fi -# done <<< "$clean_output" - -# if [ "$has_errors" = true ]; then -# grouped_errors+="$current_file\n$errors_for_file\n" -# fi - -# if [ -n "$grouped_errors" ]; then -# echo "Errors found." -# echo "GROUPED_ERRORS<> $GITHUB_ENV -# echo -e "$grouped_errors" >> $GITHUB_ENV -# echo "EOF" >> $GITHUB_ENV -# echo "HAS_ERRORS=true" >> $GITHUB_ENV -# else -# echo "No relevant errors found." -# echo "HAS_ERRORS=false" >> $GITHUB_ENV -# fi - -# if [ "$missing_lc_headers" = true ]; then -# echo "LC headers missing in one or more files." -# echo "MISSING_LC_HEADERS=true" >> $GITHUB_ENV -# echo "LC_FLAGGED_FILES<> $GITHUB_ENV -# echo -e "$(echo -e "$lc_flagged_files" | sed '/^\s*$/d')" >> $GITHUB_ENV -# echo "EOF" >> $GITHUB_ENV -# else -# echo "MISSING_LC_HEADERS=false" >> $GITHUB_ENV -# fi - -# exit 0 - -# # Comment on PR with ESLint Errors and LC Headers -# - name: Comment on PR with ESLint Errors and LC Headers -# if: env.HAS_ERRORS == 'true' -# uses: actions/github-script@v7 -# with: -# script: | -# const lintErrors = process.env.GROUPED_ERRORS; -# const issueNumber = context.payload.pull_request.number; -# const owner = context.repo.owner; -# const repo = context.repo.repo; - -# let commentBody = ""; - -# if (process.env.MISSING_LC_HEADERS === 'true') { -# const flaggedFiles = process.env.LC_FLAGGED_FILES.trim(); -# commentBody += `## 🚨 SPDX-License Header Errors\n\nThe following files are missing the required license headers:\n\n\`\`\`\n${flaggedFiles}\n\`\`\`\nPlease ensure each of these files includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Thank you!`; -# } - -# if (lintErrors) { -# commentBody += `## Frontend Project: ESLint Errors\n\`\`\`\n${lintErrors}\n\`\`\`\nPlease review and resolve the ESLint errors.`; -# } - -# if (commentBody.trim() && issueNumber) { -# await github.rest.issues.createComment({ -# issue_number: issueNumber, -# owner: owner, -# repo: repo, -# body: commentBody -# }); -# } else { -# console.log("No relevant errors to report."); -# } -# - name: Fail the Workflow if LC Headers Are Missing -# if: env.MISSING_LC_HEADERS == 'true' -# run: | -# echo "Failing the workflow because LC headers are missing." -# exit 1 \ No newline at end of file +name: Front-End Linter SPDX Licenses Checker + +on: + push: + branches: + - main + pull_request: + branches: + - "main" + - "staging" + types: + - opened + - reopened + - synchronize + - assigned + - review_requested + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install dependencies + working-directory: app/frontend + run: npm install + + - name: Run ESLint with Auto-fix + working-directory: app/frontend + run: | + set +e + npm run lint || true # Run lint and allow the workflow to continue even if there are warnings/errors + + # # Check if GPG key exists + # - name: Check if GPG key exists + # run: | + # if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then + # echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV + # else + # echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV + # fi + + # # Import GPG key if it exists + # - name: Import GPG key if it exists + # if: env.GPG_KEY_EXISTS == 'true' + # uses: crazy-max/ghaction-import-gpg@v6 + # with: + # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + # passphrase: ${{ secrets.GPG_PASSPHRASE }} + # git_user_signingkey: true + # git_commit_gpgsign: true + + # # Auto-commit changes using stefanzweifel/git-auto-commit-action + # - name: Commit changes + # uses: stefanzweifel/git-auto-commit-action@v5 + # with: + # commit_user_name: CleanBot + # commit_user_email: your-email@example.com + # commit_message: '🚨✨ AUTOMATED COMMIT | Applied Code Formatting, Cleanup and added SPDX license headers' + # commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }} + # branch: ${{ github.head_ref }} + + # Run ESLint and Capture Output + - name: Run ESLint and Capture Output + working-directory: app/frontend + id: run_eslint + run: | + set +e + output=$(npm run lint --silent 2>&1) + exit_code=$? + echo "$output" + clean_output=$(echo "$output" | sed 's/\x1b\[[0-9;]*m//g') # Remove ANSI escape codes + echo "CLEAN_OUTPUT<> $GITHUB_ENV + echo "$clean_output" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + grouped_errors="" + current_file="" + errors_for_file="" + has_errors=false + missing_lc_headers=false + lc_flagged_files="" + + while IFS= read -r line; do + if echo "$line" | grep -q '^\s*\/'; then + if [ "$has_errors" = true ]; then + grouped_errors+="$current_file\n$errors_for_file\n------------------------------------------------------------------------------------------------------------------------------------------\n" + errors_for_file="" + has_errors=false + fi + current_file=$(echo "$line" | sed 's/\n//g') + elif echo "$line" | grep -q 'error'; then + errors_for_file+=" $line\n" + has_errors=true + + if echo "$line" | grep -q 'missing header'; then + missing_lc_headers=true + errors_for_file+="!Flagged: LC header missing\n" + lc_flagged_files+="${current_file}\n" + fi + fi + done <<< "$clean_output" + + if [ "$has_errors" = true ]; then + grouped_errors+="$current_file\n$errors_for_file\n" + fi + + if [ -n "$grouped_errors" ]; then + echo "Errors found." + echo "GROUPED_ERRORS<> $GITHUB_ENV + echo -e "$grouped_errors" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + echo "HAS_ERRORS=true" >> $GITHUB_ENV + else + echo "No relevant errors found." + echo "HAS_ERRORS=false" >> $GITHUB_ENV + fi + + if [ "$missing_lc_headers" = true ]; then + echo "LC headers missing in one or more files." + echo "MISSING_LC_HEADERS=true" >> $GITHUB_ENV + echo "LC_FLAGGED_FILES<> $GITHUB_ENV + echo -e "$(echo -e "$lc_flagged_files" | sed '/^\s*$/d')" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + else + echo "MISSING_LC_HEADERS=false" >> $GITHUB_ENV + fi + + exit 0 + + # Comment on PR with ESLint Errors and LC Headers + - name: Comment on PR with ESLint Errors and LC Headers + if: env.HAS_ERRORS == 'true' + uses: actions/github-script@v7 + with: + script: | + const lintErrors = process.env.GROUPED_ERRORS; + const issueNumber = context.payload.pull_request.number; + const owner = context.repo.owner; + const repo = context.repo.repo; + + let commentBody = ""; + + if (process.env.MISSING_LC_HEADERS === 'true') { + const flaggedFiles = process.env.LC_FLAGGED_FILES.trim(); + commentBody += `## 🚨 SPDX-License Header Errors\n\nThe following files are missing the required license headers:\n\n\`\`\`\n${flaggedFiles}\n\`\`\`\nPlease ensure each of these files includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Thank you!`; + } + + if (lintErrors) { + commentBody += `## Frontend Project: ESLint Errors\n\`\`\`\n${lintErrors}\n\`\`\`\nPlease review and resolve the ESLint errors.`; + } + + if (commentBody.trim() && issueNumber) { + await github.rest.issues.createComment({ + issue_number: issueNumber, + owner: owner, + repo: repo, + body: commentBody + }); + } else { + console.log("No relevant errors to report."); + } + - name: Fail the Workflow if LC Headers Are Missing + if: env.MISSING_LC_HEADERS == 'true' + run: | + echo "Failing the workflow because LC headers are missing." + exit 1 \ No newline at end of file diff --git a/app/frontend/package.json b/app/frontend/package.json index aad719ee..15834e1b 100644 --- a/app/frontend/package.json +++ b/app/frontend/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "vite ", "build": "tsc && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "lint-fix":"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix", "preview": "vite preview", "generate-license": "npx generate-license-file --input package.json --output ./third-party-licenses.txt" }, From 9fd6a96ff0a09ace8e8a58f0f91aa0689cdc0b6c Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 31 Oct 2024 21:58:46 -0400 Subject: [PATCH 09/15] update comment in GH --- .../frontend-lint-license-checker.yml | 36 +++---------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/.github/workflows/frontend-lint-license-checker.yml b/.github/workflows/frontend-lint-license-checker.yml index d9c13846..237b5885 100644 --- a/.github/workflows/frontend-lint-license-checker.yml +++ b/.github/workflows/frontend-lint-license-checker.yml @@ -40,35 +40,6 @@ jobs: set +e npm run lint || true # Run lint and allow the workflow to continue even if there are warnings/errors - # # Check if GPG key exists - # - name: Check if GPG key exists - # run: | - # if [ -n "${{ secrets.GPG_PRIVATE_KEY }}" ]; then - # echo "GPG_KEY_EXISTS=true" >> $GITHUB_ENV - # else - # echo "GPG_KEY_EXISTS=false" >> $GITHUB_ENV - # fi - - # # Import GPG key if it exists - # - name: Import GPG key if it exists - # if: env.GPG_KEY_EXISTS == 'true' - # uses: crazy-max/ghaction-import-gpg@v6 - # with: - # gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - # passphrase: ${{ secrets.GPG_PASSPHRASE }} - # git_user_signingkey: true - # git_commit_gpgsign: true - - # # Auto-commit changes using stefanzweifel/git-auto-commit-action - # - name: Commit changes - # uses: stefanzweifel/git-auto-commit-action@v5 - # with: - # commit_user_name: CleanBot - # commit_user_email: your-email@example.com - # commit_message: '🚨✨ AUTOMATED COMMIT | Applied Code Formatting, Cleanup and added SPDX license headers' - # commit_options: ${{ env.GPG_KEY_EXISTS == 'true' && '-S' || '' }} - # branch: ${{ github.head_ref }} - # Run ESLint and Capture Output - name: Run ESLint and Capture Output working-directory: app/frontend @@ -152,11 +123,11 @@ jobs: if (process.env.MISSING_LC_HEADERS === 'true') { const flaggedFiles = process.env.LC_FLAGGED_FILES.trim(); - commentBody += `## 🚨 SPDX-License Header Errors\n\nThe following files are missing the required license headers:\n\n\`\`\`\n${flaggedFiles}\n\`\`\`\nPlease ensure each of these files includes a valid SPDX license identifier. This is essential for maintaining licensing compliance. Thank you!`; + commentBody += `## 🚨 SPDX-License Header Errors\n\nThe following files are missing the required license headers:\n\n\`\`\`\n${flaggedFiles}\n\`\`\`\nPlease ensure each of these files includes a valid SPDX license identifier to maintain licensing compliance.`; } if (lintErrors) { - commentBody += `## Frontend Project: ESLint Errors\n\`\`\`\n${lintErrors}\n\`\`\`\nPlease review and resolve the ESLint errors.`; + commentBody += `\n\n## Frontend Project: ESLint Errors\n\`\`\`\n${lintErrors}\n\`\`\`\nPlease review and resolve the ESLint errors.`; } if (commentBody.trim() && issueNumber) { @@ -169,8 +140,9 @@ jobs: } else { console.log("No relevant errors to report."); } + - name: Fail the Workflow if LC Headers Are Missing if: env.MISSING_LC_HEADERS == 'true' run: | echo "Failing the workflow because LC headers are missing." - exit 1 \ No newline at end of file + exit 1 From 112c95f9b98edb9280670d4414e088f7f64f4a10 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Fri, 1 Nov 2024 09:31:28 -0400 Subject: [PATCH 10/15] test new workflow --- .github/workflows/SPDX-license-checker.yml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/SPDX-license-checker.yml diff --git a/.github/workflows/SPDX-license-checker.yml b/.github/workflows/SPDX-license-checker.yml new file mode 100644 index 00000000..988c5e56 --- /dev/null +++ b/.github/workflows/SPDX-license-checker.yml @@ -0,0 +1,41 @@ +name: ORT SPDX License Compliance Check + +on: + push: + branches: + - main + pull_request: + branches: + - main + - staging + types: + - opened + - reopened + - synchronize + - assigned + - review_requested + + +jobs: + ort-license-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run ORT Analysis and Generate Report + uses: oss-review-toolkit/ort-ci-github-action@v1 + with: + ort-cli-args: 'analyze -i . -o ort-results && report -i ort-results/analyzer-result.yml -o ort-results/reports' + + - name: Upload ORT Results + uses: actions/upload-artifact@v3 + with: + name: ort-results + path: ort-results + + - name: Show ORT Results Summary + if: always() + run: | + cat ort-results/analyzer-result.yml From 7f285ef582667b45271382f08b6affa08f2ed1db Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Fri, 1 Nov 2024 09:39:32 -0400 Subject: [PATCH 11/15] fix issues --- .github/workflows/SPDX-license-checker.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/SPDX-license-checker.yml b/.github/workflows/SPDX-license-checker.yml index 988c5e56..b5b1beba 100644 --- a/.github/workflows/SPDX-license-checker.yml +++ b/.github/workflows/SPDX-license-checker.yml @@ -24,10 +24,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Run ORT Analysis and Generate Report + - name: Run ORT Analysis uses: oss-review-toolkit/ort-ci-github-action@v1 with: - ort-cli-args: 'analyze -i . -o ort-results && report -i ort-results/analyzer-result.yml -o ort-results/reports' + ort-cli-args: 'analyze -i . -o ort-results' + + - name: Run ORT Report Generation + uses: oss-review-toolkit/ort-ci-github-action@v1 + with: + ort-cli-args: 'report -i ort-results/analyzer-result.yml -o ort-results/reports' - name: Upload ORT Results uses: actions/upload-artifact@v3 From 4c2eeb75cccf39235e834d07fb62f7b7e3b7fc22 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Fri, 1 Nov 2024 16:50:17 -0400 Subject: [PATCH 12/15] add lc headers --- app/frontend/src/vite-env.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/frontend/src/vite-env.d.ts b/app/frontend/src/vite-env.d.ts index 11f02fe2..49916481 100644 --- a/app/frontend/src/vite-env.d.ts +++ b/app/frontend/src/vite-env.d.ts @@ -1 +1,3 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC /// From 1da8477827c3ca17a22411aedca06aeb16187ef4 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Fri, 1 Nov 2024 16:51:35 -0400 Subject: [PATCH 13/15] add lc headers --- app/api/docker_control/admin.py | 4 +++- app/frontend/src/api/modelsDeployedApis.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/docker_control/admin.py b/app/api/docker_control/admin.py index 7ddb2004..2c79060a 100644 --- a/app/api/docker_control/admin.py +++ b/app/api/docker_control/admin.py @@ -1,4 +1,6 @@ - +# SPDX-License-Identifier: Apache-2.0 +# +# SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC from django.contrib import admin diff --git a/app/frontend/src/api/modelsDeployedApis.ts b/app/frontend/src/api/modelsDeployedApis.ts index 9b88009a..9bfaf4dc 100644 --- a/app/frontend/src/api/modelsDeployedApis.ts +++ b/app/frontend/src/api/modelsDeployedApis.ts @@ -1,4 +1,5 @@ - +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC import axios from "axios"; import { customToast } from "../components/CustomToaster"; import { NavigateFunction } from "react-router-dom"; From f9025331f52f4fd9e2c430bbf07427abdfdd08d5 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Fri, 1 Nov 2024 16:52:22 -0400 Subject: [PATCH 14/15] remove this action --- .github/workflows/SPDX-license-checker.yml | 46 ---------------------- 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/SPDX-license-checker.yml diff --git a/.github/workflows/SPDX-license-checker.yml b/.github/workflows/SPDX-license-checker.yml deleted file mode 100644 index b5b1beba..00000000 --- a/.github/workflows/SPDX-license-checker.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: ORT SPDX License Compliance Check - -on: - push: - branches: - - main - pull_request: - branches: - - main - - staging - types: - - opened - - reopened - - synchronize - - assigned - - review_requested - - -jobs: - ort-license-check: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Run ORT Analysis - uses: oss-review-toolkit/ort-ci-github-action@v1 - with: - ort-cli-args: 'analyze -i . -o ort-results' - - - name: Run ORT Report Generation - uses: oss-review-toolkit/ort-ci-github-action@v1 - with: - ort-cli-args: 'report -i ort-results/analyzer-result.yml -o ort-results/reports' - - - name: Upload ORT Results - uses: actions/upload-artifact@v3 - with: - name: ort-results - path: ort-results - - - name: Show ORT Results Summary - if: always() - run: | - cat ort-results/analyzer-result.yml From c047986d86c342ee00c727759815d368d5e5f932 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Thu, 7 Nov 2024 09:40:12 -0500 Subject: [PATCH 15/15] adds SPDX lc headers based on advice from legal --- app/frontend/src/components/ui/accordion.tsx | 3 +++ app/frontend/src/components/ui/alert-dialog.tsx | 4 ++++ app/frontend/src/components/ui/alert.tsx | 4 ++++ app/frontend/src/components/ui/aspect-ratio.tsx | 4 ++++ app/frontend/src/components/ui/badge.tsx | 4 ++++ app/frontend/src/components/ui/breadcrumb.tsx | 4 ++++ app/frontend/src/components/ui/button.tsx | 3 +++ app/frontend/src/components/ui/card.tsx | 3 +++ app/frontend/src/components/ui/collapsible.tsx | 3 +++ app/frontend/src/components/ui/command.tsx | 3 +++ app/frontend/src/components/ui/dialog.tsx | 3 +++ app/frontend/src/components/ui/drawer.tsx | 3 +++ app/frontend/src/components/ui/dropdown-menu.tsx | 3 +++ app/frontend/src/components/ui/form.tsx | 3 +++ app/frontend/src/components/ui/input.tsx | 3 +++ app/frontend/src/components/ui/label.tsx | 3 +++ app/frontend/src/components/ui/menubar.tsx | 3 +++ app/frontend/src/components/ui/navigation-menu.tsx | 3 +++ app/frontend/src/components/ui/popover.tsx | 3 +++ app/frontend/src/components/ui/progress.tsx | 3 +++ app/frontend/src/components/ui/scroll-area.tsx | 3 +++ app/frontend/src/components/ui/select.tsx | 3 +++ app/frontend/src/components/ui/separator.tsx | 3 +++ app/frontend/src/components/ui/skeleton.tsx | 3 +++ app/frontend/src/components/ui/spinner.tsx | 3 +++ app/frontend/src/components/ui/stepper.tsx | 3 +++ app/frontend/src/components/ui/table.tsx | 3 +++ app/frontend/src/components/ui/textarea.tsx | 3 +++ app/frontend/src/components/ui/tooltip.tsx | 3 +++ 29 files changed, 92 insertions(+) diff --git a/app/frontend/src/components/ui/accordion.tsx b/app/frontend/src/components/ui/accordion.tsx index eee44dde..8118ba7f 100644 --- a/app/frontend/src/components/ui/accordion.tsx +++ b/app/frontend/src/components/ui/accordion.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/alert-dialog.tsx b/app/frontend/src/components/ui/alert-dialog.tsx index ad303088..3dac28c0 100644 --- a/app/frontend/src/components/ui/alert-dialog.tsx +++ b/app/frontend/src/components/ui/alert-dialog.tsx @@ -1,6 +1,10 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT + import * as React from "react" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" diff --git a/app/frontend/src/components/ui/alert.tsx b/app/frontend/src/components/ui/alert.tsx index 2ad41370..f913fa51 100644 --- a/app/frontend/src/components/ui/alert.tsx +++ b/app/frontend/src/components/ui/alert.tsx @@ -1,6 +1,10 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT + import * as React from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "../../lib/utils"; diff --git a/app/frontend/src/components/ui/aspect-ratio.tsx b/app/frontend/src/components/ui/aspect-ratio.tsx index 6b1f22be..1f9a3cfc 100644 --- a/app/frontend/src/components/ui/aspect-ratio.tsx +++ b/app/frontend/src/components/ui/aspect-ratio.tsx @@ -1,6 +1,10 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT + import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio" const AspectRatio = AspectRatioPrimitive.Root diff --git a/app/frontend/src/components/ui/badge.tsx b/app/frontend/src/components/ui/badge.tsx index f2bbcdad..90898ed4 100644 --- a/app/frontend/src/components/ui/badge.tsx +++ b/app/frontend/src/components/ui/badge.tsx @@ -1,6 +1,10 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT + /* this shadcnn badge component has been updated to be more specific to a status badge component and should not be used for the other badges in the application */ diff --git a/app/frontend/src/components/ui/breadcrumb.tsx b/app/frontend/src/components/ui/breadcrumb.tsx index 0606ca60..bdd15904 100644 --- a/app/frontend/src/components/ui/breadcrumb.tsx +++ b/app/frontend/src/components/ui/breadcrumb.tsx @@ -1,6 +1,10 @@ +/// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT + import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { ChevronRight, MoreHorizontal } from "lucide-react"; diff --git a/app/frontend/src/components/ui/button.tsx b/app/frontend/src/components/ui/button.tsx index 13cbd676..a3aa5f4a 100644 --- a/app/frontend/src/components/ui/button.tsx +++ b/app/frontend/src/components/ui/button.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/card.tsx b/app/frontend/src/components/ui/card.tsx index 36a9bd92..1a76ddf4 100644 --- a/app/frontend/src/components/ui/card.tsx +++ b/app/frontend/src/components/ui/card.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/collapsible.tsx b/app/frontend/src/components/ui/collapsible.tsx index 989bb3b3..9fb25e1e 100644 --- a/app/frontend/src/components/ui/collapsible.tsx +++ b/app/frontend/src/components/ui/collapsible.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/command.tsx b/app/frontend/src/components/ui/command.tsx index 722e984e..8e6b93de 100644 --- a/app/frontend/src/components/ui/command.tsx +++ b/app/frontend/src/components/ui/command.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/dialog.tsx b/app/frontend/src/components/ui/dialog.tsx index df4f159b..de73e381 100644 --- a/app/frontend/src/components/ui/dialog.tsx +++ b/app/frontend/src/components/ui/dialog.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/drawer.tsx b/app/frontend/src/components/ui/drawer.tsx index 50791cce..94cd9f53 100644 --- a/app/frontend/src/components/ui/drawer.tsx +++ b/app/frontend/src/components/ui/drawer.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/dropdown-menu.tsx b/app/frontend/src/components/ui/dropdown-menu.tsx index 1456dbca..9d275c2a 100644 --- a/app/frontend/src/components/ui/dropdown-menu.tsx +++ b/app/frontend/src/components/ui/dropdown-menu.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/form.tsx b/app/frontend/src/components/ui/form.tsx index 7c29acc7..7c47f749 100644 --- a/app/frontend/src/components/ui/form.tsx +++ b/app/frontend/src/components/ui/form.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/input.tsx b/app/frontend/src/components/ui/input.tsx index ca7b4ba5..309ec981 100644 --- a/app/frontend/src/components/ui/input.tsx +++ b/app/frontend/src/components/ui/input.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/label.tsx b/app/frontend/src/components/ui/label.tsx index b64ea835..8d77650e 100644 --- a/app/frontend/src/components/ui/label.tsx +++ b/app/frontend/src/components/ui/label.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/menubar.tsx b/app/frontend/src/components/ui/menubar.tsx index 82b49267..d6beac94 100644 --- a/app/frontend/src/components/ui/menubar.tsx +++ b/app/frontend/src/components/ui/menubar.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/navigation-menu.tsx b/app/frontend/src/components/ui/navigation-menu.tsx index 7a101d00..69433e5d 100644 --- a/app/frontend/src/components/ui/navigation-menu.tsx +++ b/app/frontend/src/components/ui/navigation-menu.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/popover.tsx b/app/frontend/src/components/ui/popover.tsx index 5488879b..f7db1478 100644 --- a/app/frontend/src/components/ui/popover.tsx +++ b/app/frontend/src/components/ui/popover.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/progress.tsx b/app/frontend/src/components/ui/progress.tsx index 94beb13a..3a78e86a 100644 --- a/app/frontend/src/components/ui/progress.tsx +++ b/app/frontend/src/components/ui/progress.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/scroll-area.tsx b/app/frontend/src/components/ui/scroll-area.tsx index b21466b6..47138f2e 100644 --- a/app/frontend/src/components/ui/scroll-area.tsx +++ b/app/frontend/src/components/ui/scroll-area.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/select.tsx b/app/frontend/src/components/ui/select.tsx index 4a0622cc..d3af6f6f 100644 --- a/app/frontend/src/components/ui/select.tsx +++ b/app/frontend/src/components/ui/select.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/separator.tsx b/app/frontend/src/components/ui/separator.tsx index 0e645fc9..3dc65d03 100644 --- a/app/frontend/src/components/ui/separator.tsx +++ b/app/frontend/src/components/ui/separator.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/skeleton.tsx b/app/frontend/src/components/ui/skeleton.tsx index afa65298..bf804ac2 100644 --- a/app/frontend/src/components/ui/skeleton.tsx +++ b/app/frontend/src/components/ui/skeleton.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/spinner.tsx b/app/frontend/src/components/ui/spinner.tsx index 0de1942f..32704a34 100644 --- a/app/frontend/src/components/ui/spinner.tsx +++ b/app/frontend/src/components/ui/spinner.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/stepper.tsx b/app/frontend/src/components/ui/stepper.tsx index e95b6676..bd1e6bb3 100644 --- a/app/frontend/src/components/ui/stepper.tsx +++ b/app/frontend/src/components/ui/stepper.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/table.tsx b/app/frontend/src/components/ui/table.tsx index 04503f9e..c5a54a7e 100644 --- a/app/frontend/src/components/ui/table.tsx +++ b/app/frontend/src/components/ui/table.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/textarea.tsx b/app/frontend/src/components/ui/textarea.tsx index a12feafd..65b04cd8 100644 --- a/app/frontend/src/components/ui/textarea.tsx +++ b/app/frontend/src/components/ui/textarea.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT diff --git a/app/frontend/src/components/ui/tooltip.tsx b/app/frontend/src/components/ui/tooltip.tsx index b10d06bf..e9b96ead 100644 --- a/app/frontend/src/components/ui/tooltip.tsx +++ b/app/frontend/src/components/ui/tooltip.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC +// SPDX-License-Identifier: Apache-2.0 +// This file incorporates work covered by the following copyright and permission notice: // SPDX-FileCopyrightText: Copyright (c) 2023 shadcn // SPDX-License-Identifier: MIT