Skip to content

test(dashboard): fix SecuritySettings i18n test failure#145

Merged
yacosta738 merged 2 commits into
mainfrom
test/fix-dashboard-i18n-labels-12451892336207103931
Mar 5, 2026
Merged

test(dashboard): fix SecuritySettings i18n test failure#145
yacosta738 merged 2 commits into
mainfrom
test/fix-dashboard-i18n-labels-12451892336207103931

Conversation

@yacosta738
Copy link
Copy Markdown
Contributor

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

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>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 5, 2026

Deploying corvus with  Cloudflare Pages  Cloudflare Pages

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

View logs

@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 5, 2026

Warning

Rate limit exceeded

@yacosta738 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bdd4c3ee-c8d1-47f9-9731-3df36f266a3b

📥 Commits

Reviewing files that changed from the base of the PR and between ef1613c and 99d0437.

⛔ Files ignored due to path filters (1)
  • clients/web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • clients/web/packages/locales/package.json
  • clients/web/packages/locales/src/index.ts
  • clients/web/packages/locales/src/parity.spec.ts
📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
I18n Configuration
clients/web/apps/chat/src/i18n.ts, clients/web/apps/dashboard/src/i18n.ts
Added fallbackLocale: "en" and English messages to i18nConfig to support fallback behavior when translations are missing.
Locales Package
clients/web/packages/locales/src/en.json, clients/web/packages/locales/src/index.ts
New English translations file with 112+ translation keys covering app, auth, form, gateway, security, chat, webhook sections. Index updated to import and export English translations alongside Spanish.
Test Configuration
clients/web/apps/dashboard/src/components/config/GatewaySettings.spec.ts, SecuritySettings.spec.ts, WebhookSettings.spec.ts, GeneralSettings.spec.ts
Updated test setup to explicitly set locale to "en" via createI18n({ ...i18nConfig, locale: "en" }) and updated expected assertion text from Spanish to English strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Suggested labels

area:web, area:vue

Suggested reviewers

  • yuniel-acosta
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commit style with 'test' prefix, includes a specific scope (dashboard), and is concise at 55 characters.
Description check ✅ Passed The PR description clearly explains the changes: English translations added, i18n configs updated with fallback, and tests modified to use 'en' locale explicitly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/fix-dashboard-i18n-labels-12451892336207103931

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

✅ Contributor Report

User: @yacosta738
Status: Passed (12/13 metrics passed)

Metric Description Value Threshold Status
PR Merge Rate PRs merged vs closed 88% >= 30%
Repo Quality Repos with ≥100 stars 0 >= 0
Positive Reactions Positive reactions received 9 >= 1
Negative Reactions Negative reactions received 0 <= 5
Account Age GitHub account age 3051 days >= 30 days
Activity Consistency Regular activity over time 108% >= 0%
Issue Engagement Issues with community engagement 0 >= 0
Code Reviews Code reviews given to others 390 >= 0
Merger Diversity Unique maintainers who merged PRs 2 >= 0
Repo History Merge Rate Merge rate in this repo 90% >= 0%
Repo History Min PRs Previous PRs in this repo 113 >= 0
Profile Completeness Profile richness (bio, followers) 90 >= 0
Suspicious Patterns Spam-like activity detection 1 N/A

Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-03-05 to 2026-03-05

@sentry
Copy link
Copy Markdown

sentry Bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yacosta738 yacosta738 marked this pull request as ready for review March 5, 2026 21:07
Copy link
Copy Markdown
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

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0684d60 and ef1613c.

📒 Files selected for processing (8)
  • clients/web/apps/chat/src/i18n.ts
  • clients/web/apps/dashboard/src/components/config/GatewaySettings.spec.ts
  • clients/web/apps/dashboard/src/components/config/GeneralSettings.spec.ts
  • clients/web/apps/dashboard/src/components/config/SecuritySettings.spec.ts
  • clients/web/apps/dashboard/src/components/config/WebhookSettings.spec.ts
  • clients/web/apps/dashboard/src/i18n.ts
  • clients/web/packages/locales/src/en.json
  • clients/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.ts
  • clients/web/apps/dashboard/src/components/config/WebhookSettings.spec.ts
  • clients/web/apps/dashboard/src/components/config/GatewaySettings.spec.ts
  • clients/web/packages/locales/src/index.ts
  • clients/web/apps/dashboard/src/components/config/GeneralSettings.spec.ts
  • clients/web/apps/dashboard/src/i18n.ts
  • clients/web/apps/chat/src/i18n.ts
  • clients/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: translations export update is correct.
en is 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.
Using locale: "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.

Comment on lines +7 to +10
fallbackLocale: "en",
messages: {
es: translations.es,
en: translations.en,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.")
PY

As 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>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 5, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
0.0% Coverage on New Code (required ≥ 80%)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@yacosta738 yacosta738 merged commit c55e30b into main Mar 5, 2026
16 of 18 checks passed
@yacosta738 yacosta738 deleted the test/fix-dashboard-i18n-labels-12451892336207103931 branch March 5, 2026 22:06
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