Skip to content

Conversation

@coodos
Copy link
Contributor

@coodos coodos commented Nov 12, 2025

Description of change

add a build check on CI

Issue Number

Type of change

  • Chore (refactoring, build scripts or anything else that isn't user-facing)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • Bug Fixes
    • Improved robustness of follower statistics display with enhanced handling of non-standard values

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Walkthrough

A GitHub Actions CI workflow is added to build all packages on pull requests and pushes to dev/main branches. In parallel, a React component for displaying user follow statistics is refactored to use explicit function logic with improved numeric type safety.

Changes

Cohort / File(s) Summary
CI/Build Configuration
\.github/workflows/build\.yml
New workflow that runs on PR/push to dev or main, sets up Ubuntu with Node.js 22.x, installs build dependencies and pnpm, then rebuilds native modules and builds all packages.
Component Refactoring
platforms/blabsy/src/components/user/user-follow-stats\.tsx
Replaced inline map callback with explicit function body; added local statsValue variable with guarded numeric handling (defaults to 0 for non-numeric stats); pluralization logic updated to use statsValue.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the build workflow conditions and environment configuration are correct
  • Confirm the numeric type coercion in the stats component preserves existing rendering behavior for all input types

Poem

🐰 A workflow takes shape, so tidy and clean,
With Node and pnpm, a builder's dream!
Stats grow more robust, numbers handled with care,
Building and following—progress in the air! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description follows the template structure but lacks critical details. The 'How the change has been tested' section is empty, and all checklist items are unchecked, indicating incomplete preparation. Complete the 'How the change has been tested' section with specific testing steps and check off applicable checklist items to verify code quality.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: add build workflow' is specific and clearly relates to the main change, which introduces a GitHub Actions build workflow in .github/workflows/build.yml.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/add-build-checks-for-platforms

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.

@coodos coodos merged commit ed2cf47 into main Nov 12, 2025
2 of 4 checks passed
Copy link
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/build.yml (1)

10-12: Consider adding a timeout to prevent runaway jobs.

Add a timeout to the job definition to prevent excessive CI minutes consumption:

 jobs:
   build:
     runs-on: ubuntu-latest
+    timeout-minutes: 30
     steps:

Adjust the value based on typical build duration for your monorepo.

platforms/blabsy/src/components/user/user-follow-stats.tsx (1)

52-65: Use statsValue consistently throughout the render logic.

Line 53 introduces a defensive type guard for statsValue, but line 60 still renders the original stats variable. For consistency and type safety, use statsValue in both locations.

Apply this diff:

                 ].map(([title, stats], index) => {
                     const statsValue = typeof stats === 'number' ? stats : 0;
                     return (
                         <div
                             key={title}
                             className='mt-0.5 mb-[3px] flex h-4 items-center gap-1 pointer-events-none'
                         >
                             <p className='font-bold text-light-primary dark:text-dark-primary'>
-                                {stats}
+                                {statsValue}
                             </p>
                             <p>{index === 1 && statsValue > 1 ? `${title}s` : title}</p>
                         </div>
                     );
                 })}

This ensures consistent handling of the potentially non-numeric value.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46912ab and 573de4b.

📒 Files selected for processing (2)
  • .github/workflows/build.yml (1 hunks)
  • platforms/blabsy/src/components/user/user-follow-stats.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: lint
🔇 Additional comments (1)
.github/workflows/build.yml (1)

32-37: Good defensive handling of native modules.

The approach of cleaning pre-built binaries and rebuilding is solid for ensuring compatibility across different environments.

Comment on lines +26 to +30
- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: pnpm install
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use pnpm/action-setup and enable dependency caching.

Installing pnpm via npm doesn't pin the version and misses out on built-in caching. The official pnpm/action-setup action provides version pinning from package.json and integrates with GitHub Actions cache.

Apply this diff:

-      - name: Install pnpm
-        run: npm install -g pnpm
+      - name: Install pnpm
+        uses: pnpm/action-setup@v4
+        with:
+          run_install: false
 
       - name: Install Dependencies
         run: pnpm install

Additionally, add caching for dependencies between the Node.js setup and pnpm install:

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 22.x
          cache: 'pnpm'

This will significantly reduce CI execution time on subsequent runs.

🤖 Prompt for AI Agents
.github/workflows/build.yml around lines 26 to 30: the workflow installs pnpm
globally via npm and runs pnpm install which neither pins pnpm version nor uses
Actions' dependency caching; replace the two steps with the official
pnpm/action-setup action (configured to read the pnpm version from package.json
or a pinned version) and ensure caching by using actions/setup-node@v4 with
with: node-version: 22.x and cache: 'pnpm' before running pnpm install so
dependencies are cached between runs.

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.

2 participants