Skip to content

Add support for specifying a separate Github base URL #80

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

Merged
merged 1 commit into from
Sep 9, 2015

Conversation

gdiggs
Copy link
Contributor

@gdiggs gdiggs commented Sep 9, 2015

When using GH:E, api.github.com will not be the endpoint used to handle
PRs and issues. We can specify it in the configuration to handle that
case better. Defaulting it to api.github.com means that we do not need
to backfill any data.

@codeclimate/review

@@ -55,6 +55,10 @@ def receive_issue

private

def base_url
ENV["CODECLIMATE_GITHUB_API_URL"] || DEFAULT_BASE_URL
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this defaulting happen in CodeClimate::Config and use CodeClimate.config[:github_api_url] everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This gem won't always have access to that config object, will it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do default there, but I didn't think it was re-usable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I guess I'm confused why you think this code wouldn't be able to call CodeClimate.config, it's all in the same Ruby process, right?

When using GH:E, api.github.com will not be the endpoint used to handle
PRs and issues. We can specify it in the configuration to handle that
case better. Defaulting it to api.github.com means that we do not need
to backfil any data.
@gdiggs
Copy link
Contributor Author

gdiggs commented Sep 9, 2015

@codeclimate/review Ready for another look

@pbrisbin
Copy link
Contributor

pbrisbin commented Sep 9, 2015

The change LGTM -- I think @brynary mentioned in chat that we need to make this field hidden before we can ship it, and I agree.

@gdiggs
Copy link
Contributor Author

gdiggs commented Sep 9, 2015

@pbrisbin @brynary I thought the hidden-ness happened on the app side? In the way that we don't render a checkbox for the allow comments attribute I was going to do the same here

@pbrisbin
Copy link
Contributor

pbrisbin commented Sep 9, 2015

Sorry! Thought this was an App PR (that explains earlier confusion too). LGTM :)

gdiggs added a commit that referenced this pull request Sep 9, 2015
Add support for specifying a separate Github base URL
@gdiggs gdiggs merged commit 54eb256 into master Sep 9, 2015
@gdiggs gdiggs deleted the gd-github-api branch September 9, 2015 22:27
@brynary
Copy link
Member

brynary commented Sep 9, 2015

Let's make sure hidden is actually "protected" (as in, can't slip in bad values via unexpected form POST)

—Bryan Helmkamp, Founder, Code Climate

bryan@brynary.com / 646-379-1810 / @brynary

Typed with thumbs.

On Wed, Sep 9, 2015 at 6:27 PM, pat brisbin notifications@github.com
wrote:

Sorry! Thought this was an App PR (that explains earlier confusion too). LGTM :)

Reply to this email directly or view it on GitHub:
#80 (comment)

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.

3 participants