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 _makeBadgeData -> coalesceBadge; test on [static dynamic endpoint] #2859

Merged
merged 6 commits into from
Jan 25, 2019

Conversation

paulmelnikow
Copy link
Member

base.js is pretty long and _makeBadgeData is one of the most complex
functions in it.

It's a pure function so it's easy to test in isolation. This moves the function into its own module and reorganizes the tests in a way that makes it evaluate what it's doing, and easier to test what is and isn't covered.

Ref #2796 (comment)

…amic endpoint]

`base.js` is pretty long and `_makeBadgeData` is one of the most complex
functions in it.

It's a pure function so it's easy to test in isolation. This moves the function into its own module and reorganizes the tests in a way that makes it evaluate what it's doing, and easier to test what is and isn't covered.

Ref #2796 (comment)
@paulmelnikow paulmelnikow added the core Server, BaseService, GitHub auth, Shared helpers label Jan 23, 2019
@paulmelnikow paulmelnikow changed the title _makeBadgeData -> coalesceBadge, in its own file; test on [static dynamic endpoint] Refactor _makeBadgeData -> coalesceBadge; test on [static dynamic endpoint] Jan 23, 2019
@shields-ci
Copy link

shields-ci commented Jan 23, 2019

Messages
📖 ✨ Thanks for your contribution to Shields, @paulmelnikow!

Generated by 🚫 dangerJS against dd72145

@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2859 January 23, 2019 23:35 Inactive
@paulmelnikow paulmelnikow added the blocker PRs and epics which block other work label Jan 24, 2019
])
})

// This behavior isn't great and we might want to remove it.
Copy link
Member

Choose a reason for hiding this comment

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

What's the thinking on removing it? I actually just noticed this not too long ago when I forgot to set a default badge label and noticed the category being used in my local env. If we removed this, would there be an error thrown (programmer error) or what would the label show as alternatively?

Copy link
Member Author

Choose a reason for hiding this comment

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

Throwing an error is a good idea.

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 think @chris48s was the first person who articulate this was a bad/unexpected use of the category.

@calebcartwright
Copy link
Member

This looks good to go IMO. I added a couple questions inline but basically ready to approve

@calebcartwright
Copy link
Member

Oh and I was also wondering if this warranted a full service test run? (I see it was already run against a few)

@paulmelnikow
Copy link
Member Author

Could if you’d like! I think the coverage is there in “core” though I’ve zero objections if you’d like to run more tests.

@calebcartwright calebcartwright changed the title Refactor _makeBadgeData -> coalesceBadge; test on [static dynamic endpoint] Refactor _makeBadgeData -> coalesceBadge; test on [*****] Jan 25, 2019
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2859 January 25, 2019 03:12 Inactive
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2859 January 25, 2019 03:20 Inactive
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2859 January 25, 2019 03:20 Inactive
@calebcartwright calebcartwright changed the title Refactor _makeBadgeData -> coalesceBadge; test on [*****] Refactor _makeBadgeData -> coalesceBadge; test on [static dynamic endpoint] Jan 25, 2019
@calebcartwright
Copy link
Member

The tests that were failing (David, TeamCity, etc.) were the same as what's been failing in the daily run so no issues here

@paulmelnikow paulmelnikow merged commit 23fe392 into master Jan 25, 2019
@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 coalesce-badge branch February 20, 2019 03:36
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, Shared helpers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants