4816: Cannot add github repo via API

vernonatsonos

What version are you running?

3.0.14

What's the URL of the page containing the problem?

https://reviewboard.myCompany.com/reviews/api/repositories/

What steps will reproduce the problem?

  1. Verify the name and path of the parameters below
  2. Send a post to the URL above with the following json body
{
  "name": "GitHub - myRepoName",
  "path": "git@github.com:myCompany/myRepoName",
  "tool": "git"
}

What is the expected output? What do you see instead?

I end up getting a 400 error with the following output rather than the exepected 200 call and a new repository

{
  "fields": {
    "path": ["This field is required"], 
    "tool": ["This field is required"], 
    "name": ["This field is required"]
  }, 
  "stat": "fail", 
  "err": {
    "msg": "One or more fields had errors", 
    "code": 105
  }
}

What operating system are you using? What browser?

I have gotten this response with both Advanced Rest Client and using curl. ARC was on Windows 10 and curl was on Ubuntu 16.04.

Please provide any additional information below.

For reference, this is what I set when I use a get reqeust on an existing Github repo. I was able to create this one via the repo creation page just fine.

{
  "stat": "ok", 
  "repository": {
    "name": "GitHub - otherRepo", 
    "links": {
      "info": {
        "href": "https://reviewboard.myCompany.com/reviews/api/repositories/4/info/",
        "method": "GET"
      },
      "branches": {
        "href": "https://reviewboard.myCompany.com/reviews/api/repositories/4/branches/",
        "method": "GET"
      }, 
      "commits": {
        "href": "https://reviewboard.myCompany.com/reviews/api/repositories/4/commits/",
        "method": "GET"
      }, 
      "self": {
        "href": "https://reviewboard.myCompany.com/reviews/api/repositories/4/", 
        "method": "GET"
      }, 
      "update": {
        "href": "https://reviewboard.myCompany.com/reviews/api/repositories/4/", 
        "method": "PUT"
      }, 
      "diff_file_attachments": {
        "href": "https://reviewboard.myCompany.com/reviews/api/repositories/4/diff-file-attachments/", 
        "method": "GET"
      }, 
      "delete": {
        "href": "https://reviewboard.myCompany.com/reviews/api/repositories/4/",
        "method": "DELETE"
      }
    }, 
  "mirror_path": "", 
  "tool": "Git", 
  "visible": true, 
  "bug_tracker": "https://jira.myCompany.com/browse/%s", 
  "path": "git@github.com:myCompany/otherRepo.git", 
  "id": 4
  }
}
david
#1 david

Fixed in 3.0.19+

  • -New
    +Fixed