From a33a957dd1e47dcfc3294c39a6ead89f063a66e1 Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:14:56 -0800 Subject: [PATCH 1/9] add format check --- .github/workflows/formatting_checks.yaml | 21 +++++++++++++++++++++ ui/package-lock.json | 3 ++- ui/package.json | 6 ++++-- ui/src/routes/Namespace/index.tsx | 12 ++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/formatting_checks.yaml diff --git a/.github/workflows/formatting_checks.yaml b/.github/workflows/formatting_checks.yaml new file mode 100644 index 000000000..c85d4a261 --- /dev/null +++ b/.github/workflows/formatting_checks.yaml @@ -0,0 +1,21 @@ +name: Tests +on: + push: + branches: + - 'main' + pull_request: + branches: + - 'main' + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Npm Install + run: cd ui && npm install + - name: Lint Check + run: cd ui && npm run lint \ No newline at end of file diff --git a/ui/package-lock.json b/ui/package-lock.json index a37c8af1e..01313df03 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -33,7 +33,8 @@ "web-vitals": "^2.1.4" }, "devDependencies": { - "@babel/plugin-proposal-private-property-in-object": "^7.21.11" + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", + "eslint": "^8.56.0" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/ui/package.json b/ui/package.json index 7127b9bfa..b36dd57d8 100644 --- a/ui/package.json +++ b/ui/package.json @@ -33,7 +33,8 @@ "dev": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "lint": "npx eslint --max-warnings 0 ./src" }, "eslintConfig": { "extends": [ @@ -54,6 +55,7 @@ ] }, "devDependencies": { - "@babel/plugin-proposal-private-property-in-object": "^7.21.11" + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", + "eslint": "^8.56.0" } } diff --git a/ui/src/routes/Namespace/index.tsx b/ui/src/routes/Namespace/index.tsx index 01190b218..1ca77d5c3 100644 --- a/ui/src/routes/Namespace/index.tsx +++ b/ui/src/routes/Namespace/index.tsx @@ -30,6 +30,18 @@ const NamespacePage = () => { return ( + + + + {client.namespace} + + Date: Thu, 22 Feb 2024 10:16:01 -0800 Subject: [PATCH 2/9] update workflow name --- .github/workflows/formatting_checks.yaml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/formatting_checks.yaml b/.github/workflows/formatting_checks.yaml index c85d4a261..d2b66f976 100644 --- a/.github/workflows/formatting_checks.yaml +++ b/.github/workflows/formatting_checks.yaml @@ -1,11 +1,11 @@ -name: Tests +name: Formatting Checks on: push: branches: - - 'main' + - "main" pull_request: - branches: - - 'main' + branches: + - "main" env: CARGO_TERM_COLOR: always @@ -14,8 +14,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Npm Install - run: cd ui && npm install - - name: Lint Check - run: cd ui && npm run lint \ No newline at end of file + - uses: actions/checkout@v3 + - name: Npm Install + run: cd ui && npm install + - name: UI Lint Check + run: cd ui && npm run lint + - name: Rust Format Check + - run: rustup toolchain install nightly --component rustfmt + - run: cargo +nightly fmt --check From 124325659bed0f6aaf64df6868819cc32e9e8bbb Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:18:25 -0800 Subject: [PATCH 3/9] move to test.yaml --- .github/workflows/formatting_checks.yaml | 24 ------------- .github/workflows/test.yaml | 44 +++++++++++++++--------- 2 files changed, 27 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/formatting_checks.yaml diff --git a/.github/workflows/formatting_checks.yaml b/.github/workflows/formatting_checks.yaml deleted file mode 100644 index d2b66f976..000000000 --- a/.github/workflows/formatting_checks.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Formatting Checks -on: - push: - branches: - - "main" - pull_request: - branches: - - "main" - -env: - CARGO_TERM_COLOR: always - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Npm Install - run: cd ui && npm install - - name: UI Lint Check - run: cd ui && npm run lint - - name: Rust Format Check - - run: rustup toolchain install nightly --component rustfmt - - run: cargo +nightly fmt --check diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 84af2afe4..ad6a25ba5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,29 +2,39 @@ name: Tests on: push: branches: - - 'main' + - "main" pull_request: - branches: - - 'main' + branches: + - "main" env: CARGO_TERM_COLOR: always jobs: + lint-checks: + runs-on: ubuntu-latest + steps: + - name: Npm Install + run: cd ui && npm install + - name: UI Lint Check + run: cd ui && npm run lint + - name: Rust Format Check + - run: rustup toolchain install nightly --component rustfmt + - run: cargo +nightly fmt --check test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Install protoc - run: sudo apt install -y protobuf-compiler npm - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Test - run: ./run_tests.sh - - name: Clear up space - run: | - docker stop --time 90 $(docker ps -aq) || true - docker rm --force $(docker ps -aq) || true - docker rmi --force $(docker images -aq) || true \ No newline at end of file + - uses: actions/checkout@v3 + - name: Install protoc + run: sudo apt install -y protobuf-compiler npm + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Test + run: ./run_tests.sh + - name: Clear up space + run: | + docker stop --time 90 $(docker ps -aq) || true + docker rm --force $(docker ps -aq) || true + docker rmi --force $(docker images -aq) || true From 7dba07669fbb83a91d0d5e5ee748822114c1f320 Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:20:40 -0800 Subject: [PATCH 4/9] wip --- .github/workflows/test.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ad6a25ba5..81de33e30 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,7 @@ env: CARGO_TERM_COLOR: always jobs: - lint-checks: + lint: runs-on: ubuntu-latest steps: - name: Npm Install @@ -19,8 +19,9 @@ jobs: - name: UI Lint Check run: cd ui && npm run lint - name: Rust Format Check - - run: rustup toolchain install nightly --component rustfmt - - run: cargo +nightly fmt --check + - run: | + rustup toolchain install nightly --component rustfmt + cargo +nightly fmt --check test: runs-on: ubuntu-latest steps: From 5bdf073e7ab36faf2ea73f96457463a178c963bf Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:22:02 -0800 Subject: [PATCH 5/9] wip --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 81de33e30..697f9b168 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,8 +20,8 @@ jobs: run: cd ui && npm run lint - name: Rust Format Check - run: | - rustup toolchain install nightly --component rustfmt - cargo +nightly fmt --check + rustup toolchain install nightly --component rustfmt + cargo +nightly fmt --check test: runs-on: ubuntu-latest steps: From 663d45d429005f9522788a5994a9be8b03c95837 Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:26:32 -0800 Subject: [PATCH 6/9] wip --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 697f9b168..2345f9a04 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,8 +12,10 @@ env: jobs: lint: + name: Lint Checks runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - name: Npm Install run: cd ui && npm install - name: UI Lint Check @@ -23,6 +25,7 @@ jobs: rustup toolchain install nightly --component rustfmt cargo +nightly fmt --check test: + name: Run Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 29d94c837829640d56c862a04004b84a9c5832d5 Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:42:59 -0800 Subject: [PATCH 7/9] wip --- .github/workflows/test.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2345f9a04..be8781ea8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,14 +16,28 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Npm Install run: cd ui && npm install + - name: UI Lint Check run: cd ui && npm run lint + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: rustfmt + override: true + - name: Rust Format Check - - run: | - rustup toolchain install nightly --component rustfmt - cargo +nightly fmt --check + run: | + cargo +nightly fmt -- --check test: name: Run Tests runs-on: ubuntu-latest From 600a73d54ad940c685cf2c148842ad2a5ab289b1 Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:44:36 -0800 Subject: [PATCH 8/9] test fail --- ui/src/components/TasksTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/TasksTable.tsx b/ui/src/components/TasksTable.tsx index c0e0aa323..2acbb0511 100644 --- a/ui/src/components/TasksTable.tsx +++ b/ui/src/components/TasksTable.tsx @@ -1,6 +1,6 @@ import React from "react"; import { DataGrid, GridColDef } from "@mui/x-data-grid"; -import { ITask } from "getindexify"; +import { ITask, IContent } from "getindexify"; import { Alert, Typography } from "@mui/material"; import { Box, Stack } from "@mui/system"; import TaskIcon from '@mui/icons-material/Task'; From ae8c1dbad85fd7761925eec0f6f6626cfb7605a9 Mon Sep 17 00:00:00 2001 From: Lucas Jackson Date: Thu, 22 Feb 2024 10:45:45 -0800 Subject: [PATCH 9/9] cleanup --- ui/src/components/TasksTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/TasksTable.tsx b/ui/src/components/TasksTable.tsx index 2acbb0511..c0e0aa323 100644 --- a/ui/src/components/TasksTable.tsx +++ b/ui/src/components/TasksTable.tsx @@ -1,6 +1,6 @@ import React from "react"; import { DataGrid, GridColDef } from "@mui/x-data-grid"; -import { ITask, IContent } from "getindexify"; +import { ITask } from "getindexify"; import { Alert, Typography } from "@mui/material"; import { Box, Stack } from "@mui/system"; import TaskIcon from '@mui/icons-material/Task';