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: git compatibility issue with large repository on windows #947

Merged
merged 17 commits into from
Nov 12, 2024

Conversation

scolladon
Copy link
Owner

Explain your changes


Implements Git Adapter using only simpleGit
Remove implementation using isomorphic-git and simplify treatment

Implementation is now a little bit simpler
But it is also slower and more dependant of git behavior in the terminal

Does this close any currently open issues?


closes #862

  • Jest tests added to cover the fix.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d241475) to head (1d5e6f4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #947   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           40        40           
  Lines         1083      1029   -54     
  Branches       115       103   -12     
=========================================
- Hits          1083      1029   -54     

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

@scolladon
Copy link
Owner Author

scolladon commented Nov 7, 2024

Hi @kez-sophos @ALesc21 @dsweetmanusda !

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

@scolladon scolladon force-pushed the fix/windows-git-portability branch 2 times, most recently from c87f656 to 49cecaf Compare November 7, 2024 22:31
src/adapter/GitAdapter.ts Outdated Show resolved Hide resolved
@scolladon
Copy link
Owner Author

scolladon commented Nov 9, 2024

Performance test

Current Pull request (simplegit git adapter)

e2e-test x 0.80 ops/sec ±7.74% (6 runs sampled)
e2e-test x 0.80 ops/sec ±6.30% (6 runs sampled)
e2e-test x 0.76 ops/sec ±4.39% (6 runs sampled)
e2e-test x 0.77 ops/sec ±4.35% (6 runs sampled)
e2e-test x 0.79 ops/sec ±2.67% (6 runs sampled)
standard deviation 1.62481

Current main v5.49.2 (isomorphic-git git adapter)

e2e-test x 0.73 ops/sec ±16.35% (6 runs sampled)
e2e-test x 0.79 ops/sec ±13.19% (7 runs sampled)
e2e-test x 0.88 ops/sec ±2.68% (7 runs sampled)
e2e-test x 0.90 ops/sec ±1.62% (7 runs sampled)
e2e-test x 0.87 ops/sec ±3.07% (7 runs sampled)
standard deviation 6.40625

Synthesis

Fastest comparison: simplegit is slower by 11.1%
Slowest comparison: simplegit is faster by 4%
Mean comparison: simplegit is slower by 8%
simplegit implementation is more stable in term of duration of execution

On very large repository I noticed ~30% improvements in favor of simplegit implementation

@ALesc21
Copy link
Contributor

ALesc21 commented Nov 11, 2024

HI @scolladon, should I install the new version with the command below and provide the output?

sfdx plugins:install sfdx-git-delta@dev-947

@scolladon
Copy link
Owner Author

HI @scolladon, should I install the new version with the command below and provide the output?

sfdx plugins:install sfdx-git-delta@dev-947

Yes @ALesc21 !
This way you'll be able to test the version of this PR.
And then you can come back to the previous one by executing:

sfdx plugins:install sfdx-git-delta@latest

.map(line => treatPathSep(line))
}

public async getFilesPath(path: string): Promise<string[]> {
Copy link

Choose a reason for hiding this comment

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

Function getFilesPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

@ALesc21
Copy link
Contributor

ALesc21 commented Nov 11, 2024

hi @scolladon,

after the installation of the new version I run the delta command and could build successfully a package with the latest api version.
So for us the fix is working on the server now. Great job ;)

$ sf sgd:source:delta --to HEAD --from HEAD^ --output deployment/ONECRM-0002
 »   Warning: @salesforce/cli update available from 2.62.6 to 2.64.8.
(node:12296) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instea
d.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:12296) Warning: Deprecated config name: apiVersion. Please use org-api-version instead.
{
  "error": null,
  "output": "deployment/ONECRM-0002",
  "success": true,
  "warnings": [
    "[INFORMATION] sfdx-git-delta v6 is coming soon! Read more and plan your migration: https://github.com/scolladon/sfd
x-git-delta/issues/936"
  ]
}

Copy link

codeclimate bot commented Nov 11, 2024

Code Climate has analyzed commit 1d5e6f4 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

@scolladon
Copy link
Owner Author

Thank you very much for your contribution @ALesc21
I just wrote an optimised version, could you repeat the test from the start and tell me the result on your side please ? (reinstall the save dev package and rerun your command please)

Feel free to contribute as well @kez-sophos & @dsweetmanusda ! Your feedback will be really valuable and I hope it will fix your situation as well.

@ALesc21
Copy link
Contributor

ALesc21 commented Nov 11, 2024

hi @scolladon, I reinstalled the version and tested it again. It is still working with your fix for me on the windows server. Below you can find the steps (install dev version, check plugin, generate the package)

DEBIE1TC_SFDX@MSE-SVCRM01 MINGW64 /c/BuildAgent01/work/86775e496ec9c505 (feature/ONECRM-8856|SPARSE)
$ sfdx plugins:install sfdx-git-delta@dev-947
 »   Warning: @salesforce/cli update available from 2.62.6 to 2.64.8.
(node:11880) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instea
d.
(Use `node --trace-deprecation ...` to show where the warning was created)
? sfdx-git-delta isn't signed by Salesforce. Only install the plugin if you trust its creator. Do you want to continue
the installation? yes
Because you approved this plugin, you can avoid future installation confirmations by adding the plugin to the unsignedPl
uginAllowList.json file. For details, see https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/s
fdx_setup_allowlist.htm.
Finished digital signature check.
removed 11 packages, and changed 1 package in 2s
@salesforce/cli: Installing plugin sfdx-git-delta@dev-947... installed v5.49.2

DEBIE1TC_SFDX@MSE-SVCRM01 MINGW64 /c/BuildAgent01/work/86775e496ec9c505 (feature/ONECRM-8856|SPARSE)
$ sf plugins --core
 »   Warning: @salesforce/cli update available from 2.62.6 to 2.64.8.
(node:6060) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead
.
(Use `node --trace-deprecation ...` to show where the warning was created)
@oclif/plugin-autocomplete 3.2.5 (core)
@oclif/plugin-commands 4.1.3 (core)
@oclif/plugin-help 6.2.14 (core)
@oclif/plugin-not-found 3.2.22 (core)
@oclif/plugin-plugins 5.4.14 (core)
@oclif/plugin-search 1.2.11 (core)
@oclif/plugin-update 4.6.3 (core)
@oclif/plugin-version 2.2.14 (core)
@oclif/plugin-warn-if-update-available 3.1.18 (core)
@oclif/plugin-which 3.2.15 (core)
apex 3.5.1 (core)
api 1.3.1 (core)
auth 3.6.65 (core)
community 3.0.14 (3.0.14)
data 3.7.0 (core)
deploy-retrieve 3.12.17 (core)
info 3.4.9 (core)
limits 3.3.32 (core)
marketplace 1.2.26 (core)
org 4.6.0 (core)
packaging 2.8.11 (core)
schema 3.3.34 (core)
settings 2.3.23 (core)
sfdx-git-delta 5.49.2-dev-947.11779231727-1 (dev-947)
sobject 1.4.41 (core)
source 3.5.21 (core)
telemetry 3.6.15 (core)
templates 56.3.22 (core)
trust 3.7.33 (core)
user 3.5.32 (core)

Uninstalled JIT Plugins:
custom-metadata 3.3.33
dev 2.4.2
devops-center 1.2.24
env 3.0.33
functions 1.23.0
signups 2.5.21
@salesforce/sfdx-plugin-lwc-test 1.2.1
@salesforce/sfdx-scanner 4.6.0

DEBIE1TC_SFDX@MSE-SVCRM01 MINGW64 /c/BuildAgent01/work/86775e496ec9c505 (feature/ONECRM-8856|SPARSE)
$ sf sgd:source:delta --to HEAD --from HEAD^ --output deployment/ONECRM-0002
 »   Warning: @salesforce/cli update available from 2.62.6 to 2.64.8.
(node:6920) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead
.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:6920) Warning: Deprecated config name: apiVersion. Please use org-api-version instead.
{
  "error": null,
  "output": "deployment/ONECRM-0002",
  "success": true,
  "warnings": [
    "[INFORMATION] sfdx-git-delta v6 is coming soon! Read more and plan your migration: https://github.com/scolladon/sfd
x-git-delta/issues/936"
  ]
}

@scolladon scolladon merged commit 4728132 into main Nov 12, 2024
20 of 22 checks passed
@scolladon scolladon deleted the fix/windows-git-portability branch November 12, 2024 11:05
Copy link

Shipped in release v5.49.3.
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!

@ALesc21
Copy link
Contributor

ALesc21 commented Nov 13, 2024

the version 5.49.3 is already installed and running smoothly on the server.
I really appreciate your help and hard work ;)

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.

Getting Could not find error when generating delta source
3 participants