-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Change git.cmd to RunWithContext #18693
Conversation
Can you also delete tje ...pipeline... functions? |
You mean the |
Maybe you need add |
👍 Wasn't sure about the |
Codecov Report
@@ Coverage Diff @@
## main #18693 +/- ##
=======================================
Coverage ? 46.47%
=======================================
Files ? 851
Lines ? 122000
Branches ? 0
=======================================
Hits ? 56700
Misses ? 58417
Partials ? 6883
Continue to review full report at Codecov.
|
Timeout is less of a problem now that the process go context is passed down to the git command. TBH we should probably be moving the go context into the RunContext e.g. // RunContext represents parameters to run the command
type RunContext struct {
context.Context
Env []string
Timeout time.Duration
Dir string
Stdout, Stderr io.Writer
Stdin io.Reader
PipelineFunc func(context.Context, context.CancelFunc) error
} and dropping the parent context stuff from the Command. |
Yes |
I think i missed some places like this |
How about to delete the method |
While deleting the |
yes there are different RunInXY ... func that all can be replaced |
Right! There are also another x methods need to be replaced. That's why I just introduced the |
I also have a related PR #18147 to do related things. |
The thing is, if your looking at command.go. All these overloads ending up in |
☝️ that's what has to be done :)
as mentioned it's not hard to do or understand, just a huge refactor in terms of touched lines of code |
I think i understood this wrong 😄. Thought you will do this. So i will replace everything and the clean up |
☝️ that would be awesome |
I think we can refactor them step by step. This PR is enough. Let's merge it at first. |
@martinscholz83 thanks for the work, i only found one thing ☝️ and after it its good to go :) |
thanks |
hope you enjoined contributing 👍 |
🎉 Definitely! Thx for your help! To replace the rest of the
These I got easily replaced with a regex script to
and then maybe check if
has to become this for example
Is this what you have in mind? |
☝️ yes 👍 |
* giteaofficial/main: Send mail to issue/pr assignee/reviewer also when OnMention is set (go-gitea#18707) Reduce CI go module downloads, add make targets (go-gitea#18708) Add number in queue status to monitor page (go-gitea#18712) Fix source code line highlighting (go-gitea#18729) Fix forked repositories missed tags (go-gitea#18719) [skip ci] Updated translations via Crowdin Fix release typo (go-gitea#18728) Display template path of current page in dev mode (go-gitea#18717) Separate the details links of commit-statuses in headers (go-gitea#18661) Add LDAP group sync to Teams, fixes go-gitea#1395 (go-gitea#16299) Change git.cmd to RunWithContext (go-gitea#18693)
Change all `cmd...Pipeline` commands to `cmd.RunWithContext`. go-gitea#18553 Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
Change all
cmd...Pipeline
commands from tocmd.RunWithContext
.#18553