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

Automatically sync all file events with the server that happen inside a client-side workspace folder #1454

Open
TwaHendrik opened this issue Oct 29, 2024 · 9 comments
Labels

Comments

@TwaHendrik
Copy link

We have noticed that a switch between two branches leads to a code change in the workspace. However, the change is not automatically forwarded to the IRIS instance. This leads to an inconsistent state. It would be great if the workspace was the only place of truth. This would enable code reviews and later deployment via CI/CD.

@isc-bsaviano
Copy link
Contributor

Thanks for opening this issue @TwaHendrik! I believe this issue a duplicate of #1451 (see #1451 (comment)).

@isc-bsaviano
Copy link
Contributor

@TwaHendrik After thinking about this more, I'm a little concerned that implementing this could have some unintended consequences. The VS Code API for watching the file system does not batch events, so if you have a lot of classes and routines in your git repo the server will be hammered with a lot of requests. VS Code will also only be able to sync changes that happen when it's open, so if you change branches and then open VS Code the changes wouldn't be synced automatically. I still am generally in favor of this idea, but I'd like to think about it more before adding it to that existing PR.

cc @gjsjohnmurray @isc-rsingh

@isc-rsingh
Copy link
Member

I don't think there's a good answer here. Sounds like the only way this works elegantly is if you change branches from within VS Code. Is it true that changing branches via a CLI wouldn't work whether or not VS Code is open? And even if you change branches in VS Code you trigger all those requests to the server. I fear this feature could be impossible to get right.

@isc-bsaviano
Copy link
Contributor

@isc-rsingh If VS Code has the folder open I can respond to file system events, even if they originate from the git CLI and not the VS Code UI. I need to do more research on what git does when you switch branches. For example, if there are 1000 files and only 1 changes content when you switch branches, does 1 file system event get fired, or 1000? If the former then this could work fine. If the latter, not so much.

@isc-bsaviano
Copy link
Contributor

This wouldn't be git specific by the way. Changes that happen to the files on disk triggered by any application would be picked up by VS Code.

@isc-rsingh
Copy link
Member

if there are 1000 files and only 1 changes content when you switch branches, does 1 file system event get fired, or 1000?

Exactly what I was wondering

@isc-bsaviano
Copy link
Contributor

@isc-rsingh I did a quick test and git only changes the files that it has to. In the example above, only one change event would fire, not 1000. I can't guarantee that other SCM tools/tools in general behave this way, but this increases my confidence that this feature is worth implementing.

@isc-rsingh
Copy link
Member

isc-rsingh commented Oct 31, 2024 via email

@isc-bsaviano
Copy link
Contributor

I'm going to tackle this as part of #1401

@isc-bsaviano isc-bsaviano changed the title Support for Git Feature Branching Automatically sync all file events with the server that happen inside a client-side workspace folder Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants