Skip to content

Setup Github Workflow#137

Merged
prakashchoudhary07 merged 19 commits intodevelopfrom
setup/github-actions
Nov 9, 2025
Merged

Setup Github Workflow#137
prakashchoudhary07 merged 19 commits intodevelopfrom
setup/github-actions

Conversation

@ajoykumardas12
Copy link
Contributor

@ajoykumardas12 ajoykumardas12 commented Jan 20, 2024

Date: 20 Jan 2024

Developer Name: @ajoykumardas12


Issue Ticket Number

closes #135

Description

This PR adds Github actions workflows to setup test jobs at every PR in this repo. Prettier command should be enabled after prettier is set up.
Lint check is run in "next build" so haven't added it explicitly.

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

All tests should pass.

Screenshot_12

@vercel
Copy link

vercel bot commented Jan 20, 2024

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
members-app-v1 Ready Ready Preview Comment Nov 9, 2025 4:40am

@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • New Features

    • Added error and info notification functions to enhance user feedback capabilities.
  • Tests & Infrastructure

    • Implemented continuous integration workflow for automated testing on pull requests.
    • Updated development dependencies and Node.js version for improved compatibility.
  • Bug Fixes

    • Fixed minor DOM element role assertions in tests for improved accuracy.

Walkthrough

The PR establishes continuous integration infrastructure via GitHub Actions, updates build tooling and dependencies, adds test coverage reporting capabilities, and includes minor code quality improvements such as formatting fixes and attribute name corrections across React components and utilities.

Changes

Cohort / File(s) Summary
CI/CD Infrastructure
.github/workflows/continuous-integration.yml
Adds new GitHub Actions workflow for continuous integration triggered on pull requests with Node.js 18.x matrix, 10-minute timeout, and steps for dependency installation, formatting checks, test coverage, and project build.
Build Configuration
jest.config.js, package.json, styles/Home.module.css
Jest config reformats nextJest object to single line and removes testEnvironmentOptions block; package.json updates Node version to 18.20.8, adds test:coverage and build scripts, adjusts dependencies (eslint ^8.57.0, removes @types/react-toastify, downgrades msw to ^1.3.2, adds @types/jest); CSS file removes trailing blank line.
Component Refinements
src/components/MemberContribution/ContributionAccordianItem.tsx, src/components/NewMemberSection/index.tsx, src/components/NewMemberSection/newMemberSection.module.css
Adds semicolon to URL constant, renames data-testId to data-testid attribute, standardizes JSX spacing in Spinner element.
Notification Utilities
src/utils/toast.tsx
Replaces TOP_RIGHT option with literal string 'top-right'; exports new public functions notifyError(text: string) and notifyInfo(text: string) delegating to notifyBase.
State Management
src/store/superUserOptions.ts
Wraps sequential state assignments in parentheses with no functional behavior change.
Test Suite Updates
src/test/unit/components/member-contribution/ContributionAccordianItem.test.tsx
Updates three test cases to query for link role instead of heading role, aligning assertions with refactored component structure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring extra attention:

  • msw downgrade from ^2.4.1 to ^1.3.2 — significant version reduction that may affect mock server capabilities and compatibility
  • eslint version downgrade from 9.9.0 to ^8.57.0 — verify no breaking rule changes or plugin incompatibilities
  • GitHub Actions workflow trigger conditions and Node.js setup correctness
  • Alignment between component attribute changes (data-testId → data-testid) and test query role modifications
  • Test expectations shift from heading role to link role — verify semantic HTML correctness in rendered output

Poem

🐰 Workflows spin up with GitHub's grace,
Dependencies squared in their rightful place,
Components polished, tests aligned true,
Toast notifications—both bright and new!
CI/CD magic, the pipeline's delight,
A rabbit's refactor shines ever bright! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning While the PR includes the primary workflow file, it also contains multiple unrelated changes to component files, test files, configuration, and styling that extend beyond the GitHub workflow setup objective. Consider separating out-of-scope changes (component fixes, test updates, package.json modifications) into separate PRs focused on their specific objectives to keep the workflow setup change isolated and reviewable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Setup Github Workflow' directly corresponds to the main changeset which adds a GitHub Actions workflow file for continuous integration.
Description check ✅ Passed The description is related to the changeset, explaining that the PR adds GitHub Actions workflows for test jobs on pull requests and mentions Prettier and linting setup.
Linked Issues check ✅ Passed The PR successfully implements GitHub workflows as required by linked issue #135, adding a continuous integration workflow file with test coverage, formatting checks, and build steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

…e-stream in package.json and update yarn.lock
Copy link

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/store/superUserOptions.ts (1)

47-53: Avoid the comma operator for sequential assignments.

Line 51 uses the comma operator pattern ((state.isTaskUpdateModalVisible = visibility), (state.taskId = taskId)) to combine two assignments. While functionally correct, this is non-idiomatic and reduces readability. In Redux Immer reducers, direct sequential mutations are the standard approach.

Apply this diff to restore the idiomatic pattern:

     setIsTaskUpdateModalVisible: (
       state,
       { payload: { visibility, taskId, isTaskNoteworthy } },
     ) => {
-      ((state.isTaskUpdateModalVisible = visibility), (state.taskId = taskId));
+      state.isTaskUpdateModalVisible = visibility;
+      state.taskId = taskId;
       state.isTaskNoteworthy = isTaskNoteworthy;
     },
src/components/MemberContribution/ContributionAccordianItem.tsx (1)

105-105: Inconsistent attribute casing: use data-testid.

Line 61 was correctly updated to data-testid, but this line still uses data-testId with a capital 'I'. Please update for consistency.

Apply this diff:

-          data-testId="settingButton"
+          data-testid="settingButton"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5817f67 and 704fc5c.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • .github/workflows/continuous-integration.yml (1 hunks)
  • jest.config.js (1 hunks)
  • package.json (4 hunks)
  • src/components/MemberContribution/ContributionAccordianItem.tsx (2 hunks)
  • src/components/NewMemberSection/index.tsx (1 hunks)
  • src/components/NewMemberSection/newMemberSection.module.css (1 hunks)
  • src/store/superUserOptions.ts (1 hunks)
  • src/test/unit/components/member-contribution/ContributionAccordianItem.test.tsx (3 hunks)
  • src/utils/toast.tsx (1 hunks)
  • styles/Home.module.css (0 hunks)
💤 Files with no reviewable changes (1)
  • styles/Home.module.css
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/MemberContribution/ContributionAccordianItem.tsx (1)
src/constants/AppConstants.js (2)
  • LINKS (4-8)
  • LINKS (4-8)
🔇 Additional comments (18)
src/components/NewMemberSection/index.tsx (1)

46-46: Formatting improvement approved.

The addition of a space before the self-closing tag aligns with standard JSX/Prettier formatting conventions.

src/components/NewMemberSection/newMemberSection.module.css (1)

43-43: Formatting improvement approved.

The addition of a trailing newline at the end of the file is a formatting best practice that improves consistency with standard file formatting conventions.

src/utils/toast.tsx (2)

9-9: Verify if the type assertion is necessary.

The type assertion as ToastOptions may be unnecessary. TypeScript should infer the options object type correctly, and the explicit assertion can potentially hide legitimate type mismatches.

Try removing the type assertion to see if TypeScript still accepts the code:

-  toast[type](text, { position: 'top-right', autoClose: 2000 } as ToastOptions);
+  toast[type](text, { position: 'top-right', autoClose: 2000 });

If TypeScript complains, the error message will clarify what's actually needed (e.g., satisfies, a const assertion, or a stricter position type).


13-14: LGTM! Good API expansion.

The new notifyError and notifyInfo helper functions provide a cleaner, more explicit API for users and follow the same pattern as the existing notifySuccess. This is a good addition that improves the usability of the toast utility.

src/components/MemberContribution/ContributionAccordianItem.tsx (3)

12-12: LGTM! Semicolon added for consistency.


61-61: Good fix! Standardizing to data-testid.

The change aligns with testing-library conventions which use lowercase data-testid.


63-79: LGTM! Ternary expression is clear and equivalent.

The conditional rendering logic correctly handles linking to either the task detail page or the task URL.

src/test/unit/components/member-contribution/ContributionAccordianItem.test.tsx (1)

35-36: LGTM! Test queries updated to match component structure.

The changes correctly update the role queries from heading to link, aligning with the component's rendering of Link elements for task titles.

Also applies to: 66-67, 94-95

.github/workflows/continuous-integration.yml (1)

5-7: LGTM! Appropriate PR trigger configuration.

The workflow correctly triggers on pull requests to all branches, which is suitable for continuous integration.

jest.config.js (2)

3-3: LGTM! Formatting improvement.

The consolidated single-line format for the nextJest configuration is cleaner and maintains the same functionality.


3-3: Removal of testEnvironmentOptions is safe and complete.

The removal of testEnvironmentOptions with customExportConditions: [''] has been verified. Codebase analysis confirms no references to customExportConditions or testEnvironmentOptions exist anywhere in the project. The current jest.config.js uses the standard testEnvironment: 'jest-environment-jsdom' setup, and the removal poses no risk to existing tests.

package.json (7)

6-6: LGTM! Node version update.

Updating from Node 18.16.0 to 18.20.8 brings bug fixes and security patches while staying within the same major version.


16-17: LGTM! New scripts support CI workflow.

The test:coverage and build scripts are correctly added and align with the CI workflow requirements.


56-56: Verify the autoprefixer downgrade.

Downgrading autoprefixer from ^10.4.20 to ^10.4.13 moves back several patch versions. While this is less critical than major version downgrades, please verify this is intentional and document the reason.

Consider checking if this downgrade addresses a specific issue or if it's an unintended change.


55-55: LGTM! Adding TypeScript types for Jest.

Adding @types/jest as a dev dependency is appropriate for TypeScript support in test files.


36-36: I can see that version 8.57.0 is not vulnerable to the identified advisory (it only affects versions < 4.18.2). However, I need to understand the broader context of this downgrade. Let me search for information about ESLint 9.x vs 8.x to better assess whether the downgrade is justified.

Document the reason for the ESLint downgrade in the PR description.

ESLint 9 introduces significant breaking changes including a new "flat config" default format and deprecates eslintrc, and plugin support for ESLint 9.x and flat config varies, with most popular plugins still adopting support. While downgrading from 9.9.0 to 8.57.0 is a version step backward, most users should be able to upgrade to v9 without build changes, so the downgrade warrants explanation. Version 8.57.0 has no known security vulnerabilities—security advisories for ESLint only affect versions prior to 4.18.2.

Please clarify in the PR description:

  • Which dependencies require ESLint 8 compatibility
  • Whether ESLint 9 migration was attempted and which specific issues were encountered
  • If this is temporary pending plugin updates

If ESLint 9 is needed longer term, create a follow-up issue to track the upgrade once blockers are resolved.


60-60: This downgrade is necessary and correct; the codebase uses exclusively MSW v1 APIs.

The entire codebase relies on MSW v1's rest API pattern (imported from 'msw'). Handler files across src/mocks/handlers/ all use rest.get(), rest.post(), rest.patch(), and rest.delete(). No MSW v2-specific APIs (like the http module) are present anywhere in the codebase.

If the version were upgraded to v2, the handlers would break because v2 removed the rest API in favor of the http API—a major breaking change. The downgrade to ^1.3.2 actually aligns the dependency with the existing codebase patterns and is the correct action.

No test migrations, feature updates, or compatibility concerns apply here.

Likely an incorrect or invalid review comment.


45-45: No issue found — react-toastify v10.0.5 includes built-in TypeScript definitions.

The package ships with its own TypeScript definitions via the typings entry in package.json, making @types/react-toastify unnecessary. The removal is correct and improves the dependency tree.


strategy:
matrix:
node-version: [18.x]
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider pinning the Node version more specifically.

The workflow uses 18.x while package.json specifies 18.20.8 via Volta. Using a more specific version in CI ensures consistency with local development.

Apply this diff to align with the Volta configuration:

       matrix:
-        node-version: [18.x]
+        node-version: [18.20.8]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
node-version: [18.x]
node-version: [18.20.8]
🤖 Prompt for AI Agents
In .github/workflows/continuous-integration.yml around line 15, the job
currently uses a broad node-version (18.x) which can differ from the
Volta-specified Node version in package.json; update the node-version entry to
the exact version used by Volta (18.20.8) so CI matches local environment and
avoids unexpected version drift.

node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn prettier:check
- run: yarn test:coverage
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider uploading coverage reports.

The workflow runs test coverage but doesn't upload or report the results anywhere. Consider integrating with a coverage service like Codecov or Coveralls for visibility into test coverage trends.

Example step to add after test coverage:

      - name: Upload coverage reports
        uses: codecov/codecov-action@v3
        with:
          files: ./coverage/coverage-final.json
          fail_ci_if_error: false
🤖 Prompt for AI Agents
.github/workflows/continuous-integration.yml around line 27: the workflow runs
test coverage but never uploads the reports; add a new job step immediately
after the "yarn test:coverage" run to upload the generated coverage artifact to
a coverage service (e.g., Codecov or Coveralls). Install or reference the
appropriate GitHub Action (for example codecov/codecov-action@v3), point it at
the coverage output file produced by your test runner (e.g.,
coverage/coverage-final.json or coverage/lcov.info), and set fail_ci_if_error or
equivalent to false so CI doesn't fail on upload issues; ensure any required
secrets/tokens are added to repository secrets if the chosen service requires
authentication.

@prakashchoudhary07 prakashchoudhary07 merged commit 4165f4f into develop Nov 9, 2025
4 checks passed
@prakashchoudhary07 prakashchoudhary07 deleted the setup/github-actions branch November 9, 2025 04:48
@korbit-ai
Copy link

korbit-ai bot commented Nov 9, 2025

I was unable to write a description for this pull request. This could be because I only found files I can't scan.

@MayankBansal12 MayankBansal12 mentioned this pull request Jan 16, 2026
10 tasks
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.

Setup Github workflows.

2 participants