diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-09-15 10:04:13 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-09-15 10:08:50 +0200 |
commit | eee849ea204be7f54e2cb0bd1cfc4791ab6a3b6f (patch) | |
tree | 74de46931f071d67440ed61b6d00dec94d431fe0 /client | |
parent | 5e4421091f3385254aac35f590fdcc9fbbeefcf7 (diff) |
Implement clone --list
Diffstat (limited to 'client')
-rw-r--r-- | client/go/.gitattributes | 1 | ||||
-rw-r--r-- | client/go/cmd/clone.go | 21 | ||||
-rw-r--r-- | client/go/cmd/clone_list.go | 81 | ||||
-rw-r--r-- | client/go/cmd/clone_list_test.go | 66 | ||||
-rw-r--r-- | client/go/cmd/testdata/sample-apps-contents.json | 610 | ||||
-rw-r--r-- | client/go/cmd/testdata/sample-apps-news.json | 178 | ||||
-rw-r--r-- | client/go/cmd/testdata/sample-apps-vespa-cloud.json | 130 |
7 files changed, 1084 insertions, 3 deletions
diff --git a/client/go/.gitattributes b/client/go/.gitattributes new file mode 100644 index 00000000000..6767a69b3b1 --- /dev/null +++ b/client/go/.gitattributes @@ -0,0 +1 @@ +**/testdata/* linguist-vendored diff --git a/client/go/cmd/clone.go b/client/go/cmd/clone.go index f2b9f20ef3d..9503a81debf 100644 --- a/client/go/cmd/clone.go +++ b/client/go/cmd/clone.go @@ -22,10 +22,11 @@ import ( // Set this to test without downloading this file from github var existingSampleAppsZip string +var listApps bool func init() { - existingSampleAppsZip = "" rootCmd.AddCommand(cloneCmd) + cloneCmd.Flags().BoolVarP(&listApps, "list", "l", false, "List available sample applications") } var cloneCmd = &cobra.Command{ @@ -37,9 +38,23 @@ var cloneCmd = &cobra.Command{ The application package is copied from a sample application in https://github.com/vespa-engine/sample-apps`, Example: "$ vespa clone vespa-cloud/album-recommendation my-app", DisableAutoGenTag: true, - Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { - cloneApplication(args[0], args[1]) + if listApps { + apps, err := listSampleApps() + if err != nil { + printErr(err, "Could not list sample applications") + return + } + for _, app := range apps { + log.Print(app) + } + } else { + if len(args) != 2 { + fatalErr(nil, "Expected exactly 2 arguments") + return + } + cloneApplication(args[0], args[1]) + } }, } diff --git a/client/go/cmd/clone_list.go b/client/go/cmd/clone_list.go new file mode 100644 index 00000000000..4bcf65500c9 --- /dev/null +++ b/client/go/cmd/clone_list.go @@ -0,0 +1,81 @@ +package cmd + +import ( + "encoding/json" + "net/http" + "sort" + "time" + + "github.com/vespa-engine/vespa/client/go/util" +) + +func listSampleApps() ([]string, error) { + return listSampleAppsAt("https://api.github.com/repos/vespa-engine/sample-apps/contents/") +} + +func listSampleAppsAt(url string) ([]string, error) { + rfs, err := getRepositoryFiles(url) + if err != nil { + return nil, err + } + var apps []string + for _, rf := range rfs { + isApp, follow := isApp(rf) + if isApp { + apps = append(apps, rf.Path) + } else if follow { + apps2, err := listSampleAppsAt(rf.URL) + if err != nil { + return nil, err + } + apps = append(apps, apps2...) + } + } + sort.Strings(apps) + return apps, nil +} + +func getRepositoryFiles(url string) ([]repositoryFile, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + response, err := util.HttpDo(req, time.Minute, "GitHub") + var files []repositoryFile + dec := json.NewDecoder(response.Body) + if err := dec.Decode(&files); err != nil { + return nil, err + } + return files, nil +} + +func isApp(rf repositoryFile) (ok bool, follow bool) { + if rf.Type != "dir" { + return false, false + } + if rf.Path == "" { + return false, false + } + if rf.Path[0] == '_' || rf.Path[0] == '.' { + return false, false + } + // These are just heuristics and must be updated if we add more directories that are not applications, or that + // contain multiple applications inside + switch rf.Name { + case "test", "bin", "src": + return false, false + } + switch rf.Path { + case "news", "vespa-cloud": + return false, true + } + return true, false +} + +type repositoryFile struct { + Path string `json:"path"` + Name string `json:"name"` + Type string `json:"type"` + URL string `json:"url"` + HtmlURL string `json:"html_url"` +} diff --git a/client/go/cmd/clone_list_test.go b/client/go/cmd/clone_list_test.go new file mode 100644 index 00000000000..846ad1a90e3 --- /dev/null +++ b/client/go/cmd/clone_list_test.go @@ -0,0 +1,66 @@ +package cmd + +import ( + "io/ioutil" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/vespa-engine/vespa/client/go/util" +) + +func TestListSampleApps(t *testing.T) { + c := &mockHttpClient{} + c.NextResponse(200, readTestData(t, "sample-apps-contents.json")) + c.NextResponse(200, readTestData(t, "sample-apps-news.json")) + c.NextResponse(200, readTestData(t, "sample-apps-vespa-cloud.json")) + util.ActiveHttpClient = c + + apps, err := listSampleApps() + assert.Nil(t, err) + expected := []string{ + "album-recommendation-monitoring", + "album-recommendation-selfhosted", + "basic-search-on-gke", + "boolean-search", + "dense-passage-retrieval-with-ann", + "generic-request-processing", + "http-api-using-request-handlers-and-processors", + "incremental-search", + "model-evaluation", + "msmarco-ranking", + "multiple-bundles", + "multiple-bundles-lib", + "news/app-1-getting-started", + "news/app-2-feed-and-query", + "news/app-3-searching", + "news/app-5-recommendation", + "news/app-6-recommendation-with-searchers", + "news/app-7-parent-child", + "operations", + "part-purchases-demo", + "secure-vespa-with-mtls", + "semantic-qa-retrieval", + "tensor-playground", + "text-search", + "transformers", + "use-case-shopping", + "vespa-chinese-linguistics", + "vespa-cloud/album-recommendation", + "vespa-cloud/album-recommendation-docproc", + "vespa-cloud/album-recommendation-prod", + "vespa-cloud/album-recommendation-searcher", + "vespa-cloud/cord-19-search", + "vespa-cloud/joins", + "vespa-cloud/vespa-documentation-search", + } + assert.Equal(t, expected, apps) +} + +func readTestData(t *testing.T, name string) string { + contents, err := ioutil.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatal(err) + } + return string(contents) +} diff --git a/client/go/cmd/testdata/sample-apps-contents.json b/client/go/cmd/testdata/sample-apps-contents.json new file mode 100644 index 00000000000..02824f01147 --- /dev/null +++ b/client/go/cmd/testdata/sample-apps-contents.json @@ -0,0 +1,610 @@ +[ + { + "name": ".github", + "path": ".github", + "sha": "6bcd814282757c3ca7ba265972f000bc62a76aa8", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/.github?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/.github", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/6bcd814282757c3ca7ba265972f000bc62a76aa8", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/.github?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/6bcd814282757c3ca7ba265972f000bc62a76aa8", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/.github" + } + }, + { + "name": ".gitignore", + "path": ".gitignore", + "sha": "e33d8f27d17a696ae99b12063f553a53d0d08510", + "size": 163, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/.gitignore?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/.gitignore", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/e33d8f27d17a696ae99b12063f553a53d0d08510", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/.gitignore", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/.gitignore?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/e33d8f27d17a696ae99b12063f553a53d0d08510", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/.gitignore" + } + }, + { + "name": "CONTRIBUTING.md", + "path": "CONTRIBUTING.md", + "sha": "56d974d3c4d9b5b8f1739c24fc293f822e2fcec8", + "size": 3814, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/CONTRIBUTING.md?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/CONTRIBUTING.md", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/56d974d3c4d9b5b8f1739c24fc293f822e2fcec8", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/CONTRIBUTING.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/CONTRIBUTING.md?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/56d974d3c4d9b5b8f1739c24fc293f822e2fcec8", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/CONTRIBUTING.md" + } + }, + { + "name": "Code-of-Conduct.md", + "path": "Code-of-Conduct.md", + "sha": "a812e1cfa8e464fc4a0ba6743030662efa1e4244", + "size": 7414, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/Code-of-Conduct.md?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/Code-of-Conduct.md", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/a812e1cfa8e464fc4a0ba6743030662efa1e4244", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/Code-of-Conduct.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/Code-of-Conduct.md?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/a812e1cfa8e464fc4a0ba6743030662efa1e4244", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/Code-of-Conduct.md" + } + }, + { + "name": "Gemfile", + "path": "Gemfile", + "sha": "a7befcbb3c5a4ff65d51ee222c27bc3aef92bdc8", + "size": 308, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/Gemfile?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/Gemfile", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/a7befcbb3c5a4ff65d51ee222c27bc3aef92bdc8", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/Gemfile", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/Gemfile?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/a7befcbb3c5a4ff65d51ee222c27bc3aef92bdc8", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/Gemfile" + } + }, + { + "name": "LICENSE", + "path": "LICENSE", + "sha": "df0bb94aeb6578299d1995c791da29f8f00f0cbc", + "size": 11354, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/LICENSE?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/LICENSE", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/df0bb94aeb6578299d1995c791da29f8f00f0cbc", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/LICENSE", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/LICENSE?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/df0bb94aeb6578299d1995c791da29f8f00f0cbc", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/LICENSE" + } + }, + { + "name": "README.md", + "path": "README.md", + "sha": "44b3d846b1c594196d1362a44c965b91482fb806", + "size": 8401, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/README.md?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/README.md", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/44b3d846b1c594196d1362a44c965b91482fb806", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/README.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/README.md?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/44b3d846b1c594196d1362a44c965b91482fb806", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/README.md" + } + }, + { + "name": "Vagrantfile", + "path": "Vagrantfile", + "sha": "0cb4b6dbe12404fb0bfa67e8e950287cdad722f4", + "size": 913, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/Vagrantfile?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/Vagrantfile", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/0cb4b6dbe12404fb0bfa67e8e950287cdad722f4", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/Vagrantfile", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/Vagrantfile?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/0cb4b6dbe12404fb0bfa67e8e950287cdad722f4", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/Vagrantfile" + } + }, + { + "name": "_config.yml", + "path": "_config.yml", + "sha": "d0a1af407e12cd80401d55679b5566538a925cc6", + "size": 630, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/_config.yml?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/_config.yml", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/d0a1af407e12cd80401d55679b5566538a925cc6", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/_config.yml", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/_config.yml?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/d0a1af407e12cd80401d55679b5566538a925cc6", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/_config.yml" + } + }, + { + "name": "_plugins-vespafeed", + "path": "_plugins-vespafeed", + "sha": "34a1dec1e26d0905f461a70ebdea5213e8510eea", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/_plugins-vespafeed?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/_plugins-vespafeed", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/34a1dec1e26d0905f461a70ebdea5213e8510eea", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/_plugins-vespafeed?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/34a1dec1e26d0905f461a70ebdea5213e8510eea", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/_plugins-vespafeed" + } + }, + { + "name": "album-recommendation-monitoring", + "path": "album-recommendation-monitoring", + "sha": "f2f816138535aae9c1080c8dca20e544b0a8fbde", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/album-recommendation-monitoring?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/album-recommendation-monitoring", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/f2f816138535aae9c1080c8dca20e544b0a8fbde", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/album-recommendation-monitoring?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/f2f816138535aae9c1080c8dca20e544b0a8fbde", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/album-recommendation-monitoring" + } + }, + { + "name": "album-recommendation-selfhosted", + "path": "album-recommendation-selfhosted", + "sha": "1355199dee65aba689b784a8c92977886e8b0dcb", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/album-recommendation-selfhosted?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/album-recommendation-selfhosted", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1355199dee65aba689b784a8c92977886e8b0dcb", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/album-recommendation-selfhosted?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1355199dee65aba689b784a8c92977886e8b0dcb", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/album-recommendation-selfhosted" + } + }, + { + "name": "aws_bootstrap.sh", + "path": "aws_bootstrap.sh", + "sha": "4451c011e7d84d31bda78c6bb64d1b39bf79543c", + "size": 945, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/aws_bootstrap.sh?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/aws_bootstrap.sh", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/4451c011e7d84d31bda78c6bb64d1b39bf79543c", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/aws_bootstrap.sh", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/aws_bootstrap.sh?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/4451c011e7d84d31bda78c6bb64d1b39bf79543c", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/aws_bootstrap.sh" + } + }, + { + "name": "basic-search-on-gke", + "path": "basic-search-on-gke", + "sha": "e3045c5e7e3d5a9604fe5d6e79e28276341e3190", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/basic-search-on-gke?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/basic-search-on-gke", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/e3045c5e7e3d5a9604fe5d6e79e28276341e3190", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/basic-search-on-gke?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/e3045c5e7e3d5a9604fe5d6e79e28276341e3190", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/basic-search-on-gke" + } + }, + { + "name": "boolean-search", + "path": "boolean-search", + "sha": "f698016bfba3492e36251bfdc7af27f3157dcb58", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/boolean-search?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/boolean-search", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/f698016bfba3492e36251bfdc7af27f3157dcb58", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/boolean-search?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/f698016bfba3492e36251bfdc7af27f3157dcb58", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/boolean-search" + } + }, + { + "name": "dense-passage-retrieval-with-ann", + "path": "dense-passage-retrieval-with-ann", + "sha": "3281faf0e968e5dda398f784b0f370b93a94dd7d", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/dense-passage-retrieval-with-ann?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/dense-passage-retrieval-with-ann", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/3281faf0e968e5dda398f784b0f370b93a94dd7d", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/dense-passage-retrieval-with-ann?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/3281faf0e968e5dda398f784b0f370b93a94dd7d", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/dense-passage-retrieval-with-ann" + } + }, + { + "name": "feed_to_vespa.py", + "path": "feed_to_vespa.py", + "sha": "ca825ded90c8c2300b29f6c016b8875c5547f6b6", + "size": 6825, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/feed_to_vespa.py?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/feed_to_vespa.py", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/ca825ded90c8c2300b29f6c016b8875c5547f6b6", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/feed_to_vespa.py", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/feed_to_vespa.py?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/ca825ded90c8c2300b29f6c016b8875c5547f6b6", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/feed_to_vespa.py" + } + }, + { + "name": "generic-request-processing", + "path": "generic-request-processing", + "sha": "ae922ab9efebf6cc9f8ee9726e48693b794eb235", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/generic-request-processing?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/generic-request-processing", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/ae922ab9efebf6cc9f8ee9726e48693b794eb235", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/generic-request-processing?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/ae922ab9efebf6cc9f8ee9726e48693b794eb235", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/generic-request-processing" + } + }, + { + "name": "http-api-using-request-handlers-and-processors", + "path": "http-api-using-request-handlers-and-processors", + "sha": "b8403feb85fe2a113114a2bd086057aec0538e46", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/http-api-using-request-handlers-and-processors?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/http-api-using-request-handlers-and-processors", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/b8403feb85fe2a113114a2bd086057aec0538e46", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/http-api-using-request-handlers-and-processors?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/b8403feb85fe2a113114a2bd086057aec0538e46", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/http-api-using-request-handlers-and-processors" + } + }, + { + "name": "incremental-search", + "path": "incremental-search", + "sha": "6d38eb194e4a8f6565a66591758a17bf8e6459e9", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/incremental-search?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/incremental-search", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/6d38eb194e4a8f6565a66591758a17bf8e6459e9", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/incremental-search?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/6d38eb194e4a8f6565a66591758a17bf8e6459e9", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/incremental-search" + } + }, + { + "name": "model-evaluation", + "path": "model-evaluation", + "sha": "5f782af796cd13ebfb0c3e2d4ab074bc33e41913", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/model-evaluation?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/model-evaluation", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/5f782af796cd13ebfb0c3e2d4ab074bc33e41913", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/model-evaluation?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/5f782af796cd13ebfb0c3e2d4ab074bc33e41913", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/model-evaluation" + } + }, + { + "name": "msmarco-ranking", + "path": "msmarco-ranking", + "sha": "44af5a222f523e0c1aa92fc11dda4cbe095ca6b1", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/msmarco-ranking?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/msmarco-ranking", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/44af5a222f523e0c1aa92fc11dda4cbe095ca6b1", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/msmarco-ranking?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/44af5a222f523e0c1aa92fc11dda4cbe095ca6b1", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/msmarco-ranking" + } + }, + { + "name": "multiple-bundles-lib", + "path": "multiple-bundles-lib", + "sha": "8604cc153faee34c538a82b275e09f743f83216b", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/multiple-bundles-lib?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/multiple-bundles-lib", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/8604cc153faee34c538a82b275e09f743f83216b", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/multiple-bundles-lib?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/8604cc153faee34c538a82b275e09f743f83216b", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/multiple-bundles-lib" + } + }, + { + "name": "multiple-bundles", + "path": "multiple-bundles", + "sha": "1cc37ba975795212e19801a1f2c1dd27abfbec77", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/multiple-bundles?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/multiple-bundles", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1cc37ba975795212e19801a1f2c1dd27abfbec77", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/multiple-bundles?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1cc37ba975795212e19801a1f2c1dd27abfbec77", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/multiple-bundles" + } + }, + { + "name": "news", + "path": "news", + "sha": "aed7b1fde19b139781fb5df4d7feb3e8ec1db603", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/aed7b1fde19b139781fb5df4d7feb3e8ec1db603", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/aed7b1fde19b139781fb5df4d7feb3e8ec1db603", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news" + } + }, + { + "name": "operations", + "path": "operations", + "sha": "d73d99d8a7b2f496ff1e43da6b3f87d612227232", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/operations?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/operations", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/d73d99d8a7b2f496ff1e43da6b3f87d612227232", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/operations?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/d73d99d8a7b2f496ff1e43da6b3f87d612227232", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/operations" + } + }, + { + "name": "part-purchases-demo", + "path": "part-purchases-demo", + "sha": "c1f64f68d2abe8b207da901e6ccb9277971167dc", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/part-purchases-demo?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/part-purchases-demo", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/c1f64f68d2abe8b207da901e6ccb9277971167dc", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/part-purchases-demo?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/c1f64f68d2abe8b207da901e6ccb9277971167dc", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/part-purchases-demo" + } + }, + { + "name": "pom.xml", + "path": "pom.xml", + "sha": "191e06595d1db24d864833b333539a083d8a5f30", + "size": 1839, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/pom.xml?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/pom.xml", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/191e06595d1db24d864833b333539a083d8a5f30", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/pom.xml", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/pom.xml?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/191e06595d1db24d864833b333539a083d8a5f30", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/pom.xml" + } + }, + { + "name": "screwdriver.yaml", + "path": "screwdriver.yaml", + "sha": "fd9460121b230498baed2b1760b36e2f1a067fd7", + "size": 2771, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/screwdriver.yaml?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/screwdriver.yaml", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/fd9460121b230498baed2b1760b36e2f1a067fd7", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/screwdriver.yaml", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/screwdriver.yaml?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/fd9460121b230498baed2b1760b36e2f1a067fd7", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/screwdriver.yaml" + } + }, + { + "name": "secure-vespa-with-mtls", + "path": "secure-vespa-with-mtls", + "sha": "c6321c984bc4965f274d5f773af241935edb21a2", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/secure-vespa-with-mtls?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/secure-vespa-with-mtls", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/c6321c984bc4965f274d5f773af241935edb21a2", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/secure-vespa-with-mtls?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/c6321c984bc4965f274d5f773af241935edb21a2", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/secure-vespa-with-mtls" + } + }, + { + "name": "semantic-qa-retrieval", + "path": "semantic-qa-retrieval", + "sha": "67bc047714c2c76e1318eb8faa5b208747b62d5e", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/semantic-qa-retrieval?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/semantic-qa-retrieval", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/67bc047714c2c76e1318eb8faa5b208747b62d5e", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/semantic-qa-retrieval?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/67bc047714c2c76e1318eb8faa5b208747b62d5e", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/semantic-qa-retrieval" + } + }, + { + "name": "tensor-playground", + "path": "tensor-playground", + "sha": "090954a12a47a98250b729b0c01bf804577cb7ad", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/tensor-playground?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/tensor-playground", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/090954a12a47a98250b729b0c01bf804577cb7ad", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/tensor-playground?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/090954a12a47a98250b729b0c01bf804577cb7ad", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/tensor-playground" + } + }, + { + "name": "test", + "path": "test", + "sha": "0948c9e369a9734856c5d55b11c9fc7681ca398b", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/test?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/test", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/0948c9e369a9734856c5d55b11c9fc7681ca398b", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/test?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/0948c9e369a9734856c5d55b11c9fc7681ca398b", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/test" + } + }, + { + "name": "text-search", + "path": "text-search", + "sha": "7c3eb5ebfa59f0fdc7f1d3cd9601f238c4c1461a", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/text-search?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/text-search", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/7c3eb5ebfa59f0fdc7f1d3cd9601f238c4c1461a", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/text-search?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/7c3eb5ebfa59f0fdc7f1d3cd9601f238c4c1461a", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/text-search" + } + }, + { + "name": "transformers", + "path": "transformers", + "sha": "43a907697bbb4a6baa673a3005bc009adff16cf3", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/transformers?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/transformers", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/43a907697bbb4a6baa673a3005bc009adff16cf3", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/transformers?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/43a907697bbb4a6baa673a3005bc009adff16cf3", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/transformers" + } + }, + { + "name": "use-case-shopping", + "path": "use-case-shopping", + "sha": "7083dda1a5d3ad4ea5b349e67cdd2ab9b57dc305", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/use-case-shopping?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/use-case-shopping", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/7083dda1a5d3ad4ea5b349e67cdd2ab9b57dc305", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/use-case-shopping?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/7083dda1a5d3ad4ea5b349e67cdd2ab9b57dc305", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/use-case-shopping" + } + }, + { + "name": "vespa-chinese-linguistics", + "path": "vespa-chinese-linguistics", + "sha": "de804dec91603fc905c82dbb982ca9c2dbeea99c", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-chinese-linguistics?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-chinese-linguistics", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/de804dec91603fc905c82dbb982ca9c2dbeea99c", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-chinese-linguistics?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/de804dec91603fc905c82dbb982ca9c2dbeea99c", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-chinese-linguistics" + } + }, + { + "name": "vespa-cloud", + "path": "vespa-cloud", + "sha": "1f4ae8043e03f1d31bd361f1635cf3fe7dfe7c0b", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1f4ae8043e03f1d31bd361f1635cf3fe7dfe7c0b", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1f4ae8043e03f1d31bd361f1635cf3fe7dfe7c0b", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud" + } + } +] diff --git a/client/go/cmd/testdata/sample-apps-news.json b/client/go/cmd/testdata/sample-apps-news.json new file mode 100644 index 00000000000..495f2cf1294 --- /dev/null +++ b/client/go/cmd/testdata/sample-apps-news.json @@ -0,0 +1,178 @@ +[ + { + "name": "README.md", + "path": "news/README.md", + "sha": "faaf9e19a01ae471d7a53ba9ed727bd792edf77c", + "size": 193, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/README.md?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/news/README.md", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/faaf9e19a01ae471d7a53ba9ed727bd792edf77c", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/news/README.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/README.md?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/faaf9e19a01ae471d7a53ba9ed727bd792edf77c", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/news/README.md" + } + }, + { + "name": "app-1-getting-started", + "path": "news/app-1-getting-started", + "sha": "beba7dde150de79caf412a90ccf10177aef3af92", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-1-getting-started?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-1-getting-started", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/beba7dde150de79caf412a90ccf10177aef3af92", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-1-getting-started?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/beba7dde150de79caf412a90ccf10177aef3af92", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-1-getting-started" + } + }, + { + "name": "app-2-feed-and-query", + "path": "news/app-2-feed-and-query", + "sha": "508dff55513ec03db25765b1022b85f5d5b225c3", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-2-feed-and-query?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-2-feed-and-query", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/508dff55513ec03db25765b1022b85f5d5b225c3", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-2-feed-and-query?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/508dff55513ec03db25765b1022b85f5d5b225c3", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-2-feed-and-query" + } + }, + { + "name": "app-3-searching", + "path": "news/app-3-searching", + "sha": "431c96c3a93e0ac988acb6349456b1b423fb6ff8", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-3-searching?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-3-searching", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/431c96c3a93e0ac988acb6349456b1b423fb6ff8", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-3-searching?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/431c96c3a93e0ac988acb6349456b1b423fb6ff8", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-3-searching" + } + }, + { + "name": "app-5-recommendation", + "path": "news/app-5-recommendation", + "sha": "fdbc92176cf8ee10732f3f14726ab9fba41652e0", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-5-recommendation?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-5-recommendation", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/fdbc92176cf8ee10732f3f14726ab9fba41652e0", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-5-recommendation?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/fdbc92176cf8ee10732f3f14726ab9fba41652e0", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-5-recommendation" + } + }, + { + "name": "app-6-recommendation-with-searchers", + "path": "news/app-6-recommendation-with-searchers", + "sha": "b636cb11c3c3c2f5334b04e151101c100d22c375", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-6-recommendation-with-searchers?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-6-recommendation-with-searchers", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/b636cb11c3c3c2f5334b04e151101c100d22c375", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-6-recommendation-with-searchers?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/b636cb11c3c3c2f5334b04e151101c100d22c375", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-6-recommendation-with-searchers" + } + }, + { + "name": "app-7-parent-child", + "path": "news/app-7-parent-child", + "sha": "56760f75354c43c7cdc387758f6b68659c10087b", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-7-parent-child?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-7-parent-child", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/56760f75354c43c7cdc387758f6b68659c10087b", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/app-7-parent-child?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/56760f75354c43c7cdc387758f6b68659c10087b", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/app-7-parent-child" + } + }, + { + "name": "bin", + "path": "news/bin", + "sha": "7c755f24e4d885d3f6677ec593e46c7d64c377f8", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/bin?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/bin", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/7c755f24e4d885d3f6677ec593e46c7d64c377f8", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/bin?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/7c755f24e4d885d3f6677ec593e46c7d64c377f8", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/bin" + } + }, + { + "name": "doc.json", + "path": "news/doc.json", + "sha": "4f7cad1c86d48ad9b1470c19bcec0a9c136dee11", + "size": 72, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/doc.json?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/news/doc.json", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/4f7cad1c86d48ad9b1470c19bcec0a9c136dee11", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/news/doc.json", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/doc.json?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/4f7cad1c86d48ad9b1470c19bcec0a9c136dee11", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/news/doc.json" + } + }, + { + "name": "requirements.txt", + "path": "news/requirements.txt", + "sha": "21fe4a3bc4ed1fcc2797c8a9f4188e48fed6d4e7", + "size": 37, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/requirements.txt?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/news/requirements.txt", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/21fe4a3bc4ed1fcc2797c8a9f4188e48fed6d4e7", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/news/requirements.txt", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/requirements.txt?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/21fe4a3bc4ed1fcc2797c8a9f4188e48fed6d4e7", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/news/requirements.txt" + } + }, + { + "name": "src", + "path": "news/src", + "sha": "106a0eca050c215f3b6a919640d6b4449d0c0aa5", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/src?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/news/src", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/106a0eca050c215f3b6a919640d6b4449d0c0aa5", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/news/src?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/106a0eca050c215f3b6a919640d6b4449d0c0aa5", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/news/src" + } + } +] diff --git a/client/go/cmd/testdata/sample-apps-vespa-cloud.json b/client/go/cmd/testdata/sample-apps-vespa-cloud.json new file mode 100644 index 00000000000..3aa932c348f --- /dev/null +++ b/client/go/cmd/testdata/sample-apps-vespa-cloud.json @@ -0,0 +1,130 @@ +[ + { + "name": "README.md", + "path": "vespa-cloud/README.md", + "sha": "6405553e7184306476d1e13001aa19558f925158", + "size": 3129, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/README.md?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/blob/master/vespa-cloud/README.md", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/6405553e7184306476d1e13001aa19558f925158", + "download_url": "https://raw.githubusercontent.com/vespa-engine/sample-apps/master/vespa-cloud/README.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/README.md?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/blobs/6405553e7184306476d1e13001aa19558f925158", + "html": "https://github.com/vespa-engine/sample-apps/blob/master/vespa-cloud/README.md" + } + }, + { + "name": "album-recommendation-docproc", + "path": "vespa-cloud/album-recommendation-docproc", + "sha": "e77b300ad64b1c553d066c7840cbb8f555df91cd", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation-docproc?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation-docproc", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/e77b300ad64b1c553d066c7840cbb8f555df91cd", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation-docproc?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/e77b300ad64b1c553d066c7840cbb8f555df91cd", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation-docproc" + } + }, + { + "name": "album-recommendation-prod", + "path": "vespa-cloud/album-recommendation-prod", + "sha": "0944ec03009e38ff1c12be835ca6a0600e6aee93", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation-prod?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation-prod", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/0944ec03009e38ff1c12be835ca6a0600e6aee93", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation-prod?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/0944ec03009e38ff1c12be835ca6a0600e6aee93", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation-prod" + } + }, + { + "name": "album-recommendation-searcher", + "path": "vespa-cloud/album-recommendation-searcher", + "sha": "fd1027d9cd51a2aac9f2220047b5a748ef75d2c1", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation-searcher?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation-searcher", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/fd1027d9cd51a2aac9f2220047b5a748ef75d2c1", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation-searcher?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/fd1027d9cd51a2aac9f2220047b5a748ef75d2c1", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation-searcher" + } + }, + { + "name": "album-recommendation", + "path": "vespa-cloud/album-recommendation", + "sha": "fdb9ffd4dff104a8a603d5ce0ead1bed180f8b80", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/fdb9ffd4dff104a8a603d5ce0ead1bed180f8b80", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/album-recommendation?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/fdb9ffd4dff104a8a603d5ce0ead1bed180f8b80", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/album-recommendation" + } + }, + { + "name": "cord-19-search", + "path": "vespa-cloud/cord-19-search", + "sha": "29a28e0e0455d2bcd5c7bcdcd3c8759455f6bc71", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/cord-19-search?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/cord-19-search", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/29a28e0e0455d2bcd5c7bcdcd3c8759455f6bc71", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/cord-19-search?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/29a28e0e0455d2bcd5c7bcdcd3c8759455f6bc71", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/cord-19-search" + } + }, + { + "name": "joins", + "path": "vespa-cloud/joins", + "sha": "1f3272bfa1c4dd6cb9d26b662bf48de3c05aef04", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/joins?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/joins", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1f3272bfa1c4dd6cb9d26b662bf48de3c05aef04", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/joins?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/1f3272bfa1c4dd6cb9d26b662bf48de3c05aef04", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/joins" + } + }, + { + "name": "vespa-documentation-search", + "path": "vespa-cloud/vespa-documentation-search", + "sha": "9c46d6eb0eef9ce95688d96ef603a5143c3c46c0", + "size": 0, + "url": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/vespa-documentation-search?ref=master", + "html_url": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/vespa-documentation-search", + "git_url": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/9c46d6eb0eef9ce95688d96ef603a5143c3c46c0", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/vespa-engine/sample-apps/contents/vespa-cloud/vespa-documentation-search?ref=master", + "git": "https://api.github.com/repos/vespa-engine/sample-apps/git/trees/9c46d6eb0eef9ce95688d96ef603a5143c3c46c0", + "html": "https://github.com/vespa-engine/sample-apps/tree/master/vespa-cloud/vespa-documentation-search" + } + } +] |