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

update git.listfiles to list files in .insomnia directory #5683

Merged
merged 4 commits into from
Jan 24, 2023

Conversation

PatrickMurrell
Copy link
Contributor

@PatrickMurrell PatrickMurrell commented Jan 16, 2023

changelog(Fixes): Fixed an issue where insomnia would take longer to calculate file changes on Git Sync depending on the size of the Git repository

I noticed in my own working with Insomnia git sync that the git.listfiles method seems to pull all the files in the entire git repository. and runs them through a for loop in the getGitChanges function. This makes the repository I am trying to use insomnia with take 3 minutes to calculate what files were changed and can be committed. Limiting the git.listfiles to the .insomnia directory seems to speed up the load time of this part of the program dramatically. This should address the following open issues #5551 #3269

Closes #5551
Closes #3269

@filfreire filfreire requested a review from a team January 16, 2023 17:07
Copy link
Member

@filfreire filfreire left a comment

Choose a reason for hiding this comment

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

@PatrickMurrell thanks for contributing this.

This change seems to cause a side-effect - where some changes, like deleting a unit test, are not reflected when preparing a commit:

Example in develop:
Screenshot 2023-01-16 at 17 53 39

Example in this branch:
Screenshot 2023-01-16 at 17 53 01

@PatrickMurrell
Copy link
Contributor Author

@filfreire So looking at the source code of isomorphic git that function doesn't actually do the filtering of the git repository for you. It just results in the git repo returning nothing. I added a new commit that will filter the results manually and it seems to account for the scenario you brought up when deleting requests

@filfreire filfreire force-pushed the fix/optimize-getGitChanges branch from 2491111 to 7ae1160 Compare January 17, 2023 14:18
Copy link
Member

@filfreire filfreire left a comment

Choose a reason for hiding this comment

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

@PatrickMurrell your last change seems to do the trick, LGTM

@filfreire filfreire requested a review from a team January 17, 2023 14:27
@filfreire filfreire force-pushed the fix/optimize-getGitChanges branch 2 times, most recently from 637673a to 3ffd944 Compare January 18, 2023 15:28
Copy link
Contributor

@gatzjames gatzjames left a comment

Choose a reason for hiding this comment

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

Left a cleanup suggestion to make it easier to reason on the types of files returned.
Note: This will come back when we revisit the git sync filesystem

@filfreire filfreire force-pushed the fix/optimize-getGitChanges branch 4 times, most recently from e81bb6d to 7557e5f Compare January 20, 2023 15:44
@filfreire filfreire force-pushed the fix/optimize-getGitChanges branch from 7557e5f to 26f3c25 Compare January 20, 2023 17:32
@filfreire filfreire merged commit 18defb5 into Kong:develop Jan 24, 2023
@filfreire
Copy link
Member

@PatrickMurrell if you haven't already, you can claim a free tshirt for this PR contribution - find more at https://konghq.com/community/open-source-contribution

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