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

Move "good" badge helpers from lib/ to services/ #3101

Merged
merged 9 commits into from
Feb 28, 2019

Conversation

paulmelnikow
Copy link
Member

@paulmelnikow paulmelnikow commented Feb 25, 2019

This moves a few helpers from lib/ to services/:

build-status.js
build-status.spec.js
color-formatters.js
color-formatters.spec.js
contributor-count.js
licenses.js
licenses.spec.js
php-version.js
php-version.spec.js
text-formatters.js
text-formatters.spec.js
version.js
version.spec.js

And one from lib/ to core/:

unhandled-rejection.spec.js

The diff is long, but the changes are straightforward.

Ref #2832

@paulmelnikow paulmelnikow added service-badge Accepted and actionable changes, features, and bugs core Server, BaseService, GitHub auth labels Feb 25, 2019
@paulmelnikow paulmelnikow changed the title Move "good" badge helpers fro lib/ to services/ Move "good" badge helpers from lib/ to services/ Feb 25, 2019
@paulmelnikow paulmelnikow mentioned this pull request Feb 25, 2019
5 tasks
@shields-ci
Copy link

shields-ci commented Feb 25, 2019

Warnings
⚠️ Lots 'o changes. Skipping diff-based checks.
⚠️ This PR modified service code for f-droid but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for gem but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for hackage but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for hexpm but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for elm-package but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for itunes but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for jenkins but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for jetbrains but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for jitpack but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for lgtm but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for eclipse-marketplace but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for liberapay but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for dub but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for librariesio but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for discourse but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for luarocks but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for date but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for maven-central but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for ctan but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for maven-metadata but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for crates but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for nexus but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for cran but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for nodeping but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for cpan but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for npm but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for coveralls but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for packagecontrol but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for cookbook but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for packagist but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for conda but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for php-eye but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for codecov but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for pub but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for codeclimate but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for puppetforge but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for codacy but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for pypi but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for cocoapods but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for redmine but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for clojars but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for sonarqube but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for cii-best-practices but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for sourceforge but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for chrome-web-store but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for spiget but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for cdnjs but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for stackexchange but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for bstats but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for steam but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for bower but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for symfony but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for bountysource but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for teamcity but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for bintray but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for twitter but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for aur but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for uptimerobot but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for apm but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for vaadin-directory but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for ansible but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for visual-studio-marketplace but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for amo but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for wordpress but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for homebrew but not its test code.
That's okay so long as it's refactoring existing code.
Messages
📖 ✨ Thanks for your contribution to Shields, @paulmelnikow!
📖

Thanks for contributing to our documentation. We ❤️ our documentarians!

Generated by 🚫 dangerJS against cc44cc2

@paulmelnikow paulmelnikow added the blocker PRs and epics which block other work label Feb 25, 2019
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-3101 February 25, 2019 19:41 Inactive
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-3101 February 27, 2019 22:54 Inactive
@paulmelnikow
Copy link
Member Author

This will keep causing merge conflicts as service are changed. It would be great to get this merged. Have added a list of affected files to the top post.

@calebcartwright
Copy link
Member

calebcartwright commented Feb 27, 2019

I can look at this one tonight

@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-3101 February 27, 2019 23:59 Inactive
@calebcartwright
Copy link
Member

calebcartwright commented Feb 28, 2019

Was debating whether to ask this here or back over on #2832 (or #2698), but how are we qualifying "good" and "bad" for helper functions?

(not implying any of the functions in this PR are "bad", just not sure what puts a helper into a category)

Is "bad" just helper functions that are for legacy code/that will be unneeded once the service refactor is complete?

@paulmelnikow
Copy link
Member Author

Is "bad" just helper functions that are for legacy code/that will be unneeded once the service refactor is complete?

Yes, and regular-update which needs a total rewrite for async, maybe using node-cache.

@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-3101 February 28, 2019 00:53 Inactive
@@ -96,32 +93,35 @@ Each service has a directory for its files:
All service badge classes inherit from [BaseService] or another class which extends it.
Other classes implement useful behavior on top of [BaseService].

* [BaseJsonService](https://github.com/badges/shields/blob/master/services/base-json.js)
- [BaseJsonService](https://github.com/badges/shields/blob/master/services/base-json.js)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah just realized these links are bad now, should be https://github.com/badges/shields/blob/master/core/base-service/base-json.js

implements methods for performing requests to a JSON API and schema validation.
* [BaseXmlService](https://github.com/badges/shields/blob/master/services/base-xml.js)
- [BaseXmlService](https://github.com/badges/shields/blob/master/services/base-xml.js)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be https://github.com/badges/shields/blob/master/core/base-service/base-xml.js

class for the badges or one may already exist.

[BaseService]: https://github.com/badges/shields/blob/master/services/base.js
[baseservice]: https://github.com/badges/shields/blob/master/services/base.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be https://github.com/badges/shields/blob/master/core/base-service/base.js


module.exports = class Example extends BaseService { // (3)
module.exports = class Example extends BaseService {
// (3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not a fan of how prettier moves these comments around (especially num. 3) due to their relation to the bullets below.

Maybe we could move all the numbered comments to above the line the reference to both be consistent and satisfy prettier?

This doesn't need to be a blocker IMO (given all the changes in this PR) but if we merge these Tutorial changes as-is then I do feel we should update these inline code blocks soon

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh my editor must have done that. Thanks for catching it.

Do you think the inline numbers would look okay? They would be a lot easier to maintain, and it'd let us stop prettier-ignoring this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we merge this and one of us can deal with the broken links and formatting as a follow-on?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we merge this and one of us can deal with the broken links and formatting as a follow-on?

Works for me!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #3116 just to make sure we don't accidentally forget

@paulmelnikow
Copy link
Member Author

Thanks for the careful review!

@shields-deployment
Copy link

This pull request was merged to master branch. This change is now waiting for deployment, which will usually happen within a few days. Stay tuned by joining our #ops channel on Discord!

After deployment, changes are copied to gh-pages branch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker PRs and epics which block other work core Server, BaseService, GitHub auth service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants