-
-
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
replace all git.Command.RunInPipeline... with RunWithContext #18553
Comments
If all has been replaced, then we can rename |
Can I take this up? I searched with a regex |
@martinscholz83 yes would be awesome 👍 |
PS: if you look closely all the RunInPipeline... func do already use RunWithContext ... so the code cleanup should be easy todo - if you have issues just tell us here :) |
Change all `cmd...Pipeline` commands to `cmd.RunWithContext`. #18553 Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
I changed all the calls to |
@martinscholz83 yes sure go on :) as always if you need help we are a |
Change all `cmd...Pipeline` commands to `cmd.RunWithContext`. go-gitea#18553 Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
…nWithContextBytes` (#19266) This follows * #18553 Introduce `RunWithContextString` and `RunWithContextBytes` to help the refactoring. Add related unit tests. They keep the same behavior to save stderr into err.Error() as `RunInXxx` before. Remove `RunInDirTimeoutPipeline` `RunInDirTimeoutFullPipeline` `RunInDirTimeout` `RunInDirTimeoutEnv` `RunInDirPipeline` `RunInDirFullPipeline` `RunTimeout`, `RunInDirTimeoutEnvPipeline`, `RunInDirTimeoutEnvFullPipeline`, `RunInDirTimeoutEnvFullPipelineFunc`. Then remaining `RunInDir` `RunInDirBytes` `RunInDirWithEnv` can be easily refactored in next PR with a simple search & replace: * before: `stdout, err := RunInDir(path)` * next: `stdout, _, err := RunWithContextString(&git.RunContext{Dir:path})` Other changes: 1. When `timeout <= 0`, use default. Because `timeout==0` is meaningless and could cause bugs. And now many functions becomes more simple, eg: `GitGcRepos` 9 lines to 1 line. `Fsck` 6 lines to 1 line. 2. Only set defaultCommandExecutionTimeout when the option `setting.Git.Timeout.Default > 0`
Follows go-gitea#19266, go-gitea#8553, Close go-gitea#18553, now there are only three `Run..(&RunOpts{})` functions. * before: `stdout, err := RunInDir(path)` * now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`
cmd.RunInDirTimeoutPipeline,
cmd.RunInDirTimeoutEnvFullPipeline,
cmd.RunInDirFullPipeline,
...
The text was updated successfully, but these errors were encountered: