-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CODENVY-556 Add service for fetching recipe script #1717
Conversation
missing a server side test of the new method but looks great ! |
@@ -30,6 +30,7 @@ | |||
import static com.google.gwt.http.client.RequestBuilder.DELETE; | |||
import static com.google.gwt.http.client.RequestBuilder.PUT; | |||
import static org.eclipse.che.ide.MimeType.APPLICATION_JSON; | |||
import static org.eclipse.che.ide.MimeType.TEXT_PLAIN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, will fix
Other Ok |
Build # 1197 - FAILED Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1197/ to view the results. |
@garagatyi @evoevodin @riuvshin pls review |
ok foe me but @garagatyi comment make sens need to discuss with him |
I will move it to a separate service in Machine Plugin |
Build # 1215 - FAILED Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1215/ to view the results. |
@Inject | ||
public RecipeScriptDownloadServiceClientImpl(@RestContext String restContext, AsyncRequestFactory asyncRequestFactory) { | ||
this.restContext = restContext; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
save the byte - save the nature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
Ok |
/** | ||
* Fetch recipe script for machine source location | ||
* @param machine | ||
* machineto fetch for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check this sentence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
LGTM |
try { | ||
final String protocol = new URL(machineCfg.getSource().getLocation()).getProtocol(); | ||
checkArgument(protocol.equals("http") || protocol.equals("https"), | ||
"Environment " + envName + " contains machine with invalid source location"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this message is not good enough. For instance you can add more certainty to the message by saying what exactly is wrong, i mean if we allow only http/https protocols for recipe locations then it is obviously good to add it to the exception, moreover if environment provides many machine configs then it will be also useful to add recipe location to the exception message as well.
LGTM |
ok |
In order to fetch recipe script from external host, and not end up with 'Mixed content' error, when trying to send HTTP request on HTTPS installation, we will do it on server side instead. from HTT
3db5d8c
to
411dd89
Compare
Build # 1223 - FAILED Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1223/ to view the results. |
In order to fetch recipe script from external host, and not
end up with 'Mixed content' error, when trying to send
HTTP request on HTTPS installation, we will do it on server side instead.
from HTT