NuKeeperDotNet / NuKeeper-AzureDevops-extension

NuKeeper AzureDevops and VSTS extension
12 stars 15 forks source link

nukeeper task succeeds even with failure #31

Open OneCyrus opened 5 years ago

OneCyrus commented 5 years ago

the task doesn't report a failure or warning even when it failed. at least it should report this as a warning.

Found 8 package updates
Microsoft.ApplicationInsights.AspNetCore to 2.6.1 from 2.5.1 in 1 place since 3 months ago.
Microsoft.ApplicationInsights.SnapshotCollector to 1.3.4 from 1.3.3 in 1 place since 22 days ago.
Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer to 3.2.0 from 3.1.0 in 1 place since 4 months ago.
Microsoft.PowerShell.SDK to 6.2.0 from 6.1.2 in 1 place since 2 months ago.
coverlet.msbuild to 2.6.1 from 2.5.0 in 1 place since 5 days ago.
Microsoft.CodeCoverage to 16.1.0 from 15.9.0 in 1 place since 5 days ago.
Microsoft.NET.Test.Sdk to 16.1.0 from 15.9.0 in 1 place since 5 days ago.
Newtonsoft.Json.Schema to 3.0.11 from 3.0.10 in 1 place since 22 days ago.
Filtered by minimum package age '7 days ago' from 8 to 5
Selection of package updates: 8 candidates, filtered to 5, capped at 3
Selected package update of Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer to 3.2.0
Selected package update of Microsoft.ApplicationInsights.AspNetCore to 2.6.1
Selected package update of Microsoft.PowerShell.SDK to 6.2.0
Updating'Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer' from 3.1.0 to 3.2.0 in 1 projects
Updates failed NameConflictException : failed to write reference 'refs/heads/nukeeper-update-Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer-to-3.2.0': a reference with that name already exists.
Attempted 3 updates and did 0
##[section]Finishing: NuKeeper
MarcBruins commented 5 years ago

I think should be fixed within NuKeeper itself. It should return a exitcode -1 which causes a task fail

OneCyrus commented 5 years ago

this looks like an issue how nukeeper handles branches. we stil have this issue and it looks like the repro is:

  1. let nukeeper create a PR + branch for a dependency update in Azure DevOPs
  2. go into the PR and click "abandon" and "delete branch"
  3. let nukeeper try and create the same update again -> it fails with the issue above.

probably the way Azure DevOps deletes the branch is not compatible with how nukeeper checks if the branch already exists.

P.S. and yes, the issue should probably be moved to the nukeeper repo

OneCyrus commented 5 years ago

ok finally pin pointed the issue. the problem is with the local only branches which nukeeper creates. those won't be deleted and stay there forever.

running git show-ref shows somehting like this:

a2009d458f23370b2d121bdf2b92c5e58ca8e79c refs/heads/master
0e02c55d7a31bfad46d9a01e97db0d5d2e0a8098 refs/heads/nukeeper-update-CsvHelper-to-12.1.2
2743e0e5aee1c6a50985cb07c971cfbf9f97ad15 refs/heads/nukeeper-update-Microsoft.ApplicationInsights.AspNetCore-to-2.6.1
16e7ba49fa0d684b500402400ce0233033d0d9db refs/heads/nukeeper-update-Microsoft.NET.Test.Sdk-to-16.0.1
5e9de71f4d6f224dce0889e52fb17b13666a7000 refs/heads/nukeeper-update-Microsoft.NET.Test.Sdk-to-16.1.0
224742cb988de111ab796476e05406b33927fd74 refs/heads/nukeeper-update-Microsoft.NET.Test.Sdk-to-16.1.1
3d6e68e92838758c1435015546baf5bae924729f refs/heads/nukeeper-update-MySql.Data-to-8.0.15
0cbcc5e112977b56f649d15e2639df91c4ea9956 refs/heads/nukeeper-update-Serilog.Extensions.Logging.File-to-2.0.0-dev-00032
d821a8f7b94ae32341c8dd97f2928b8ded2052e1 refs/heads/nukeeper-update-SonarAnalyzer.CSharp-to-7.14.0.8411
bee7db4746ebd3f2d410bf5148f969883ecadfa4 refs/heads/nukeeper-update-coverlet.msbuild-to-2.6.1
2ffc11dca76b09d6c4b6bed5bde1ef0c08afd8a2 refs/heads/nukeeper-update-coverlet.msbuild-to-2.6.2
d34e3b83ad260a7a9598757574791421b9afc320 refs/remotes/origin/master
224742cb988de111ab796476e05406b33927fd74 refs/remotes/origin/nukeeper-update-Microsoft.NET.Test.Sdk-to-16.1.1
2ffc11dca76b09d6c4b6bed5bde1ef0c08afd8a2 refs/remotes/origin/nukeeper-update-coverlet.msbuild-to-2.6.2

adding e.g. a git branch -d nukeeper-update-Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer-to-3.2.0 resolves the issue for this branch.

IMHO nukeeper should remove a local-only branch when it already exists

CrispyDrone commented 4 years ago

I solved this by making sure my pipeline starts with a clean repository (clean: resources):

jobs:
- job: NuKeeper
  displayName: Update dependencies
  continueOnError: "false"
  workspace:
    clean: resources
  steps:
  - task: nukeeper.nukeeper.nukeeper.NuKeeper@0
    displayName: NuKeeper
    inputs: 
      arguments: '--verbosity detailed'
  pool:
   name: "Default"

However yes, the pipeline is not failing on error.