-
-
Notifications
You must be signed in to change notification settings - Fork 4
Fail build if any i18n strings were not extracted #1864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughA new CI workflow step was added to the frontend job in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Interestingly, I believe this will fail the build right now, because there are 6 unextracted strings related to audio on current |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
.github/workflows/fw-lite.yaml (3)
100-100
: Anchor the grep to the start of the hunk to avoid false positives
grep '+msgid'
will also match diff context lines such as"msgid"
appearing elsewhere in the hunk header.
Tighten the pattern to only match addedmsgid
lines:-DIFFCOUNT=$(diff -u src/locales/en.po{.old,} | grep '+msgid' | wc -l) +DIFFCOUNT=$(diff -u src/locales/en.po{.old,} | grep '^+msgid ' | wc -l)This eliminates accidental matches and ensures the count truly represents new untranslated strings.
100-101
: Quote the variable in the numeric comparisonAlthough unlikely here, an unset or empty
DIFFCOUNT
would trigger a Bash “unary operator expected” error.
Quoting the variable in the test guard is a cheap safety net:-if [ $DIFFCOUNT -gt 0 ]; then +if [ "$DIFFCOUNT" -gt 0 ]; then
112-113
: The explicitexit 0
is redundantThe script is already at the bottom of the step; letting it fall through implicitly exits with 0 and keeps the script slightly cleaner.
- rm -f src/locales/en.po.old - exit 0 + rm -f src/locales/en.po.old
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/fw-lite.yaml
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: frontend-component-unit-tests
- GitHub Check: frontend
- GitHub Check: Build FW Lite and run tests
The blank lines are supposed to make the "Unextracted strings found" message stand out, but the GHA logs are omitting blank lines. So we'll use `***` to make it stand out instead.
Also set `shell: bash` so this step could be run on Windows and still work
The lingui CLI command exits with code 1 if it finds unextracted strings, which allows it to function as the test in our CLI step.
It seems something else was responsible for the non-zero exit code on the previous run, not lingui's CLI. Go back to comparing .po files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work! I made a tweak to the pnpm script and I updated the localizations to ensure this works correctly when it should, and to prevent develop from failing the moment this is merged
Going to wait until the eslint-fix PR (#1844) merges cleanly, then merge this one next. |
Fixes #1859.