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

(Add option to) Fail if git --reset fails #331

Open
DanielFEvans opened this issue Aug 13, 2019 · 1 comment
Open

(Add option to) Fail if git --reset fails #331

DanielFEvans opened this issue Aug 13, 2019 · 1 comment

Comments

@DanielFEvans
Copy link

DanielFEvans commented Aug 13, 2019

On our Jenkins server, we occasionally encounter problems when the plugin's call to git reset --hard <commit id> fails because the base commit is unavailable (usually indicating user error, i.e. that they have a modified base branch with commits that don't exist remotely). The plugin is aware that the command has failed, emitting a log warning stating Got non-zero exit code resetting to base commit <commit id>: 128, but does not exit and fail the build.

The issue we encounter is that the plugin then continues and runs arc patch, which hangs while trying to find the missing commit. Our Jenkins server then kills off the build when the timeout kicks in, and on Windows we find that this routinely leaves files locked open and/or a rogue git process started by arc patch still running in the background, requiring manual intervention.

Additionally, it's also a little unclear to developers why the build failed. This is because the log report relating to git reset --hard failing is about halfway down the log output, and doesn't stand out compared to the normal log output.

We would prefer it if the Plugin exited immediately on git reset --hard failing, making it clear that this is the cause of the problem, and preventing arc patch hanging while trying to find a nonexistent commit. However, I'm not sure if it's possible for git reset --hard to fail, but for the build to continue successfully, which would make the implementation of this request a bit more difficult.

@artms
Copy link
Contributor

artms commented Jan 25, 2021

In our particular use case - we depend on git reset --hard not failing hard because we patched and made arc patch quite clever to find missing commit.

We can accept PR request where you make git reset --hard a hard failure for as an option for test job.

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

No branches or pull requests

2 participants