{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/scm-api-plugin/issues/65","repository_url":"https://api.github.com/repos/jenkinsci/scm-api-plugin","labels_url":"https://api.github.com/repos/jenkinsci/scm-api-plugin/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/scm-api-plugin/issues/65/comments","events_url":"https://api.github.com/repos/jenkinsci/scm-api-plugin/issues/65/events","html_url":"https://github.com/jenkinsci/scm-api-plugin/pull/65","id":436835107,"node_id":"MDExOlB1bGxSZXF1ZXN0MjczMjQyNDYy","number":65,"title":"[JENKINS-43802] Allow fetch/fetchRevisions to be given an Item context","user":{"login":"jglick","id":154109,"node_id":"MDQ6VXNlcjE1NDEwOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/154109?v=4","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2019-04-24T18:05:37Z","updated_at":"2019-06-03T17:41:49Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/jenkinsci/scm-api-plugin/pulls/65","html_url":"https://github.com/jenkinsci/scm-api-plugin/pull/65","diff_url":"https://github.com/jenkinsci/scm-api-plugin/pull/65.diff","patch_url":"https://github.com/jenkinsci/scm-api-plugin/pull/65.patch"},"body":"Needed for [JENKINS-43802](https://issues.jenkins-ci.org/browse/JENKINS-43802).\r\n\r\nI thought of adding a builder field to `SCMSourceContext` / `SCMSourceRequest` but these seem heavily tied to branch scanning, whereas this is a different use case, for libraries. I also thought of adding something like\r\n\r\n```java\r\n/**\r\n * Allows this to be associated with a particular context, such as a job in which a build is running.\r\n * If defined, should be considered to supersede {@link #getOwner}\r\n * for purposes of {@link #retrieve(String, TaskListener)}, {@link #retrieveRevisions(TaskListener)}, etc.\r\n * @param context a context, such as a folder or job\r\n * @return {@code this} by default; may be overridden to create a <em>new</em> object with a copy of this configuration\r\n */\r\npublic @NonNull SCMSource withContext(@CheckForNull Item context) {\r\n    return this;\r\n}\r\n```\r\n\r\nwhich could even have a default implementation using either `DescribableModel` or `Cloneable` to make a copy of the original object, offering a `protected Item getContext()` to subclasses, but this seemed to just be perpetuating the antipattern of having critical parameters to a method be injected magically from some `owner` field, so I decided to keep it simple and just introduce new overloads for what I needed. Alternate design suggestions would certainly be considered."},"comment":{"url":"https://api.github.com/repos/jenkinsci/scm-api-plugin/issues/comments/498355700","html_url":"https://github.com/jenkinsci/scm-api-plugin/pull/65#issuecomment-498355700","issue_url":"https://api.github.com/repos/jenkinsci/scm-api-plugin/issues/65","id":498355700,"node_id":"MDEyOklzc3VlQ29tbWVudDQ5ODM1NTcwMA==","user":{"login":"bitwiseman","id":1958953,"node_id":"MDQ6VXNlcjE5NTg5NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1958953?v=4","gravatar_id":"","url":"https://api.github.com/users/bitwiseman","html_url":"https://github.com/bitwiseman","followers_url":"https://api.github.com/users/bitwiseman/followers","following_url":"https://api.github.com/users/bitwiseman/following{/other_user}","gists_url":"https://api.github.com/users/bitwiseman/gists{/gist_id}","starred_url":"https://api.github.com/users/bitwiseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitwiseman/subscriptions","organizations_url":"https://api.github.com/users/bitwiseman/orgs","repos_url":"https://api.github.com/users/bitwiseman/repos","events_url":"https://api.github.com/users/bitwiseman/events{/privacy}","received_events_url":"https://api.github.com/users/bitwiseman/received_events","type":"User","site_admin":false},"created_at":"2019-06-03T17:41:49Z","updated_at":"2019-06-03T17:41:49Z","author_association":"CONTRIBUTOR","body":"@jglick \r\nThen I'm in favor of the design as it is.  \r\n\r\n\r\n"}}
{"actor":{"display_login":"bitwiseman"}}