test(dashboard): fix SecuritySettings i18n test failure#145
Conversation
Added missing English translations to @corvus/locales and updated the dashboard and chat i18n configurations to include 'en' as a fallback. Modified dashboard configuration unit tests to explicitly use the 'en' locale to ensure assertions against English labels pass consistently. Co-authored-by: yacosta738 <33158051+yacosta738@users.noreply.github.com>
Deploying corvus with
|
| Latest commit: |
99d0437
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2aea903c.corvus-42x.pages.dev |
| Branch Preview URL: | https://test-fix-dashboard-i18n-labe.corvus-42x.pages.dev |
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds English internationalization support to chat and dashboard applications. Introduces fallback locale configuration and comprehensive English translations file. Updates test configurations to explicitly use English locale and verifies expected English text outputs. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
✅ Contributor ReportUser: @yacosta738
Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-03-05 to 2026-03-05 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@clients/web/apps/dashboard/src/i18n.ts`:
- Around line 7-10: Add a locale-parity guard that fails CI when Spanish and
English locale files diverge: create a test (or CI step) that reads
clients/web/packages/locales/src/es.json and en.json, flattens nested keys,
asserts the sets of keys are identical, and checks interpolation placeholder
parity (e.g., tokens like {name}) for each shared key; wire this into the
repository checks so with fallbackLocale and messages (translations.es /
translations.en) enabled, missing es keys or placeholder mismatches cause the
build to fail and surface mixed-language UI risks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7708ecbf-afd2-4231-8a2b-3fad97d0fb12
📒 Files selected for processing (8)
clients/web/apps/chat/src/i18n.tsclients/web/apps/dashboard/src/components/config/GatewaySettings.spec.tsclients/web/apps/dashboard/src/components/config/GeneralSettings.spec.tsclients/web/apps/dashboard/src/components/config/SecuritySettings.spec.tsclients/web/apps/dashboard/src/components/config/WebhookSettings.spec.tsclients/web/apps/dashboard/src/i18n.tsclients/web/packages/locales/src/en.jsonclients/web/packages/locales/src/index.ts
📜 Review details
⏰ 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: Cloudflare Pages
🧰 Additional context used
📓 Path-based instructions (1)
**/*
⚙️ CodeRabbit configuration file
**/*: Security first, performance second.
Validate input boundaries, auth/authz implications, and secret management.
Look for behavioral regressions, missing tests, and contract breaks across modules.
Files:
clients/web/apps/dashboard/src/components/config/SecuritySettings.spec.tsclients/web/apps/dashboard/src/components/config/WebhookSettings.spec.tsclients/web/apps/dashboard/src/components/config/GatewaySettings.spec.tsclients/web/packages/locales/src/index.tsclients/web/apps/dashboard/src/components/config/GeneralSettings.spec.tsclients/web/apps/dashboard/src/i18n.tsclients/web/apps/chat/src/i18n.tsclients/web/packages/locales/src/en.json
🔇 Additional comments (7)
clients/web/packages/locales/src/en.json (1)
1-112: English locale resource coverage looks solid.
This is comprehensive for the dashboard/chat surfaces touched in this PR and lowers missing-key runtime failures.clients/web/packages/locales/src/index.ts (1)
2-6:translationsexport update is correct.
enis wired cleanly and matches the new locale resource addition.clients/web/apps/dashboard/src/components/config/SecuritySettings.spec.ts (1)
26-26: Good test hardening.
Pinning locale to English here makes label assertions deterministic.clients/web/apps/dashboard/src/components/config/GeneralSettings.spec.ts (1)
24-29: Assertions and locale setup are aligned.
The explicit English locale plus updated expected labels is correct.clients/web/apps/dashboard/src/components/config/WebhookSettings.spec.ts (1)
24-28: Webhook i18n test update is correct.
Locale pinning and English assertion now match runtime behavior.clients/web/apps/dashboard/src/components/config/GatewaySettings.spec.ts (1)
25-25: Nice consistency with the other config specs.
Usinglocale: "en"here keeps this test stable and predictable.clients/web/apps/chat/src/i18n.ts (1)
7-10: No new issue beyond the locale-parity concern already raised.
Same fallback behavior applies here; one shared parity check in locales should cover both apps.
| fallbackLocale: "en", | ||
| messages: { | ||
| es: translations.es, | ||
| en: translations.en, |
There was a problem hiding this comment.
Add a locale-parity guard now that fallback is enabled.
With fallbackLocale: "en", missing es keys will silently render English, which can ship mixed-language UI undetected. Add a CI/test parity check for es.json vs en.json (keys + interpolation placeholders).
#!/bin/bash
set -euo pipefail
python - <<'PY'
import json, re, sys
from pathlib import Path
es_path = Path("clients/web/packages/locales/src/es.json")
en_path = Path("clients/web/packages/locales/src/en.json")
es = json.loads(es_path.read_text(encoding="utf-8"))
en = json.loads(en_path.read_text(encoding="utf-8"))
def flatten(node, prefix=""):
out = {}
if isinstance(node, dict):
for k, v in node.items():
key = f"{prefix}.{k}" if prefix else k
out.update(flatten(v, key))
else:
out[prefix] = node
return out
es_flat = flatten(es)
en_flat = flatten(en)
es_keys = set(es_flat.keys())
en_keys = set(en_flat.keys())
missing_in_es = sorted(en_keys - es_keys)
missing_in_en = sorted(es_keys - en_keys)
placeholder_re = re.compile(r"\{([a-zA-Z0-9_]+)\}")
placeholder_mismatch = []
for k in sorted(es_keys & en_keys):
es_vars = set(placeholder_re.findall(str(es_flat[k])))
en_vars = set(placeholder_re.findall(str(en_flat[k])))
if es_vars != en_vars:
placeholder_mismatch.append((k, sorted(es_vars), sorted(en_vars)))
if missing_in_es or missing_in_en or placeholder_mismatch:
print("Locale parity check failed.")
if missing_in_es:
print("\\nKeys missing in es.json:")
print("\\n".join(missing_in_es))
if missing_in_en:
print("\\nKeys missing in en.json:")
print("\\n".join(missing_in_en))
if placeholder_mismatch:
print("\\nPlaceholder mismatches:")
for k, esv, env in placeholder_mismatch:
print(f"{k}: es={esv} en={env}")
sys.exit(1)
print("Locale parity check passed.")
PYAs per coding guidelines, "Look for behavioral regressions, missing tests, and contract breaks across modules."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@clients/web/apps/dashboard/src/i18n.ts` around lines 7 - 10, Add a
locale-parity guard that fails CI when Spanish and English locale files diverge:
create a test (or CI step) that reads clients/web/packages/locales/src/es.json
and en.json, flattens nested keys, asserts the sets of keys are identical, and
checks interpolation placeholder parity (e.g., tokens like {name}) for each
shared key; wire this into the repository checks so with fallbackLocale and
messages (translations.es / translations.en) enabled, missing es keys or
placeholder mismatches cause the build to fail and surface mixed-language UI
risks.
Added missing English translations to @corvus/locales and updated the dashboard and chat i18n configurations to include 'en' as a fallback. Modified dashboard configuration unit tests to explicitly use the 'en' locale to ensure assertions against English labels pass consistently. Implemented a locale parity guard in @corvus/locales to ensure es.json and en.json remain synchronized. Co-authored-by: yacosta738 <33158051+yacosta738@users.noreply.github.com>
|




Added missing English translations to @corvus/locales and updated the dashboard and chat i18n configurations to include 'en' as a fallback. Modified dashboard configuration unit tests to explicitly use the 'en' locale to ensure assertions against English labels pass consistently.
PR created automatically by Jules for task 12451892336207103931 started by @yacosta738