I find having these in a consistent order makes the services much faster to read.
This is the order I’ve generally been using:
1. Category
2. Route
3. Examples
4. Rendering
5. Other helpers (`fetch()`, `transform()`)
6. `handle()`
* refactor(JenkinsTests): finished core refactor to new service model
* refactor(JenkinsTests): more updates
* refactor(JenkinsCoverage): minor refactor to leverage new common Jenkins content
* refactor(JenkinsBuild): update redirector to include shorthand alias
* chore: apply suggestion on jenkins-tests.service.js
Co-Authored-By: calebcartwright <calebcartwright@users.noreply.github.com>
* refactor(JenkinsTests): rename test helpers
* chore: cleanup JenkinsCoverage redirector
* chore: cleanup JenkinsBuild redirector
* chore: cleanup test docs
* [Bit] add bit components count service
* [Bit] change 404 error to 'collection not found'
* [Bit] remove comment
* [Bit] change collection schema
* [Bit] use isMetric
* [Bit] replace static color to dynamic color
* [BIt] change bit total components route
* change scope to collection
* change all scope var to collection
- Prefer inline transforms to take place in `handle()` rather than `render()`
- Avoid inversion of control by removing `BaseWordpress#handle()`, passing `extensionType` into `fetch()`, and removing one layer of subclassing
- Move “not found” checks into `fetch()`
- Cache wordpress versions instead of fetching on each request
- Start to convert aliases to redirects (there are more of these which could be tackled in a follow-on)
- Replace at least one route `format` with a `pattern` (ref #3329)
- Partially reorder: name, category, route, examples, defaultBadgeData, render, fetch, handle
Some of this is in line with our established patterns or makes it clearly easier to follow; some of it is arguably stylistic.
* Use url `pattern` for [nexus]
* chore: minor nexus example tweaks
* chore: fix prettier issue
* refactor(Nexus): minor refactor to fix tests and examples
* chore: increase timeout on nexus service tests
* chore: prettified for prettier
* tests(Nexus): increase timeout for recurringly slow test
* chore: update nexus schema with docs
* refactor(JenkinsBuild): ported to new service model
* refactor(JenkinsBuild): added redirector for jenkins-ci route
* refactor(JenkinsBuild): trying to debug test on circle
* refactor(JenkinsBuild): fix test of mock creds
* chore: fix typo in wrong file 🤦
* refactor(JenkinsBuild): update route
* refactor(JenkinsBuild): fixed service test
* refactor(JenkinsBuild): made strictSSL configurable via QP
This moves the four npm download services into a single class, in line with #3174, and other service implementations we've written in the last couple months.
1. Change the suffixes from **/m** to **/month** for consistency.
2. Add tests of one of the intervals besides total.
3. Rewrite mocked service tests as unit tests.
4. Use (and work with) the `intervalMap` pattern that I think @calebcartwright started us using.
* Add drone build badge based on travis
* Fix wrong mocked endpoint for done builder
* Refactor service tester using helper method
* Add missing failure status to red statuses
* Remove extraneous invalid svg test from drone
* Test on failure red status in build status spec
* refactor(drone): use json service instead of svg
* refactor(drone): remove status text and extraneous build path in test
* refactor(drone): allow defining self-hosted drone instances
* fix(drone): use proper urls in drone examples
* fix(drone): add drone token authorization for self-hosted instances
* refactor(drone): call render build status badge directly instead of render
* refactor(drone): use server query parameter for self-hosted instances
* fix(drone): separate url and query params in example
* fix(drone): use actual build status message in examples
* fix(drone): add missing message for status code 401
Co-Authored-By: byCedric <me@bycedric.com>
* refactor(drone): remove color from drone tests
* refactor(drone): remove extraneous comments from drone tests
* refactor(drone): remove unused static preview method
* refactor(drone): remove unused static render method
* refactor(drone): reuse render build status badge helper in static previews
* fix(drone): test inaccessible repos on new message
Attacking this in two pieces for ease of review. The legacy implementation for coverage is still there, though I disabled it via the route. That whole file will be removed in the next PR.
Ref #2863
* refactor(sonar)
* refactor(sonarqube): creating separate services for SQ badges
* refactor(sonar): more sonar refactorings
* refactor(sonar): fixed duplicate service names from c/p
* refactor(sonar): finished violations service impl
* refactor(sonar): finished unit tests for violations service
* feat(sonar): violation badge updates
* refactor(sonar): finished doc. api density service
* feat(sonar): added quality gate service
* chore: sonar doc tweaks
* refactor(sonar): added redirector service
* refactor(sonar): added examples
* refactor(sonar): minor example updates
* refactor(sonar): added final tests
* chore(sonar): removed unneeded test spec file for base class
* refactor(sonar): updates based on PR feedback
* refactor(sonar): change query param to sonarVersion
* refactor(sonar): fixing query param issue
* refactor(sonar): fix test color for generic metric
* chore: fix lint/prettier issue
* chore(sonar): update query param name in examples
* refactor(sonar): make schema metric key required
* reactor(sonar): fix tests
* refactor(sonar): added more example listings
* refactor(sonar): minor style updates
* refactor(sonar): update examples
* refactor(Sonar): minor example tweaks
Not really sure what happened, but the test for the deprecated gratipay/gittp service has been failing for a while with a 404 badge not found error. For example
`AssertionError: label mismatch: expected '404' to equal 'gratipay'`
This tweaks the rout pattern so the test is passing again.
One of the tests for the Maintenance service that was added when the service was refactored is failing
`AssertionError: message mismatch: expected 'no! (as of 2018)' to equal 'stale (as of 2019)'`
I believe the test was added in an attempt to cover the one of the code paths, but that original test would only pass a couple months out of the year.
Testing those paths with the original implementation would have required a lot of stubbing clocks/timers, so instead I refactored the code a bit. I removed the flaky live/service test, and added some unit tests instead (which made more sense to me since this service badge doesn't hit a live endpoint)