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

GithubApiProvider: injectible interface for code that calls [github] (also affects [suggest php-eye travis]) #1812

Merged
merged 11 commits into from
Aug 7, 2018

Conversation

paulmelnikow
Copy link
Member

@paulmelnikow paulmelnikow commented Jul 27, 2018

This interface was designed as part of the work in #1205. Right now it's just a wrapper around the legacy code, though it facilitates making this all dependency-injectible. This is the interface between the github logic and the badge code, so it grabs the bulk of the miscellaneous changes from that WIP PR.

See also #1205 (comment)

@paulmelnikow paulmelnikow added the core Server, BaseService, GitHub auth, Shared helpers label Jul 27, 2018
@shields-ci
Copy link

shields-ci commented Jul 27, 2018

Warnings
⚠️

This PR modified package.json, but not package-lock.json - Perhaps you need to run npm install?

⚠️

This PR modified the server but none of the service tests. That's okay so long as it's refactoring existing code.

⚠️

This PR modified helper functions in lib/ but not accompanying tests. That's okay so long as it's refactoring existing code.

Messages
📖

✨ Thanks for your contribution to Shields, @paulmelnikow!

Generated by 🚫 dangerJS

@paulmelnikow paulmelnikow changed the title GithubApiProvider: injectible interface for code that calls [github] (also affects [suggest]) GithubApiProvider: injectible interface for code that calls [github] (also affects [suggest php-eye travis]) Jul 27, 2018
server.js Outdated
'User-Agent': 'Shields.io',
'Accept': 'application/vnd.github.drax-preview+json'
};
request(apiUrl, { headers: customHeaders }, function(err, res, buffer) {
Copy link
Member Author

@paulmelnikow paulmelnikow Jul 27, 2018

Choose a reason for hiding this comment

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

This appears to be obsolete auth code which preceded githubAuth.

@paulmelnikow
Copy link
Member Author

In order to try out a PaaS, it's going to be important to make our Github token persistence platform-friendly, which means closing out the work of #1205. That's still a really hairy PR, and getting this in is the next step in paring it down.

@paulmelnikow
Copy link
Member Author

@PyvesB would you have a moment to review this? It would be very helpful for moving forward on the github work in #1848.

it('should invoke the callback', function(done) {
provider.request(mockRequest, '/foo', {}, (err, res, buffer) => {
expect(err).to.equal(null);
// Add more?
Copy link
Member

Choose a reason for hiding this comment

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

Would having a test with a non null error be useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

Couldn't hurt. I will add one.

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.

Reviewed, this looks like a good start to me! 😉

@paulmelnikow paulmelnikow merged commit 56fcb2e into badges:master Aug 7, 2018
@shields-deployment
Copy link

This pull request was merged to master branch. Now this change is waiting for deployment.
Deploys usually happen every few weeks. After deployment changes are copied to gh-pages branch.

This badge displays deployment status:

@paulmelnikow paulmelnikow deleted the github-api-provider branch August 7, 2018 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Server, BaseService, GitHub auth, Shared helpers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants