campaigns preview panics while resolving repositories
Created by: evanweible-wf
src-cli version: 3.22.0 recommended version by our deployment: 3.20.0
repositoriesMatchingQuery: dart_functional_test_image or dart_unit_test_image
I hit this while trying to preview a campaign spec, although I'm not actually sure if this is a valid query, as I was under the impression that file-contents searches didn't work for campaigns. So maybe that's the issue Read through the most recent docs and see a similar query in the examples, so I guess it is a valid query. Either way, a panic is probably not the expected result.
Output:
✅ Parsing campaign spec
✅ Resolving namespace
✅ Preparing container images ███████████████████████████████████████████████████████████████████████████████████████████████████████
⠹ Resolving repositories
panic: assignment to entry in nil map
goroutine 1 [running]:
github.com/sourcegraph/src-cli/internal/campaigns.(*Service).resolveRepositorySearch(0xc000209640, 0x1748da0, 0xc0000b7ec0, 0xc0003df080, 0x32, 0xc000210001, 0xc0003ab410, 0xc000529198, 0x100ea8d, 0x1651fa0)
/home/runner/work/src-cli/src-cli/internal/campaigns/service.go:490 +0x26b
github.com/sourcegraph/src-cli/internal/campaigns.(*Service).ResolveRepositoriesOn(0xc000209640, 0x1748da0, 0xc0000b7ec0, 0xc000529280, 0x147a5e5, 0x8, 0x16b8ac8, 0xc0001ff3e0, 0x1)
/home/runner/work/src-cli/src-cli/internal/campaigns/service.go:407 +0x192
github.com/sourcegraph/src-cli/internal/campaigns.(*Service).ResolveRepositories(0xc000209640, 0x1748da0, 0xc0000b7ec0, 0xc0003058f0, 0xc0001ff3e0, 0x0, 0x0, 0xc0003ffce0, 0x1)
/home/runner/work/src-cli/src-cli/internal/campaigns/service.go:373 +0x45b
main.campaignsExecute(0x1748da0, 0xc0000b7ec0, 0xc0000b7e80, 0xc000209640, 0xc00020e180, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/runner/work/src-cli/src-cli/cmd/src/campaigns_common.go:218 +0xdd0
main.init.4.func1(0xc0000b8040, 0x8, 0x8, 0x0, 0x0)
/home/runner/work/src-cli/src-cli/cmd/src/campaigns_preview.go:49 +0x3f7
main.commander.run(0xc000212fc0, 0x5, 0x8, 0xc000200240, 0x16844bc, 0xd, 0x16a85a5, 0x251, 0xc0000b8030, 0x9, ...)
/home/runner/work/src-cli/src-cli/cmd/src/cmd.go:94 +0x3aa
main.init.1.func1(0xc0000b8030, 0x9, 0x9, 0x9, 0x0)
/home/runner/work/src-cli/src-cli/cmd/src/campaigns.go:32 +0x97
main.commander.run(0xc00020e200, 0x10, 0x10, 0xc0000b4120, 0x167c7f2, 0x3, 0x16ab01a, 0x46e, 0xc0000b8010, 0xb, ...)
/home/runner/work/src-cli/src-cli/cmd/src/cmd.go:94 +0x3aa
main.main()
/home/runner/work/src-cli/src-cli/cmd/src/main.go:68 +0xf7