-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: Implement i18n Static Analysis Pipeline with Pre-Commit Enforcement and CI Support #4956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: Implement i18n Static Analysis Pipeline with Pre-Commit Enforcement and CI Support #4956
Conversation
|
No significant changes currently retry |
Our Pull Request Approval ProcessThis PR will be reviewed according to our: Your PR may be automatically closed if:
Thanks for contributing! |
WalkthroughAdds a new i18n validation script that scans source files for non-internationalized user-visible text, adds an npm script to run it, integrates it into the pre-commit hook, and introduces a GitHub Actions step to compute changed source files; also updates knip.deps.json to ignore Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (20)📓 Common learnings📚 Learning: 2024-12-09T15:54:04.872ZApplied to files:
📚 Learning: 2024-12-07T14:25:09.928ZApplied to files:
📚 Learning: 2025-11-30T15:34:04.189ZApplied to files:
📚 Learning: 2024-10-08T16:13:41.996ZApplied to files:
📚 Learning: 2024-11-02T07:32:43.099ZApplied to files:
📚 Learning: 2025-11-28T18:25:57.426ZApplied to files:
📚 Learning: 2025-10-22T22:22:27.696ZApplied to files:
📚 Learning: 2024-12-03T05:52:37.888ZApplied to files:
📚 Learning: 2024-11-02T07:48:36.443ZApplied to files:
📚 Learning: 2024-12-02T04:20:11.745ZApplied to files:
📚 Learning: 2025-10-10T11:01:34.075ZApplied to files:
📚 Learning: 2025-11-28T23:56:12.253ZApplied to files:
📚 Learning: 2025-11-30T23:13:22.697ZApplied to files:
📚 Learning: 2025-04-13T10:05:41.802ZApplied to files:
📚 Learning: 2025-11-27T15:33:20.511ZApplied to files:
📚 Learning: 2025-03-19T17:42:16.729ZApplied to files:
📚 Learning: 2024-10-28T06:33:09.726ZApplied to files:
📚 Learning: 2025-04-07T21:27:22.031ZApplied to files:
📚 Learning: 2025-10-29T04:36:50.503ZApplied to files:
⏰ 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). (3)
🔇 Additional comments (1)
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. Comment |
|
@coderabbitai Add label ignore-sensitive-files-pr to this PR #4956 |
|
Tip For best results, initiate chat on the files or code changes. @rawadhossain, I don't have permissions to add labels to PRs in the talawa-admin repository. Based on the retrieved learnings, label management requires manual intervention by users with appropriate permissions. Since this PR modifies workflow files ( If you need assistance with the command, you can use: gh pr edit 4956 --add-label "ignore-sensitive-files-pr"🧠 Learnings used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/pull-request.yml(1 hunks).husky/pre-commit(1 hunks)knip.deps.json(1 hunks)package.json(1 hunks)scripts/check-i18n.js(1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4866
File: .github/workflows/pull-request-target.yml:28-30
Timestamp: 2025-11-27T15:33:20.511Z
Learning: In the talawa-admin repository, the PR greeting message in .github/workflows/pull-request-target.yml is intentionally simplified to only reference the centralized Palisadoes Contributing Guidelines (https://developer.palisadoes.org/docs/contributor-guide/contributing). This simplification is part of a strategic decision to centralize PR guidance and reporting across multiple Palisadoes repositories, rather than maintaining separate detailed documentation in each repository's workflow files.
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4484
File: cypress/pageObjects/AdminPortal/PostPage.ts:33-33
Timestamp: 2025-10-18T18:54:40.093Z
Learning: In the Talawa Admin project, E2E test assertions (including toast messages) are intentionally hardcoded in English for developer experience, even though the application supports localization. This is an accepted practice for Cypress E2E tests in this codebase.
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
📚 Learning: 2025-07-23T22:29:25.082Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4022
File: .github/workflows/cypress.yml:95-103
Timestamp: 2025-07-23T22:29:25.082Z
Learning: In the talawa-admin project, the npm script used to start the development server for Cypress testing is "npm run serve", not the more common "npm run dev" or "npm start".
Applied to files:
package.json
📚 Learning: 2025-03-16T04:32:35.820Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3852
File: .github/workflows/pull-request.yml:47-68
Timestamp: 2025-03-16T04:32:35.820Z
Learning: In GitHub Actions workflows that replace tj-actions/changed-files with git diff commands, the current implementation (without quoting $GITHUB_OUTPUT) handles all cases correctly since the environment variable typically contains a simple path without spaces.
Applied to files:
.github/workflows/pull-request.yml
📚 Learning: 2025-10-10T11:01:34.075Z
Learnt from: swastikCommits
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-10-10T11:01:34.075Z
Learning: For PRs that only update dependency versions in package.json and package-lock.json without modifying source code files, test coverage warnings are not applicable. The coverage requirements from linked issues apply to "affected files" which means source code files, not configuration/dependency files.
Applied to files:
.github/workflows/pull-request.ymlknip.deps.json
📚 Learning: 2025-10-22T18:08:21.451Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4522
File: .github/workflows/pull-request.yml:768-775
Timestamp: 2025-10-22T18:08:21.451Z
Learning: In the talawa-admin repository, the ZAP security scan job in .github/workflows/pull-request.yml should depend on Code-Quality-Checks, Test-Application, Run-Cypress-Tests, Start-App-Without-Docker, and Docker-Start-Check to ensure security scanning only runs on stable code that passes all prerequisite checks, optimizing CI resource usage.
Applied to files:
.github/workflows/pull-request.yml
📚 Learning: 2024-12-09T15:54:04.872Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 2619
File: vitest.config.ts:0-0
Timestamp: 2024-12-09T15:54:04.872Z
Learning: The files `scripts/custom-test-env.js`, `src/utils/i18nForTest.ts`, and `vitest.setup.ts` are not test files and should not be included in the test pattern.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-12-07T14:25:09.928Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 2612
File: scripts/githooks/check-localstorage-usage.js:10-18
Timestamp: 2024-12-07T14:25:09.928Z
Learning: TypeScript type annotations should not be added to JavaScript (`.js`) files in this project. Type annotations can only be used in TypeScript (`.ts` or `.tsx`) files.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-10-08T16:13:41.996Z
Learnt from: Chaitanya1672
Repo: PalisadoesFoundation/talawa-admin PR: 2049
File: src/screens/OrganizationActionItems/ActionItemUpdateModal.tsx:112-138
Timestamp: 2024-10-08T16:13:41.996Z
Learning: The `istanbul ignore next` comments in the `ActionItemUpdateModal.tsx` file were added as part of a commit that introduced tests for the `ActionItemUpdateModal` component. Removing these comments and writing tests to cover the previously ignored lines is recommended to ensure code integrity and improve test coverage.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-30T15:34:04.189Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4901
File: scripts/fix-nyc-compatibility.js:145-149
Timestamp: 2025-11-30T15:34:04.189Z
Learning: In the talawa-admin repository, the nyc compatibility wrapper in scripts/fix-nyc-compatibility.js is intentionally limited to only "merge" and "report" commands because other nyc commands are not used in the project and are currently incompatible with Node.js v24. This is a deliberate design decision, not an oversight.
Applied to files:
scripts/check-i18n.jsknip.deps.json
📚 Learning: 2025-09-23T04:50:51.081Z
Learnt from: BharathC0
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-09-23T04:50:51.081Z
Learning: In PalisadoesFoundation/talawa-admin, Rollup platform-specific binaries must be listed under optionalDependencies (not devDependencies) to avoid EBADPLATFORM on Linux CI runners. To satisfy rollup bump issues (e.g., #4148), set rollup/rollup-win32-x64-msvc to ^4.50.0 in optionalDependencies and keep the 'ignore-sensitive-files-pr' label when package-lock.json changes.
Applied to files:
knip.deps.json
📚 Learning: 2025-08-17T07:39:34.255Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4077
File: package.json:189-213
Timestamp: 2025-08-17T07:39:34.255Z
Learning: The Talawa Admin codebase primarily uses .spec.tsx/.spec.ts naming convention for unit tests, with Cypress tests using .cy.ts pattern. However, there is at least one .test.tsx file in the codebase, so NYC exclude patterns should include both .spec and .test patterns.
Applied to files:
knip.deps.json
⏰ 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: Analyse Code With CodeQL (javascript)
🔇 Additional comments (4)
knip.deps.json (1)
5-5: Ignoringnycin knip deps is reasonableMarking
nycas ignored for dependency analysis aligns with its use as a tooling-only CLI and avoids noisy unused-dependency reports..husky/pre-commit (1)
7-10: Pre-commit i18n hook wiring looks correct (with usual filename caveat)The staged-src detection and conditional
check-i18nrun are wired correctly for src/*.{ts,tsx,js,jsx} and won’t fire when there are no such files staged. This does assume no spaces in paths (since files are space-separated), which matches existing repo conventions.Also applies to: 17-17
.github/workflows/pull-request.yml (1)
105-116: Changed-src step is consistent and ready for future i18n enforcementThe new
changed-srcstep correctly computes src/*.{ts,tsx,js,jsx} changes via merge-base, exposes them as a space-separatedfilesoutput, and provides anoneflag for conditional use. The commented i18n step is wired appropriately to enable later once baseline violations are fixed.Also applies to: 118-123
package.json (1)
99-100: check-i18n script wiring is consistent with the new toolingAdding
"check-i18n": "node scripts/check-i18n.js"matches how the pre-commit hook and (future) workflow step invoke the detector and is compatible with the project’s ESM setup.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4956 +/- ##
========================================
Coverage 95.36% 95.36%
========================================
Files 387 387
Lines 15057 15057
Branches 4532 4532
========================================
Hits 14359 14359
Misses 670 670
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/check-i18n.js(1 hunks)
🧰 Additional context used
🧠 Learnings (18)
📓 Common learnings
Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-01-30T10:03:22.905Z
Learning: The 'ignore-sensitive-files-pr' label is required when making changes to sensitive files like package.json, package-lock.json, and workflow files in the talawa-admin repository.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4866
File: .github/workflows/pull-request-target.yml:28-30
Timestamp: 2025-11-27T15:33:20.511Z
Learning: In the talawa-admin repository, the PR greeting message in .github/workflows/pull-request-target.yml is intentionally simplified to only reference the centralized Palisadoes Contributing Guidelines (https://developer.palisadoes.org/docs/contributor-guide/contributing). This simplification is part of a strategic decision to centralize PR guidance and reporting across multiple Palisadoes repositories, rather than maintaining separate detailed documentation in each repository's workflow files.
Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-01-30T10:03:22.905Z
Learning: CodeRabbit does not have permissions to add labels to PRs in the talawa-admin repository. Labels need to be added manually by users with appropriate permissions.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4550
File: .github/workflows/pull-request.yml:377-382
Timestamp: 2025-10-29T04:36:50.503Z
Learning: In the talawa-admin repository's .github/workflows/pull-request.yml, the Check-AutoDocs job is intentionally added as a dependency of Test-Application to create a sequential chain (Code-Quality-Checks → Check-AutoDocs → Test-Application), ensuring documentation validation must complete before tests run. This design is approved and should not be flagged as a CI latency concern.
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4522
File: .github/workflows/pull-request.yml:768-775
Timestamp: 2025-10-22T18:08:21.451Z
Learning: In the talawa-admin repository, the ZAP security scan job in .github/workflows/pull-request.yml should depend on Code-Quality-Checks, Test-Application, Run-Cypress-Tests, Start-App-Without-Docker, and Docker-Start-Check to ensure security scanning only runs on stable code that passes all prerequisite checks, optimizing CI resource usage.
Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 3485
File: .github/workflows/pull-request.yml:79-149
Timestamp: 2025-01-30T10:29:36.662Z
Learning: In the talawa-admin repository, pull request authors without special permissions cannot add labels to their PRs. Only repository maintainers and bots with appropriate permissions can add labels.
Learnt from: BharathC0
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-09-23T04:50:51.081Z
Learning: In PalisadoesFoundation/talawa-admin, Rollup platform-specific binaries must be listed under optionalDependencies (not devDependencies) to avoid EBADPLATFORM on Linux CI runners. To satisfy rollup bump issues (e.g., #4148), set rollup/rollup-win32-x64-msvc to ^4.50.0 in optionalDependencies and keep the 'ignore-sensitive-files-pr' label when package-lock.json changes.
📚 Learning: 2024-12-09T15:54:04.872Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 2619
File: vitest.config.ts:0-0
Timestamp: 2024-12-09T15:54:04.872Z
Learning: The files `scripts/custom-test-env.js`, `src/utils/i18nForTest.ts`, and `vitest.setup.ts` are not test files and should not be included in the test pattern.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-12-07T14:25:09.928Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 2612
File: scripts/githooks/check-localstorage-usage.js:10-18
Timestamp: 2024-12-07T14:25:09.928Z
Learning: TypeScript type annotations should not be added to JavaScript (`.js`) files in this project. Type annotations can only be used in TypeScript (`.ts` or `.tsx`) files.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-10-08T16:13:41.996Z
Learnt from: Chaitanya1672
Repo: PalisadoesFoundation/talawa-admin PR: 2049
File: src/screens/OrganizationActionItems/ActionItemUpdateModal.tsx:112-138
Timestamp: 2024-10-08T16:13:41.996Z
Learning: The `istanbul ignore next` comments in the `ActionItemUpdateModal.tsx` file were added as part of a commit that introduced tests for the `ActionItemUpdateModal` component. Removing these comments and writing tests to cover the previously ignored lines is recommended to ensure code integrity and improve test coverage.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-30T15:34:04.189Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4901
File: scripts/fix-nyc-compatibility.js:145-149
Timestamp: 2025-11-30T15:34:04.189Z
Learning: In the talawa-admin repository, the nyc compatibility wrapper in scripts/fix-nyc-compatibility.js is intentionally limited to only "merge" and "report" commands because other nyc commands are not used in the project and are currently incompatible with Node.js v24. This is a deliberate design decision, not an oversight.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-11-02T07:32:43.099Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/TagActions/TagActions.tsx:367-0
Timestamp: 2024-11-02T07:32:43.099Z
Learning: In `src/components/TagActions/TagActions.tsx`, fragments around parentheses in the ancestor tags display are acceptable and should not be flagged as unnecessary.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-28T18:25:57.426Z
Learnt from: krikera
Repo: PalisadoesFoundation/talawa-admin PR: 4887
File: src/components/LoginPortalToggle/LoginPortalToggle.spec.tsx:57-59
Timestamp: 2025-11-28T18:25:57.426Z
Learning: In talawa-admin tests, when testing CSS module class names (imported as `styles from '*.module.css'`), prefer importing the styles module and using `toHaveClass(styles.className)` over `className.toContain('className')`. Vite hashes CSS module class names (e.g., activeLink → _activeLink_d8535b), so `toHaveClass('activeLink')` with plain strings will fail. The styles import approach is semantic, type-safe, and matches patterns in SideToggle.spec.tsx. Alternatively, `className.toContain()` is acceptable for substring matching without imports.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-10-22T22:22:27.696Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/Requests/Requests.spec.tsx:0-0
Timestamp: 2025-10-22T22:22:27.696Z
Learning: In talawa-admin tests using react-infinite-scroll-component (e.g., src/screens/Requests/Requests.spec.tsx), jsdom scroll is flaky. Prefer a resilient approach: try querying the container via document.querySelector('[data-testid="infinite-scroll-component"]') and fall back to window scroll if missing. Strengthen assertions by checking for page-2 items (e.g., "User9 Test") to ensure fetchMore actually ran instead of relying only on row counts.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-12-03T05:52:37.888Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:155-162
Timestamp: 2024-12-03T05:52:37.888Z
Learning: In the `ChangeLanguageDropdown` component (`src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.tsx`), error handling has not been implemented. Therefore, test cases in `src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx` do not cover error scenarios related to error handling.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-11-02T07:48:36.443Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/AddPeopleToTag/AddPeopleToTag.test.tsx:177-241
Timestamp: 2024-11-02T07:48:36.443Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.test.tsx`, prefer keeping test cases separate and more readable, even if it involves some duplication, instead of extracting common logic into helper functions.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-12-02T04:20:11.745Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:145-155
Timestamp: 2024-12-02T04:20:11.745Z
Learning: In PRs focused solely on refactoring test cases from Jest to Vitest, avoid suggesting optimizations or changes outside the migration scope.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-10-10T11:01:34.075Z
Learnt from: swastikCommits
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-10-10T11:01:34.075Z
Learning: For PRs that only update dependency versions in package.json and package-lock.json without modifying source code files, test coverage warnings are not applicable. The coverage requirements from linked issues apply to "affected files" which means source code files, not configuration/dependency files.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-28T23:56:12.253Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-30T23:13:22.697Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-04-13T10:05:41.802Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/style/app-fixed.module.css:8456-8463
Timestamp: 2025-04-13T10:05:41.802Z
Learning: For the Talawa Admin repository, focus feedback on substantive issues rather than minor styling suggestions, especially when the code follows established patterns in the codebase.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-27T15:33:20.511Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4866
File: .github/workflows/pull-request-target.yml:28-30
Timestamp: 2025-11-27T15:33:20.511Z
Learning: In the talawa-admin repository, the PR greeting message in .github/workflows/pull-request-target.yml is intentionally simplified to only reference the centralized Palisadoes Contributing Guidelines (https://developer.palisadoes.org/docs/contributor-guide/contributing). This simplification is part of a strategic decision to centralize PR guidance and reporting across multiple Palisadoes repositories, rather than maintaining separate detailed documentation in each repository's workflow files.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-03-19T17:42:16.729Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-10-28T06:33:09.726Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.test.tsx:251-274
Timestamp: 2024-10-28T06:33:09.726Z
Learning: In `TagActions.test.tsx`, negative test cases for tag operations can be deferred and added later if necessary, according to the team's plan.
Applied to files:
scripts/check-i18n.js
🔇 Additional comments (10)
scripts/check-i18n.js (10)
1-10: LGTM!Clean setup with appropriate shebang and Node.js built-in imports. The ES module syntax is modern and appropriate for this Node.js script.
11-31: LGTM!Well-defined constants with comprehensive test/mock patterns and user-visible attributes. The case-insensitive regex patterns and POSIX path normalization ensure robust cross-platform behavior.
56-61: Comment stripping edge case is acceptable for this use case.The regex patterns correctly strip block and line comments while preserving line numbers. Note that this approach might incorrectly strip
//or/* */sequences within string literals, but this is a rare edge case and acceptable for a linting/validation tool focused on detecting i18n violations.
63-78: LGTM!Excellent filtering logic with Unicode-aware word detection (
\p{L}+) that handles international text correctly. TheisAllowedStringfunction appropriately skips template literals with variables, URLs, and non-word strings.
93-100: JSX text detection regex is correct.The regex
/>\s*([^<>{}\n]+?)\s*</gcorrectly detects single-line JSX text nodes. As discussed in previous reviews, multi-line JSX detection is intentionally out of scope per the original issue requirements.
103-113: Attribute detection regex is appropriate.The dynamically constructed regex correctly detects user-visible attributes with string values. The pattern intentionally excludes values containing quotes or backticks to keep the regex simple and avoid complex escaping scenarios.
115-124: Toast message detection is correct.The regex pattern correctly captures toast method calls with string literal arguments and uses backreference
\2to match the closing quote.
126-132: LGTM!Excellent inline documentation explaining the intentional scope limitations. This comment helps future maintainers understand why generic string literal checks are omitted.
137-180: LGTM!Well-structured orchestration logic with:
- Proper CLI argument handling
- Graceful handling of empty file lists
- Clear output format matching issue requirements
- Correct exit codes for CI/pre-commit integration
- Cross-platform path normalization in output
182-182: LGTM!Standard script execution pattern.
There was a problem hiding this 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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/check-i18n.js(1 hunks)
🧰 Additional context used
🧠 Learnings (19)
📓 Common learnings
Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-01-30T10:03:22.905Z
Learning: The 'ignore-sensitive-files-pr' label is required when making changes to sensitive files like package.json, package-lock.json, and workflow files in the talawa-admin repository.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4866
File: .github/workflows/pull-request-target.yml:28-30
Timestamp: 2025-11-27T15:33:20.511Z
Learning: In the talawa-admin repository, the PR greeting message in .github/workflows/pull-request-target.yml is intentionally simplified to only reference the centralized Palisadoes Contributing Guidelines (https://developer.palisadoes.org/docs/contributor-guide/contributing). This simplification is part of a strategic decision to centralize PR guidance and reporting across multiple Palisadoes repositories, rather than maintaining separate detailed documentation in each repository's workflow files.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4550
File: .github/workflows/pull-request.yml:377-382
Timestamp: 2025-10-29T04:36:50.503Z
Learning: In the talawa-admin repository's .github/workflows/pull-request.yml, the Check-AutoDocs job is intentionally added as a dependency of Test-Application to create a sequential chain (Code-Quality-Checks → Check-AutoDocs → Test-Application), ensuring documentation validation must complete before tests run. This design is approved and should not be flagged as a CI latency concern.
Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-01-30T10:03:22.905Z
Learning: CodeRabbit does not have permissions to add labels to PRs in the talawa-admin repository. Labels need to be added manually by users with appropriate permissions.
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4522
File: .github/workflows/pull-request.yml:768-775
Timestamp: 2025-10-22T18:08:21.451Z
Learning: In the talawa-admin repository, the ZAP security scan job in .github/workflows/pull-request.yml should depend on Code-Quality-Checks, Test-Application, Run-Cypress-Tests, Start-App-Without-Docker, and Docker-Start-Check to ensure security scanning only runs on stable code that passes all prerequisite checks, optimizing CI resource usage.
Learnt from: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 3485
File: .github/workflows/pull-request.yml:79-149
Timestamp: 2025-01-30T10:29:36.662Z
Learning: In the talawa-admin repository, pull request authors without special permissions cannot add labels to their PRs. Only repository maintainers and bots with appropriate permissions can add labels.
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Learnt from: BharathC0
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-09-23T04:50:51.081Z
Learning: In PalisadoesFoundation/talawa-admin, Rollup platform-specific binaries must be listed under optionalDependencies (not devDependencies) to avoid EBADPLATFORM on Linux CI runners. To satisfy rollup bump issues (e.g., #4148), set rollup/rollup-win32-x64-msvc to ^4.50.0 in optionalDependencies and keep the 'ignore-sensitive-files-pr' label when package-lock.json changes.
Learnt from: Chaitanya1672
Repo: PalisadoesFoundation/talawa-admin PR: 2049
File: src/screens/OrganizationActionItems/ActionItemUpdateModal.tsx:112-138
Timestamp: 2024-10-08T16:13:41.996Z
Learning: The `istanbul ignore next` comments in the `ActionItemUpdateModal.tsx` file were added as part of a commit that introduced tests for the `ActionItemUpdateModal` component. Removing these comments and writing tests to cover the previously ignored lines is recommended to ensure code integrity and improve test coverage.
📚 Learning: 2024-12-09T15:54:04.872Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 2619
File: vitest.config.ts:0-0
Timestamp: 2024-12-09T15:54:04.872Z
Learning: The files `scripts/custom-test-env.js`, `src/utils/i18nForTest.ts`, and `vitest.setup.ts` are not test files and should not be included in the test pattern.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-12-07T14:25:09.928Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 2612
File: scripts/githooks/check-localstorage-usage.js:10-18
Timestamp: 2024-12-07T14:25:09.928Z
Learning: TypeScript type annotations should not be added to JavaScript (`.js`) files in this project. Type annotations can only be used in TypeScript (`.ts` or `.tsx`) files.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-30T15:34:04.189Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4901
File: scripts/fix-nyc-compatibility.js:145-149
Timestamp: 2025-11-30T15:34:04.189Z
Learning: In the talawa-admin repository, the nyc compatibility wrapper in scripts/fix-nyc-compatibility.js is intentionally limited to only "merge" and "report" commands because other nyc commands are not used in the project and are currently incompatible with Node.js v24. This is a deliberate design decision, not an oversight.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-10-08T16:13:41.996Z
Learnt from: Chaitanya1672
Repo: PalisadoesFoundation/talawa-admin PR: 2049
File: src/screens/OrganizationActionItems/ActionItemUpdateModal.tsx:112-138
Timestamp: 2024-10-08T16:13:41.996Z
Learning: The `istanbul ignore next` comments in the `ActionItemUpdateModal.tsx` file were added as part of a commit that introduced tests for the `ActionItemUpdateModal` component. Removing these comments and writing tests to cover the previously ignored lines is recommended to ensure code integrity and improve test coverage.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-11-02T07:32:43.099Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/TagActions/TagActions.tsx:367-0
Timestamp: 2024-11-02T07:32:43.099Z
Learning: In `src/components/TagActions/TagActions.tsx`, fragments around parentheses in the ancestor tags display are acceptable and should not be flagged as unnecessary.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-28T18:25:57.426Z
Learnt from: krikera
Repo: PalisadoesFoundation/talawa-admin PR: 4887
File: src/components/LoginPortalToggle/LoginPortalToggle.spec.tsx:57-59
Timestamp: 2025-11-28T18:25:57.426Z
Learning: In talawa-admin tests, when testing CSS module class names (imported as `styles from '*.module.css'`), prefer importing the styles module and using `toHaveClass(styles.className)` over `className.toContain('className')`. Vite hashes CSS module class names (e.g., activeLink → _activeLink_d8535b), so `toHaveClass('activeLink')` with plain strings will fail. The styles import approach is semantic, type-safe, and matches patterns in SideToggle.spec.tsx. Alternatively, `className.toContain()` is acceptable for substring matching without imports.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-10-22T22:22:27.696Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/Requests/Requests.spec.tsx:0-0
Timestamp: 2025-10-22T22:22:27.696Z
Learning: In talawa-admin tests using react-infinite-scroll-component (e.g., src/screens/Requests/Requests.spec.tsx), jsdom scroll is flaky. Prefer a resilient approach: try querying the container via document.querySelector('[data-testid="infinite-scroll-component"]') and fall back to window scroll if missing. Strengthen assertions by checking for page-2 items (e.g., "User9 Test") to ensure fetchMore actually ran instead of relying only on row counts.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-12-03T05:52:37.888Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:155-162
Timestamp: 2024-12-03T05:52:37.888Z
Learning: In the `ChangeLanguageDropdown` component (`src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.tsx`), error handling has not been implemented. Therefore, test cases in `src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx` do not cover error scenarios related to error handling.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-11-02T07:48:36.443Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/AddPeopleToTag/AddPeopleToTag.test.tsx:177-241
Timestamp: 2024-11-02T07:48:36.443Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.test.tsx`, prefer keeping test cases separate and more readable, even if it involves some duplication, instead of extracting common logic into helper functions.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-12-02T04:20:11.745Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:145-155
Timestamp: 2024-12-02T04:20:11.745Z
Learning: In PRs focused solely on refactoring test cases from Jest to Vitest, avoid suggesting optimizations or changes outside the migration scope.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-10-10T11:01:34.075Z
Learnt from: swastikCommits
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-10-10T11:01:34.075Z
Learning: For PRs that only update dependency versions in package.json and package-lock.json without modifying source code files, test coverage warnings are not applicable. The coverage requirements from linked issues apply to "affected files" which means source code files, not configuration/dependency files.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-28T23:56:12.253Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-30T23:13:22.697Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-04-13T10:05:41.802Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/style/app-fixed.module.css:8456-8463
Timestamp: 2025-04-13T10:05:41.802Z
Learning: For the Talawa Admin repository, focus feedback on substantive issues rather than minor styling suggestions, especially when the code follows established patterns in the codebase.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-11-27T15:33:20.511Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4866
File: .github/workflows/pull-request-target.yml:28-30
Timestamp: 2025-11-27T15:33:20.511Z
Learning: In the talawa-admin repository, the PR greeting message in .github/workflows/pull-request-target.yml is intentionally simplified to only reference the centralized Palisadoes Contributing Guidelines (https://developer.palisadoes.org/docs/contributor-guide/contributing). This simplification is part of a strategic decision to centralize PR guidance and reporting across multiple Palisadoes repositories, rather than maintaining separate detailed documentation in each repository's workflow files.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-03-19T17:42:16.729Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2024-10-28T06:33:09.726Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.test.tsx:251-274
Timestamp: 2024-10-28T06:33:09.726Z
Learning: In `TagActions.test.tsx`, negative test cases for tag operations can be deferred and added later if necessary, according to the team's plan.
Applied to files:
scripts/check-i18n.js
📚 Learning: 2025-10-29T04:36:50.503Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4550
File: .github/workflows/pull-request.yml:377-382
Timestamp: 2025-10-29T04:36:50.503Z
Learning: In the talawa-admin repository's .github/workflows/pull-request.yml, the Check-AutoDocs job is intentionally added as a dependency of Test-Application to create a sequential chain (Code-Quality-Checks → Check-AutoDocs → Test-Application), ensuring documentation validation must complete before tests run. This design is approved and should not be flagged as a CI latency concern.
Applied to files:
scripts/check-i18n.js
🔇 Additional comments (5)
scripts/check-i18n.js (5)
1-31: LGTM: Well-structured configuration.The constants and configuration are well-chosen:
- File extensions cover the relevant TypeScript and JavaScript variants
- Test exclusion patterns are comprehensive
- User-visible attributes list includes key accessibility and UI attributes
- Cross-platform path handling with POSIX normalization is a good practice
33-80: LGTM: Robust helper functions.The helper functions are well-designed:
walk()provides clean recursive directory traversalshouldAnalyzeFile()properly normalizes paths for cross-platform test exclusionstripComments()cleverly preserves line numbers for accurate violation reportingcountWords()uses Unicode-aware regex (\p{L}+) to handle international textisAllowedString()has sensible heuristics to reduce false positives (templates, URLs, non-words)
82-89: LGTM: Error handling properly implemented.The try-catch block added in commit 30cc6f9 correctly handles file read errors by logging a warning with the file path and error message, then returning an empty array to allow continued processing of other files.
94-107: LGTM: JSX text detection now works correctly.The JSX regex fix in commit 96da1c9 correctly changed from
\\sand\\n(literal backslash + letter) to\sand\n(whitespace and newline character classes) in the regex literal. This will now properly detect hardcoded JSX text nodes.
144-189: LGTM: Main orchestration logic is solid.The main function correctly:
- Accepts CLI file arguments or scans the entire src/ directory
- Filters files through
shouldAnalyzeFile()for extension and test exclusion- Collects and aggregates violations per file
- Formats output with relative POSIX paths and line numbers (matching issue #4749 requirements)
- Exits with proper status codes (1 for violations, 0 for clean)
The implementation aligns well with the stated objectives: line-based reporting with file path, line number, and violation text, grouped by file with blank-line separation.
What kind of change does this PR introduce?
Feature:Adds an automated detection system for non-internationalized user-visible text, along with pre-commit checks and CI support.Issue Number:
Fixes #4749
Snapshots/Videos:
If relevant, did you update the documentation?
Summary
scripts/check-i18n.js) to scan non-test files undersrc/.toast.error/success/info/warning)placeholder,title,alt,aria-label,label)*.test.*,*.spec.*,__tests__,__mocks__,.mock.).srcfiles only) so contributors can catch issues locally.Notes:
This avoids blocking current and future PRs while existing baseline i18n violations still exist in the repository.
Once the baseline hardcoded strings are fully translated, the CI step can be safely re-enabled by uncommenting it.
Does this PR introduce a breaking change?
No
Checklist
CodeRabbit AI Review
Test Coverage
Other information
Have you read the contributing guide?
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.