Implemented internal siteInfo endpoint#703
Merged
Merged
Conversation
gwicke
reviewed
Nov 3, 2016
| return res; | ||
| } | ||
| return hyper.get({ | ||
| uri: new URI([req.params.domain, 'sys', 'action', 'siteinfo']) |
Member
There was a problem hiding this comment.
It might be worth wrapping this in a utility method (toAbsoluteURI or the like).
Contributor
There was a problem hiding this comment.
+1 on that. That method could also extract the body of the response right away to be compatible with the current code.
|
|
||
| return next(hyper, req) | ||
| .then(attachLocation) | ||
| .catch(attachLocation) |
Member
There was a problem hiding this comment.
Minor: You can use .then(attachLocation, attachLocation) instead.
Member
|
LGTM overall, but I didn't review extremely thoroughly. |
Contributor
Author
d00rman
reviewed
Nov 4, 2016
| body: '{{request.body}}', | ||
| }).expand; | ||
| } else { | ||
| if (!options.apiUriTemplate || !options.baseUriTemplate) { |
Contributor
There was a problem hiding this comment.
Minor: Add baseUriTemplate to the error message below.
d00rman
reviewed
Nov 4, 2016
| hyper.log('warn/bg-updates', e); | ||
| return mwUtil.getSiteInfo(hyper, req) | ||
| .then((siteInfo) => { | ||
| const baseUri = siteInfo.baseUri.replace(/^htts?:/, ''); |
Contributor
Author
Contributor
Author
|
Created a puppet config change here: https://gerrit.wikimedia.org/r/#/c/319897/ That config change must be deployed before this PR is. |
Member
|
LGTM. Any reason to delay the merge? |
Member
|
You didn't update config.example.yaml? |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #699 we need to have an internal
siteinfoendpoint, so I've implemented it.But I went even further - the endpoint now returns the
baseUriproperty that allows us to configure how RESTBase is exposed publicly in one place. This requires a config change to be deployed before this can go out.