Skip to content
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

Add i18n checks to PR workflows #8411

Merged
merged 3 commits into from
Oct 5, 2024

Conversation

AMoo-Miki
Copy link
Collaborator

@AMoo-Miki AMoo-Miki commented Oct 1, 2024

Description

  • Add i18n checks to PR workflows
  • Ignore missing formats while checking locale files
  • Add help text and description to i18n-check
  • Fix malformed translations

Changelog

  • infra: Add i18n checks to PR workflows
  • feat: Ignore missing formats while checking locale files
  • feat: Add help text and description to i18n-check
  • fix: Fix malformed translations

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link
Contributor

github-actions bot commented Oct 1, 2024

❌ Invalid Prefix

Invalid description prefix. Found "maintenance". Expected "breaking", "deprecate", "feat", "fix", "infra", "doc", "chore", "refactor", "security", "skip", or "test".

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 60.93%. Comparing base (17ec426) to head (f4ed90a).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/dev/i18n/integrate_locale_files.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8411      +/-   ##
==========================================
- Coverage   60.93%   60.93%   -0.01%     
==========================================
  Files        3760     3760              
  Lines       89310    89312       +2     
  Branches    13970    13971       +1     
==========================================
- Hits        54423    54421       -2     
- Misses      31492    31495       +3     
- Partials     3395     3396       +1     
Flag Coverage Δ
Linux_1 28.91% <ø> (ø)
Linux_2 56.30% <ø> (ø)
Linux_3 37.76% <ø> (-0.01%) ⬇️
Linux_4 29.93% <0.00%> (-0.01%) ⬇️
Windows_1 28.93% <ø> (ø)
Windows_2 56.25% <ø> (ø)
Windows_3 37.76% <ø> (ø)
Windows_4 29.93% <0.00%> (-0.01%) ⬇️

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.

opensearch-changeset-bot bot added a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Oct 1, 2024
@ashwin-pc
Copy link
Member

@AMoo-Miki Tests where pass?

@ashwin-pc ashwin-pc added the i18n Internationalization related Issues and PRs label Oct 1, 2024
@AMoo-Miki
Copy link
Collaborator Author

AMoo-Miki commented Oct 2, 2024

@AMoo-Miki Tests where pass?

Tests pass when no translation files are available. I removed this ignoring in the PR that split stuff and kept them separate to not block the workflows. This or that PR will be the last one of i18n that we merge for everything to kick in.

[08:00:08] Checking For Untracked Messages based on .i18nrc.json [started]
[08:00:08] Checking For Untracked Messages based on .i18nrc.json [skipped]
[08:00:08] → No translations found.
[08:00:08] Validating Default Messages [started]
[08:00:08] Validating Default Messages [skipped]
[08:00:08] → No translations found.
[08:00:08] Compatibility Checks [started]
[08:00:08] Compatibility Checks [skipped]
[08:00:08] → No translations found.

manasvinibs
manasvinibs previously approved these changes Oct 2, 2024
ZilongX
ZilongX previously approved these changes Oct 2, 2024
@AMoo-Miki AMoo-Miki marked this pull request as draft October 4, 2024 04:31
Also:
* Add help text and description to `i18n-check`
* Fix malformed translations

Signed-off-by: Miki <[email protected]>
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Oct 4, 2024
@AMoo-Miki AMoo-Miki dismissed stale reviews from ZilongX and manasvinibs via 2450bfc October 4, 2024 05:22
opensearch-changeset-bot bot added a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Oct 4, 2024
@AMoo-Miki AMoo-Miki marked this pull request as ready for review October 4, 2024 05:27
fix,
},
log
),
{ exitOnError: true }
{ exitOnError: false }
Copy link
Member

Choose a reason for hiding this comment

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

This seems changed the existing behavior, is it by intention?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. If true, it exits at the first error. When false, it logs them all and then finally throws.

While "checking" we would rather have all of the problems shown to us, as opposed to just the first problem.

@AMoo-Miki AMoo-Miki merged commit 428a7c2 into opensearch-project:main Oct 5, 2024
67 of 68 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-8411-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 428a7c2c9165b43c0343e293acd143e0bdac58b4
# Push it to GitHub
git push --set-upstream origin backport/backport-8411-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-8411-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-8411-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 428a7c2c9165b43c0343e293acd143e0bdac58b4
# Push it to GitHub
git push --set-upstream origin backport/backport-8411-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-8411-to-2.x.

AMoo-Miki added a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Oct 7, 2024
* Ignore missing `formats` while checking locale files

Also:
* Add help text and description to `i18n-check`
* Fix malformed translations

Signed-off-by: Miki <[email protected]>

* Add i18n checks to PR workflows

Signed-off-by: Miki <[email protected]>

* Changeset file for PR opensearch-project#8411 created/updated

---------

Signed-off-by: Miki <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

(cherry picked from commit 428a7c2)
Signed-off-by: Miki <[email protected]>
AMoo-Miki added a commit that referenced this pull request Oct 8, 2024
* Ignore missing `formats` while checking locale files

Also:
* Add help text and description to `i18n-check`
* Fix malformed translations



* Add i18n checks to PR workflows



* Changeset file for PR #8411 created/updated

---------




(cherry picked from commit 428a7c2)

Signed-off-by: Miki <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x distinguished-contributor i18n Internationalization related Issues and PRs v2.18.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants