{"action":"created","comment":{"url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/comments/235795247","pull_request_review_id":177745520,"id":235795247,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTc5NTI0Nw==","diff_hunk":"@@ -0,0 +1,159 @@\n+package controllers\n+\n+\n+import io.swagger.annotations._\n+import javax.inject._\n+import models._\n+import play.api.libs.json._\n+import play.api.mvc._\n+import repository._\n+import services._\n+\n+import scala.concurrent._\n+\n+@Api(value = \"ProjectController\", produces = \"application/json\")\n+class ProjectController @Inject()(projectRepository: ProjectRepository, projectService: ProjectService, hierarchyRepository: HierarchyRepository, branchRepository: BranchRepository, criteriaService: CriteriaService)(implicit ec: ExecutionContext) extends InjectedController {\n+\n+  implicit val branchFormat = Json.format[Branch]\n+  implicit val hierarchyFormat = Json.format[HierarchyNode]\n+  implicit val projectFormat = Json.format[Project]\n+\n+  @ApiOperation(value = \"Register a new project\", code = 201, response = classOf[Project])\n+  @ApiImplicitParams(Array(new ApiImplicitParam(value = \"The project to register\", required = true, dataType = \"models.Project\", paramType = \"body\")))\n+  @ApiResponses(Array(new ApiResponse(code = 400, message = \"Incorrect json\")))\n+  def registerProject(): Action[Project] = Action(parse.json[Project]) { implicit request =>\n+    val project = request.body\n+\n+    if (projectRepository.existsById(project.id)) {\n+      BadRequest\n+\n+    } else {\n+      val savedProject = projectRepository.save(project)\n+\n+      projectService.checkoutRemoteBranches(savedProject)\n+\n+      criteriaService.refreshCache()\n+\n+      Created(Json.toJson(savedProject))\n+    }\n+  }\n+\n+  @ApiOperation(value = \"Get all projects\", response = classOf[Project], responseContainer = \"list\")\n+  def getAllProjects(): Action[AnyContent] = Action {\n+    Ok(Json.toJson(projectRepository.findAll()))\n+  }\n+\n+  @ApiOperation(value = \"Get a project\", response = classOf[Project])\n+  @ApiResponses(Array(new ApiResponse(code = 404, message = \"Project not found\")))\n+  def getProject(@ApiParam(\"Project id\") id: String): Action[AnyContent] = Action {","path":"app/controllers/ProjectController.scala","position":48,"original_position":48,"commit_id":"a1e83127e1de7253e961736658a700b6e1661993","original_commit_id":"a1e83127e1de7253e961736658a700b6e1661993","user":{"login":"sonarcloud[bot]","id":39514782,"node_id":"MDM6Qm90Mzk1MTQ3ODI=","avatar_url":"https://avatars2.githubusercontent.com/in/12526?v=4","gravatar_id":"","url":"https://api.github.com/users/sonarcloud%5Bbot%5D","html_url":"https://github.com/apps/sonarcloud","followers_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/followers","following_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/repos","events_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"![Code Smell](https://sonarsource.github.io/sonar-github/code_smell.png 'Code Smell') Code Smell: Define a constant instead of duplicating this literal \"Project id\" 5 times. ([scala:S1192](https://sonarcloud.io/organizations/kelkoo/rules#rule_key=scala%3AS1192))\n\n[See it in SonarCloud](https://sonarcloud.io/project/issues?id=theGardener&pullRequest=30&issues=AWc2sahz0POp3Yiza5Qx&open=AWc2sahz0POp3Yiza5Qx)\n\n[ISSUE_KEY]: AWc2sahz0POp3Yiza5Qx","created_at":"2018-11-22T17:42:47Z","updated_at":"2018-11-22T17:42:49Z","html_url":"https://github.com/KelkooGroup/theGardener/pull/30#discussion_r235795247","pull_request_url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/comments/235795247"},"html":{"href":"https://github.com/KelkooGroup/theGardener/pull/30#discussion_r235795247"},"pull_request":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30","id":232683273,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNjgzMjcz","html_url":"https://github.com/KelkooGroup/theGardener/pull/30","diff_url":"https://github.com/KelkooGroup/theGardener/pull/30.diff","patch_url":"https://github.com/KelkooGroup/theGardener/pull/30.patch","issue_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues/30","number":30,"state":"open","locked":false,"title":"Generate documentation","user":{"login":"notflorian","id":409484,"node_id":"MDQ6VXNlcjQwOTQ4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/409484?v=4","gravatar_id":"","url":"https://api.github.com/users/notflorian","html_url":"https://github.com/notflorian","followers_url":"https://api.github.com/users/notflorian/followers","following_url":"https://api.github.com/users/notflorian/following{/other_user}","gists_url":"https://api.github.com/users/notflorian/gists{/gist_id}","starred_url":"https://api.github.com/users/notflorian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notflorian/subscriptions","organizations_url":"https://api.github.com/users/notflorian/orgs","repos_url":"https://api.github.com/users/notflorian/repos","events_url":"https://api.github.com/users/notflorian/events{/privacy}","received_events_url":"https://api.github.com/users/notflorian/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-21T14:28:27Z","updated_at":"2018-11-22T17:42:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ccc4fd3897cd51a697fd59575d039c12939016e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"GeReinhart","id":5529106,"node_id":"MDQ6VXNlcjU1MjkxMDY=","avatar_url":"https://avatars0.githubusercontent.com/u/5529106?v=4","gravatar_id":"","url":"https://api.github.com/users/GeReinhart","html_url":"https://github.com/GeReinhart","followers_url":"https://api.github.com/users/GeReinhart/followers","following_url":"https://api.github.com/users/GeReinhart/following{/other_user}","gists_url":"https://api.github.com/users/GeReinhart/gists{/gist_id}","starred_url":"https://api.github.com/users/GeReinhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeReinhart/subscriptions","organizations_url":"https://api.github.com/users/GeReinhart/orgs","repos_url":"https://api.github.com/users/GeReinhart/repos","events_url":"https://api.github.com/users/GeReinhart/events{/privacy}","received_events_url":"https://api.github.com/users/GeReinhart/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30/commits","review_comments_url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30/comments","review_comment_url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues/30/comments","statuses_url":"https://api.github.com/repos/KelkooGroup/theGardener/statuses/a1e83127e1de7253e961736658a700b6e1661993","head":{"label":"KelkooGroup:feature/generate-documentation","ref":"feature/generate-documentation","sha":"a1e83127e1de7253e961736658a700b6e1661993","user":{"login":"KelkooGroup","id":36245593,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MjQ1NTkz","avatar_url":"https://avatars1.githubusercontent.com/u/36245593?v=4","gravatar_id":"","url":"https://api.github.com/users/KelkooGroup","html_url":"https://github.com/KelkooGroup","followers_url":"https://api.github.com/users/KelkooGroup/followers","following_url":"https://api.github.com/users/KelkooGroup/following{/other_user}","gists_url":"https://api.github.com/users/KelkooGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KelkooGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KelkooGroup/subscriptions","organizations_url":"https://api.github.com/users/KelkooGroup/orgs","repos_url":"https://api.github.com/users/KelkooGroup/repos","events_url":"https://api.github.com/users/KelkooGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KelkooGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":120674896,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA2NzQ4OTY=","name":"theGardener","full_name":"KelkooGroup/theGardener","private":false,"owner":{"login":"KelkooGroup","id":36245593,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MjQ1NTkz","avatar_url":"https://avatars1.githubusercontent.com/u/36245593?v=4","gravatar_id":"","url":"https://api.github.com/users/KelkooGroup","html_url":"https://github.com/KelkooGroup","followers_url":"https://api.github.com/users/KelkooGroup/followers","following_url":"https://api.github.com/users/KelkooGroup/following{/other_user}","gists_url":"https://api.github.com/users/KelkooGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KelkooGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KelkooGroup/subscriptions","organizations_url":"https://api.github.com/users/KelkooGroup/orgs","repos_url":"https://api.github.com/users/KelkooGroup/repos","events_url":"https://api.github.com/users/KelkooGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KelkooGroup/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/KelkooGroup/theGardener","description":"Give an easy access for all to your BDD scenarios ","fork":false,"url":"https://api.github.com/repos/KelkooGroup/theGardener","forks_url":"https://api.github.com/repos/KelkooGroup/theGardener/forks","keys_url":"https://api.github.com/repos/KelkooGroup/theGardener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KelkooGroup/theGardener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KelkooGroup/theGardener/teams","hooks_url":"https://api.github.com/repos/KelkooGroup/theGardener/hooks","issue_events_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues/events{/number}","events_url":"https://api.github.com/repos/KelkooGroup/theGardener/events","assignees_url":"https://api.github.com/repos/KelkooGroup/theGardener/assignees{/user}","branches_url":"https://api.github.com/repos/KelkooGroup/theGardener/branches{/branch}","tags_url":"https://api.github.com/repos/KelkooGroup/theGardener/tags","blobs_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/refs{/sha}","trees_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KelkooGroup/theGardener/statuses/{sha}","languages_url":"https://api.github.com/repos/KelkooGroup/theGardener/languages","stargazers_url":"https://api.github.com/repos/KelkooGroup/theGardener/stargazers","contributors_url":"https://api.github.com/repos/KelkooGroup/theGardener/contributors","subscribers_url":"https://api.github.com/repos/KelkooGroup/theGardener/subscribers","subscription_url":"https://api.github.com/repos/KelkooGroup/theGardener/subscription","commits_url":"https://api.github.com/repos/KelkooGroup/theGardener/commits{/sha}","git_commits_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/commits{/sha}","comments_url":"https://api.github.com/repos/KelkooGroup/theGardener/comments{/number}","issue_comment_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues/comments{/number}","contents_url":"https://api.github.com/repos/KelkooGroup/theGardener/contents/{+path}","compare_url":"https://api.github.com/repos/KelkooGroup/theGardener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KelkooGroup/theGardener/merges","archive_url":"https://api.github.com/repos/KelkooGroup/theGardener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KelkooGroup/theGardener/downloads","issues_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues{/number}","pulls_url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls{/number}","milestones_url":"https://api.github.com/repos/KelkooGroup/theGardener/milestones{/number}","notifications_url":"https://api.github.com/repos/KelkooGroup/theGardener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KelkooGroup/theGardener/labels{/name}","releases_url":"https://api.github.com/repos/KelkooGroup/theGardener/releases{/id}","deployments_url":"https://api.github.com/repos/KelkooGroup/theGardener/deployments","created_at":"2018-02-07T21:37:21Z","updated_at":"2018-11-14T15:28:42Z","pushed_at":"2018-11-22T17:35:54Z","git_url":"git://github.com/KelkooGroup/theGardener.git","ssh_url":"git@github.com:KelkooGroup/theGardener.git","clone_url":"https://github.com/KelkooGroup/theGardener.git","svn_url":"https://github.com/KelkooGroup/theGardener","homepage":"https://github.com/KelkooGroup/theGardener/wiki","size":42113,"stargazers_count":5,"watchers_count":5,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"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":2,"open_issues":2,"watchers":5,"default_branch":"master"}},"base":{"label":"KelkooGroup:master","ref":"master","sha":"ddf463543ce33cb09c17feb5ca19150d765ffd92","user":{"login":"KelkooGroup","id":36245593,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MjQ1NTkz","avatar_url":"https://avatars1.githubusercontent.com/u/36245593?v=4","gravatar_id":"","url":"https://api.github.com/users/KelkooGroup","html_url":"https://github.com/KelkooGroup","followers_url":"https://api.github.com/users/KelkooGroup/followers","following_url":"https://api.github.com/users/KelkooGroup/following{/other_user}","gists_url":"https://api.github.com/users/KelkooGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KelkooGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KelkooGroup/subscriptions","organizations_url":"https://api.github.com/users/KelkooGroup/orgs","repos_url":"https://api.github.com/users/KelkooGroup/repos","events_url":"https://api.github.com/users/KelkooGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KelkooGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":120674896,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA2NzQ4OTY=","name":"theGardener","full_name":"KelkooGroup/theGardener","private":false,"owner":{"login":"KelkooGroup","id":36245593,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MjQ1NTkz","avatar_url":"https://avatars1.githubusercontent.com/u/36245593?v=4","gravatar_id":"","url":"https://api.github.com/users/KelkooGroup","html_url":"https://github.com/KelkooGroup","followers_url":"https://api.github.com/users/KelkooGroup/followers","following_url":"https://api.github.com/users/KelkooGroup/following{/other_user}","gists_url":"https://api.github.com/users/KelkooGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KelkooGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KelkooGroup/subscriptions","organizations_url":"https://api.github.com/users/KelkooGroup/orgs","repos_url":"https://api.github.com/users/KelkooGroup/repos","events_url":"https://api.github.com/users/KelkooGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KelkooGroup/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/KelkooGroup/theGardener","description":"Give an easy access for all to your BDD scenarios ","fork":false,"url":"https://api.github.com/repos/KelkooGroup/theGardener","forks_url":"https://api.github.com/repos/KelkooGroup/theGardener/forks","keys_url":"https://api.github.com/repos/KelkooGroup/theGardener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KelkooGroup/theGardener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KelkooGroup/theGardener/teams","hooks_url":"https://api.github.com/repos/KelkooGroup/theGardener/hooks","issue_events_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues/events{/number}","events_url":"https://api.github.com/repos/KelkooGroup/theGardener/events","assignees_url":"https://api.github.com/repos/KelkooGroup/theGardener/assignees{/user}","branches_url":"https://api.github.com/repos/KelkooGroup/theGardener/branches{/branch}","tags_url":"https://api.github.com/repos/KelkooGroup/theGardener/tags","blobs_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/refs{/sha}","trees_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KelkooGroup/theGardener/statuses/{sha}","languages_url":"https://api.github.com/repos/KelkooGroup/theGardener/languages","stargazers_url":"https://api.github.com/repos/KelkooGroup/theGardener/stargazers","contributors_url":"https://api.github.com/repos/KelkooGroup/theGardener/contributors","subscribers_url":"https://api.github.com/repos/KelkooGroup/theGardener/subscribers","subscription_url":"https://api.github.com/repos/KelkooGroup/theGardener/subscription","commits_url":"https://api.github.com/repos/KelkooGroup/theGardener/commits{/sha}","git_commits_url":"https://api.github.com/repos/KelkooGroup/theGardener/git/commits{/sha}","comments_url":"https://api.github.com/repos/KelkooGroup/theGardener/comments{/number}","issue_comment_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues/comments{/number}","contents_url":"https://api.github.com/repos/KelkooGroup/theGardener/contents/{+path}","compare_url":"https://api.github.com/repos/KelkooGroup/theGardener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KelkooGroup/theGardener/merges","archive_url":"https://api.github.com/repos/KelkooGroup/theGardener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KelkooGroup/theGardener/downloads","issues_url":"https://api.github.com/repos/KelkooGroup/theGardener/issues{/number}","pulls_url":"https://api.github.com/repos/KelkooGroup/theGardener/pulls{/number}","milestones_url":"https://api.github.com/repos/KelkooGroup/theGardener/milestones{/number}","notifications_url":"https://api.github.com/repos/KelkooGroup/theGardener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KelkooGroup/theGardener/labels{/name}","releases_url":"https://api.github.com/repos/KelkooGroup/theGardener/releases{/id}","deployments_url":"https://api.github.com/repos/KelkooGroup/theGardener/deployments","created_at":"2018-02-07T21:37:21Z","updated_at":"2018-11-14T15:28:42Z","pushed_at":"2018-11-22T17:35:54Z","git_url":"git://github.com/KelkooGroup/theGardener.git","ssh_url":"git@github.com:KelkooGroup/theGardener.git","clone_url":"https://github.com/KelkooGroup/theGardener.git","svn_url":"https://github.com/KelkooGroup/theGardener","homepage":"https://github.com/KelkooGroup/theGardener/wiki","size":42113,"stargazers_count":5,"watchers_count":5,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"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":2,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30"},"html":{"href":"https://github.com/KelkooGroup/theGardener/pull/30"},"issue":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/issues/30"},"comments":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/KelkooGroup/theGardener/statuses/a1e83127e1de7253e961736658a700b6e1661993"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"sonarcloud"}}