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

chore: prevent translation changes being merged without the correct configurations #19964

Draft
wants to merge 44 commits into
base: develop
Choose a base branch
from

Conversation

RadhepS
Copy link
Contributor

@RadhepS RadhepS commented Feb 4, 2025

@RadhepS RadhepS requested a review from a team as a code owner February 4, 2025 17:12
@github-actions github-actions bot marked this pull request as draft February 4, 2025 17:12
@RadhepS RadhepS changed the base branch from develop to develop-cxspa-9258 February 4, 2025 17:15
@RadhepS RadhepS changed the base branch from develop-cxspa-9258 to develop February 5, 2025 15:18
@RadhepS RadhepS changed the title [Do not merge] test translation script chore: prevent translation changes being merged without the correct configurations Feb 5, 2025
@RadhepS RadhepS marked this pull request as ready for review February 5, 2025 15:52
Copy link

cypress bot commented Feb 5, 2025

spartacus    Run #46967

Run Properties:  status check passed Passed #46967  •  git commit 132ff0781e ℹ️: Merge 3e4d2b202b4a80c0be86c42b19cd6ea517f425ba into 98606c7e960bff896fb3efcc6bbd...
Project spartacus
Branch Review feature/cxspa-9258
Run status status check passed Passed #46967
Run duration 11m 56s
Commit git commit 132ff0781e ℹ️: Merge 3e4d2b202b4a80c0be86c42b19cd6ea517f425ba into 98606c7e960bff896fb3efcc6bbd...
Committer Radhep Sabapathipillai
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 125
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@github-actions github-actions bot marked this pull request as draft February 12, 2025 19:37
Comment on lines 55 to 56
# Find all translation folders in the repository
translation_paths=$(find . -type d -path '*/assets/translations')
Copy link
Contributor

Choose a reason for hiding this comment

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

While running the script on local (where having /dist folder with already built libs), I've got a failure of the script:
Translations file not found: ./dist/organization/account-summary/assets/translations/translations.ts

Suggested change
# Find all translation folders in the repository
translation_paths=$(find . -type d -path '*/assets/translations')
# Find all translation folders in the repository, excluding node_modules/ and dist/
translation_paths=$(find . -type d -path '*/assets/translations' -not -path './node_modules/*' -not -path './dist/*')
``

Comment on lines 32 to 33
changed_files=$(git diff --name-only $BASE_COMMIT $HEAD_COMMIT | grep 'assets/translations')

Copy link
Contributor

@Platonn Platonn Feb 13, 2025

Choose a reason for hiding this comment

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

Here we account only for the pattern assets/translations, but it can be also assets/src/translations (with src in the middle).

When I removed an expected export statement or import statement in files in the folder projects/assets/src/translations/ - the script didn't complain, but it should.

We need take it into account:

  • in line 32
  • in line 37
  • in file ci-scripts/validate-translations.sh in line 56

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.

2 participants