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

refactor arch user repositories [aur] service #2086

Merged
merged 4 commits into from
Oct 6, 2018

Conversation

chris48s
Copy link
Member

Refs #1358

This PR ports the Arch User Repositories integration to the new service architecture.

class AurVersion extends BaseAurService {
static render({ version, outOfDate }) {
const color = outOfDate === null ? 'blue' : 'orange'
return { message: versionText(version), color: color }
Copy link
Member Author

Choose a reason for hiding this comment

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

I've intentionally not used renderVersionBadge() here because we're using colour to convey a different meaning here

@shields-ci
Copy link

Messages
📖

✨ Thanks for your contribution to Shields, @chris48s!

📖

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

Generated by 🚫 dangerJS

@chris48s chris48s added the service-badge Accepted and actionable changes, features, and bugs label Sep 25, 2018
@PyvesB
Copy link
Member

PyvesB commented Sep 27, 2018

We seem to usually break down different badges implementations into different files, shouldn't we have version, votes and license separated?

@chris48s
Copy link
Member Author

We've got a mix. For some services we've got the base class in one file and each service in its own file, but for example APM also defines 3 badge classes in one file:

module.exports = {
APMDownloads,
APMVersion,
APMLicense,
}

I definitely wouldn't want to define a large service family like NPM or PyPI all in one file, but I reckon when we're dealing with a couple hundred lines of code its fine. I guess its a matter of taste though.

@PyvesB
Copy link
Member

PyvesB commented Oct 1, 2018

Fair enough. I'm a bit short on time at the moment, but will aim at reviewing this more carefully later during the week. 😉

Copy link
Member

@PyvesB PyvesB left a comment

Choose a reason for hiding this comment

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

Looks good to me, I've left a question and a small observation inline. 😉

results: Joi.alternatives(
Joi.array()
.min(0)
.max(0)
Copy link
Member

Choose a reason for hiding this comment

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

I believe you could simply use length(0) here.

services/aur/aur.service.js Show resolved Hide resolved
@@ -16,7 +15,7 @@ t.create('version (valid)')
.get('/version/yaourt.json?style=_shields_test')
.expectJSONTypes(
Joi.object().keys({
name: 'aur',
name: 'version',
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 somewhat confused here. Why has the label changed to version?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. Looking over the examples we usually use the platform name as the label on version badges so I shouldn't have changed this.

@chris48s chris48s changed the title refactor arch user repositories [aur] service code refactor arch user repositories [aur] service Oct 6, 2018
@chris48s chris48s merged commit 7ea540d into badges:master Oct 6, 2018
@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:

@chris48s
Copy link
Member Author

chris48s commented Oct 6, 2018

cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants