Skip to content

feat: add GitHub Actions CI workflow for typecheck and lint#331

Merged
Sachinchaurasiya360 merged 6 commits into
Sachinchaurasiya360:mainfrom
Harkiratcodess:feat/add-ci-typecheck-lint-workflow
May 21, 2026
Merged

feat: add GitHub Actions CI workflow for typecheck and lint#331
Sachinchaurasiya360 merged 6 commits into
Sachinchaurasiya360:mainfrom
Harkiratcodess:feat/add-ci-typecheck-lint-workflow

Conversation

@Harkiratcodess
Copy link
Copy Markdown
Contributor

@Harkiratcodess Harkiratcodess commented May 19, 2026

Fixes #103

What

Adds a new GitHub Actions CI workflow at .github/workflows/ci.yml
that runs on every pull request targeting main.

Jobs

  • typecheck-client → runs tsc --noEmit in /client
  • typecheck-server → runs tsc --noEmit in /server
  • lint-client → runs ESLint on .ts/.tsx files in /client
  • lint-server → runs ESLint on .ts files in /server

Features

  • node_modules cached via actions/setup-node for faster runs
  • All 4 jobs run in parallel
  • PRs with type errors or lint violations will be blocked

Files Changed

  • .github/workflows/ci.yml (new file)

Label Request

Requesting enhancement + devops labels.

Summary by CodeRabbit

  • Chores
    • Updated internal CI/CD configuration to streamline automated checks on pull requests.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ce5ff82-b49a-43d4-a730-5e92c4dd531b

📥 Commits

Reviewing files that changed from the base of the PR and between 348c6e3 and e4a551d.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

The GitHub Actions CI workflow is streamlined to trigger only on pull requests to main. TypeScript typecheck jobs for client and server are restructured with explicit dependency installation and tsc --noEmit steps, while server includes Prisma client generation. Client ESLint linting is made non-blocking. Push triggers, path filters, server linting, and the ci-status gate are removed.

Changes

GitHub Actions CI/CD Workflow Refactor

Layer / File(s) Summary
Workflow trigger configuration
.github/workflows/ci.yml
The workflow trigger is updated to run only on pull_request events targeting the main branch, removing broader trigger behavior from the previous workflow.
Client and server TypeScript typecheck jobs
.github/workflows/ci.yml
Client and server typecheck jobs are updated to install dependencies with npm ci in their respective directories and run npx tsc --noEmit. The server job additionally generates the Prisma client before type-checking.
Client ESLint linting and job cleanup
.github/workflows/ci.yml
Client linting is simplified to run `npx eslint . --ext .ts,.tsx

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

level:intermediate

Poem

🐰 A workflow refined, so clean and so bright,
No push triggers now, just PRs done right,
Type-checks and linting with steps crystal clear,
Server and client both dancing right here!
hops gleefully

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR includes unrelated changes to Navbar.tsx, CompanyListPage.tsx, and JobBrowsePage.tsx that are not mentioned in linked issue #103, which only requires CI workflow changes. Remove unrelated component changes (Navbar, CompanyListPage, JobBrowsePage) and create separate PRs for those features.
Out of Scope Changes check ⚠️ Warning Multiple out-of-scope changes detected: Navbar.tsx refactoring, CompanyListPage.tsx routing logic updates, and JobBrowsePage.tsx hook refactoring are unrelated to the CI workflow objective. Remove these component modifications and focus solely on implementing the GitHub Actions CI workflow as specified in issue #103.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: adding a GitHub Actions CI workflow for typecheck and lint validation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)

9-91: ⚡ Quick win

Consider using a matrix strategy to reduce duplication.

The four jobs share nearly identical structure. A matrix strategy could reduce duplication and improve maintainability:

♻️ Example matrix-based refactor
jobs:
  checks:
    name: ${{ matrix.check }} ${{ matrix.package }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        package: [client, server]
        check: [typecheck, lint]
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: "npm"
          cache-dependency-path: ${{ matrix.package }}/package-lock.json

      - name: Install dependencies
        run: npm ci
        working-directory: ${{ matrix.package }}

      - name: Run typecheck
        if: matrix.check == 'typecheck'
        run: npx tsc --noEmit
        working-directory: ${{ matrix.package }}

      - name: Run lint
        if: matrix.check == 'lint'
        run: npx eslint . --ext ${{ matrix.package == 'client' && '.ts,.tsx' || '.ts' }}
        working-directory: ${{ matrix.package }}

This approach reduces duplication while maintaining clarity. However, the current explicit job definitions are also valid and may be easier to customize per-job if needed in the future.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 9 - 91, The four nearly identical jobs
(typecheck-client, typecheck-server, lint-client, lint-server) should be
collapsed into a single matrix job to remove duplication: add a job (e.g.,
checks) with a strategy.matrix over package: [client, server] and check:
[typecheck, lint], update shared steps (checkout, actions/setup-node with
cache-dependency-path using ${{ matrix.package }}/package-lock.json, npm ci with
working-directory: ${{ matrix.package }}), and replace the per-job run steps
with conditional steps using if: matrix.check == 'typecheck' to run npx tsc
--noEmit and if: matrix.check == 'lint' to run the appropriate eslint invocation
(use .ts,.tsx for client when matrix.package == 'client' and .ts for server) so
you preserve behavior of typecheck-client/typecheck-server and
lint-client/lint-server while eliminating repeated blocks.
client/src/components/Navbar.tsx (1)

49-56: 💤 Low value

Consider extracting role-based routing logic for readability.

The nested ternary is functionally correct but could be more readable. For a "Chill" review, this is purely optional.

♻️ Optional refactor using a helper function
+const getDashboardLink = (role: string | undefined) => {
+  if (role === "ADMIN") return "/admin";
+  if (role === "RECRUITER") return "/recruiters";
+  return "/student/applications";
+};
+
+const getProfileLink = (role: string | undefined) => {
+  return role === "RECRUITER" ? "/recruiters/profile" : "/student/profile";
+};
+
-  const dashboardLink =
-    user?.role === "ADMIN"
-      ? "/admin"
-      : user?.role === "RECRUITER"
-        ? "/recruiters"
-        : "/student/applications";
-  const profileLink =
-    user?.role === "RECRUITER" ? "/recruiters/profile" : "/student/profile";
+  const dashboardLink = getDashboardLink(user?.role);
+  const profileLink = getProfileLink(user?.role);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/components/Navbar.tsx` around lines 49 - 56, Extract the
role-based routing logic out of the nested ternary expressions into a small
helper (e.g., getDashboardLink(role) and getProfileLink(role) or a single
getRouteForRole(role)) and use that from the Navbar component instead of the
inline ternaries that set dashboardLink and profileLink; implement the helper
using a switch or an object map to return "/admin", "/recruiters", or
"/student/applications" for dashboardLink and "/recruiters/profile" or
"/student/profile" for profileLink, and call it with user?.role in Navbar to
improve readability and maintainability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/module/student/jobs/JobBrowsePage.tsx`:
- Around line 140-144: When debounced filters change (debouncedSearch,
debouncedLocation) or the submit handler is invoked (the submit/handleSubmit
function around lines 327–330), reset pagination state to avoid landing on
empty/misaligned pages: set page, extPage, and scrPage back to 1 before
triggering the refetch. Update the effect(s) that depend on debouncedSearch and
debouncedLocation to call setPage(1), setExtPage(1), and setScrPage(1) prior to
any fetch, and ensure the submit handler also resets those three states before
performing its fetch/refetch logic.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 9-91: The four nearly identical jobs (typecheck-client,
typecheck-server, lint-client, lint-server) should be collapsed into a single
matrix job to remove duplication: add a job (e.g., checks) with a
strategy.matrix over package: [client, server] and check: [typecheck, lint],
update shared steps (checkout, actions/setup-node with cache-dependency-path
using ${{ matrix.package }}/package-lock.json, npm ci with working-directory:
${{ matrix.package }}), and replace the per-job run steps with conditional steps
using if: matrix.check == 'typecheck' to run npx tsc --noEmit and if:
matrix.check == 'lint' to run the appropriate eslint invocation (use .ts,.tsx
for client when matrix.package == 'client' and .ts for server) so you preserve
behavior of typecheck-client/typecheck-server and lint-client/lint-server while
eliminating repeated blocks.

In `@client/src/components/Navbar.tsx`:
- Around line 49-56: Extract the role-based routing logic out of the nested
ternary expressions into a small helper (e.g., getDashboardLink(role) and
getProfileLink(role) or a single getRouteForRole(role)) and use that from the
Navbar component instead of the inline ternaries that set dashboardLink and
profileLink; implement the helper using a switch or an object map to return
"/admin", "/recruiters", or "/student/applications" for dashboardLink and
"/recruiters/profile" or "/student/profile" for profileLink, and call it with
user?.role in Navbar to improve readability and maintainability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 24c185d2-93f7-44a6-9ce3-88ef52fe714a

📥 Commits

Reviewing files that changed from the base of the PR and between 3552efa and 348c6e3.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • client/src/components/Navbar.tsx
  • client/src/module/student/companies/CompanyListPage.tsx
  • client/src/module/student/jobs/JobBrowsePage.tsx

Comment thread client/src/module/student/jobs/JobBrowsePage.tsx
@Sachinchaurasiya360 Sachinchaurasiya360 added bug Something isn't working enhancement New feature or request good first issue Good for newcomers level:beginner Good for first-time contributors gssoc:approved Approved for GSSoC scoring labels May 21, 2026
@Sachinchaurasiya360 Sachinchaurasiya360 merged commit afec3b1 into Sachinchaurasiya360:main May 21, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request good first issue Good for newcomers gssoc:approved Approved for GSSoC scoring level:beginner Good for first-time contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI/CD workflow for TypeScript type-check and lint on every PR

2 participants