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

Atomic push not working as expected #801

Open
DBarthe opened this issue Apr 15, 2024 · 0 comments
Open

Atomic push not working as expected #801

DBarthe opened this issue Apr 15, 2024 · 0 comments

Comments

@DBarthe
Copy link

DBarthe commented Apr 15, 2024

Hello & thank you for this plugin,

As of now, when the atomic git-push failed for some reason, if the error contains the word "atomic", then a fallback to non-atomic push is attempted.

See:

return exec('git', [
'push',
...gitPushOptions,
'--atomic',
remote,
branch,
tag,
])
.pipe(
catchError((error) => {
if (/atomic/.test(error)) {
_logStep({
step: 'warning',
level: 'warn',
message: 'Git push --atomic failed, attempting non-atomic push.',
projectName,
});
return exec('git', ['push', ...gitPushOptions, remote, branch, tag]);
}
return throwError(() => error);
}),
)

When pushing atomically, if the commit is rejected (let's say a PR has been merged concurrently, we got a non-fast-forward error), then the tag would be rejected as well (with a atomic push failed).

In that situation, with the current implementation, a fallback non-atomic push is attempted as a retry (because the error message DOES contain the word "atomic").

We ends up with an orphan tag being pushed, preventing further release process to be achieved with success, until we manually delete the tag.

I don't understand why the condition on fallback non-atomic attempt is implemented like that.

Thanks in advance for your help & clarification on how we should use that correctly.

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

1 participant