Open dahlbyk opened 7 years ago
I'm brand-spanking-new and I'm not sure how this works. But since up-for-grabs.net was the most encouraging in doing this, I'm compelled to jump in and try to help.
I'm throwing my hat in the ring on this and heading back to read all the detailed how-to's and codes-of-conduct, etc.
I'm calling a gentle claim on this one (mostly because I'm not sure if I'm yet qualified to do it, but, golly, I'm willing to get in and get dirty with it!)
~Bon
@mathfour sure thing - do let us know you go!
All right - I'm in!
I'll start looking at it fresh in the morning.
What's the best place/way to ask questions? Here? Slack?
#excited
Just add them here - we don't have a Slack or chat setup currently...
@mathfour Are you still working on this? If not, I'd love to take a crack at it!
Go ahead @aph3rson - I'm trying to figure out github (we had to use it in a project and it's a bit more complex than I thought). I'll keep following this thread so I can watch how you work. :D Thanks!
I'd like to see #604 (for issue #567) merged in before I start working on this - the pagination code there might be hard to merge into.
My thoughts are to rewrite the issueCount
procedure to determine the appropriate strategy to update the issue count. However, it doesn't appear that there's a reliable way to determine the strategy, short of looking at the URL for the link to the issue. I'd rather shy away from doing that - case and point, it's possible that a project is maintained in a privately-hosted copy of Gitlab CE, JIRA (Apache), or Phabricator (Wikimedia). Therefore, looking at the URL does not guarantee us a method to determine how to poll the issue count. If there was a way to access the data from the YAML file in main.js
, then that would let us set a type
or strategy
attribute in those files, which could be used to poll issue counts.
A little bit more on the GitLab API: as long as the user is authenticated to the GitLab server in question (be it gitlab.com or otherwise - API calls will use local cookies if available), we can HEAD the API endpoint https://gitlab.example.com/api/v4/projects/owner%2Fproject/issues
. If the user is unauthenticated, we'll get an HTTP/401 in response. Otherwise, we should get an HTTP/200. The JSON content doesn't actually matter to us - the X-Total
response header will tell us how many issues match. Note that this is not ideal for a first-point-of-contact website like up-for-grabs - it's unlikely that a particular visitor will have an account on a project-specific GitLab instance, unless it's on gitlab.com (still somewhat unlikely).
Additionally, note that GitLab also will reply with ETags, and support a HTTP/304 response for If-None-Match
request headers (see #546). It doesn't appear that GitLab does any sort of rate-limiting, so this isn't as big of an issue, but it does allow us to reduce load on maintainers' servers.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
While GitLab's API doesn't support anonymous access, users who are authenticated to GitLab should be able to see projects' issue counts.
issueCount