{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/1145","repository_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin","labels_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/1145/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/1145/comments","events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/1145/events","html_url":"https://github.com/jenkinsci/blueocean-plugin/pull/1145","id":235243239,"number":1145,"title":"Story/jenkins 40855 GitHub enterprise credential / domain changes","user":{"login":"cliffmeyers","id":143466,"avatar_url":"https://avatars3.githubusercontent.com/u/143466?v=3","gravatar_id":"","url":"https://api.github.com/users/cliffmeyers","html_url":"https://github.com/cliffmeyers","followers_url":"https://api.github.com/users/cliffmeyers/followers","following_url":"https://api.github.com/users/cliffmeyers/following{/other_user}","gists_url":"https://api.github.com/users/cliffmeyers/gists{/gist_id}","starred_url":"https://api.github.com/users/cliffmeyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cliffmeyers/subscriptions","organizations_url":"https://api.github.com/users/cliffmeyers/orgs","repos_url":"https://api.github.com/users/cliffmeyers/repos","events_url":"https://api.github.com/users/cliffmeyers/events{/privacy}","received_events_url":"https://api.github.com/users/cliffmeyers/received_events","type":"User","site_admin":false},"labels":[{"id":334266887,"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/labels/needs-review","name":"needs-review","color":"eb6420","default":false},{"id":334266774,"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/labels/work-in-progress","name":"work-in-progress","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-12T14:02:53Z","updated_at":"2017-06-20T20:53:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/1145","html_url":"https://github.com/jenkinsci/blueocean-plugin/pull/1145","diff_url":"https://github.com/jenkinsci/blueocean-plugin/pull/1145.diff","patch_url":"https://github.com/jenkinsci/blueocean-plugin/pull/1145.patch"},"body":"# Description\r\nAfter some extended discussion with @vivek we decided to do the following here:\r\n- Leave `/scm/github` endpoint as-is for now, to avoid changing that API.\r\n- Make some changes to \"new\" `/scm/github-enterprise/validate` API:\r\n  - `apiUrl` becomes a required parameter, whereas it's optional for github\r\n  - All credentials are now stored in single domain named `blueocean-github-enterprise-domain`\r\n- Add \"credentials\" property to `/scm/github-enterprise` API:\r\n  - Credentials are exposed as a `credentials` property on the enterprise SCM object (see below)\r\n  - The UI can fetch this data and be aware of which API URL's already have a credential registered. I \"normalize\" the URI when credential is created by always stripping off the trailing slash with the hope we can avoid silly mismatch errors that way.\r\n- [ ] Need to decide if raw URL is okay or whether we really need a 2-way decode. If needed, perhaps Base64 would work?\r\n\r\n```\r\n{\r\n    \"_class\": \"...\",\r\n    \"_links\": { ... },\r\n    \"credentialId\": null,\r\n    \"id\": \"github-enterprise\",\r\n    \"credentials\": [{\r\n        \"apiUri\": \"https://api.github.com\",\r\n        \"credentialId\": \"blueocean-github-enterprise-domain:https://api.github.com\"\r\n    }]\r\n}\r\n```\r\n\r\n# Submitter checklist\r\n- [x] Link to JIRA ticket in description, if appropriate.\r\n- [x] Change is code complete and matches issue description\r\n- [x] Appropriate unit or acceptance tests or explanation to why this change has no tests\r\n- [ ] Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.\r\n- [ ] Ran Acceptance Test Harness against PR changes.\r\n\r\n# Reviewer checklist\r\n- [ ] Run the changes and verified the change matches the issue description\r\n- [ ] Reviewed the code\r\n- [ ] Verified that the appropriate tests have been written or valid explanation given\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/comments/309888104","html_url":"https://github.com/jenkinsci/blueocean-plugin/pull/1145#issuecomment-309888104","issue_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/1145","id":309888104,"user":{"login":"cliffmeyers","id":143466,"avatar_url":"https://avatars3.githubusercontent.com/u/143466?v=3","gravatar_id":"","url":"https://api.github.com/users/cliffmeyers","html_url":"https://github.com/cliffmeyers","followers_url":"https://api.github.com/users/cliffmeyers/followers","following_url":"https://api.github.com/users/cliffmeyers/following{/other_user}","gists_url":"https://api.github.com/users/cliffmeyers/gists{/gist_id}","starred_url":"https://api.github.com/users/cliffmeyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cliffmeyers/subscriptions","organizations_url":"https://api.github.com/users/cliffmeyers/orgs","repos_url":"https://api.github.com/users/cliffmeyers/repos","events_url":"https://api.github.com/users/cliffmeyers/events{/privacy}","received_events_url":"https://api.github.com/users/cliffmeyers/received_events","type":"User","site_admin":false},"created_at":"2017-06-20T20:53:01Z","updated_at":"2017-06-20T20:53:01Z","body":"@vivek PTAL when you have a chance. I've implemented the changes we discussed yesterday. I think we have pretty good test coverage for GET requests against `/scm/github-enterprise` as I check for 200, 400 and 404 responses now."}}
{"actor":{"display_login":"cliffmeyers"}}