Add `campaigns add-changesets` subcommand
Created by: mrnugget
This adds the changesets with the given external IDs to the given campaign.
Example:
$ src campaigns add-changesets -campaign-id Q2FtcGFpZ246NA== -repo-name github.com/sourcegraph/sourcegraph 5016 5017 5018
Created 3 changesets.
Added changeset to campaign. Changesets now in campaign: 10
Current downsides
(These are mostly due to how our API works with batches and could be fixed on the API side, collecting these just here for documentation/transparency)
- When one of the changeset already exists, the command fails with:
[
{
"message": "pq: duplicate key value violates unique constraint \"changesets_repo_external_id_unique\"",
"path": [
"createChangesets"
]
}
]
- When one of the external IDs specified is invalid (non existant, for example), it creates the rest silently but returns an error message for the single invalid one:
[
{
"message": "error in GraphQL response: Could not resolve to a PullRequest with the number of 5013.",
"path": [
"createChangesets"
]
}
]