User can't add repositories through GraphQL API
Created by: dadlerj
- Sourcegraph version:
- Platform information:
Steps to reproduce:
A user reported that using our API to add repositories wasn't working for them. They tried the following mutation:
mutation{
configurationMutation(input: {subject: "VXNlcjox", lastID: 1}) {
overwriteConfiguration(contents: "repos.list:[{url:file:///var/opt/sourcegraph/repos/gerrit/proctool/jenkins-jobs, path:jenkins-jobs}]") {
empty {
alwaysNil
}
}
}
}
They indicated that they got this by copying the mutation done in graphqlbackend/configuration_test.go
The documentation indicated to them, regarding the AddRepository migration:
"To add arbitrary repositories (that don't need to reside on an already configured code host), use the site configuration "repos.list" property."
They also tried this query, but got no response:
mutation{
configurationMutation(input: {subject: "VXNlcjox", lastID: 6}) {
editConfiguration(edit : {keyPath: [{property: "repos.list"}],
value: "bla"}) {
empty {
alwaysNil
}
}
}
}