{"action":"created","comment":{"url":"https://api.github.com/repos/clearlinux/diva/pulls/comments/199867428","pull_request_review_id":134071319,"id":199867428,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTg2NzQyOA==","diff_hunk":"@@ -0,0 +1,183 @@\n+// Copyright © 2018 Intel Corporation\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 cmd\n+\n+import (\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"os\"\n+\t\"strings\"\n+\n+\t\"github.com/clearlinux/diva/bundle\"\n+\t\"github.com/clearlinux/diva/diva\"\n+\t\"github.com/clearlinux/diva/internal/config\"\n+\t\"github.com/clearlinux/diva/internal/helpers\"\n+\t\"github.com/clearlinux/diva/pkginfo\"\n+\t\"github.com/spf13/cobra\"\n+)\n+\n+func init() {\n+\tvar err error\n+\tc, err = config.ReadConfig(\"\")\n+\tif err != nil {\n+\t\thelpers.Fail(err)\n+\t}\n+\n+\tcheckCmd.AddCommand(verifyBundlesCmd)\n+\tverifyBundlesCmd.Flags().StringVarP(&bundleFlags.repoPath, \"path\", \"p\", c.UpstreamURL, \"Path to repo\")\n+\tverifyBundlesCmd.Flags().StringVarP(&bundleFlags.repoName, \"reponame\", \"n\", \"clear\", \"Name of repo\")\n+\tverifyBundlesCmd.Flags().UintVarP(&bundleFlags.version, \"version\", \"v\", 0, \"Version to check\")\n+\tverifyBundlesCmd.Flags().StringVarP(&bundleFlags.bundle, \"bundle\", \"b\", \"\", \"Bundle to check\")\n+}\n+\n+type bundleCmdFlags struct {\n+\trepoPath string\n+\trepoName string\n+\tversion  uint\n+\tbundle   string\n+}\n+\n+// flags passed in as args\n+var bundleFlags bundleCmdFlags\n+\n+// config object used by GetUpstreamRepoFiles and called functions\n+var c *config.Config\n+\n+var verifyBundlesCmd = &cobra.Command{\n+\tUse:   \"bundles\",\n+\tShort: \"Verify bundle definitions are complete, and packages exist within repo.\",\n+\tLong: `Verify bundles are complete by checking that all named packages within\n+bundle and package bundle files can be found in the configured repo. A <version>\n+or <path> must be passed, and will run against all bundles or a <bundle>. An\n+optional <reponame> argument may also be passed; the default being \"clear\". This\n+check also ensures no include loops exist, and that the bundle filename matches\n+the bundle definition header title.`,\n+\tRun: runVerifyBundle,\n+}\n+\n+func runVerifyBundle(cmd *cobra.Command, args []string) {\n+\n+\tif bundleFlags.version == 0 && bundleFlags.repoPath == c.UpstreamURL {\n+\t\thelpers.Fail(errors.New(\"must supply either --version or --path argument\"))\n+\t}\n+\n+\trepo := pkginfo.Repo{\n+\t\tURI:     fmt.Sprintf(\"%s/releases/%d/clear/x86_64/os/\", bundleFlags.repoPath, bundleFlags.version),\n+\t\tName:    bundleFlags.repoName,\n+\t\tVersion: bundleFlags.version,\n+\t\tType:    \"B\",\n+\t}\n+\n+\tif bundleFlags.version == 0 {\n+\t\trepo.URI = fmt.Sprintf(\"%s/mash/clear/x86_64/os/\", bundleFlags.repoPath)\n+\t}\n+\n+\tif err := pkginfo.ImportAllRPMs(&repo); err != nil {\n+\t\thelpers.Fail(err)\n+\t}\n+\n+\tresult := &diva.Results{Name: \"bundle-verify\"}\n+\tresult, bundles := checkAndGetBundleDefinitions(result)","path":"cmd/bundle-verify.go","position":92,"original_position":92,"commit_id":"98afc028632ae1fd1f1b87f8f45cab361d70a5ba","original_commit_id":"98afc028632ae1fd1f1b87f8f45cab361d70a5ba","user":{"login":"matthewrsj","id":12090084,"node_id":"MDQ6VXNlcjEyMDkwMDg0","avatar_url":"https://avatars0.githubusercontent.com/u/12090084?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewrsj","html_url":"https://github.com/matthewrsj","followers_url":"https://api.github.com/users/matthewrsj/followers","following_url":"https://api.github.com/users/matthewrsj/following{/other_user}","gists_url":"https://api.github.com/users/matthewrsj/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewrsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewrsj/subscriptions","organizations_url":"https://api.github.com/users/matthewrsj/orgs","repos_url":"https://api.github.com/users/matthewrsj/repos","events_url":"https://api.github.com/users/matthewrsj/events{/privacy}","received_events_url":"https://api.github.com/users/matthewrsj/received_events","type":"User","site_admin":false},"body":"you don't need to actually return `result` from these functions, you can just modify them in the function itself.","created_at":"2018-07-03T16:15:06Z","updated_at":"2018-07-03T16:15:07Z","html_url":"https://github.com/clearlinux/diva/pull/26#discussion_r199867428","pull_request_url":"https://api.github.com/repos/clearlinux/diva/pulls/26","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/clearlinux/diva/pulls/comments/199867428"},"html":{"href":"https://github.com/clearlinux/diva/pull/26#discussion_r199867428"},"pull_request":{"href":"https://api.github.com/repos/clearlinux/diva/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/clearlinux/diva/pulls/26","id":197851979,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3ODUxOTc5","html_url":"https://github.com/clearlinux/diva/pull/26","diff_url":"https://github.com/clearlinux/diva/pull/26.diff","patch_url":"https://github.com/clearlinux/diva/pull/26.patch","issue_url":"https://api.github.com/repos/clearlinux/diva/issues/26","number":26,"state":"open","locked":false,"title":"Bundle verify - DO NOT MERGE","user":{"login":"Gabib32","id":8284020,"node_id":"MDQ6VXNlcjgyODQwMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/8284020?v=4","gravatar_id":"","url":"https://api.github.com/users/Gabib32","html_url":"https://github.com/Gabib32","followers_url":"https://api.github.com/users/Gabib32/followers","following_url":"https://api.github.com/users/Gabib32/following{/other_user}","gists_url":"https://api.github.com/users/Gabib32/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabib32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabib32/subscriptions","organizations_url":"https://api.github.com/users/Gabib32/orgs","repos_url":"https://api.github.com/users/Gabib32/repos","events_url":"https://api.github.com/users/Gabib32/events{/privacy}","received_events_url":"https://api.github.com/users/Gabib32/received_events","type":"User","site_admin":false},"body":"A first attempt at bundle-verify, still need to add package deletes, and passing in one bundle, but wanted to be sure I was on the right track first. ","created_at":"2018-06-27T20:59:46Z","updated_at":"2018-07-03T16:15:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"418574b420770cc818f20fc3e44ba9d90e5d54ab","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/clearlinux/diva/pulls/26/commits","review_comments_url":"https://api.github.com/repos/clearlinux/diva/pulls/26/comments","review_comment_url":"https://api.github.com/repos/clearlinux/diva/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clearlinux/diva/issues/26/comments","statuses_url":"https://api.github.com/repos/clearlinux/diva/statuses/98afc028632ae1fd1f1b87f8f45cab361d70a5ba","head":{"label":"Gabib32:bundle-verify","ref":"bundle-verify","sha":"98afc028632ae1fd1f1b87f8f45cab361d70a5ba","user":{"login":"Gabib32","id":8284020,"node_id":"MDQ6VXNlcjgyODQwMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/8284020?v=4","gravatar_id":"","url":"https://api.github.com/users/Gabib32","html_url":"https://github.com/Gabib32","followers_url":"https://api.github.com/users/Gabib32/followers","following_url":"https://api.github.com/users/Gabib32/following{/other_user}","gists_url":"https://api.github.com/users/Gabib32/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabib32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabib32/subscriptions","organizations_url":"https://api.github.com/users/Gabib32/orgs","repos_url":"https://api.github.com/users/Gabib32/repos","events_url":"https://api.github.com/users/Gabib32/events{/privacy}","received_events_url":"https://api.github.com/users/Gabib32/received_events","type":"User","site_admin":false},"repo":{"id":138335271,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgzMzUyNzE=","name":"diva","full_name":"Gabib32/diva","owner":{"login":"Gabib32","id":8284020,"node_id":"MDQ6VXNlcjgyODQwMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/8284020?v=4","gravatar_id":"","url":"https://api.github.com/users/Gabib32","html_url":"https://github.com/Gabib32","followers_url":"https://api.github.com/users/Gabib32/followers","following_url":"https://api.github.com/users/Gabib32/following{/other_user}","gists_url":"https://api.github.com/users/Gabib32/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabib32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabib32/subscriptions","organizations_url":"https://api.github.com/users/Gabib32/orgs","repos_url":"https://api.github.com/users/Gabib32/repos","events_url":"https://api.github.com/users/Gabib32/events{/privacy}","received_events_url":"https://api.github.com/users/Gabib32/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gabib32/diva","description":null,"fork":true,"url":"https://api.github.com/repos/Gabib32/diva","forks_url":"https://api.github.com/repos/Gabib32/diva/forks","keys_url":"https://api.github.com/repos/Gabib32/diva/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gabib32/diva/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gabib32/diva/teams","hooks_url":"https://api.github.com/repos/Gabib32/diva/hooks","issue_events_url":"https://api.github.com/repos/Gabib32/diva/issues/events{/number}","events_url":"https://api.github.com/repos/Gabib32/diva/events","assignees_url":"https://api.github.com/repos/Gabib32/diva/assignees{/user}","branches_url":"https://api.github.com/repos/Gabib32/diva/branches{/branch}","tags_url":"https://api.github.com/repos/Gabib32/diva/tags","blobs_url":"https://api.github.com/repos/Gabib32/diva/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gabib32/diva/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gabib32/diva/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gabib32/diva/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gabib32/diva/statuses/{sha}","languages_url":"https://api.github.com/repos/Gabib32/diva/languages","stargazers_url":"https://api.github.com/repos/Gabib32/diva/stargazers","contributors_url":"https://api.github.com/repos/Gabib32/diva/contributors","subscribers_url":"https://api.github.com/repos/Gabib32/diva/subscribers","subscription_url":"https://api.github.com/repos/Gabib32/diva/subscription","commits_url":"https://api.github.com/repos/Gabib32/diva/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gabib32/diva/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gabib32/diva/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gabib32/diva/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gabib32/diva/contents/{+path}","compare_url":"https://api.github.com/repos/Gabib32/diva/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gabib32/diva/merges","archive_url":"https://api.github.com/repos/Gabib32/diva/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gabib32/diva/downloads","issues_url":"https://api.github.com/repos/Gabib32/diva/issues{/number}","pulls_url":"https://api.github.com/repos/Gabib32/diva/pulls{/number}","milestones_url":"https://api.github.com/repos/Gabib32/diva/milestones{/number}","notifications_url":"https://api.github.com/repos/Gabib32/diva/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gabib32/diva/labels{/name}","releases_url":"https://api.github.com/repos/Gabib32/diva/releases{/id}","deployments_url":"https://api.github.com/repos/Gabib32/diva/deployments","created_at":"2018-06-22T18:24:50Z","updated_at":"2018-06-29T23:16:30Z","pushed_at":"2018-07-03T00:23:59Z","git_url":"git://github.com/Gabib32/diva.git","ssh_url":"git@github.com:Gabib32/diva.git","clone_url":"https://github.com/Gabib32/diva.git","svn_url":"https://github.com/Gabib32/diva","homepage":null,"size":88,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"clearlinux:master","ref":"master","sha":"4e43824cf046fdfea9864af3a21404769f1ff7e9","user":{"login":"clearlinux","id":12545216,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNTQ1MjE2","avatar_url":"https://avatars2.githubusercontent.com/u/12545216?v=4","gravatar_id":"","url":"https://api.github.com/users/clearlinux","html_url":"https://github.com/clearlinux","followers_url":"https://api.github.com/users/clearlinux/followers","following_url":"https://api.github.com/users/clearlinux/following{/other_user}","gists_url":"https://api.github.com/users/clearlinux/gists{/gist_id}","starred_url":"https://api.github.com/users/clearlinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearlinux/subscriptions","organizations_url":"https://api.github.com/users/clearlinux/orgs","repos_url":"https://api.github.com/users/clearlinux/repos","events_url":"https://api.github.com/users/clearlinux/events{/privacy}","received_events_url":"https://api.github.com/users/clearlinux/received_events","type":"Organization","site_admin":false},"repo":{"id":133871444,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM4NzE0NDQ=","name":"diva","full_name":"clearlinux/diva","owner":{"login":"clearlinux","id":12545216,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNTQ1MjE2","avatar_url":"https://avatars2.githubusercontent.com/u/12545216?v=4","gravatar_id":"","url":"https://api.github.com/users/clearlinux","html_url":"https://github.com/clearlinux","followers_url":"https://api.github.com/users/clearlinux/followers","following_url":"https://api.github.com/users/clearlinux/following{/other_user}","gists_url":"https://api.github.com/users/clearlinux/gists{/gist_id}","starred_url":"https://api.github.com/users/clearlinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearlinux/subscriptions","organizations_url":"https://api.github.com/users/clearlinux/orgs","repos_url":"https://api.github.com/users/clearlinux/repos","events_url":"https://api.github.com/users/clearlinux/events{/privacy}","received_events_url":"https://api.github.com/users/clearlinux/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clearlinux/diva","description":null,"fork":false,"url":"https://api.github.com/repos/clearlinux/diva","forks_url":"https://api.github.com/repos/clearlinux/diva/forks","keys_url":"https://api.github.com/repos/clearlinux/diva/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clearlinux/diva/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clearlinux/diva/teams","hooks_url":"https://api.github.com/repos/clearlinux/diva/hooks","issue_events_url":"https://api.github.com/repos/clearlinux/diva/issues/events{/number}","events_url":"https://api.github.com/repos/clearlinux/diva/events","assignees_url":"https://api.github.com/repos/clearlinux/diva/assignees{/user}","branches_url":"https://api.github.com/repos/clearlinux/diva/branches{/branch}","tags_url":"https://api.github.com/repos/clearlinux/diva/tags","blobs_url":"https://api.github.com/repos/clearlinux/diva/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clearlinux/diva/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clearlinux/diva/git/refs{/sha}","trees_url":"https://api.github.com/repos/clearlinux/diva/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clearlinux/diva/statuses/{sha}","languages_url":"https://api.github.com/repos/clearlinux/diva/languages","stargazers_url":"https://api.github.com/repos/clearlinux/diva/stargazers","contributors_url":"https://api.github.com/repos/clearlinux/diva/contributors","subscribers_url":"https://api.github.com/repos/clearlinux/diva/subscribers","subscription_url":"https://api.github.com/repos/clearlinux/diva/subscription","commits_url":"https://api.github.com/repos/clearlinux/diva/commits{/sha}","git_commits_url":"https://api.github.com/repos/clearlinux/diva/git/commits{/sha}","comments_url":"https://api.github.com/repos/clearlinux/diva/comments{/number}","issue_comment_url":"https://api.github.com/repos/clearlinux/diva/issues/comments{/number}","contents_url":"https://api.github.com/repos/clearlinux/diva/contents/{+path}","compare_url":"https://api.github.com/repos/clearlinux/diva/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clearlinux/diva/merges","archive_url":"https://api.github.com/repos/clearlinux/diva/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clearlinux/diva/downloads","issues_url":"https://api.github.com/repos/clearlinux/diva/issues{/number}","pulls_url":"https://api.github.com/repos/clearlinux/diva/pulls{/number}","milestones_url":"https://api.github.com/repos/clearlinux/diva/milestones{/number}","notifications_url":"https://api.github.com/repos/clearlinux/diva/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clearlinux/diva/labels{/name}","releases_url":"https://api.github.com/repos/clearlinux/diva/releases{/id}","deployments_url":"https://api.github.com/repos/clearlinux/diva/deployments","created_at":"2018-05-17T21:42:55Z","updated_at":"2018-06-29T23:53:18Z","pushed_at":"2018-07-03T16:07:36Z","git_url":"git://github.com/clearlinux/diva.git","ssh_url":"git@github.com:clearlinux/diva.git","clone_url":"https://github.com/clearlinux/diva.git","svn_url":"https://github.com/clearlinux/diva","homepage":null,"size":83,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clearlinux/diva/pulls/26"},"html":{"href":"https://github.com/clearlinux/diva/pull/26"},"issue":{"href":"https://api.github.com/repos/clearlinux/diva/issues/26"},"comments":{"href":"https://api.github.com/repos/clearlinux/diva/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/clearlinux/diva/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/clearlinux/diva/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clearlinux/diva/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/clearlinux/diva/statuses/98afc028632ae1fd1f1b87f8f45cab361d70a5ba"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"matthewrsj"}}