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 build badge examples into services/ #2234

Merged
merged 7 commits into from
Oct 31, 2018
Merged

Conversation

paulmelnikow
Copy link
Member

@paulmelnikow paulmelnikow commented Oct 30, 2018

all-badge-examples is a common cause of merge conflicts. It’s difficult to adjust the badge categorization in that file – or to understand the diff – because it requires moving a block from one point to another. It’s much easier to edit a badge’s category in one place.

This starts the process of breaking up what’s left of that file, following up on the work from #1931. New-style services can only be in one category, which means legacy service examples have to be split along category lines. I split out separate legacy service classes where I could do so easily, leaving behind the ones which require more work, for one reason or another.

I did this manually, which wasn't as bad as I thought. Doing it one category at a time made it easier. Also someone must have done some work to harmonize the keys. 😁(That wasn't I, was it?)

Anyway, these were done manually, so I'll check them on the deploy app. If someone else wants to do that too, an extra set of eyes wouldn't hurt!

all-badge-examples is a common cause of merge conflicts. It’s difficult to adjust the badge categorization in that file – or to understand the diff – because it requires moving a block from one point to another. It’s much easier to edit a badge’s category in one place.

This starts the process of breaking up what’s left of that file, following up on the work from #1931.
@paulmelnikow paulmelnikow added the service-badge Accepted and actionable changes, features, and bugs label Oct 30, 2018
@paulmelnikow paulmelnikow changed the title Move build badge examples into services/ Move most of the badge examples into services/ Oct 30, 2018
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2234 October 30, 2018 16:58 Inactive
@shields-ci
Copy link

Warnings
⚠️

This PR modified service code for beerpay 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 homebrew but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for imagelayers 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 elm-package but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for jira 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 liberapay 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 dub but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for maintenance but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for docker 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 dockbit 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 discourse but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for microbadger but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for dependabot but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for osstracker but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for david 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 coverity 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 coveralls 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 continuousphp 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 codetally but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for readthedocs but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for codeship but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for scrutinizer 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 sensiolabs 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 sonarqube 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 sourceforge but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for bundlephobia but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for sourcegraph but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for buildkite 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 bugzilla but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for travis 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 twitter 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 vso but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for bitrise but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for waffle but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for bitbucket but not its test code.
That's okay so long as it's refactoring existing code.

⚠️

This PR modified service code for wheelmap 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.

Messages
📖

✨ Thanks for your contribution to Shields, @paulmelnikow!

📖

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

Generated by 🚫 dangerJS

@paulmelnikow paulmelnikow changed the title Move most of the badge examples into services/ Move build badge examples into services/ [bintray cookbook jitter] Oct 30, 2018
Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

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

I've had a look over this on staging by eye. I've left one inline comment which is an easy fix. I also found the dockbit and bitrise examples aren't rendering, but I'm not quite sure why. It seems like it might be something to do with the colon character being URLencoded as %3a, but its only in the template URL. It can't be a coincidence though.

Annoyingly, now I see this I remember we did notice this in an earlier PR review #1740 (review) but I think it got lost in that review somewhere and we didn't do anything about it :(

Apart from that, everything else seems to be where it should be..

return [
{
title: 'LGTM Grade',
previewUrl: '/lgtm/grade/java/g/apache/cloudstack',
Copy link
Member

Choose a reason for hiding this comment

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

The LGTM Grade example isn't rendering - I suspect this is because starting this with a / is giving us an extra / char in the URL: /grade//lgtm/ (it would be nice to be more lenient about this)

Copy link
Member Author

Choose a reason for hiding this comment

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

Heh, it's not just the slash; I forgot to strip off /lgtm/grade/ so that's showing up twice in the URL. 😝 Fixed.

@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2234 October 30, 2018 21:21 Inactive
@paulmelnikow
Copy link
Member Author

I also found the dockbit and bitrise examples aren't rendering, but I'm not quite sure why. It seems like it might be something to do with the colon character being URLencoded as %3a, but its only in the template URL. It can't be a coincidence though.

Buh. Yea. The example URLs are wrong too. Part of it is the encoding, and the other part is putting the .svg before the query string. Independent of this, yea?

Offline we discussed running the test from #1800 (comment) to check these programmatically too. I'll work on that now.

@paulmelnikow paulmelnikow changed the title Move build badge examples into services/ [bintray cookbook jitter] Move build badge examples into services/ [bintray cookbook gitter] Oct 30, 2018
@chris48s
Copy link
Member

the other part is putting the .svg before the query string

Aah yeah - that'll be it. We probably need to be able to pass a queryString in the example object to get round that. In general we don't really have good handling for badges that use queryString params in the new base class architecture - there will need to be some extra base class work before we can port those. If those ones are the only things broken, we could move those examples back to all-badge-examples for now and deal with that as another issue.

@paulmelnikow
Copy link
Member Author

I don't think moving them back to all-badge-examples will solve the problem. As far as I can tell, dockbit was broken before the move.

I'm working on a little refactor of prepareExamples toward solving this problem.

We'll be able to change the schema more easily once we empty out all-badge-examples – looking forward to that!

paulmelnikow added a commit that referenced this pull request Oct 31, 2018
I went down a rabbit hole while trying to untangle the bug in the dockbit and bitrise examples #2234 (review).

The URL generation code is spaghetti-like, with functions, many of which I wrote, with opaque names, doing similar but not identical things, and making slightly incompatible assumptions about the way query strings are handled.

I got a bit lost and need to take a step back.

Meanwhile, this is a smalle piece of work I did that’s worth keeping. It doesn’t scratch the surface of the tangle, but it does remove a bit of duplication.

It also makes a minor stylistic ES6 change in the handling of default arguments.
@paulmelnikow
Copy link
Member Author

paulmelnikow commented Oct 31, 2018

Ah, after running the automated test I see dockbit and bitrise got more broken by the move. I'll put them back.

I pushed a fix for the new issue with these two badges, which is the misplaced .svg. I did not fix the issue with encoding the colon in the query string – which is not new.

@paulmelnikow
Copy link
Member Author

paulmelnikow commented Oct 31, 2018

I used your script to compare the previewUrls in master and in the branch. This is the diff:

124,125d123
< /bundlephobia/min/react.svg
< /bundlephobia/minzip/react.svg
175c173
< /david/babel/babel.svg?path=packages/babel-core
---
> /david/babel/babel.svg?path=packages%2Fbabel-core
367c365
< /twitter/follow/espadrine.svg?style=social&label=Follow
---
> /twitter/follow/espadrine.svg?label=Follow&style=social
383c381
< 382
---
> 380
  • bundlephobia I removed on purpose, because the examples had been duplicated under size and version.
  • david is arguably more correct now
  • twitter the order doesn't really matter

I repeated the test for urlPattern and exampleUrl and everything lines up.

This should be good to go!

I'm going to disable the service tests because they're failing for unrelated reasons (#2239).

@paulmelnikow paulmelnikow changed the title Move build badge examples into services/ [bintray cookbook gitter] Move build badge examples into services/ Oct 31, 2018
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2234 October 31, 2018 02:19 Inactive
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2234 October 31, 2018 02:40 Inactive
@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:

@paulmelnikow paulmelnikow deleted the split-all-badge-examples branch October 31, 2018 21:32
paulmelnikow added a commit that referenced this pull request Nov 1, 2018
Continuing the work from #2234, this creates additional, empty LegacyServices to hold the badge examples for conda and cocoapods. It's an approach we could take to finish emptying out all-badge-examples while the refactoring continues.

On the website badge, even the first URL path component is variable. I didn't think it could be moved, but it can!
paulmelnikow added a commit that referenced this pull request Nov 5, 2018
I went down a rabbit hole while trying to untangle the bug in the dockbit and bitrise examples #2234 (review).

The URL generation code is spaghetti-like, with functions, many of which I wrote, with opaque names, doing similar but not identical things, and making slightly incompatible assumptions about the way query strings are handled.

I got a bit lost and need to take a step back.

Meanwhile, this is a small piece of work I did that’s worth keeping. It doesn’t scratch the surface of the tangle, but it does remove a bit of duplication.

It also makes a minor stylistic ES6 change in the handling of default arguments.

Ref: #2027
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.

3 participants