13 Commits

Author SHA1 Message Date
Paul Melnikow
5dd4ee078b Start on the Github rewrite, with [GithubPullRequestCheckState] (#2253)
The GitHub service family is the largest, and as yet untouched by our service rewrite. I thought I would start the process by tackling one service.

This pull request has a few things going on:

1. Rename pull-request-status to pull-request-check-state. We have another badge called pull request status. It seems like the checks are called one thing in the UI and another thing in the API, which is unfortunate. If other folks have strong feelings about the name, I’ll defer.
2. Move its tests and tighten up the syntax.
3. Move its badge examples including the doc string.
4. Add a new helper `errorMessagesFor` to use in the new services in place of `githubCheckErrorResponse`. It seems like we didn’t really use the `errorMessages` parameter to `githubCheckErrorResponse`, so I pared this down. I’m not sure if this is the function we’ll ultimately want, but it seems like a good place to start.
5. Pull fetch code I _know_ we use in other places into `github-common-fetch`. As in the PR I just opened for azure-devops, this takes a functional approach to the shared code, which is more direct, nimble, and easy to reason about than inheritance.
6. Create `GithubAuthService` which functions identically to BaseJsonService, except for one thing, which is that it uses the token pool. I accomplished this by adding a `_requestFetcher` property to BaseService, which is initialized to `sendAndCacheRequest` in the constructor, and can be overridden in subclasses. Since we weren’t using `_sendAndCacheRequest` directly except in BaseService and tests, I removed that property. I like this approach to patching in the GitHub auth because it’s very simple and creates no new API exposure. However, the way we’re doing the dependency injection feels a bit odd. Maybe the eventual refactor of request-handler would be a godo time to revisit this.

The GitHub requests go through many, many layers of indirection at this point. Later on it would be good to shave some of these off, perhaps once the legacy GitHub services have been converted, or when all the services are done and we can take another look at the base service hierarchy. The work in #2021 and #1205 is also related.
2018-11-09 16:22:48 -05:00
Paul Melnikow
611e58e43e Make a few github tests more reliable (#2292)
The version test is failing because the shields repo version is not a dotted version.
2018-11-08 14:48:44 -05:00
Lentil Sun
88f10f8079 Fix: colorB override not working for Github Stars (#2171) 2018-10-21 14:33:12 +01:00
chris48s
a74db34853 Allow [GitHub] tag badge to sort by date (#2157)
* add test for tag-pre
* support /releases-pre (but also allow /all for BC)
* allow GH tags to be sorted by date instead of semver
* fix license badge
2018-10-08 18:29:02 +01:00
Pyves
3e69873930 [aur packagist php-eye travis vaadin-directory github david jitpack twitter] Enforced lowercase badge labels (#2058) 2018-09-09 11:41:10 +01:00
Pyves
b0070ff861 [GitHub] Error message customisation for all status codes (#1888) 2018-08-14 18:57:24 +01:00
Danial
b2af8f7a04 [GitHub] support issue tags with "/" character (#1902)
* support tags with "/" character
2018-08-12 15:20:30 +12:00
Paul Melnikow
ada1dec815 Lengthen timeout on a flaky service test (#1885) 2018-08-10 15:10:31 -04:00
Paul Melnikow
7a664ca3e8 Run prettier (#1866)
Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
2018-08-08 17:57:14 -04:00
Pyves
e1affea266 [GitHub] Fix undefined badges (#1816) 2018-08-08 20:57:57 +01:00
Marcin Mielnicki
9d90bd1f95 [github] Commit merge status badge (#1709)
* Basic version of commit-status badge added

* Support for case with no common ancestor

* Handle unknown branch

* Service tests with error responses

* Handle unexpected 404 responses from github

* Branch is a base

* Tests reordered

* Using not the newest commit in tests

* Test for checked commit identical with the newest commit in branch

* Code refactoring

* Example for Github commit merge status
2018-05-30 18:51:52 +02:00
chris48s
714df8fac5 change CC0 example in GH service tests (#1634) 2018-04-28 20:59:27 +01:00
Paul Melnikow
ea4b758612 Move service tests alongside code (#1563)
Per discussion in #1543
2018-03-20 18:32:48 -07:00