{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/152565632","pull_request_review_id":78444864,"id":152565632,"diff_hunk":"@@ -0,0 +1,156 @@\n+package io.mesosphere.types.dtr;\n+\n+import io.mesosphere.types.dtr.compiler.impl.StringTemplateEngine;\n+import io.mesosphere.types.dtr.compiler.internal.CompiledFragment;\n+import io.mesosphere.types.dtr.compiler.internal.CompilerEngine;\n+import io.mesosphere.types.dtr.compiler.internal.CompiledFragmentType;\n+import io.mesosphere.types.dtr.compiler.internal.arguments.FileObjectTypeFragmentArguments;\n+import io.mesosphere.types.dtr.models.internal.Type;\n+import io.mesosphere.types.dtr.models.internal.TypeScope;\n+import io.mesosphere.types.dtr.models.internal.TypeScopeRelation;\n+import io.mesosphere.types.dtr.models.internal.scopes.FileScope;\n+import io.mesosphere.types.dtr.models.internal.scopes.GlobalScope;\n+import io.mesosphere.types.dtr.models.internal.types.*;\n+import io.mesosphere.types.dtr.models.parser.RAMLParser;\n+import io.mesosphere.types.dtr.repository.internal.Repository;\n+import io.mesosphere.types.dtr.repository.internal.RepositoryView;\n+import org.apache.commons.cli.*;\n+\n+import java.io.FileOutputStream;\n+import java.io.IOException;\n+import java.io.PrintStream;\n+import java.util.List;\n+import java.util.Map;\n+\n+public class Main {\n+\n+    /**\n+     * Entry point\n+     * @param args\n+     */\n+    public static void main(String[] args) throws ParseException {\n+        Options options = new Options();\n+        CommandLineParser parser = new DefaultParser();\n+\n+        // Prepare options\n+        Option o_help = Option.builder(\"h\")\n+                .longOpt(\"help\")\n+                .desc(\"Print this help message\")\n+                .argName(\"help\")\n+                .build();\n+\n+        Option o_project = Option.builder(\"p\")\n+                .longOpt(\"project\")\n+                .required()\n+                .desc(\"The project name to target\")\n+                .hasArg()\n+                .argName(\"project\")\n+                .build();\n+\n+        Option o_version = Option.builder(\"v\")\n+                .longOpt(\"version\")\n+                .required()\n+                .desc(\"The project version to use\")\n+                .hasArg()\n+                .argName(\"version\")\n+                .build();\n+\n+        Option o_repo = Option.builder(\"r\")\n+                .longOpt(\"repo\")\n+                .required()\n+                .desc(\"The repository URI to use\")","path":"type-generator/src/main/java/io/mesosphere/types/dtr/Main.java","position":61,"original_position":61,"commit_id":"115c50b473d272a33b63cda7462acaeb84aeb9b3","original_commit_id":"115c50b473d272a33b63cda7462acaeb84aeb9b3","user":{"login":"jeschkies","id":2418440,"avatar_url":"https://avatars3.githubusercontent.com/u/2418440?v=4","gravatar_id":"","url":"https://api.github.com/users/jeschkies","html_url":"https://github.com/jeschkies","followers_url":"https://api.github.com/users/jeschkies/followers","following_url":"https://api.github.com/users/jeschkies/following{/other_user}","gists_url":"https://api.github.com/users/jeschkies/gists{/gist_id}","starred_url":"https://api.github.com/users/jeschkies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeschkies/subscriptions","organizations_url":"https://api.github.com/users/jeschkies/orgs","repos_url":"https://api.github.com/users/jeschkies/repos","events_url":"https://api.github.com/users/jeschkies/events{/privacy}","received_events_url":"https://api.github.com/users/jeschkies/received_events","type":"User","site_admin":false},"body":"Is this just a folder? Could we postpone the support for repositories? This seems like a door that says open even if we won't support repositories for now. Let's keep things simple.","created_at":"2017-11-22T13:36:09Z","updated_at":"2017-11-22T13:58:01Z","html_url":"https://github.com/mesosphere/marathon/pull/5759#discussion_r152565632","pull_request_url":"https://api.github.com/repos/mesosphere/marathon/pulls/5759","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/152565632"},"html":{"href":"https://github.com/mesosphere/marathon/pull/5759#discussion_r152565632"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/5759"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/5759","id":153930847,"html_url":"https://github.com/mesosphere/marathon/pull/5759","diff_url":"https://github.com/mesosphere/marathon/pull/5759.diff","patch_url":"https://github.com/mesosphere/marathon/pull/5759.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/5759","number":5759,"state":"open","locked":false,"title":"Introduce dcos-type-generator ","user":{"login":"wavesoft","id":883486,"avatar_url":"https://avatars2.githubusercontent.com/u/883486?v=4","gravatar_id":"","url":"https://api.github.com/users/wavesoft","html_url":"https://github.com/wavesoft","followers_url":"https://api.github.com/users/wavesoft/followers","following_url":"https://api.github.com/users/wavesoft/following{/other_user}","gists_url":"https://api.github.com/users/wavesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/wavesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavesoft/subscriptions","organizations_url":"https://api.github.com/users/wavesoft/orgs","repos_url":"https://api.github.com/users/wavesoft/repos","events_url":"https://api.github.com/users/wavesoft/events{/privacy}","received_events_url":"https://api.github.com/users/wavesoft/received_events","type":"User","site_admin":false},"body":"This PR brings in the `dcos-type-generator` project that can read RAML files and generate code based on [StringTemplate4](https://github.com/antlr/stringtemplate4/blob/master/doc/cheatsheet.md) templates.\r\n\r\n**Note: The StringTemplate that generates the code will come as a separate PR**\r\n_Note2: This project was added as a git sub-tree_\r\n\r\nYou can consider this \"fluffy\" I guess 👼  , as long as you have something like this in mind:\r\n\r\n![Fluffy](http://www.bunnyslippers.com/blog/wp-content/uploads/2013/10/fluffiest-rabbit.png)\r\n\r\nOr you could [browse this on it's own repository](https://github.com/mesosphere/dcos-type-generator)\r\n\r\n## A few information for the reviewers:\r\n\r\n1. The code is broken down semantically into three packages:\r\n    1. Filesystem Access `io.mesosphere.types.dtr.repository`\r\n    2. Internal type representation `io.mesosphere.types.dtr.models`\r\n    3. Compiler interface `io.mesosphere.types.dtr.compiler`\r\n2. Regarding filesystem access:\r\n    1. There is an implementation of accessing the local filesystem in `LocalRepository`\r\n    2. You can see an example of a local repository in `src/test/java/files/testrepo`\r\n3. Regarding internal type representation:\r\n    1. Check this document : https://github.com/mesosphere/dcos-type-generator/blob/master/doc/Internal%20Types.md\r\n    2. When parsing all types are created asynchronously using `CompletableFuture`s, since we could have circular dependencies.\r\n    3. The entry point for the RAML parsing is in `models.parser.RAMLParser` and in particular the `loadProjectTypes` method.\r\n4. Regarding compiler interface:\r\n    1. There is an abstraction between the internal types and the values passed as arguments to the StringTemplate engine. It can be found in `compiler.internal.arguments`\r\n    2. The StringTemplate engine will automatically map getters into properties. For example when you do `<type.id>` the engine will call the `getId()` method in `TypeArguments`.\r\n    3. The compiler interface is described in `compiler.internal.CompilerEngine`\r\n\r\n## How to review\r\n\r\nI would recommend:\r\n\r\n1. Do the obvious and check if tests pass with `mvn test`\r\n2. Follow the data flow, starting from the `Main` class.\r\n    1. Check how files are accessed through the `Repository` interface\r\n    2. Check how they are loaded into the internal structures using the `RAMLParser`\r\n    3. Check how the `CompilerEngine` is instantiated and invoked\r\n    4. Then jump into the `*Arguments` classes and see what's available in the templates\r\n    5. Then jump into the `StringTemplateEngineTest` and try to fiddle with your own changes\r\n","created_at":"2017-11-21T16:01:36Z","updated_at":"2017-11-22T13:58:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f19527fb3ab050d6b5a8f0e1aea8b920f6aa6358","assignee":null,"assignees":[],"requested_reviewers":[{"login":"timcharper","id":183,"avatar_url":"https://avatars1.githubusercontent.com/u/183?v=4","gravatar_id":"","url":"https://api.github.com/users/timcharper","html_url":"https://github.com/timcharper","followers_url":"https://api.github.com/users/timcharper/followers","following_url":"https://api.github.com/users/timcharper/following{/other_user}","gists_url":"https://api.github.com/users/timcharper/gists{/gist_id}","starred_url":"https://api.github.com/users/timcharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timcharper/subscriptions","organizations_url":"https://api.github.com/users/timcharper/orgs","repos_url":"https://api.github.com/users/timcharper/repos","events_url":"https://api.github.com/users/timcharper/events{/privacy}","received_events_url":"https://api.github.com/users/timcharper/received_events","type":"User","site_admin":false},{"login":"jdef","id":2348332,"avatar_url":"https://avatars3.githubusercontent.com/u/2348332?v=4","gravatar_id":"","url":"https://api.github.com/users/jdef","html_url":"https://github.com/jdef","followers_url":"https://api.github.com/users/jdef/followers","following_url":"https://api.github.com/users/jdef/following{/other_user}","gists_url":"https://api.github.com/users/jdef/gists{/gist_id}","starred_url":"https://api.github.com/users/jdef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdef/subscriptions","organizations_url":"https://api.github.com/users/jdef/orgs","repos_url":"https://api.github.com/users/jdef/repos","events_url":"https://api.github.com/users/jdef/events{/privacy}","received_events_url":"https://api.github.com/users/jdef/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon/pulls/5759/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon/pulls/5759/comments","review_comment_url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/5759/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/115c50b473d272a33b63cda7462acaeb84aeb9b3","head":{"label":"mesosphere:ic/type-generator/import","ref":"ic/type-generator/import","sha":"115c50b473d272a33b63cda7462acaeb84aeb9b3","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"name":"marathon","full_name":"mesosphere/marathon","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2017-11-21T22:40:54Z","pushed_at":"2017-11-22T13:39:22Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":32540,"stargazers_count":3503,"watchers_count":3503,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":815,"mirror_url":null,"archived":false,"open_issues_count":16,"forks":815,"open_issues":16,"watchers":3503,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"3618983bb5fb95631f4d05afad6f1c5f98684211","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"name":"marathon","full_name":"mesosphere/marathon","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2017-11-21T22:40:54Z","pushed_at":"2017-11-22T13:39:22Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":32540,"stargazers_count":3503,"watchers_count":3503,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":815,"mirror_url":null,"archived":false,"open_issues_count":16,"forks":815,"open_issues":16,"watchers":3503,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/5759"},"html":{"href":"https://github.com/mesosphere/marathon/pull/5759"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/5759"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/5759/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/5759/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/5759/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon/statuses/115c50b473d272a33b63cda7462acaeb84aeb9b3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jeschkies"}}