Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ All notable changes to `src-cli` are documented in this file.

### Removed

- The `src repos enable|disable` commands were removed as they are no longer supported.

## 3.28.3

### Fixed
Expand Down
28 changes: 26 additions & 2 deletions cmd/src/repos.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package main

import (
"context"
"flag"
"fmt"
"time"

"github.com/sourcegraph/src-cli/internal/api"
)

var reposCommands commander
Expand All @@ -19,8 +22,6 @@ The commands are:

get gets a repository
list lists repositories
enable enables repositories
disable disables repositories
delete deletes repositories

Use "src repos [command] -h" for more information about a command.
Expand Down Expand Up @@ -88,3 +89,26 @@ type GitRef struct {
Name string `json:"name"`
DisplayName string `json:"displayName"`
}

func fetchRepositoryID(ctx context.Context, client api.Client, repoName string) (string, error) {
query := `query RepositoryID($repoName: String!) {
repository(name: $repoName) {
id
}
}`

var result struct {
Repository struct {
ID string
}
}
if ok, err := client.NewRequest(query, map[string]interface{}{
"repoName": repoName,
}).Do(ctx, &result); err != nil || !ok {
return "", err
}
if result.Repository.ID == "" {
return "", fmt.Errorf("repository not found: %s", repoName)
}
return result.Repository.ID, nil
}
113 changes: 0 additions & 113 deletions cmd/src/repos_enable_disable.go

This file was deleted.