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

Cannot checkout when using NuKeeper extension on a branch with slash #37

Open
thomasmktong opened this issue Jun 1, 2019 · 6 comments

Comments

@thomasmktong
Copy link

When running NuKeeper extension on a branch with slash, e.g. bug/31386-xxx I found that only the last segment of the branch is sent to NuKeeper, i.e. 31386-xxx without bug/

##[debug]Build.SourceBranchName=31386-xxx
##[debug]arguments=--maxpackageupdates 1000 --change minor --consolidate --verbosity detailed --exclude MathNet
:\Program Files\dotnet\dotnet.exe" C:\vsts_agent_integration\_work\_tool\nukeeper\0.21.3\x64\NuKeeper.dll repo C:\vsts_agent_integration\_work\35\s *** --targetBranch origin/31386-xxx --maxpackageupdates 1000 --change minor --consolidate --verbosity detailed
Git checkout 'origin/31386-xxx'
Updates failed NuKeeperException : Git Cannot checkout branch: the branch named 'origin/31386-xxx' doesn't exist
   at NuKeeper.Git.LibGit2SharpDriver.Checkout(String branchName) in /home/vsts/work/r1/a/drop/NuKeeper.Git/LibGit2SharpDriver.cs:line 96
   at NuKeeper.Engine.Packages.PackageUpdater.MakeUpdatePullRequests(IGitDriver git, RepositoryData repository, NuGetSources sources, SettingsContainer settings, IReadOnlyCollection`1 updates) in /home/vsts/work/r1/a/drop/NuKeeper/Engine/Packages/PackageUpdater.cs:line 70
   at NuKeeper.Engine.Packages.PackageUpdater.MakeUpdatePullRequests(IGitDriver git, RepositoryData repository, IReadOnlyCollection`1 updates, NuGetSources sources, SettingsContainer settings) in /home/vsts/work/r1/a/drop/NuKeeper/Engine/Packages/PackageUpdater.cs:line 46
Attempted 134 updates and did 0
Done at 2019-06-01T04:15:58Z

I think somehow the VSTS build variable Build.SourceBranchName was used as that one only has last segment of a branch name, ref: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml

@MaxMommersteeg
Copy link
Contributor

I think you are right: https://github.com/NuKeeperDotNet/NuKeeper-AzureDevops-extension/blob/master/nukeeper/src/NuKeeper.ts#L18

Could you give me the exact arguments you are using? I can try to replicate and fix the issue later today.

@thomasmktong
Copy link
Author

Thanks. I just run the task with these

--maxpackageupdates 1000 --change minor --consolidate --verbosity detailed

image
it this what you are looking for?

@MaxMommersteeg
Copy link
Contributor

MaxMommersteeg commented Jun 2, 2019

Yep, thanks. Is bug/31386-xxx the default branch, or do you target that one in the pipeline?

For reference: microsoft/azure-pipelines-agent#838

@MaxMommersteeg
Copy link
Contributor

I opened up a PR, I think that code change will fix the issue you're experiencing.

@thomasmktong
Copy link
Author

thanks very much, it was the branch that i targeted

MarcBruins pushed a commit that referenced this issue Jun 3, 2019
* Update from upstream. (#1)

* Pull after branch checkout.

Fix for: NuKeeperDotNet/NuKeeper#620

* Updated task version.

* Update README.md

* docker build

* update to use v0.13.0 and set icon

* 0.16.0

* use latest always

* use these files

* delete all bin files

* feat(installer): changed to native download and extraction

* npm fix packages

* version 0.1.65

* fix(Unzip): await unzip (#21)

* fix(Unzip): await unzip

* fix(Zip): unzip reverted

* skip download when already available (#23)

* fix(Unzip): await unzip

* fix(Zip): unzip reverted

* fix(Download): only download when it doesn't exists

* fix(git): changed git commands to synchronous (#24)

* fix(git): changed git commands to synchronous

* fix(version): updated version

* update to 0.1.691 using tool lib for download (#25)

* update

* remove obsolte libs

* remove old version of tool-lib

* Update README.md

* 0.2.2 (#26)

* update

* remove obsolte libs

* remove old version of tool-lib

* move to 0.2.2

* update to 0.2.4

* Update explanation about oauth checkmark and update version and use async exectuion

* version 0.3.2

* version 0.3.4

* Update README.md

* add version capabalities

* remove jsonpath-plus

* update packages

* add group

* add installer.ts file

* no global

* update latest

* Make NuKeeper task debuggable

* log output to debug console

* use slash not dot

* remove unneeded variable

* Update README.md

* Update README.md

* release 0.4.7

* move stuff aroudn

* moving again

* update to latest

* Added SourceBranch var to launch.json.

* Support slashes in branch.

* Corrected spacing.
@MaxMommersteeg
Copy link
Contributor

@thomasmktong Could you try again, new version of extension should be live.

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