Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

NuKeeper reports success even if Git operation fails #930

Open
1 of 7 tasks
ianjirka opened this issue Mar 1, 2020 · 14 comments
Open
1 of 7 tasks

NuKeeper reports success even if Git operation fails #930

ianjirka opened this issue Mar 1, 2020 · 14 comments
Labels

Comments

@ianjirka
Copy link

ianjirka commented Mar 1, 2020

🐛 Bug Report

If NuKeeper cannot perform a git operation and fails, it still reports success via errorlevel = 0. This will impact any automation system that leverages NuKeeper (in my case, Azure DevOps)

Expected behavior

If NuKeeper fails it reports as a failure so automation (such as DevOps) can correctly notify that a failure occurred.

Reproduction steps

Configure project with NuKeeper in any environment that doesn't provide it access to push. Simply denying branch creation rights should be sufficient, or putting into an ADO pipeline without token access.

Updates failed LibGit2SharpException : request failed with status code: 403
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_remote_push(RemoteHandle remote, IEnumerable1 refSpecs, GitPushOptions opts) at LibGit2Sharp.Network.Push(Remote remote, IEnumerable1 pushRefSpecs, PushOptions pushOptions)
at LibGit2Sharp.Network.Push(IEnumerable1 branches, PushOptions pushOptions) at NuKeeper.Git.LibGit2SharpDriver.<>c__DisplayClass17_0.<Push>b__0() in d:\a\r1\a\drop\NuKeeper.Git\LibGit2SharpDriver.cs:line 189 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at NuKeeper.Engine.Packages.PackageUpdater.MakeUpdatePullRequests(IGitDriver git, RepositoryData repository, NuGetSources sources, SettingsContainer settings, IReadOnlyCollection1 updates) in d:\a\r1\a\drop\NuKeeper\Engine\Packages\PackageUpdater.cs:line 85
at NuKeeper.Engine.Packages.PackageUpdater.MakeUpdatePullRequests(IGitDriver git, RepositoryData repository, IReadOnlyCollection`1 updates, NuGetSources sources, SettingsContainer settings) in d:\a\r1\a\drop\NuKeeper\Engine\Packages\PackageUpdater.cs:line 46

Configuration

nukeeper 0.26.0 x64

Platform if applicable:

  • 🛠️ NuKeeper CLI
  • ✨ GitHub
  • 🤖 AzureDevops
  • 🏁 Bitbucket
  • 🌎 Gitlab
  • 📺 Gitea
  • 🐳 Docker
@stale
Copy link

stale bot commented May 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 30, 2020
@AnthonySteele
Copy link
Member

Should still look into this?

@stale stale bot removed the wontfix label Jun 1, 2020
@scp-mb
Copy link

scp-mb commented Jun 11, 2020

It will also report success if NuGet.exe throws an exit code other than 0 which is not desirable behaviour as running nukeeper on a CI agent will report a success, even though packages have not been updated properly because of an error.

Definitely should report a proper exit code if any part of the process fails. @AnthonySteele

@stale
Copy link

stale bot commented Sep 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 9, 2020
@scp-mb
Copy link

scp-mb commented Sep 14, 2020

Has any changes been made for this so far? If not it's still relevant.

@stale stale bot removed the wontfix label Sep 14, 2020
@wojciechrak
Copy link

I am experiencing the same behavior when package cannot be updated for some reason
Example

Updating 'Microsoft.Extensions.Configuration.Abstractions' to 3.1.8 in 8 projects
...
/tmp/NuKeeper/repo-c59bd8d6b834403694776ed8bef12eac/source/MySampleProject/MySampleProject.csproj : error NU1605: Detected package downgrade: Microsoft.Extensions.Configuration.Abstractions from 3.1.8 to 3.1.6. Reference the package directly from the project to select a different version. 
...
Command dotnet failed with exit code: 1

But nukeeper exits with code 0:

$ echo $?
0

This is really important in CI scenarios, where exit code indicates whether process succeeded or failed.

@stale
Copy link

stale bot commented Jan 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 6, 2021
@scp-mb
Copy link

scp-mb commented Jan 7, 2021

Still relevant AFAIK

@stale stale bot removed the wontfix label Jan 7, 2021
@MartinDemberger
Copy link
Contributor

Still very relevant. Last week this hides several errors which I recognized yesterday.

@stale
Copy link

stale bot commented Jun 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 22, 2021
@ghost
Copy link

ghost commented Jul 8, 2021

In my CI, I run NuKeeper from a PowerShell task and parse the results. If no packages were updated, I throw an error. Maybe this can help you. Now I need to find out why NuKeeper doesn't always find the newest package from my feed even though it is in there.

- powershell: |
    git config --global user.name "Matt Edwards"
    git config --global user.email "[email protected]"
    $test = nukeeper update $(build.sourcesDirectory) --age 0 -v d
    $match = $test -Match "Found no package updates"
    echo $test
    if ( $match ) { Write-Error "Error - Found no package updates" } else { Write-Output "Success - Updated project packages" }
  failOnStderr: true
  displayName: 'NuKeeper'

@stale stale bot removed the wontfix label Jul 8, 2021
@ceejeeb
Copy link

ceejeeb commented Aug 16, 2021

This is also an issue for me.

@stale
Copy link

stale bot commented Dec 15, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 15, 2021
@scp-mb
Copy link

scp-mb commented Dec 15, 2021

Still relevant

@stale stale bot removed the wontfix label Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants