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

Error when creating repo merge on GitLab #901

Closed
1 of 7 tasks
ThinkingBIGRon opened this issue Dec 1, 2019 · 2 comments
Closed
1 of 7 tasks

Error when creating repo merge on GitLab #901

ThinkingBIGRon opened this issue Dec 1, 2019 · 2 comments
Labels

Comments

@ThinkingBIGRon
Copy link
Contributor

🐛 Bug Report

Running the following command:

$  nukeeper repo https://gitlab.com/under-test/undertest.git ACCESSTOKENVALUE

results in the following output:

Matched uri 'https://gitlab.com/api/v4/' to collaboration platform 'GitLab'
Using upstream fork as push, for project under-test at https://gitlab.com/under-test/undertest.git
Git clone https://gitlab.com/under-test/undertest.git, branch default, to /var/folders/8g/tyrxmcbd33x_ghbldgptqcb80000gn/T/NuKeeper/repo-29dc10be34c2445694ce85b72e192e79
Found 23 packages
Filtered by Exclude 'Glob*' from 23 to 21
Found 21 packages in use, 20 distinct, in 3 projects.
Colorful.Console, CommandLineParser, CsvHelper, FluentAssertions, Gherkin, GitVersion.CommandLine, GitVersion.CommandLine.DotNetCore, JetBrains.Annotations, Microsoft.NET.Test.Sdk, Newtonsoft.Json, NuGet.CommandLine, NuGet.Core, Nuke.Common, nunit, NUnit.ConsoleRunner, NUnit3TestAdapter, Serilog, Serilog.Settings.AppSettings, Serilog.Sinks.Console, SimpleInjector
Found 2 possible updates
Nuke.Common from 0.22.2 to 0.23.4 in build/_build.csproj
SimpleInjector from 4.7.1 to 4.8.1 in src/UnderTest/UnderTest.csproj

Found 2 package updates
Nuke.Common to 0.23.4 from 0.22.2 in 1 place since 14 days ago.
SimpleInjector to 4.8.1 from 4.7.1 in 1 place since 10 hours ago.
Selection of package updates: 2 candidates
Selected package update of Nuke.Common to 0.23.4
Selected package update of SimpleInjector to 4.8.1
Updating 'Nuke.Common' from 0.22.2 to 0.23.4 in 1 projects
OpenMergeRequest failed to parse json to NuKeeper.Gitlab.Model.MergeRequest: Unexpected character encountered while parsing value: [. Path 'labels', line 1, position 1208.
Updates failed NuKeeperException : Failed to parse json to NuKeeper.Gitlab.Model.MergeRequest
Inner Exception JsonReaderException : Unexpected character encountered while parsing value: [. Path 'labels', line 1, position 1208.
Attempted 2 updates and did 0

The part I am reporting here is:

OpenMergeRequest failed to parse json to NuKeeper.Gitlab.Model.MergeRequest: Unexpected character encountered while parsing value: [. Path 'labels', line 1, position 1208.
Updates failed NuKeeperException : Failed to parse json to
NuKeeper.Gitlab.Model.MergeRequest
Inner Exception JsonReaderException : Unexpected character encountered while parsing value: > [. Path 'labels', line 1, position 1208.
Attempted 2 updates and did 0

Note: the merge request is still successfully created.

After downloading the repo and running locally(note: different repo as the first ran out of changes) in debug mode the posted JSON is in the form of:

{
    "id":"under-test/undertest.featurelint",
    "title":"Automatic update of Microsoft.NET.Test.Sdk to 16.4.0",
    "description":"NuKeeper has generated a minor update of `Microsoft.NET.Test.Sdk` to `16.4.0` from `16.3.0`\n`Microsoft.NET.Test.Sdk 16.4.0` was published at `2019-11-06T10:50:48Z`, 24 days ago\n\n1 project 
    update:\nUpdated `src/UnderTest.FeatureLint.Common.Tests/UnderTest.FeatureLint.Common.Tests.csproj` to `Microsoft.NET.Test.Sdk` `16.4.0` from `16.3.0`\n\n[Microsoft.NET.Test.Sdk 16.4.0 on NuGet.org](https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/16.4.0)\n\n\nThis is an automated update. Merge only if it passes tests\n**NuKeeper**: https://github.com/NuKeeperDotNet/NuKeeper\n",
    "target_branch":"release-v0.5.0",
    "source_branch":"nukeeper-update-Microsoft.NET.Test.Sdk-to-16.4.0",
    "remove_source_branch":true,
    "labels":"nukeeper"}

and the response JSON is in the form of:

{
   "id":123,
   "iid":456,
   "project_id":789,
   "title":"Automatic update of Microsoft.NET.Test.Sdk to 16.4.0",
   "description":"NuKeeper has generated a minor update of `Microsoft.NET.Test.Sdk` to `16.4.0` from `16.3.0`\n`Microsoft.NET.Test.Sdk 16.4.0` was published at `2019-11-06T10:50:48Z`, 24 days ago\n\n1 project update:\nUpdated `src/UnderTest.FeatureLint.Common.Tests/UnderTest.FeatureLint.Common.Tests.csproj` to `Microsoft.NET.Test.Sdk` `16.4.0` from `16.3.0`\n\n[Microsoft.NET.Test.Sdk 16.4.0 on NuGet.org](https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/16.4.0)\n\n\nThis is an automated update. Merge only if it passes tests\n**NuKeeper**: https://github.com/NuKeeperDotNet/NuKeeper",
   "state":"opened",
   "created_at":"2019-12-01T00:59:35.849Z",
   "updated_at":"2019-12-01T00:59:35.849Z",
   "merged_by":null,
   "merged_at":null,
   "closed_by":null,
   "closed_at":null,
   "target_branch":"release-v0.5.0",
   "source_branch":"nukeeper-update-Microsoft.NET.Test.Sdk-to-16.4.0",
   "user_notes_count":0,
   "upvotes":0,
   "downvotes":0,
   "assignee":null,
   "author":{
      ...
   },
   "assignees":[

   ],
   "source_project_id":123,
   "target_project_id":123,
   "labels":[
      "nukeeper"
   ],
   "work_in_progress":false,
   "milestone":null,
   "merge_when_pipeline_succeeds":false,
   "merge_status":"can_be_merged",
   "sha":"...",
   "merge_commit_sha":null,
   "squash_commit_sha":null,
   "discussion_locked":null,
   "should_remove_source_branch":null,
   "force_remove_source_branch":true,
   "reference":"!191",
   "web_url":"https://gitlab.com/under-test/undertest.featurelint/merge_requests/191",
   "time_stats":{
      "time_estimate":0,
      "total_time_spent":0,
      "human_time_estimate":null,
      "human_total_time_spent":null
   },
   "squash":false,
   "task_completion_status":{
      "count":0,
      "completed_count":0
   },
   "has_conflicts":false,
   "blocking_discussions_resolved":true,
   "subscribed":true,
   "changes_count":"1",
   "latest_build_started_at":null,
   "latest_build_finished_at":null,
   "first_deployed_to_production_at":null,
   "pipeline":null,
   "head_pipeline":{
      ...
   },
   "diff_refs":{
      "base_sha":"fb8227416707db2d40ac0fa77ed428d2c26b40f7",
      "head_sha":"1763aa2df31c37c8bd891d44fd220f41607bb743",
      "start_sha":"fb8227416707db2d40ac0fa77ed428d2c26b40f7"
   },
   "merge_error":null,
   "user":{
      "can_merge":true
   },
   "approvals_before_merge":null
}

the important item here is labels(it's an array):

"labels":[
  "nukeeper"
],

It is a string in MergeRequest.

I see this as something GitLab must have changed that we need to catch up to.

Expected behavior

Merges are created without error.

Reproduction steps

Run the following command template on a GitLab repo where one or more :

$  nukeeper repo https://gitlab.com/under-test.featurelint/undertest.git ACCESSTOKENVALUE

my specific command was:

$  nukeeper repo https://gitlab.com/under-test.featurelint/undertest.git ACCESSTOKENVALUE --maxpackageupdates 999 --age 0 -d=true --fork=SingleRepositoryOnly --useprerelease=Never

Configuration

Version: 0.26.0 (also tried 0.25.0)

Platform if applicable:

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

Fixed in #902

@stale
Copy link

stale bot commented May 10, 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 10, 2020
@stale stale bot closed this as completed May 31, 2020
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

2 participants