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

CODENVY-556 Add service for fetching recipe script #1717

Merged
merged 1 commit into from
Jul 15, 2016
Merged

Conversation

mkuznyetsov
Copy link
Contributor

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

@benoitf
Copy link
Contributor

benoitf commented Jul 12, 2016

missing a server side test of the new method but looks great !

@codenvy-ci
Copy link

@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, will fix

@mshaposhnik
Copy link
Contributor

Other Ok

@codenvy-ci
Copy link

Build # 1197 - FAILED

Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1197/ to view the results.

@mkuznyetsov
Copy link
Contributor Author

@garagatyi @evoevodin @riuvshin pls review

@codenvy-ci
Copy link

@vparfonov
Copy link
Contributor

ok foe me but @garagatyi comment make sens need to discuss with him

@mkuznyetsov
Copy link
Contributor Author

I will move it to a separate service in Machine Plugin

@codenvy-ci
Copy link

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;

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k

@mshaposhnik
Copy link
Contributor

Ok

/**
* Fetch recipe script for machine source location
* @param machine
* machineto fetch for
Copy link
Member

Choose a reason for hiding this comment

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

check this sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@garagatyi
Copy link

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");
Copy link
Contributor

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.

@voievodin
Copy link
Contributor

LGTM

@akorneta
Copy link
Contributor

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
@mkuznyetsov mkuznyetsov merged commit e8ff05f into master Jul 15, 2016
@mkuznyetsov mkuznyetsov deleted the CODENVY-556-2 branch July 15, 2016 12:27
@codenvy-ci
Copy link

Build # 1223 - FAILED

Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1223/ to view the results.

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.

9 participants