turbot / steampipe-plugin-github

Use SQL to instantly query repositories, users, gists and more from GitHub. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/github
Apache License 2.0
74 stars 29 forks source link

watchers_count is same as stargazers_count #162

Closed judell closed 2 years ago

judell commented 2 years ago

In the case of lensacom/sparkit-learn for example, there are currently 1124 stargazers and 90 watchers.

select full_name, stargazers_count, watchers_count from github_search_repository where query = 'pyspark' limit 10;
+---------------------------------------+------------------+----------------+
| full_name                             | stargazers_count | watchers_count |
+---------------------------------------+------------------+----------------+
| lensacom/sparkit-learn                | 1124             | 1124           |
| AlexIoannides/pyspark-example-project | 907              | 907            |
| mahmoudparsian/pyspark-tutorial       | 898              | 898            |
| PacktPublishing/Learning-PySpark      | 273              | 273            |
| spark-examples/pyspark-examples       | 477              | 477            |
| krishnaik06/Pyspark-With-Python       | 165              | 165            |
| MingChen0919/learning-apache-spark    | 237              | 237            |
| UrbanInstitute/pyspark-tutorials      | 346              | 346            |
| susanli2016/PySpark-and-MLlib         | 245              | 245            |
| ekampf/PySpark-Boilerplate            | 369              | 369            |
+---------------------------------------+------------------+----------------+
japborst commented 2 years ago

I tried reproducing this using the GH API, as steampipe doesn't manipulate this data

$ gh api \
  -H "Accept: application/vnd.github.v3+json" \
  /repos/lensacom/sparkit-learn | jq '.full_name, .stargazers_count, .watchers_count, .subscribers_count

results in

"lensacom/sparkit-learn"
1123
1123
90

So it seems that watchers and stargazers are effectively the same, but you should use subscribers_count to find the data you're looking for.

cbruno10 commented 2 years ago

@judell Can you please use the column that @japborst suggested and see if that gives you the information you're looking for? Thanks!

judell commented 2 years ago

Hey @cbruno10 I just saw this. Yes, evidently stargazers and watchers are aliases in Steampipe. And yes, subscribers is what one might think of as watchers. Thanks @japborst, for pointing that out.

I guess it's still a bug that stargazers = watchers in Steampipe but a bit of googling suggests there has been general and longstanding confusion in the API about this terminology.

cbruno10 commented 2 years ago

@judell In the GitHub API v3, it seems like the stargazers count and watchers count are the same and are planned to be the same indefinitely, as per this GitHub blog post. So I don't believe this is a bug in this plugin, as we're returning the data that GitHub API v3 returns us.

When GitHub releases the next major version, I assume this behaviour will change, and we can make adjustments ourselves then as well.

I'm closing this issue as there are no plans to deviate from the GitHub API at this time, but if you encounter any other issues, please let us know!