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

[SCM-1022] - jgit push failure is not failing the build #203

Closed
wants to merge 1 commit into from

Conversation

attiand
Copy link

@attiand attiand commented Apr 4, 2024

No description provided.

@michael-o
Copy link
Member

Looking into...

@michael-o michael-o requested review from michael-o and kwin April 4, 2024 12:33

import static org.junit.Assert.assertFalse;

public class JGitCheckinCommandTest extends ScmTestCase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer having this test as part of the Git TCK so that it is executed against both Git CLI and JGit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. It turns out that the RemoteRefUpdate.Status#UP_TO_DATE equivalent for gitexe is considered ok as the git push command returns zero. Which seems questionable for maven-release. Nothing would be changed in the upstream.

Which is better: To have equal behavior for both implementations, or a successful, possibly empty release?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a push which doesn't add any commits should never be an error (neither in JGit nor in GitExe). If there is an up2date check being necessary in maven-release-plugin that needs to be triggered separately. I would therefore appreciate to add the test to the TCK but assert that it is returning a success status.

@attiand attiand requested a review from michael-o April 8, 2024 06:04
@attiand
Copy link
Author

attiand commented Apr 8, 2024

Moved RejectedNonFastForward Test to TCK. Removed UpToDate test since gitexec and jgit return different status, see #203 (comment)

Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this PR.

@michael-o michael-o requested a review from kwin April 8, 2024 08:02
@michael-o
Copy link
Member

@kwin Any objections?

michael-o pushed a commit to attiand/maven-scm that referenced this pull request Apr 8, 2024
@michael-o michael-o force-pushed the jgit-push-failure branch from 013825e to 2f6591c Compare April 8, 2024 08:08
@attiand
Copy link
Author

attiand commented Apr 8, 2024

Status.UP_TO_DATE is now successful. Added TCK testUpToDatePush.

@michael-o
Copy link
Member

Let me run this again

@michael-o michael-o force-pushed the jgit-push-failure branch from dca79a8 to 6575148 Compare April 8, 2024 10:46
@michael-o michael-o closed this in d77b92e Apr 8, 2024
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

Successfully merging this pull request may close these issues.

3 participants