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 precommit hook to validate i18n #8423

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 precommit hook to validate i18n

Changelog

  • infra: Add precommit hook to validate i18n

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 (9da5f9b) to head (c9e23c6).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/dev/i18n/utils/utils.js 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8423      +/-   ##
==========================================
- Coverage   60.93%   60.93%   -0.01%     
==========================================
  Files        3760     3760              
  Lines       89310    89313       +3     
  Branches    13970    13970              
==========================================
  Hits        54423    54423              
- Misses      31492    31495       +3     
  Partials     3395     3395              
Flag Coverage Δ
Linux_1 28.91% <ø> (ø)
Linux_2 56.30% <ø> (ø)
Linux_3 37.76% <ø> (ø)
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.

files: string[],
targetMap: Map<string, { message: string }>,
config: I18nConfig,
reporter: any
Copy link
Member

Choose a reason for hiding this comment

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

Is this ErrorReporter | FailReport?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is code I just copied from another part of i18n which uses any because different things can use it (I think). I don't think anyone other that FailReport would get here but lemme deal with that later. Thanks for this.

@@ -0,0 +1,147 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

A little bit weird why we use the large license header in a new file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

code is copied from a file that has other license.

@AMoo-Miki AMoo-Miki merged commit 5203139 into opensearch-project:main Oct 5, 2024
65 of 67 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-8423-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 520313988c02323f9190cd93ccaa8a632744d358
# Push it to GitHub
git push --set-upstream origin backport/backport-8423-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-8423-to-2.x.

AMoo-Miki added a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Oct 7, 2024
* Add precommit hook to validate i18n

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

* Changeset file for PR opensearch-project#8423 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 5203139)
Signed-off-by: Miki <[email protected]>
AMoo-Miki added a commit that referenced this pull request Oct 8, 2024
* Add precommit hook to validate i18n



* Changeset file for PR #8423 created/updated

---------




(cherry picked from commit 5203139)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants