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

fix: suffix based translation file detection and output subDir #901

Merged
merged 7 commits into from
Aug 26, 2024

Conversation

scolladon
Copy link
Owner

@scolladon scolladon commented Aug 15, 2024

Explain your changes


Ensure the flow translation code deals with both .translation and .translation-meta.xml Translation files suffix.
Test if the translation file is a sub dir of the output folder when output folder is different than the repository folder

Does this close any currently open issues?


closes #321

  • Jest tests added to cover the fix.

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4ef7204) to head (7b95a29).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #901   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           40        40           
  Lines         1078      1083    +5     
  Branches       114       115    +1     
=========================================
+ Hits          1078      1083    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@scolladon
Copy link
Owner Author

Hi @ArielS1 !

Could you test on your side and help us validate this PR please ?
You can follow those steps to easily do it on your side

@ArielS1
Copy link

ArielS1 commented Aug 19, 2024

actually the file's extension on the real repo translation-meta.xml
but i'm still able to reproduce it both on dev-901 and 5.42.0
check my repository

@scolladon
Copy link
Owner Author

actually the file's extension on the real repo translation-meta.xml but i'm still able to reproduce it both on dev-901 and 5.42.0 check my repository

on my side it is fixed with the version in this PR...
I mean the translation file is added in the package.xml and is is also copied in the output folder.

Are you sure you are using the version of the plugin from this PR ?

@ArielS1
Copy link

ArielS1 commented Aug 21, 2024

actually the file's extension on the real repo translation-meta.xml but i'm still able to reproduce it both on dev-901 and 5.42.0 check my repository

on my side it is fixed with the version in this PR... I mean the translation file is added in the package.xml and is is also copied in the output folder.

Are you sure you are using the version of the plugin from this PR ?

did you pull my last changes in my repo?
this is what i do, and the generated package.xml is like in the repo.

arielsi@Ariel:/mnt/c/Users/arielsi/IdeaProjects/SgdFlowTranslations$ sfdx plugins:install sfdx-git-delta@dev-901
 ›   Warning: sfdx-cli update available from 7.172.0 to 7.209.6.
This plugin is not digitally signed and its authenticity cannot be verified. Continue installation y/n?: y
Finished digital signature check.
warning "sfdx-git-delta > @salesforce/command > @oclif/test > @oclif/core > [email protected]" has unmet peer dependency "@types/node@*".
warning "sfdx-git-delta > @salesforce/command > @oclif/test > @oclif/core > [email protected]" has unmet peer dependency "typescript@>=2.7".
Installing plugin sfdx-git-delta... installed v5.42.0-dev-901.10410862637-1
arielsi@Ariel:/mnt/c/Users/arielsi/IdeaProjects/SgdFlowTranslations$ sfdx plugins
 ›   Warning: sfdx-cli update available from 7.172.0 to 7.209.6.
sfdx-git-delta 5.42.0-dev-901.10410862637-1 (dev-901)
arielsi@Ariel:/mnt/c/Users/arielsi/IdeaProjects/SgdFlowTranslations$ sfdx sgd:source:delta --to master --from changeFlow --repo . --output .
 ›   Warning: sfdx-cli update available from 7.172.0 to 7.209.6.
(node:670) Warning: Deprecated environment variable: SFDX_AUTOUPDATE_DISABLE. Please use SF_AUTOUPDATE_DISABLE instead.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:670) Warning: Deprecated environment variable: SFDX_DISABLE_AUTOUPDATE. Please use SF_DISABLE_AUTOUPDATE instead.
(node:670) Warning: Deprecated config name: apiVersion. Please use org-api-version instead.
{
  "error": null,
  "output": ".",
  "success": true,
  "warnings": []
}

@scolladon
Copy link
Owner Author

scolladon commented Aug 21, 2024

did you pull my last changes in my repo? this is what i do, and the generated package.xml is like in the repo.

Yep @ArielS1, I created a new repository and tried with the version of this PR.
The issue you have that I don't is for you the output folder is the current folder.
The plugin check for the translations file that are not in the output folder because when using -d file are copied and it should not evaluate the file generated by the plugin. In your scenario the output folder is the repository folder so translation files are ignored.
You should use a dedicated folder for the output of the plugin and avoid using the same folder as the repository because using -d would override in file metadata (like workflow, custom labels, etc).

You can workaround this issue by creating a folder output and pass this folder to the parameter --output :

mkdir output
sfdx sgd:source:delta --to master --from changeFlow --repo . -o output

I'll ship a fix in this PR to ignore the "output folder filter" when --output is equal to --repo

I'll let you know when it is done so you can validate it on your side as well :)

@scolladon scolladon marked this pull request as draft August 21, 2024 19:32
@scolladon scolladon force-pushed the fix/translation-post-processing branch from 3954b51 to e0c8bdf Compare August 22, 2024 16:46
@scolladon scolladon force-pushed the fix/translation-post-processing branch from e0c8bdf to 7b95a29 Compare August 22, 2024 16:47
Copy link

codeclimate bot commented Aug 22, 2024

Code Climate has analyzed commit 7b95a29 and detected 0 issues on this pull request.

View more on Code Climate.

@scolladon scolladon marked this pull request as ready for review August 22, 2024 16:48
@scolladon
Copy link
Owner Author

I fixed the issue when output is equal to the repo, could you QA one more time and let me know your finding please @ArielS1 ?

@scolladon
Copy link
Owner Author

I fixed the issue when output is equal to the repo, could you QA one more time and let me know your finding please @ArielS1 ?

Hi @ArielS1 😁 do you think you could have a final round of UAT (hopefully) please ?

@ArielS1
Copy link

ArielS1 commented Aug 26, 2024

I fixed the issue when output is equal to the repo, could you QA one more time and let me know your finding please @ArielS1 ?

Hi @ArielS1 😁 do you think you could have a final round of UAT (hopefully) please ?

Hi,

I checked and it works both on my local env and on the real build env.

Thanks

@scolladon scolladon changed the title fix: suffix based translation file detection fix: suffix based translation file detection and output subDir Aug 26, 2024
@scolladon scolladon merged commit 4723352 into main Aug 26, 2024
18 of 22 checks passed
@scolladon scolladon deleted the fix/translation-post-processing branch August 26, 2024 10:32
Copy link

Shipped in release v5.42.1.
You can install the new version using the version number or the latest-rc channel

$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install [email protected]

Happy incremental deployment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants