Add schema for importing existing changesets
Created by: eseliger
Usage example:
name: awesome-campaign
...
importChangesets:
- repo: github.com/sourcegraph/sourcegraph
externalIDs: [110, "#113", 119]
- repo: gitlab.com/sourcegraph/sourcegraph
externalIDs: [110, "!113", 119]
- repo: bitbucket.sourcegraph.com/sourcegraph/sourcegraph
externalIDs: [110, 113, 119]
- repo: github.com/sourcegraph/sourcegraph
externalIDs:
- 110
- 113
- 119
...
or programmatically from an external tool:
for repo in repos:
externalID=$(my-awesome-tool --output-pr-id)
jq --arg repo "$repo" --arg externalID "$externalID" '.importChangesets += [{ "repo": "$repo", "externalIDs": ["$externalID"] }]' campaign_spec.json
I think for the programmatic use-case, it makes sense to not have a keyed object to ensure uniqueness of "repo", but rather allow it being used multiple times.