-
Notifications
You must be signed in to change notification settings - Fork 551
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
Stop running hooks in commit function #5894
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
76ff920
to
4ee4df0
Compare
message.to_owned() | ||
}; | ||
|
||
if run_hooks { |
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 think you should make commit
no longer run hooks here at all. Instead, having the hooks execution in a separate command, this way the UI can execute the two commands in sequence.
As I wrote in the other message before, the benefits would be:
- better UX (we can show that hooks are being executed/spinner)
- we can easily differentiate the errors
- the test is more testable and less error prone because each command does less.
Let's discuss tomorrow.
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 love the idea to make the UI more aware of what's going on. Something I wonder though is if there is another way of doing it, one that doesn't force the UI to steer it. An idea was to stream progress information to the UI, but I don't think tauri
supports that outside of events, so for the UI it would always be a separate stream of events coming in so the action at hand and additional streaming data (like progress) will always be separate. In the backend, this could probably be some sort of trait implementation that is passed around. With such a system, progress could be implemented, too.
Both ideas, separating commits from running hooks, and passing some trait object that allows for real-time metadata to get out of backend functions while they execute, are orthogonal and maybe both will help solve this problem better than they would alone.
I haven't arrived at a clear conclusion myself, but wanted to share my thoughts while at it.
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 love the idea to make the UI more aware of what's going on. Something I wonder though is if there is another way of doing it, one that doesn't force the UI to steer it. An idea was to stream progress information to the UI, but I don't think
tauri
supports that outside of events, so for the UI it would always be a separate stream of events coming in so the action at hand and additional streaming data (like progress) will always be separate. In the backend, this could probably be some sort of trait implementation that is passed around. With such a system, progress could be implemented, too.Both ideas, separating commits from running hooks, and passing some trait object that allows for real-time metadata to get out of backend functions while they execute, are orthogonal and maybe both will help solve this problem better than they would alone.
I haven't arrived at a clear conclusion myself, but wanted to share my thoughts while at it.
Another alternative could be to compose the two commands, this way the UI doesn't have to do it. But it feels like this may not be the correct separation since we want the UI to be aware of the two steps in this process
👨🔬 Meta comment on stacking / code collab /review 🔍 Interestingly, this time stacking makes the whole thing harder to review (e.g. the changes feel very much related with new code being introduced and then moved to a different file in another part of the stack). As a reviewer, I think would have been more ergonomic to have these as commits in one branch. And then I would likely look at the final diff instead of commit by commit... |
4ee4df0
to
140e4ff
Compare
140e4ff
to
4309bd1
Compare
4309bd1
to
ee2d78b
Compare
ee2d78b
to
51cf919
Compare
51cf919
to
9b7a7b7
Compare
9b7a7b7
to
06ebdc4
Compare
06ebdc4
to
fb5fd4b
Compare
fb5fd4b
to
b9a4012
Compare
b9a4012
to
5a22bc8
Compare
- will be orchestrated by client instead
5a22bc8
to
3662989
Compare
This is part 2 of 3 in a stack made with GitButler: