WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@rawadhossain
Copy link

@rawadhossain rawadhossain commented Dec 6, 2025

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

  • Implements a detection script (scripts/check-i18n.js) to scan non-test files under src/.
  • Flags user-visible hardcoded text in:
    • JSX text nodes
    • Toast messages (toast.error/success/info/warning)
    • User-visible HTML/ARIA attributes (placeholder, title, alt, aria-label, label)
  • Excludes tests and mocks (*.test.*, *.spec.*, __tests__, __mocks__, .mock.).
  • Outputs violations with:
    • File path
    • Line number
    • The exact user-visible text
  • Groups violations per file with a blank line; prints a clear header.
  • Exits with status code 1 when violations are detected.
  • Adds the script to Husky pre-commit (staged src files only) so contributors can catch issues locally.

Notes:

  • CI enforcement for the i18n check in pull-request.yml is intentionally commented out.
    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.
  • This PR does not fix existing violations.

Does this PR introduce a breaking change?
No

Checklist

CodeRabbit AI Review

  • I have reviewed and addressed all critical issues flagged by CodeRabbit AI
  • I have implemented or provided justification for each non-critical suggestion
  • I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

Test Coverage

  • I have written tests for all new changes/features
  • I have verified that test coverage meets or exceeds 95%
  • I have run the test suite locally and all tests pass

Other information

Have you read the contributing guide?

Summary by CodeRabbit

  • Chores
    • CI now detects changed source files and can conditionally run i18n validation on PRs.
    • Pre-commit hook added to validate staged source files for i18n issues before committing.
    • New local script available to run the i18n check manually.
    • Dependency-analysis configuration updated to ignore an additional tooling dependency.

✏️ Tip: You can customize this high-level summary in your review settings.

@keploy
Copy link

keploy bot commented Dec 6, 2025

No significant changes currently retry

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

Our Pull Request Approval Process

This PR will be reviewed according to our:

  1. Palisadoes Contributing Guidelines

  2. AI Usage Policy

Your PR may be automatically closed if:

  1. Our PR template isn't filled in correctly

  2. You haven't correctly linked your PR to an issue

Thanks for contributing!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Walkthrough

Adds 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 nyc. (50 words)

Changes

Cohort / File(s) Summary
I18n validation script
scripts/check-i18n.js
New Node.js script that scans src/ (TS/JS/TSX/JSX) for user-visible text (JSX text, attributes: placeholder,title,aria-label,alt,label,aria-placeholder, and toast.*), excludes tests/mocks, strips comments while preserving line numbers, reports file+line+text, accepts optional file args, normalizes paths, and exits 1 on violations.
Pre-commit hook
.husky/pre-commit
Adds collection of staged src files with extensions .ts,.tsx,.js,.jsx into STAGED_SRC and conditionally runs pnpm run check-i18n when such files exist.
GitHub Actions workflow
.github/workflows/pull-request.yml
Adds "Get changed source files" step: computes merge-base, lists changed files between base and head, filters to .ts,.tsx,.js,.jsx source files, outputs a space-separated files value and boolean none; includes commented conditional to run i18n check only if changes exist.
Package & deps config
package.json, knip.deps.json
package.json: adds script "check-i18n": "node scripts/check-i18n.js". knip.deps.json: adds "nyc" to ignoreDependencies.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Dev as Developer
participant Husky as .husky/pre-commit
participant GH as GitHub Actions
participant Script as scripts/check-i18n.js
note right of Dev #e0f7fa: Developer stages/commits / opens PR
Dev->>Husky: Commit (pre-commit runs)
Husky->>Script: If staged src files exist, invoke check-i18n with file list
alt violations found locally
Script-->>Husky: Exit 1 + report
Husky-->>Dev: Abort commit
else no violations
Script-->>Husky: Exit 0
Husky-->>Dev: Allow commit
end
note right of GH #fff3e0: On PR
GH->>GH: Compute merge-base; list changed source files
GH->>Script: Optionally run check-i18n on changed files (when enabled)
alt violations found in CI
Script-->>GH: Exit 1 + report
GH-->>Repo: Mark check failed
else no violations
Script-->>GH: Exit 0
GH-->>Repo: Check passes
end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to:
    • scripts/check-i18n.js: comment-stripping correctness, regex/heuristic accuracy for JSX and attribute detection, handling of template literals and edge-case strings, and platform-safe path normalization.
    • .husky/pre-commit and .github/workflows/pull-request.yml: correctness of file discovery/filtering and robustness of the GitHub Actions output behavior.
    • package.json and knip.deps.json: confirm script name and rationale for adding nyc to ignored deps.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing an i18n static analysis pipeline with pre-commit and CI support, matching the core functionality added.
Description check ✅ Passed The PR description addresses most required template sections with clear detail: change type (Feature), issue number (#4749), summary of implementation, notes on intentional decisions, and breaking change status. While test coverage checkboxes remain unchecked, the core description is complete and thorough.
Linked Issues check ✅ Passed The implementation fully addresses all coding requirements from issue #4749: detects non-translated user-visible text (JSX nodes, toast messages, ARIA attributes), outputs violations with file path/line number, groups by file with separators, integrates into pre-commit and CI, and exits with error code on violations.
Out of Scope Changes check ✅ Passed All changes are directly scoped to i18n detection implementation: the detection script, pre-commit integration, workflow modifications, and supporting package.json/knip configuration changes are all necessary for the stated objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30cc6f9 and 41fb7a6.

📒 Files selected for processing (1)
  • scripts/check-i18n.js (1 hunks)
🧰 Additional context used
🧠 Learnings (20)
📓 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: 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: 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-04-07T21:27:22.031Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: public/locales/hi/translation.json:1221-1221
Timestamp: 2025-04-07T21:27:22.031Z
Learning: Be more careful when reviewing translations - verify context thoroughly and assume that translations have been properly reviewed by the developer before suggesting changes, especially for languages where I may not have complete context.

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
⏰ 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)
  • GitHub Check: Check Python Code Style
  • GitHub Check: Generate and Validate Documentation
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (1)
scripts/check-i18n.js (1)

1-189: Excellent implementation—meets all requirements from issue #4749.

The script is well-structured and handles the core objectives:

  • File discovery: Recursively scans src/, filters by extension, excludes tests/mocks with cross-platform path normalization.
  • Comment stripping: Preserves line numbers while removing block and line comments.
  • Detection: Focuses on high-signal, user-visible targets (JSX text nodes, user-visible HTML/ARIA attributes, toast messages) while intentionally skipping generic string literals to reduce false positives.
  • Reporting: Groups violations by file, shows file path, line number, and exact text; exits with code 1 on violations.
  • Error handling: File read failures are caught, logged, and gracefully handled.
  • Unicode support: Word counting uses \p{L}+ for international scripts.

All critical issues from previous reviews have been resolved:

  • JSX regex escaping fixed (commit 96da1c9) ✓
  • Error handling added (commit 30cc6f9) ✓
  • Character class consistency between attribute and toast regexes ✓

The acknowledged limitation (single-line detection only) aligns with the issue scope and is documented inline (lines 133-139).


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.

@rawadhossain rawadhossain changed the title feat: internationalization feat: Implement i18n Static Analysis Pipeline with Pre-Commit Enforcement and CI Support Dec 6, 2025
@rawadhossain
Copy link
Author

@coderabbitai Add label ignore-sensitive-files-pr to this PR #4956

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

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 (.github/workflows/pull-request.yml) and pre-commit hooks, the ignore-sensitive-files-pr label is indeed appropriate. You'll need to add this label manually through the GitHub UI or using the GitHub CLI if you have the necessary permissions.

If you need assistance with the command, you can use:

gh pr edit 4956 --add-label "ignore-sensitive-files-pr"

🧠 Learnings used
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: 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: Priyanshuthapliyal2005
Repo: PalisadoesFoundation/talawa-admin PR: 3485
File: .github/workflows/pull-request.yml:79-149
Timestamp: 2025-01-30T10:29:36.662Z
Learning: CodeRabbit bot does not have permissions to add labels in the talawa-admin repository. Label management requires repository maintainer intervention.

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.

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: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63bba8d and 1ff52e8.

📒 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.yml
  • knip.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.js
  • knip.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: Ignoring nyc in knip deps is reasonable

Marking nyc as 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-i18n run 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 enforcement

The new changed-src step correctly computes src/*.{ts,tsx,js,jsx} changes via merge-base, exposes them as a space-separated files output, and provides a none flag 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 tooling

Adding "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
Copy link

codecov bot commented Dec 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.36%. Comparing base (1f9f7bb) to head (41fb7a6).
⚠️ Report is 2 commits behind head on develop.

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           
Flag Coverage Δ
vitest 95.36% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ff52e8 and 96da1c9.

📒 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. The isAllowedString function appropriately skips template literals with variables, URLs, and non-word strings.


93-100: JSX text detection regex is correct.

The regex />\s*([^<>{}\n]+?)\s*</g correctly 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 \2 to 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.

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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 96da1c9 and 30cc6f9.

📒 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 traversal
  • shouldAnalyzeFile() properly normalizes paths for cross-platform test exclusion
  • stripComments() cleverly preserves line numbers for accurate violation reporting
  • countWords() uses Unicode-aware regex (\p{L}+) to handle international text
  • isAllowedString() 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 \\s and \\n (literal backslash + letter) to \s and \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.

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.

1 participant