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

RemoteRefUpdate Status is not populated to exception logger #684

Closed
VicenteJankowski opened this issue Nov 29, 2023 · 2 comments
Closed

Comments

@VicenteJankowski
Copy link
Contributor

GitRepository.class has verifyPushResults method, which looks for RemoteRefUpdate instance of package org.eclipse.jgit.transport with status different than OK. As a result of verifyPushResults there is created new ScmPushResult instance in which there is only populated value of message of the RemoteRefUpdate, but not status. As documentation of RemoteRefUpdate states, message is present only if it is "needed/possible".

As consequence, there are cases in which push results in self-explaining failure status with no message - this happens for example for REJECTED_NONFASTFORWARD status.

Because of the above, if push will be rejected with status, which does not include message, we then get gradle task failure with exception ReleaseFailedException with no error message:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':release'.
> pl.allegro.tech.build.axion.release.ReleaseFailedException (no error message)

This is hard to quickly understand the reason of the problem and to debug.

Improvement suggestion:
The code should populate RemoteRefUpdate.Status to ScmPushResult.class and then status should be included in exception logger. Example of possible stdout:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':release'.
>  pl.allegro.tech.build.axion.release.ReleaseFailedException 
  Status: REJECTED_NONFASTFORWARD
  Message: (empty)
@bgalek
Copy link
Member

bgalek commented Nov 29, 2023

hi, nice idea! would you like to make a PR?:)

@VicenteJankowski
Copy link
Contributor Author

Of course, already in progress :)

VicenteJankowski pushed a commit to VicenteJankowski/axion-release-plugin that referenced this issue Nov 30, 2023
…, to ScmPushResult and including this status in logger.error (allegro#684)
VicenteJankowski pushed a commit to VicenteJankowski/axion-release-plugin that referenced this issue Nov 30, 2023
…, to ScmPushResult and including this status in logger.error (allegro#684)
VicenteJankowski pushed a commit to VicenteJankowski/axion-release-plugin that referenced this issue Nov 30, 2023
…, to ScmPushResult and including this status in logger.error (allegro#684)
VicenteJankowski pushed a commit to VicenteJankowski/axion-release-plugin that referenced this issue Nov 30, 2023
…, to ScmPushResult and including this status in logger.error (allegro#684)
bgalek pushed a commit that referenced this issue Nov 30, 2023
…, to ScmPushResult and including this status in logger.error (#684) (#685)

Co-authored-by: Michał Jankowski <michal.jankowski@payback.net>
@bgalek bgalek closed this as completed Dec 7, 2023
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