Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "Watchers" available in Octokit.net? #1470

Closed
tang-jason opened this issue Sep 21, 2016 · 5 comments
Closed

No "Watchers" available in Octokit.net? #1470

tang-jason opened this issue Sep 21, 2016 · 5 comments
Assignees

Comments

@tang-jason
Copy link

Using
client.Search.SearchRepo(new SearchRepositoriesRequest(searchTerm));

I don't seem to find "watchers" listed from the repos that I pulled. Is this available/implemented in Octokit?

@ryangribble
Copy link
Contributor

ryangribble commented Sep 21, 2016

Assuming I am understanding what you're referring to, I believe the API field name (and hence the octokit member name) is StargazersCount (on the Repository class)

@tang-jason
Copy link
Author

@ryangribble Isn't the StargazersCount referring to "Star". Take octokit for example, it has

Watch: 123
Star: 1052
Fork: 531

"Watch" is the one I am looking for.

@ryangribble
Copy link
Contributor

ryangribble commented Sep 21, 2016

Ah sorry, indeed you are correct

There is a watchers_count field in the API response that is not currently implemented in octokit.net. It should be a simple change, just adding a member called WatchersCount to the Repository object

Typically missing fields like this are added as people run into them, but I would actually like to proactively add useful missing fields. I started the first step by auditing API response fields that are missing from our response model classes in #1400 (and sure enough, these watcher fields are listed)

@ryangribble
Copy link
Contributor

ryangribble commented Sep 25, 2016

Hey so I actually stumbled upon an old issue #699 that explains this WatchersCount property was actually deprecated and SubscribersCount is the field you want to use for this... But then SubscribersCount field was also deprecated/removed in issue #736. So apparently the "correct" way to retrieve this info is using the "Watchers" API WatchedClient.GetAllWatchers() instead.

Although, since the API response still include the SubscribersCount field (showing the correct value of 125 for this repo, for example) and the linked blog in #699 mentions they will be supported indefinitely in API v3, perhaps it would be OK to add the field back in again.

@shiftkey or @haacked care to comment on these historic issues? From my perspective, if SubscribersCount is still being returned AND contains the correct value, it was possibly premature to remove it and require additional API calls to get that information?

Ive created PR #1473 to add SubscribersCount field back, as well as a couple of others that were missing (as per #1400)

@shiftkey
Copy link
Member

Assigning to myself to remember and investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants