openedx / i18n-tools

Tools to help with internationalization and localization of Open edX projects
Apache License 2.0
26 stars 31 forks source link

fix: Partial files are not added to cleaning process #136

Closed shadinaif closed 1 year ago

shadinaif commented 1 year ago

By mistake, we use django_partial and djangojs_partial naming instead of django-partial.po and djangojs-partial.po

This is considered a patch to https://github.com/openedx/i18n-tools/pull/129

Before the fix, no cleaning was done: for example https://github.com/Zeit-Labs/openedx-translations/pull/67/files#r1312206111 After the fix, cleaning is working on the generated files: https://github.com/Zeit-Labs/openedx-translations/pull/72/files#r1312299530

openedx-webhooks commented 1 year ago

Thanks for the pull request, @shadinaif! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

shadinaif commented 1 year ago

@OmarIthawi , @brian-smith-tcril ready for your review. It's a quick and obvious fix

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (53b8f06) 99.74% compared to head (55c7354) 99.75%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #136 +/- ## ======================================= Coverage 99.74% 99.75% ======================================= Files 10 10 Lines 399 401 +2 Branches 27 27 ======================================= + Hits 398 400 +2 Partials 1 1 ``` | [Files Changed](https://app.codecov.io/gh/openedx/i18n-tools/pull/136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx) | Coverage Δ | | |---|---|---| | [tests/test\_extract.py](https://app.codecov.io/gh/openedx/i18n-tools/pull/136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-dGVzdHMvdGVzdF9leHRyYWN0LnB5) | `100.00% <100.00%> (ø)` | | | [tests/test\_generate.py](https://app.codecov.io/gh/openedx/i18n-tools/pull/136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-dGVzdHMvdGVzdF9nZW5lcmF0ZS5weQ==) | `100.00% <100.00%> (ø)` | | | [tests/test\_segment.py](https://app.codecov.io/gh/openedx/i18n-tools/pull/136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-dGVzdHMvdGVzdF9zZWdtZW50LnB5) | `97.05% <100.00%> (+0.08%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

OmarIthawi commented 1 year ago

@shadinaif I think this one needs a test case. Please add it and tag me again.

shadinaif commented 1 year ago

Thank you @OmarIthawi , in fact the fix wasn't working too 😅 , I fixed the name again and it's working now

Before the fix, no cleaning was done: for example https://github.com/Zeit-Labs/openedx-translations/pull/67/files#r1312206111 After the fix, cleaning is working on the generated files: https://github.com/Zeit-Labs/openedx-translations/pull/72/files#r1312299530

OmarIthawi commented 1 year ago

Thanks @shadinaif. I meant a python test case (aka unit test). This is sort of bugs are the best use of unit tests in my opinion.

We know it's been fixed now, but it's helpful to keep the verification within the test suite that the CI runs.

Before the fix, no cleaning was done: for example https://github.com/Zeit-Labs/openedx-translations/pull/67/files#r1312206111 After the fix, cleaning is working on the generated files: https://github.com/Zeit-Labs/openedx-translations/pull/72/files#r1312299530

This is certainly useful! Thanks :)

shadinaif commented 1 year ago

Thank you @OmarIthawi , tests were added already here. And they all passed, the problem was that file names django-partial.po and djangojs-partial.po were hard coded in both methods and tests. Therefore, tests were using correct names and passed without an issue!

I've converted hard-coded file names into constants to be sharable between methods and tests. The cause of the Falsy tests was here

openedx-webhooks commented 1 year ago

@shadinaif 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.