{"action":"created","comment":{"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments/45234897","id":45234897,"diff_hunk":"@@ -196,11 +217,74 @@ public void loadResources() {\n \n \t@Override\n \tpublic void setParameters(List<IParameter> parameters) {\n-\t\tfirePropertyChange(PROPERTY_PARAMETERS, this.parameters, this.parameters = parameters);\n-\t\tthis.originalValueMap = new HashMap<String, String>(parameters.size());\n-\t\tfor (IParameter param : parameters) {\n-\t\t\toriginalValueMap.put(param.getName(), param.getValue());\n+\t\tfirePropertyChange(PROPERTY_PARAMETERS, this.parameters, this.parameters = injectProjectParameters(getEclipseProject(), parameters));\n+\t\toriginalValueMap = parameters.stream().collect(Collectors.toMap(IParameter::getName,IParameter::getValue));\n+\t}\n+\n+\tprivate static List<IParameter> injectProjectParameters(org.eclipse.core.resources.IProject project, List<IParameter> originalParameters) {\n+\t\tif (originalParameters == null || originalParameters.isEmpty()) {\n+\t\t\treturn originalParameters;\n+\t\t}\n+\t\tMap<String, String> projectParams = getProjectParameters(project);\n+\n+\t\tList<IParameter> newParameters = originalParameters.stream().map(p -> { \n+\t\t\tIParameter clone = p.clone();\n+\t\t\tString value = projectParams.get(clone.getName());\n+\t\t\tif (value != null) {\n+\t\t\t\tclone.setValue(value);\n+\t\t\t}\n+\t\t\treturn clone;\n+\t\t}).collect(Collectors.toList());\n+\n+\t\treturn newParameters;\n+\t}\n+\n+\tprivate static Map<String, String> getProjectParameters(org.eclipse.core.resources.IProject project) {\n+\t\tif(project == null) {\n+\t\t\treturn Collections.emptyMap();\n+\t\t}\n+\t\tMap<String,String> projectParams = new HashMap<>();\n+\t\tString gitRepo = getDefaultRemoteRepo(project);\n+\t\tif (gitRepo != null) {\n+\t\t\tprojectParams.put(\"SOURCE_REPOSITORY_URL\", gitRepo);\n+\t\t\tprojectParams.put(\"GIT_URI\", gitRepo);//legacy key\n+\t\t\t\n+\t\t\tString branch = getDefaultBranch(project);\n+\t\t\tprojectParams.put(\"SOURCE_REPOSITORY_REF\", branch);\n+\t\t\tprojectParams.put(\"GIT_REF\", branch);//legacy key\n+\t\t\t\n+\t\t\t//Setting the context dir is a really bad idea if we're dealing with a multi module project\n+\t\t\t//Better let the user do it manually if needed.\n+\t\t\t//String contextDir = getDefaultContextDir(project);\n+\t\t\tString contextDir = \"\";\n+\t\t\tprojectParams.put(\"CONTEXT_DIR\", contextDir);\n+\t\t\tprojectParams.put(\"GIT_CONTEXT_DIR\", contextDir);//legacy key\n \t\t}\n+\t\treturn projectParams;\n+\t}\n+\n+\tprivate static String getDefaultBranch(org.eclipse.core.resources.IProject project) {\n+\t\tRepository repo = EGitUtils.getRepository(project);\n+\t\tif (repo != null) {\n+\t\t\ttry {\n+\t\t\t\treturn EGitUtils.getCurrentBranch(repo);\n+\t\t\t} catch (CoreException e) {\n+\t\t\t\tthrow new OpenShiftException(e, NLS.bind(\"Could not determine the default Git branch for \\\"{0}\\\"\", project.getName()));\n+\t\t\t}\n+\t\t}\n+\t\treturn null;\n+\t}\n+\n+\tprivate static String getDefaultRemoteRepo(org.eclipse.core.resources.IProject project) {","path":"plugins/org.jboss.tools.openshift.ui/src/org/jboss/tools/openshift/internal/ui/wizard/newapp/NewApplicationWizardModel.java","position":145,"original_position":145,"commit_id":"5b454f8bac6eb78bee0a3676085b305c00938ad6","original_commit_id":"5b454f8bac6eb78bee0a3676085b305c00938ad6","user":{"login":"fbricon","id":148698,"avatar_url":"https://avatars.githubusercontent.com/u/148698?v=3","gravatar_id":"","url":"https://api.github.com/users/fbricon","html_url":"https://github.com/fbricon","followers_url":"https://api.github.com/users/fbricon/followers","following_url":"https://api.github.com/users/fbricon/following{/other_user}","gists_url":"https://api.github.com/users/fbricon/gists{/gist_id}","starred_url":"https://api.github.com/users/fbricon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbricon/subscriptions","organizations_url":"https://api.github.com/users/fbricon/orgs","repos_url":"https://api.github.com/users/fbricon/repos","events_url":"https://api.github.com/users/fbricon/events{/privacy}","received_events_url":"https://api.github.com/users/fbricon/received_events","type":"User","site_admin":false},"body":"Yup, same as previous answer","created_at":"2015-11-18T17:58:36Z","updated_at":"2015-11-18T17:58:36Z","html_url":"https://github.com/jbosstools/jbosstools-openshift/pull/815#discussion_r45234897","pull_request_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815","_links":{"self":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments/45234897"},"html":{"href":"https://github.com/jbosstools/jbosstools-openshift/pull/815#discussion_r45234897"},"pull_request":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815"}}},"pull_request":{"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815","id":51024195,"html_url":"https://github.com/jbosstools/jbosstools-openshift/pull/815","diff_url":"https://github.com/jbosstools/jbosstools-openshift/pull/815.diff","patch_url":"https://github.com/jbosstools/jbosstools-openshift/pull/815.patch","issue_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/815","number":815,"state":"open","locked":false,"title":"[JBDS-3489] Deploy workspace projects to OpenShift 3","user":{"login":"fbricon","id":148698,"avatar_url":"https://avatars.githubusercontent.com/u/148698?v=3","gravatar_id":"","url":"https://api.github.com/users/fbricon","html_url":"https://github.com/fbricon","followers_url":"https://api.github.com/users/fbricon/followers","following_url":"https://api.github.com/users/fbricon/following{/other_user}","gists_url":"https://api.github.com/users/fbricon/gists{/gist_id}","starred_url":"https://api.github.com/users/fbricon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbricon/subscriptions","organizations_url":"https://api.github.com/users/fbricon/orgs","repos_url":"https://api.github.com/users/fbricon/repos","events_url":"https://api.github.com/users/fbricon/events{/privacy}","received_events_url":"https://api.github.com/users/fbricon/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Fred Bricon <fbricon@gmail.com>","created_at":"2015-11-18T00:04:12Z","updated_at":"2015-11-18T17:58:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9a2e48820df27f8b4245c23d2ed9bb02dc04e00","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815/commits","review_comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815/comments","review_comment_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/815/comments","statuses_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/5b454f8bac6eb78bee0a3676085b305c00938ad6","head":{"label":"fbricon:deploy-workspace-projects","ref":"deploy-workspace-projects","sha":"5b454f8bac6eb78bee0a3676085b305c00938ad6","user":{"login":"fbricon","id":148698,"avatar_url":"https://avatars.githubusercontent.com/u/148698?v=3","gravatar_id":"","url":"https://api.github.com/users/fbricon","html_url":"https://github.com/fbricon","followers_url":"https://api.github.com/users/fbricon/followers","following_url":"https://api.github.com/users/fbricon/following{/other_user}","gists_url":"https://api.github.com/users/fbricon/gists{/gist_id}","starred_url":"https://api.github.com/users/fbricon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbricon/subscriptions","organizations_url":"https://api.github.com/users/fbricon/orgs","repos_url":"https://api.github.com/users/fbricon/repos","events_url":"https://api.github.com/users/fbricon/events{/privacy}","received_events_url":"https://api.github.com/users/fbricon/received_events","type":"User","site_admin":false},"repo":{"id":14592217,"name":"jbosstools-openshift","full_name":"fbricon/jbosstools-openshift","owner":{"login":"fbricon","id":148698,"avatar_url":"https://avatars.githubusercontent.com/u/148698?v=3","gravatar_id":"","url":"https://api.github.com/users/fbricon","html_url":"https://github.com/fbricon","followers_url":"https://api.github.com/users/fbricon/followers","following_url":"https://api.github.com/users/fbricon/following{/other_user}","gists_url":"https://api.github.com/users/fbricon/gists{/gist_id}","starred_url":"https://api.github.com/users/fbricon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbricon/subscriptions","organizations_url":"https://api.github.com/users/fbricon/orgs","repos_url":"https://api.github.com/users/fbricon/repos","events_url":"https://api.github.com/users/fbricon/events{/privacy}","received_events_url":"https://api.github.com/users/fbricon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fbricon/jbosstools-openshift","description":"JBoss Tools :: OpenShift { openshift }","fork":true,"url":"https://api.github.com/repos/fbricon/jbosstools-openshift","forks_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/forks","keys_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/teams","hooks_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/hooks","issue_events_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/issues/events{/number}","events_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/events","assignees_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/assignees{/user}","branches_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/branches{/branch}","tags_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/tags","blobs_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/git/refs{/sha}","trees_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/statuses/{sha}","languages_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/languages","stargazers_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/stargazers","contributors_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/contributors","subscribers_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/subscribers","subscription_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/subscription","commits_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/commits{/sha}","git_commits_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/git/commits{/sha}","comments_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/comments{/number}","issue_comment_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/issues/comments{/number}","contents_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/contents/{+path}","compare_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/merges","archive_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/downloads","issues_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/issues{/number}","pulls_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/pulls{/number}","milestones_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/milestones{/number}","notifications_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/labels{/name}","releases_url":"https://api.github.com/repos/fbricon/jbosstools-openshift/releases{/id}","created_at":"2013-11-21T16:00:15Z","updated_at":"2014-01-17T09:40:13Z","pushed_at":"2015-11-18T00:03:34Z","git_url":"git://github.com/fbricon/jbosstools-openshift.git","ssh_url":"git@github.com:fbricon/jbosstools-openshift.git","clone_url":"https://github.com/fbricon/jbosstools-openshift.git","svn_url":"https://github.com/fbricon/jbosstools-openshift","homepage":"","size":14009,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"jbosstools:jbosstools-4.3.x","ref":"jbosstools-4.3.x","sha":"02ba2bda585a655dc8245f4f45342ec8047fc285","user":{"login":"jbosstools","id":619871,"avatar_url":"https://avatars.githubusercontent.com/u/619871?v=3","gravatar_id":"","url":"https://api.github.com/users/jbosstools","html_url":"https://github.com/jbosstools","followers_url":"https://api.github.com/users/jbosstools/followers","following_url":"https://api.github.com/users/jbosstools/following{/other_user}","gists_url":"https://api.github.com/users/jbosstools/gists{/gist_id}","starred_url":"https://api.github.com/users/jbosstools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbosstools/subscriptions","organizations_url":"https://api.github.com/users/jbosstools/orgs","repos_url":"https://api.github.com/users/jbosstools/repos","events_url":"https://api.github.com/users/jbosstools/events{/privacy}","received_events_url":"https://api.github.com/users/jbosstools/received_events","type":"Organization","site_admin":false},"repo":{"id":6308288,"name":"jbosstools-openshift","full_name":"jbosstools/jbosstools-openshift","owner":{"login":"jbosstools","id":619871,"avatar_url":"https://avatars.githubusercontent.com/u/619871?v=3","gravatar_id":"","url":"https://api.github.com/users/jbosstools","html_url":"https://github.com/jbosstools","followers_url":"https://api.github.com/users/jbosstools/followers","following_url":"https://api.github.com/users/jbosstools/following{/other_user}","gists_url":"https://api.github.com/users/jbosstools/gists{/gist_id}","starred_url":"https://api.github.com/users/jbosstools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbosstools/subscriptions","organizations_url":"https://api.github.com/users/jbosstools/orgs","repos_url":"https://api.github.com/users/jbosstools/repos","events_url":"https://api.github.com/users/jbosstools/events{/privacy}","received_events_url":"https://api.github.com/users/jbosstools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jbosstools/jbosstools-openshift","description":"JBoss Tools :: OpenShift { openshift }","fork":false,"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift","forks_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/forks","keys_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/teams","hooks_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/hooks","issue_events_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/events{/number}","events_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/events","assignees_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/assignees{/user}","branches_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/branches{/branch}","tags_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/tags","blobs_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/{sha}","languages_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/languages","stargazers_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/stargazers","contributors_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/contributors","subscribers_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/subscribers","subscription_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/subscription","commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/contents/{+path}","compare_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/merges","archive_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/downloads","issues_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues{/number}","pulls_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls{/number}","milestones_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/milestones{/number}","notifications_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/labels{/name}","releases_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/releases{/id}","created_at":"2012-10-20T11:23:01Z","updated_at":"2015-08-11T20:47:08Z","pushed_at":"2015-11-18T17:44:04Z","git_url":"git://github.com/jbosstools/jbosstools-openshift.git","ssh_url":"git@github.com:jbosstools/jbosstools-openshift.git","clone_url":"https://github.com/jbosstools/jbosstools-openshift.git","svn_url":"https://github.com/jbosstools/jbosstools-openshift","homepage":"","size":14976,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":7,"forks":36,"open_issues":7,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815"},"html":{"href":"https://github.com/jbosstools/jbosstools-openshift/pull/815"},"issue":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/815"},"comments":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/815/comments"},"review_comments":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815/comments"},"review_comment":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/815/commits"},"statuses":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/5b454f8bac6eb78bee0a3676085b305c00938ad6"}}}}