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

Added [codetally] to shields project. #1069

Merged
merged 2 commits into from
Sep 24, 2017
Merged

Added [codetally] to shields project. #1069

merged 2 commits into from
Sep 24, 2017

Conversation

triggerman722
Copy link
Contributor

Looking to add codetally to the shields project.

@triggerman722
Copy link
Contributor Author

triggerman722 commented Sep 5, 2017

Prior build failure appeared to be due to call to github(?). Retrying. #979.

@triggerman722
Copy link
Contributor Author

#1054 would be awesome in addition to this merge. Thanks!

@paulmelnikow paulmelnikow changed the title Added codetally to shields project. Added [codetally] to shields project. Sep 22, 2017
Copy link
Member

@paulmelnikow paulmelnikow left a comment

Choose a reason for hiding this comment

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

This looks really nice! Thanks, and thanks for the tests.

.get('/triggerman722/colorstrap.json')
.expectJSONTypes(Joi.object().keys({
name: Joi.equal('codetally'),
value: Joi.string().regex(/\b\d+(?:.\d+)?/)
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment indicating the intent of this regex?

server.js Outdated
}
try {
var data = JSON.parse(buffer);
badgeData.text[1] = " " + data.currency_sign + " " + data.amount + " " + data.multiplier;
Copy link
Member

Choose a reason for hiding this comment

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

Could you omit the space between the currency sign and the amount? $2.50 instead of $ 2.50.

<rect x="6" y="3" width="1" height="7"/>
<line x1="0.25" y1="9.75" x2="6.75" y2="3.25" stroke-width="1" stroke="#fff" />
</g>
</svg>
Copy link
Member

Choose a reason for hiding this comment

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

There isn't consensus about how to handle showing vendor logos, particularly by default. The design goal of shields was to display clean, consistent badges. The social badges have logos, though there are only a couple other badges with logos.

Would you mind removing it until a consensus is reached? It would expedite getting this merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you Paul. I will update to remove the logo, space and provide testing comments this and re-submit.

@triggerman722
Copy link
Contributor Author

Hi Paul,

I've made the 3 requested changes:

  1. Removed the space between $ and the value
  2. Removed the logo
  3. Added a comment explaining the regex in the test.

Note: the travis tests fail, however that is due to a 403 from github which occurs periodically due to rate limiting (i.e. not specific to this change).

@paulmelnikow
Copy link
Member

Thanks! I just re-ran the Travis build and one of the new Codetally tests failed. Ran it one more time, and it passed. Hopefully a fluke!

@paulmelnikow paulmelnikow merged commit 20ab540 into badges:master Sep 24, 2017
@paulmelnikow
Copy link
Member

paulmelnikow commented Sep 24, 2017

Just caught another failure on that test in a different CI build.

I timed the request by running time curl http://www.codetally.com/formattedshield/triggerman722/colorstrap. Oddly the first time I ran it, the request took almost two seconds. After that, it took about 100–200 ms.

Could there be some caching on the server that makes it work on subsequent requests, but not the first one?

It seems to me that, to keep this badge, we need their API to respond faster than two seconds. Even 100–200 ms is a bit long.

Could you raise the issue upstream?

@paulmelnikow paulmelnikow self-assigned this Sep 24, 2017
@triggerman722
Copy link
Contributor Author

Hi Paul,

Codetally is on heroku and yesterday I upgraded my plan there to avoid this problem. On Heroku's cheap plans (which is what Codetally was on when you saw this problem) sites with low volume get put to sleep, then fire up on first request. That is why you had 2s then 100-200ms. From now on, you should have neither problem (i.e. no more initial lag and individual hits should be faster as well.).

If we see a continued trend of poor performance, please log an issue in the codetally_core project - https://github.com/Codetally/codetally_core/issues/new.

Thanks

@paulmelnikow
Copy link
Member

Aha! It was a Hobby dyno. Thanks for addressing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants