{"action":"created","comment":{"url":"https://api.github.com/repos/opencontainers/image-tools/pulls/comments/84680417","pull_request_review_id":5400900,"id":84680417,"diff_hunk":"@@ -0,0 +1,78 @@\n+// Copyright 2016 The Linux Foundation\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package main\n+\n+import (\n+\t\"fmt\"\n+\t\"os\"\n+\n+\t\"github.com/opencontainers/image-tools/image/refs/layout\"\n+\t\"github.com/spf13/cobra\"\n+\t\"golang.org/x/net/context\"\n+)\n+\n+type listCmd struct {\n+\tpath string\n+}\n+\n+func newListCmd() *cobra.Command {\n+\tstate := &listCmd{}\n+\n+\treturn &cobra.Command{\n+\t\tUse:   \"list PATH\",\n+\t\tShort: \"Return available names from the store.\",\n+\t\tRun:   state.Run,\n+\t}\n+}\n+\n+func (state *listCmd) Run(cmd *cobra.Command, args []string) {\n+\tif len(args) != 1 {\n+\t\tfmt.Fprintln(os.Stderr, \"PATH must be provided\")\n+\t\tif err := cmd.Usage(); err != nil {\n+\t\t\tfmt.Fprintln(os.Stderr, err)\n+\t\t}\n+\t\tos.Exit(1)\n+\t}\n+\n+\tstate.path = args[0]\n+\n+\terr := state.run()\n+\tif err != nil {\n+\t\tfmt.Fprintln(os.Stderr, err)\n+\t\tos.Exit(1)\n+\t}\n+\n+\tos.Exit(0)\n+}\n+\n+func (state *listCmd) run() (err error) {\n+\tctx := context.Background()\n+\n+\tengine, err := layout.NewEngine(ctx, state.path)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tdefer engine.Close()\n+\n+\treturn engine.List(ctx, \"\", -1, 0, state.printName)","path":"cmd/oci-refs/list.go","position":69,"original_position":69,"commit_id":"4dfe06f9cd6c3e0dfb245ddcc12d039722626540","original_commit_id":"4dfe06f9cd6c3e0dfb245ddcc12d039722626540","user":{"login":"cyphar","id":2888411,"avatar_url":"https://avatars.githubusercontent.com/u/2888411?v=3","gravatar_id":"","url":"https://api.github.com/users/cyphar","html_url":"https://github.com/cyphar","followers_url":"https://api.github.com/users/cyphar/followers","following_url":"https://api.github.com/users/cyphar/following{/other_user}","gists_url":"https://api.github.com/users/cyphar/gists{/gist_id}","starred_url":"https://api.github.com/users/cyphar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyphar/subscriptions","organizations_url":"https://api.github.com/users/cyphar/orgs","repos_url":"https://api.github.com/users/cyphar/repos","events_url":"https://api.github.com/users/cyphar/events{/privacy}","received_events_url":"https://api.github.com/users/cyphar/received_events","type":"User","site_admin":false},"body":"For me this fails with\r\n\r\n```\r\n../../.local/src/image-tools/cmd/oci-refs/list.go:69: cannot use state.printName (type func(\"image-tools/vendor/golang.org/x/net/context\".Context, string) error) as type refs.ListNameCallback in argument to engine.List\r\n```\r\n\r\nIsn't Go an amazing language? They didn't have vendoring so people rolled their own, then they implemented an incompatible version that breaks if the wind blows in the wrong direction. Absolutely amazing.","created_at":"2016-10-24T12:56:20Z","updated_at":"2016-10-24T12:58:25Z","html_url":"https://github.com/opencontainers/image-tools/pull/5#discussion_r84680417","pull_request_url":"https://api.github.com/repos/opencontainers/image-tools/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/opencontainers/image-tools/pulls/comments/84680417"},"html":{"href":"https://github.com/opencontainers/image-tools/pull/5#discussion_r84680417"},"pull_request":{"href":"https://api.github.com/repos/opencontainers/image-tools/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/opencontainers/image-tools/pulls/5","id":85538357,"html_url":"https://github.com/opencontainers/image-tools/pull/5","diff_url":"https://github.com/opencontainers/image-tools/pull/5.diff","patch_url":"https://github.com/opencontainers/image-tools/pull/5.patch","issue_url":"https://api.github.com/repos/opencontainers/image-tools/issues/5","number":5,"state":"open","locked":false,"title":"image: Refactor to use cas/ref engines instead of walkers","user":{"login":"wking","id":209920,"avatar_url":"https://avatars.githubusercontent.com/u/209920?v=3","gravatar_id":"","url":"https://api.github.com/users/wking","html_url":"https://github.com/wking","followers_url":"https://api.github.com/users/wking/followers","following_url":"https://api.github.com/users/wking/following{/other_user}","gists_url":"https://api.github.com/users/wking/gists{/gist_id}","starred_url":"https://api.github.com/users/wking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wking/subscriptions","organizations_url":"https://api.github.com/users/wking/orgs","repos_url":"https://api.github.com/users/wking/repos","events_url":"https://api.github.com/users/wking/events{/privacy}","received_events_url":"https://api.github.com/users/wking/received_events","type":"User","site_admin":false},"body":"Abstract out the details of the image-layout format, since the validators and unpackers shouldn't care about that sort of backend stuff. This should make it easy to build backends based on zip files, HTTP, the Docker registry format, etc.\n\nCarried from opencontainers/image-spec#159.  The outstanding issue there was what to do about tar handling.  I'm fine with this PR as it stands, but I've [floated a few alternatives][1] in case the maintainers want to pick an alternative path.\n\n[1]: https://github.com/opencontainers/image-spec/pull/159#issuecomment-244303955","created_at":"2016-09-16T08:53:40Z","updated_at":"2016-10-24T12:58:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdd1c24eb0bf5b215ae394bd0651053b768bd675","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencontainers/image-tools/pulls/5/commits","review_comments_url":"https://api.github.com/repos/opencontainers/image-tools/pulls/5/comments","review_comment_url":"https://api.github.com/repos/opencontainers/image-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencontainers/image-tools/issues/5/comments","statuses_url":"https://api.github.com/repos/opencontainers/image-tools/statuses/4dfe06f9cd6c3e0dfb245ddcc12d039722626540","head":{"label":"wking:cas-api","ref":"cas-api","sha":"4dfe06f9cd6c3e0dfb245ddcc12d039722626540","user":{"login":"wking","id":209920,"avatar_url":"https://avatars.githubusercontent.com/u/209920?v=3","gravatar_id":"","url":"https://api.github.com/users/wking","html_url":"https://github.com/wking","followers_url":"https://api.github.com/users/wking/followers","following_url":"https://api.github.com/users/wking/following{/other_user}","gists_url":"https://api.github.com/users/wking/gists{/gist_id}","starred_url":"https://api.github.com/users/wking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wking/subscriptions","organizations_url":"https://api.github.com/users/wking/orgs","repos_url":"https://api.github.com/users/wking/repos","events_url":"https://api.github.com/users/wking/events{/privacy}","received_events_url":"https://api.github.com/users/wking/received_events","type":"User","site_admin":false},"repo":{"id":68365340,"name":"image-tools","full_name":"wking/image-tools","owner":{"login":"wking","id":209920,"avatar_url":"https://avatars.githubusercontent.com/u/209920?v=3","gravatar_id":"","url":"https://api.github.com/users/wking","html_url":"https://github.com/wking","followers_url":"https://api.github.com/users/wking/followers","following_url":"https://api.github.com/users/wking/following{/other_user}","gists_url":"https://api.github.com/users/wking/gists{/gist_id}","starred_url":"https://api.github.com/users/wking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wking/subscriptions","organizations_url":"https://api.github.com/users/wking/orgs","repos_url":"https://api.github.com/users/wking/repos","events_url":"https://api.github.com/users/wking/events{/privacy}","received_events_url":"https://api.github.com/users/wking/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wking/image-tools","description":"OCI Image Tooling","fork":true,"url":"https://api.github.com/repos/wking/image-tools","forks_url":"https://api.github.com/repos/wking/image-tools/forks","keys_url":"https://api.github.com/repos/wking/image-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wking/image-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wking/image-tools/teams","hooks_url":"https://api.github.com/repos/wking/image-tools/hooks","issue_events_url":"https://api.github.com/repos/wking/image-tools/issues/events{/number}","events_url":"https://api.github.com/repos/wking/image-tools/events","assignees_url":"https://api.github.com/repos/wking/image-tools/assignees{/user}","branches_url":"https://api.github.com/repos/wking/image-tools/branches{/branch}","tags_url":"https://api.github.com/repos/wking/image-tools/tags","blobs_url":"https://api.github.com/repos/wking/image-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wking/image-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wking/image-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/wking/image-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wking/image-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/wking/image-tools/languages","stargazers_url":"https://api.github.com/repos/wking/image-tools/stargazers","contributors_url":"https://api.github.com/repos/wking/image-tools/contributors","subscribers_url":"https://api.github.com/repos/wking/image-tools/subscribers","subscription_url":"https://api.github.com/repos/wking/image-tools/subscription","commits_url":"https://api.github.com/repos/wking/image-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/wking/image-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/wking/image-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/wking/image-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/wking/image-tools/contents/{+path}","compare_url":"https://api.github.com/repos/wking/image-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wking/image-tools/merges","archive_url":"https://api.github.com/repos/wking/image-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wking/image-tools/downloads","issues_url":"https://api.github.com/repos/wking/image-tools/issues{/number}","pulls_url":"https://api.github.com/repos/wking/image-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/wking/image-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/wking/image-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wking/image-tools/labels{/name}","releases_url":"https://api.github.com/repos/wking/image-tools/releases{/id}","deployments_url":"https://api.github.com/repos/wking/image-tools/deployments","created_at":"2016-09-16T08:50:58Z","updated_at":"2016-09-16T08:50:59Z","pushed_at":"2016-10-21T06:37:15Z","git_url":"git://github.com/wking/image-tools.git","ssh_url":"git@github.com:wking/image-tools.git","clone_url":"https://github.com/wking/image-tools.git","svn_url":"https://github.com/wking/image-tools","homepage":"https://opencontainers.org","size":861,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opencontainers:master","ref":"master","sha":"f24d27b5e62acb27a688e36cbac13902bfb75234","user":{"login":"opencontainers","id":12563465,"avatar_url":"https://avatars.githubusercontent.com/u/12563465?v=3","gravatar_id":"","url":"https://api.github.com/users/opencontainers","html_url":"https://github.com/opencontainers","followers_url":"https://api.github.com/users/opencontainers/followers","following_url":"https://api.github.com/users/opencontainers/following{/other_user}","gists_url":"https://api.github.com/users/opencontainers/gists{/gist_id}","starred_url":"https://api.github.com/users/opencontainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencontainers/subscriptions","organizations_url":"https://api.github.com/users/opencontainers/orgs","repos_url":"https://api.github.com/users/opencontainers/repos","events_url":"https://api.github.com/users/opencontainers/events{/privacy}","received_events_url":"https://api.github.com/users/opencontainers/received_events","type":"Organization","site_admin":false},"repo":{"id":67737264,"name":"image-tools","full_name":"opencontainers/image-tools","owner":{"login":"opencontainers","id":12563465,"avatar_url":"https://avatars.githubusercontent.com/u/12563465?v=3","gravatar_id":"","url":"https://api.github.com/users/opencontainers","html_url":"https://github.com/opencontainers","followers_url":"https://api.github.com/users/opencontainers/followers","following_url":"https://api.github.com/users/opencontainers/following{/other_user}","gists_url":"https://api.github.com/users/opencontainers/gists{/gist_id}","starred_url":"https://api.github.com/users/opencontainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencontainers/subscriptions","organizations_url":"https://api.github.com/users/opencontainers/orgs","repos_url":"https://api.github.com/users/opencontainers/repos","events_url":"https://api.github.com/users/opencontainers/events{/privacy}","received_events_url":"https://api.github.com/users/opencontainers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencontainers/image-tools","description":"OCI Image Tooling","fork":false,"url":"https://api.github.com/repos/opencontainers/image-tools","forks_url":"https://api.github.com/repos/opencontainers/image-tools/forks","keys_url":"https://api.github.com/repos/opencontainers/image-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencontainers/image-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencontainers/image-tools/teams","hooks_url":"https://api.github.com/repos/opencontainers/image-tools/hooks","issue_events_url":"https://api.github.com/repos/opencontainers/image-tools/issues/events{/number}","events_url":"https://api.github.com/repos/opencontainers/image-tools/events","assignees_url":"https://api.github.com/repos/opencontainers/image-tools/assignees{/user}","branches_url":"https://api.github.com/repos/opencontainers/image-tools/branches{/branch}","tags_url":"https://api.github.com/repos/opencontainers/image-tools/tags","blobs_url":"https://api.github.com/repos/opencontainers/image-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencontainers/image-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencontainers/image-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencontainers/image-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencontainers/image-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/opencontainers/image-tools/languages","stargazers_url":"https://api.github.com/repos/opencontainers/image-tools/stargazers","contributors_url":"https://api.github.com/repos/opencontainers/image-tools/contributors","subscribers_url":"https://api.github.com/repos/opencontainers/image-tools/subscribers","subscription_url":"https://api.github.com/repos/opencontainers/image-tools/subscription","commits_url":"https://api.github.com/repos/opencontainers/image-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencontainers/image-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencontainers/image-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencontainers/image-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencontainers/image-tools/contents/{+path}","compare_url":"https://api.github.com/repos/opencontainers/image-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencontainers/image-tools/merges","archive_url":"https://api.github.com/repos/opencontainers/image-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencontainers/image-tools/downloads","issues_url":"https://api.github.com/repos/opencontainers/image-tools/issues{/number}","pulls_url":"https://api.github.com/repos/opencontainers/image-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/opencontainers/image-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/opencontainers/image-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencontainers/image-tools/labels{/name}","releases_url":"https://api.github.com/repos/opencontainers/image-tools/releases{/id}","deployments_url":"https://api.github.com/repos/opencontainers/image-tools/deployments","created_at":"2016-09-08T20:19:15Z","updated_at":"2016-10-24T11:33:08Z","pushed_at":"2016-10-24T12:12:11Z","git_url":"git://github.com/opencontainers/image-tools.git","ssh_url":"git@github.com:opencontainers/image-tools.git","clone_url":"https://github.com/opencontainers/image-tools.git","svn_url":"https://github.com/opencontainers/image-tools","homepage":"https://opencontainers.org","size":907,"stargazers_count":10,"watchers_count":10,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":34,"forks":12,"open_issues":34,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencontainers/image-tools/pulls/5"},"html":{"href":"https://github.com/opencontainers/image-tools/pull/5"},"issue":{"href":"https://api.github.com/repos/opencontainers/image-tools/issues/5"},"comments":{"href":"https://api.github.com/repos/opencontainers/image-tools/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/opencontainers/image-tools/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/opencontainers/image-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencontainers/image-tools/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/opencontainers/image-tools/statuses/4dfe06f9cd6c3e0dfb245ddcc12d039722626540"}}}}
{"actor":{"display_login":"cyphar"}}