(feat) add "src repos {add|update|delete}-metadata -repo-name" flag support
Created by: erzhtor
Part of https://github.com/sourcegraph/pr-faqs/issues/96.
This PR adds src repos {add|update|delete}-metadata -repo-name
flag support
NOTE: When using repo-name
flag, it makes an extra GQL query to get a repo ID. This is made for back compat purposes instead of introducing breaking change and updating underlying add/update/delete repo metadata GQL query.
Test plan
- Add/update/delete using
repo
flag as previouslygo run ./cmd/src repos add-metadata -repo=$repoID -key=test
go run ./cmd/src repos update-metadata -repo=$repoID -key=test -value=value
go run ./cmd/src repos delete-metadata -repo=$repoID -key=test
- Add/update/delete using
repo-name
flag as previouslygo run ./cmd/src repos add-metadata -repo-name=$repoName -key=test
go run ./cmd/src repos update-metadata -repo-name=$repoName -key=test -value=value
go run ./cmd/src repos delete-metadata -repo-name=$repoName -key=test