From b0cf80c1231d403d9dc746696950804129c5c68b Mon Sep 17 00:00:00 2001 From: Keegan Carruthers-Smith Date: Wed, 8 Apr 2026 15:41:59 +0200 Subject: [PATCH 1/2] Revert "repos: remove unread fields from graphql query (#1288)" This reverts commit 81ef50c88a538ba242c407e03efba7ec5345d5c5. --- cmd/src/repos.go | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/cmd/src/repos.go b/cmd/src/repos.go index c1347f5889..d7131c6f87 100644 --- a/cmd/src/repos.go +++ b/cmd/src/repos.go @@ -4,6 +4,7 @@ import ( "context" "flag" "fmt" + "time" "github.com/sourcegraph/sourcegraph/lib/errors" @@ -50,17 +51,53 @@ Use "src repos [command] -h" for more information about a command. const repositoryFragment = ` fragment RepositoryFields on Repository { + id name + url + description + language + createdAt + updatedAt + externalRepository { + id + serviceType + serviceID + } defaultBranch { name displayName } + viewerCanAdminister + keyValuePairs { + key + value + } } ` type Repository struct { - Name string `json:"name"` - DefaultBranch GitRef `json:"defaultBranch"` + ID string `json:"id"` + Name string `json:"name"` + URL string `json:"url"` + Description string `json:"description"` + Language string `json:"language"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` + ExternalRepository ExternalRepository `json:"externalRepository"` + DefaultBranch GitRef `json:"defaultBranch"` + ViewerCanAdminister bool `json:"viewerCanAdminister"` + KeyValuePairs []KeyValuePair `json:"keyValuePairs"` +} + +type KeyValuePair struct { + Key string `json:"key"` + Value *string `json:"value"` +} + +type ExternalRepository struct { + ID string `json:"id"` + ServiceType string `json:"serviceType"` + ServiceID string `json:"serviceID"` } type GitRef struct { From 14fea34ed7be6114e997eb196ca19ac041348c69 Mon Sep 17 00:00:00 2001 From: Keegan Carruthers-Smith Date: Wed, 8 Apr 2026 15:42:26 +0200 Subject: [PATCH 2/2] repos: remove Language field This field is expensive to compute. --- cmd/src/repos.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/src/repos.go b/cmd/src/repos.go index d7131c6f87..b839f6d1e8 100644 --- a/cmd/src/repos.go +++ b/cmd/src/repos.go @@ -55,7 +55,6 @@ fragment RepositoryFields on Repository { name url description - language createdAt updatedAt externalRepository { @@ -80,7 +79,6 @@ type Repository struct { Name string `json:"name"` URL string `json:"url"` Description string `json:"description"` - Language string `json:"language"` CreatedAt time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` ExternalRepository ExternalRepository `json:"externalRepository"`