From 8022d44585ccb52c1ab2acf94795ade8e844bb14 Mon Sep 17 00:00:00 2001 From: MohamedAklamaash Date: Thu, 25 Jun 2026 17:59:24 +0530 Subject: [PATCH] ci: fix pipeline (pnpm frontend job, ruff import order, lint error) - Frontend CI used npm (cache: npm, package-lock.json, npm ci) but the project uses pnpm -> setup-node failed to resolve the lockfile. Switch to pnpm/action-setup + pnpm cache + `pnpm install --frozen-lockfile`, and run tsc / lint / build. - Fix a latent eslint error: `no-unused-expressions` on a ternary-as- statement in Dashboard.toggle (rewrite as if/else). - Apply ruff import-order autofix to 3 pre-existing files so `ruff check .` passes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 17 +++++++++++------ .../apps/auth_github/tests/test_github_api.py | 1 - backend/apps/repos/tasks.py | 2 +- backend/apps/repos/tests/test_view_helpers.py | 3 +-- frontend/src/components/Dashboard.tsx | 3 ++- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88f2025..44d1f08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,15 +63,20 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 9 + - uses: actions/setup-node@v4 with: node-version: "20" - cache: "npm" - cache-dependency-path: frontend/package-lock.json + cache: "pnpm" + cache-dependency-path: frontend/pnpm-lock.yaml - - name: Install & type-check + - name: Install & check run: | cd frontend - npm ci - npx tsc --noEmit - npx eslint src/ + pnpm install --frozen-lockfile + pnpm exec tsc --noEmit + pnpm lint + pnpm build diff --git a/backend/apps/auth_github/tests/test_github_api.py b/backend/apps/auth_github/tests/test_github_api.py index 0a00a25..92edb24 100644 --- a/backend/apps/auth_github/tests/test_github_api.py +++ b/backend/apps/auth_github/tests/test_github_api.py @@ -25,7 +25,6 @@ ) from apps.auth_github.models import GitHubIdentity - # --------------------------------------------------------------------------- # get_identity_or_reauth # --------------------------------------------------------------------------- diff --git a/backend/apps/repos/tasks.py b/backend/apps/repos/tasks.py index c55cdea..6a6ee9b 100644 --- a/backend/apps/repos/tasks.py +++ b/backend/apps/repos/tasks.py @@ -7,7 +7,7 @@ from celery import shared_task from django.conf import settings -from .models import RepoStatus, Repository +from .models import Repository, RepoStatus from .utils import parse_github_owner_repo as _parse_github_owner_repo logger = logging.getLogger(__name__) diff --git a/backend/apps/repos/tests/test_view_helpers.py b/backend/apps/repos/tests/test_view_helpers.py index 4a8ec3a..dc960d2 100644 --- a/backend/apps/repos/tests/test_view_helpers.py +++ b/backend/apps/repos/tests/test_view_helpers.py @@ -18,10 +18,9 @@ get_user_repo_or_404_response, normalize_or_400, ) -from apps.repos.models import RepoStatus, Repository, RepositoryAccess +from apps.repos.models import Repository, RepositoryAccess, RepoStatus from apps.repos.views import _normalize_url - # --------------------------------------------------------------------------- # normalize_or_400 # --------------------------------------------------------------------------- diff --git a/frontend/src/components/Dashboard.tsx b/frontend/src/components/Dashboard.tsx index 5b0d484..2aa408b 100644 --- a/frontend/src/components/Dashboard.tsx +++ b/frontend/src/components/Dashboard.tsx @@ -33,7 +33,8 @@ export function Dashboard({ repo, onReanalyze, switcher }: Props) { const toggle = (panel: ImperativePanelHandle | null) => { if (!panel) return - panel.isCollapsed() ? panel.expand() : panel.collapse() + if (panel.isCollapsed()) panel.expand() + else panel.collapse() } const handleReanalyze = async () => {