-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(GGs): introduce GitFileSystemService as middleman interface #867
feat(GGs): introduce GitFileSystemService as middleman interface #867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarifications:
is this already funcitonal in local dev? is there a quick sanity check that I can do here to assert this?
[Style, Error Handling]: Lets not return an unknown
, it would resolve to the top level, and it might not yield the usefulness of the types!
} | ||
|
||
// Pull the latest changes from upstream Git hosting provider | ||
// TODO: Pulling is a very expensive operation, should find a way to optimise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting note, out of curiosity why is this the case ah? I thought after the first git clone, the git pull should be ok no?
How expensive is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expensive in terms of latency? Latency of network call or disk write? Curious - did you manage to benchmark this on ur local?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't manage to dive into the exact cause of the latency issues, but just a quick benchmarking on my local machine, the Git pull operation adds almost 2 seconds in latency for each request (281 ms without, 2.91 seconds with pulling)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, let's focus on latency once MVP is out as our baseline metric is the reduction of API calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought git checkout might help and I ran a simple benchmark, weirdly checkout is slower than pull?
❯ node benchmark.js
Time taken for git checkout: 3386.3763749599457 ms
Time taken for git pull: 3241.95516705513 ms
❯ node benchmark.js
Time taken for git checkout: 3356.351875066757 ms
Time taken for git pull: 3228.0880839824677 ms
❯ node benchmark.js
Time taken for git checkout: 3306.690124988556 ms
Time taken for git pull: 3079.9089580774307 ms
❯ node benchmark.js
Time taken for git pull: 2990.787334084511 ms
Time taken for git checkout: 3404.82679104805 ms
) | ||
} | ||
|
||
return okAsync(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why return okAsync(null)
over the path to the repo? (okAsync(path_to_repo)
)
) | ||
} | ||
|
||
return okAsync(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, why not do a git fetch
here? the repo is correct already but not guaranteed to be updated
) | ||
} | ||
|
||
return okAsync(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the git fetch help? In any read operation we are already performing a git pull first
} | ||
|
||
// Pull the latest changes from upstream Git hosting provider | ||
// TODO: Pulling is a very expensive operation, should find a way to optimise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expensive in terms of latency? Latency of network call or disk write? Curious - did you manage to benchmark this on ur local?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on your first PR after coming back 👏 👏
Appreciate your detailed explanation, lgtm with nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, some conflicts pending
Problem
Closes IS-320.
Solution
Breaking Changes
Features:
This PR is the first of a 2-part PR. The eventual architecture should look something like this:
Tests
Deploy Notes
New environment variables:
EFS_VOL_PATH
: The path to the EFS volume used for storing the Git repositoriesNew dependencies:
simple-git
: Wrapper for running Git-related operations on the underlying file systemNew dev dependencies:
mock-fs
: Provides a mock filesystem when performing unit tests