Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github actions workflows #65

Closed
wants to merge 111 commits into from
Closed

add github actions workflows #65

wants to merge 111 commits into from

Conversation

anirudTT
Copy link
Contributor

@anirudTT anirudTT commented Oct 21, 2024

Add SPDX License Checkers for Backend and Frontend + Automated Fixes

This PR introduces a set of automated workflows aimed at ensuring compliance with SPDX license headers in both backend and frontend codebases. It includes new GitHub Actions for automated SPDX license checks, as well as a mechanism to add missing headers where necessary. Additionally, ESLint has been configured to identify any license header issues in frontend files.

Key Changes:

  • Backend License Checking:

    • Added a new GitHub Actions workflow: .github/workflows/backend-license-checker.yml.
    • This workflow checks for SPDX license headers on every PR and applies fixes automatically if any are missing.
    • Missing headers are auto-committed with the message: 🚨✨AUTOMATED COMMIT | Added missing SPDX license headers automatically.
    • A bot comment is added to the PR if any issues are detected.
  • Frontend License Checking and ESLint:

    • Added a new GitHub Actions workflow: .github/workflows/frontend-lint-license-checker.yml.
    • This workflow integrates with ESLint to identify missing SPDX license headers and automatically fixes them where possible.
    • A GPG check is also introduced to sign commits if a GPG key is available.; Currently no gpg key is added to this repository
    • Comments are posted on the PR summarizing any ESLint errors or missing SPDX headers.
  • Miscellaneous Changes:

    • Updated several backend files by adding missing SPDX headers, and also resolved ESLint errors and missing license headers in the frontend files.

How it Works:
Backend Workflow: Runs on pull requests, detects missing SPDX headers, adds them where necessary, and commits the changes automatically.
Frontend Workflow: Lints the frontend code, checks for missing SPDX headers, fixes them if necessary, and commits the changes.
Comments are posted to the PR if any issues are found or resolved automatically.

How this PR was tested / self reviewed

To test and verify the changes introduced in this PR, one can use following these steps as guidelines:

  • Triggering Workflows:
    • Create or synchronize a new PR, or push directly to the this dev branch to ensure the workflows trigger as expected (this is optional since this has already been tested by the as seen in previously workflow runs; but if one wanted to see how it ran would be helpful to do this )
  • Review Workflow Runs:
    • Examine the workflow runs under the Actions tab to verify that they correctly execute for the events mentioned above (PR creation, synchronization, direct push).
  • Check Automated PR Comments:
    • Inspect the automated PR comments for this and previous pull requests to confirm that any missing SPDX headers or ESLint errors were properly flagged and resolved by the automation.
  • Verify Files:
    • Manually review the files in the PR to ensure that:
    • All relevant files now include the correct SPDX license headers.
    • Any other changes are strictly related to the addition of these headers.
  • Simulate a Missing Header:
    • As an additional test, one can remove an SPDX header from a file and push a new commit to verify that the workflow catches and corrects the issue automatically.

This comment was marked as resolved.

1 similar comment

This comment was marked as duplicate.

This comment was marked as duplicate.

1 similar comment

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

1 similar comment

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

1 similar comment

This comment was marked as duplicate.

This comment was marked as resolved.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as outdated.

2 similar comments

This comment was marked as duplicate.

Copy link

Frontend Project: ESLint Errors

/home/runner/work/tt-studio/tt-studio/app/frontend/src/App.tsx
    8:3  error  Delete `⏎··`  prettier/prettier

------------------------------------------------------------------------------------------------------------------------------------------
/home/runner/work/tt-studio/tt-studio/app/frontend/src/components/ConfirmDialog.tsx
     1:1   error  missing header                                                                                                                                                                                                                           header/header
    20:22  error  Replace `,` with `;`                                                                                                                                                                                                                     prettier/prettier
    21:23  error  Replace `,` with `;`                                                                                                                                                                                                                     prettier/prettier
    22:22  error  Replace `,` with `;`                                                                                                                                                                                                                     prettier/prettier
    23:28  error  Replace `,` with `;`                                                                                                                                                                                                                     prettier/prettier
    33:35  error  Replace `⏎············{dialogDescription}⏎··········` with `{dialogDescription}`                                                                                                                                                         prettier/prettier
    38:29  error  Replace `⏎············className="bg-red-700·dark:bg-red-600·hover:bg-red-500·dark:hover:bg-red-500·text-white·rounded-lg"` with `·className="bg-red-700·dark:bg-red-600·hover:bg-red-500·dark:hover:bg-red-500·text-white·rounded-lg">`  prettier/prettier
    40:11  error  Replace `>{cancelText·||·'Cancel'}` with `··{cancelText·||·"Cancel"}{"·"}⏎·········`                                                                                                                                                     prettier/prettier
    43:32  error  Replace `>{confirmText·||·'Continue'}` with `⏎··········>⏎············{confirmText·||·"Continue"}⏎··········`                                                                                                                            prettier/prettier
    48:2   error  Insert `⏎`                                                                                                                                                                                                                               prettier/prettier

------------------------------------------------------------------------------------------------------------------------------------------
/home/runner/work/tt-studio/tt-studio/app/frontend/src/components/SideBar.tsx
     22:57  error  Insert `⏎······`                                                                                                                                                                                                                                                                                              prettier/prettier
     23:1   error  Delete `··`                                                                                                                                                                                                                                                                                                   prettier/prettier
     76:74  error  Delete `·Datasources`                                                                                                                                                                                                                                                                                         prettier/prettier
     77:16  error  Replace `·to·augment·the·responses·provided·by·the·models·you·have·deployed.·You·can·select⏎················a·datasource·to·use·from·the` with `·Datasources·to·augment·the·responses·provided·by·the·models·you⏎················have·deployed.·You·can·select·a·datasource·to·use·from·the⏎···············`  prettier/prettier
     82:78  error  Replace `·must·have·a·unique·name·of·at·least·two·characters·and·no·spaces.` with `⏎··················must·have·a·unique·name·of·at·least·two·characters·and·no`                                                                                                                                              prettier/prettier
     83:18  error  Replace `·Enter·the·name·of·your·datasource·and·click·the·create·button·to·create·the·datasource.` with `·spaces.·Enter·the·name·of·your·datasource·and·click·the·create⏎··················button·to·create·the·datasource.{"·"}⏎···············`                                                             prettier/prettier
     85:80  error  Insert `⏎·················`                                                                                                                                                                                                                                                                                   prettier/prettier
     88:76  error  Insert `⏎·················`                                                                                                                                                                                                                                                                                   prettier/prettier
    160:75  error  Insert `⏎··········`                                                                                                                                                                                                                                                                                          prettier/prettier
    161:1   error  Replace `··········}·w-2/6·transform·${` with `········}·w-2/6·transform·${⏎··········`                                                                                                                                                                                                                       prettier/prettier
    162:1   error  Delete `··`                                                                                                                                                                                                                                                                                                   prettier/prettier
    183:57  error  Insert `⏎··········`                                                                                                                                                                                                                                                                                          prettier/prettier
    184:1   error  Delete `··`                                                                                                                                                                                                                                                                                                   prettier/prettier

------------------------------------------------------------------------------------------------------------------------------------------
/home/runner/work/tt-studio/tt-studio/app/frontend/src/pages/rag/RagManagement.tsx
    151:5  error  'theme' is defined but never used  @typescript-eslint/no-unused-vars

------------------------------------------------------------------------------------------------------------------------------------------
/home/runner/work/tt-studio/tt-studio/app/frontend/src/routes/index.tsx
    15:5  error  Insert `··`                           prettier/prettier
    16:1  error  Insert `··`                           prettier/prettier
    17:7  error  Insert `··`                           prettier/prettier
    18:1  error  Insert `··`                           prettier/prettier
    19:1  error  Replace `········` with `··········`  prettier/prettier
    20:9  error  Insert `··`                           prettier/prettier
    21:1  error  Insert `··`                           prettier/prettier
    22:7  error  Insert `··`                           prettier/prettier
    23:1  error  Insert `··`                           prettier/prettier

------------------------------------------------------------------------------------------------------------------------------------------
/home/runner/work/tt-studio/tt-studio/app/frontend/vite.config.ts
    27:18  error  Replace `"error",` with `⏎··········"error",⏎·········`                                                                                                                                                                                                       prettier/prettier
    28:11  error  Insert `··`                                                                                                                                                                                                                                                   prettier/prettier
    29:9   error  Replace `}` with `··},⏎········`                                                                                                                                                                                                                              prettier/prettier
    30:18  error  Replace `"proxyReq",·(proxyReq:·ClientRequest,·req:·IncomingMessage,·_res:·ServerResponse` with `⏎··········"proxyReq",⏎··········(⏎············proxyReq:·ClientRequest,⏎············req:·IncomingMessage,⏎············_res:·ServerResponse,⏎··········`      prettier/prettier
    31:1   error  Replace `··········` with `············`                                                                                                                                                                                                                      prettier/prettier
    32:9   error  Replace `}` with `··},⏎········`                                                                                                                                                                                                                              prettier/prettier
    33:18  error  Replace `"proxyRes",·(proxyRes:·IncomingMessage,·req:·IncomingMessage,·_res:·ServerResponse` with `⏎··········"proxyRes",⏎··········(⏎············proxyRes:·IncomingMessage,⏎············req:·IncomingMessage,⏎············_res:·ServerResponse,⏎··········`  prettier/prettier
    34:1   error  Insert `··`                                                                                                                                                                                                                                                   prettier/prettier
    35:1   error  Replace `············` with `··············`                                                                                                                                                                                                                  prettier/prettier
    36:13  error  Insert `··`                                                                                                                                                                                                                                                   prettier/prettier
    37:13  error  Insert `··`                                                                                                                                                                                                                                                   prettier/prettier
    38:1   error  Replace `··········` with `············`                                                                                                                                                                                                                      prettier/prettier
    39:9   error  Replace `}` with `··},⏎········`                                                                                                                                                                                                                              prettier/prettier
  ✖ 54 problems (47 errors, 7 warnings)
    46 errors and 0 warnings potentially fixable with the `--fix` option.


Please review and resolve the ESLint errors.

This comment was marked as duplicate.

This comment was marked as resolved.

This comment was marked as duplicate.

1 similar comment

This comment was marked as duplicate.

anirudTT and others added 27 commits October 25, 2024 13:22
@anirudTT anirudTT force-pushed the anirud/github-actions branch from f3068a7 to 4875c3b Compare October 25, 2024 17:24
@anirudTT anirudTT closed this Oct 28, 2024
@anirudTT anirudTT deleted the anirud/github-actions branch October 28, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants