{"action":"created","issue":{"url":"https://api.github.com/repos/octokit/octokit.net/issues/1228","repository_url":"https://api.github.com/repos/octokit/octokit.net","labels_url":"https://api.github.com/repos/octokit/octokit.net/issues/1228/labels{/name}","comments_url":"https://api.github.com/repos/octokit/octokit.net/issues/1228/comments","events_url":"https://api.github.com/repos/octokit/octokit.net/issues/1228/events","html_url":"https://github.com/octokit/octokit.net/pull/1228","id":144272590,"number":1228,"title":"Implement additional `SearchIssuesRequest` options","user":{"login":"ryangribble","id":5425163,"avatar_url":"https://avatars.githubusercontent.com/u/5425163?v=3","gravatar_id":"","url":"https://api.github.com/users/ryangribble","html_url":"https://github.com/ryangribble","followers_url":"https://api.github.com/users/ryangribble/followers","following_url":"https://api.github.com/users/ryangribble/following{/other_user}","gists_url":"https://api.github.com/users/ryangribble/gists{/gist_id}","starred_url":"https://api.github.com/users/ryangribble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryangribble/subscriptions","organizations_url":"https://api.github.com/users/ryangribble/orgs","repos_url":"https://api.github.com/users/ryangribble/repos","events_url":"https://api.github.com/users/ryangribble/events{/privacy}","received_events_url":"https://api.github.com/users/ryangribble/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/octokit/octokit.net/labels/feature","name":"feature","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"shiftkey","id":359239,"avatar_url":"https://avatars.githubusercontent.com/u/359239?v=3","gravatar_id":"","url":"https://api.github.com/users/shiftkey","html_url":"https://github.com/shiftkey","followers_url":"https://api.github.com/users/shiftkey/followers","following_url":"https://api.github.com/users/shiftkey/following{/other_user}","gists_url":"https://api.github.com/users/shiftkey/gists{/gist_id}","starred_url":"https://api.github.com/users/shiftkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiftkey/subscriptions","organizations_url":"https://api.github.com/users/shiftkey/orgs","repos_url":"https://api.github.com/users/shiftkey/repos","events_url":"https://api.github.com/users/shiftkey/events{/privacy}","received_events_url":"https://api.github.com/users/shiftkey/received_events","type":"User","site_admin":true},"milestone":null,"comments":10,"created_at":"2016-03-29T13:56:21Z","updated_at":"2016-04-13T15:42:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/octokit/octokit.net/pulls/1228","html_url":"https://github.com/octokit/octokit.net/pull/1228","diff_url":"https://github.com/octokit/octokit.net/pull/1228.diff","patch_url":"https://github.com/octokit/octokit.net/pull/1228.patch"},"body":"## Status\r\n- [x] Implemented new options\r\n- [x] Unit tests for the request parameters for all new (and existing types)\r\n- [x] Flesh out some integration tests to use some of the new options\r\n- [ ] Get feedback on naming of `No` property and `IssueNoMetadataQualifier` enum\r\n- [ ] Get feedback on implementation of exclusion parameters\r\n- [ ] Guidance from @Haacked +/- @shiftkey on whether to include additional fields other than `label` in the exclusion support\r\n\r\n## Details\r\nFixes #1227 \r\nhttps://developer.github.com/v3/search/#search-issues\r\nhttps://help.github.com/articles/searching-issues\r\n\r\nAdded new options to `SearchIssuesRequest`\r\n\r\n- Searching by [`team`](https://help.github.com/articles/searching-issues/#search-by-a-team-thats-mentioned-within-an-issue-or-pull-request)\r\n- Searching by \"not\" label syntax [`-label`](https://help.github.com/articles/searching-issues/#search-by-the-labels-on-an-issue)\r\n- Searching on missing metadata [`no`](https://help.github.com/articles/searching-issues/#search-by-missing-metadata-on-an-issue-or-pull-request)\r\n- The \"human\" styled [`is`](https://help.github.com/articles/searching-issues/#search-based-on-the-state-of-an-issue-or-pull-request) query \r\n - (although `state` and `type` cover most of the `is` options, the `merged`/`unmerged` have no alternative)\r\n- Searching by commit [`status`](https://help.github.com/articles/searching-issues/#search-based-on-commit-status)\r\n- Searching by branch names [`base`](https://help.github.com/articles/searching-issues/#search-based-on-branch-names) or [`head`](https://help.github.com/articles/searching-issues/#search-based-on-branch-names)\r\n- Searching on [`closed`](https://help.github.com/articles/searching-issues/#search-based-on-when-an-issue-or-pull-request-was-closed) date range\r\n\r\n## Testing\r\nAdded unit tests for each parameter on this class to verify that when not set, the parameter is not in the query string, and when set the parameter is set as expected\r\n\r\nAdded some integration tests that excercise some of the new options\r\n\r\n## Discussion\r\n\r\n~~I'd appreciate feedback on the implementation for [\"excluding\" labels](https://help.github.com/articles/searching-issues/#search-by-the-labels-on-an-issue).  In the API docs, this is done by using notation `-label:labelname` as opposed to `label:labelname` to include a label.  At first I thought we could just implement this by having any label prepended with a hyphen be deemed to be an \"exclusion\" label, however it turns out that it's actually valid to have labels that start with a hyphen.  So I implemented this as a separate list property `SearchIssuesRequest.NotLabels`~~\r\n\r\n~~It feels a bit ugly so if someone has a better way, let me know~~\r\n\r\n~~**Update**: Now renamed to `SearchIssuesRequest.ExcludeLabels`~~\r\nSee https://github.com/octokit/octokit.net/pull/1228#issuecomment-203965890 for how the \"exclusion\" field implementation is shaping up...\r\n\r\nSimilarly, the [\"missing metadata\"](https://help.github.com/articles/searching-issues/#search-by-missing-metadata-on-an-issue-or-pull-request) search option, ive called the class property `No` to match the query property in API docs `no`, and gone with `IssueNoMetadataQualifier` as the enum name.  Open to better suggestions..."},"comment":{"url":"https://api.github.com/repos/octokit/octokit.net/issues/comments/209517605","html_url":"https://github.com/octokit/octokit.net/pull/1228#issuecomment-209517605","issue_url":"https://api.github.com/repos/octokit/octokit.net/issues/1228","id":209517605,"user":{"login":"M-Zuber","id":4746537,"avatar_url":"https://avatars.githubusercontent.com/u/4746537?v=3","gravatar_id":"","url":"https://api.github.com/users/M-Zuber","html_url":"https://github.com/M-Zuber","followers_url":"https://api.github.com/users/M-Zuber/followers","following_url":"https://api.github.com/users/M-Zuber/following{/other_user}","gists_url":"https://api.github.com/users/M-Zuber/gists{/gist_id}","starred_url":"https://api.github.com/users/M-Zuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M-Zuber/subscriptions","organizations_url":"https://api.github.com/users/M-Zuber/orgs","repos_url":"https://api.github.com/users/M-Zuber/repos","events_url":"https://api.github.com/users/M-Zuber/events{/privacy}","received_events_url":"https://api.github.com/users/M-Zuber/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T15:42:40Z","updated_at":"2016-04-13T15:42:40Z","body":"> Created,Updated,Merged,Closed,Comments\r\nThese date/range fields already support greater/less than and \"between\" syntax, so having an exclusion option doesnt really make sense so I didnt attempt to implement/test\r\n\r\nI would say to yes implement (assuming support) as some users may find it easier conceptually to use `.Exclusions` (BTW great job on naming)\r\nMight be open to doing a PR into this PR for those fields.\r\n>User\r\nNot tested.\r\nDoes it make sense to do a search for something in all repos EXCEPT those owned by a user or organisation?\r\nRepos\r\nNot tested.\r\nDoes it make sense to do a search in all repos EXCEPT some specified?\r\n\r\nI vote for yes as I have done both in the past.\r\n\r\nOne example that covers both is looking for something .Net Core related - but not in anything from Microsoft & Microsoft related repositories."}}