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

New 1.0 API: Address TODO items. #204

Merged
merged 4 commits into from
Jul 6, 2018
Merged

New 1.0 API: Address TODO items. #204

merged 4 commits into from
Jul 6, 2018

Conversation

kvosper
Copy link
Contributor

@kvosper kvosper commented Jul 2, 2018

Some of the TODOs have been resolved. Some have been transformed into GitHub issues. Others have requests for clarity added.

@mikkokar mikkokar changed the title Todos New 1.0 API: Address TODO items. Jul 3, 2018
// This method is bad because it just takes string instead of stream of chunks. Also it implicitly
// assumes UTF_8 encoding.

// TODO see https://github.com/HotelsDotCom/styx/issues/200
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment can be removed as I have merged your PR #205.

});

return future;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note:

We should consider if the StreamingHttpMessage.java is necessary at all. Looking at this now it feels bit unnecessary interface. For example releaseContentBuffers could have been delegated if we didn't have this interface already in place.

@@ -38,6 +38,8 @@

// TODO: Mikko: Styx 2.0 Api: `onError`: is more flexible type signature possible? Such as:
// <U> StyxObservable<U> onError(Function<Throwable, StyxObservable<U>> errorHandler);
// Doesn't look like rx.Observable.onError has a suitable method
// Might be possible to hack it, but it's possible that the compiler may get confused by such a method
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I think we can just remove all these comments.

package com.hotels.styx.api.netty;

import com.hotels.styx.api.messages.HttpResponseStatus;
package com.hotels.styx.api.messages;

/**
* Custom HTTP response status codes.
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to remove the netty package from the API. Can you raise another GitHub issue for this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Raised #207

// TODO: Mikko: Styx 2.0 API: Had to relax visibility due to CustomHttpResponseStatus class.
// Check with Kyle.
public HttpResponseStatus(int code, String description) {
HttpResponseStatus(int code, String description) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -32,6 +32,7 @@ public static HttpServer createAdminServer(StyxServerComponents config) {
// TODO: Pass all backend Service Registries to AdminServerBuilder:
// - only one backendServicesRegistry is passed in to the admin interface. Instead we
// should pass all of them:
// The comment seems to refer to part of a larger piece of work. Is there an issue to associate this with?
Copy link
Contributor

Choose a reason for hiding this comment

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

Haha this is your own comment @kvosper: Styx server refactoring (#116).

If you no longer remember please remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As the first line of the comment says, I only moved the comment here from StyxServer. I don't believe I wrote it originally. If it doesn't mean anything to you either, I will remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Please remove.

@@ -50,6 +50,7 @@ DQUOTE : ["] ;
ID : [a-zA-Z0-9_]+ ;

// TODO: should also accept any visible non-delimiting US-ASCII character
// Not clear what this comment is referring to. Need more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's stick to 1.0 API related TODO items. This is not one of them. Please back off this change.

@@ -42,6 +42,7 @@ public static ProxyToBackendRoute proxyToBackend(HttpClient client) {
@Override
public StyxObservable<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) {
// TODO: Mikko: Styx 2.0 API:
// Unclear comment
return fromRxObservable(client.sendRequest(request));
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment was there to remind me that the client is still using bare rx observables. It can be removed now as the client interface is a well-understood limitation in the 1.0 API.

@@ -49,7 +49,7 @@

def run_command(command):
cmd_process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
# TODO, should read input using communicate() method:
# TODO, should read input using communicate() method: - what does this mean? needs looking at by someone who knows python
cmd_process.wait()
Copy link
Contributor

Choose a reason for hiding this comment

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

As it is not related to the API work please back off this change.

@@ -22,7 +22,7 @@

def run_command(command):
cmd_process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
# TODO, should read input using communicate() method:
# TODO, should read input using communicate() method: - what does this mean? needs looking at by someone who knows python
Copy link
Contributor

Choose a reason for hiding this comment

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

Also here, please back off this change as it is not an API related comment.

@@ -34,6 +34,7 @@ public void add(String key, Object value) {
}

// TODO: Mikko: Styx 2.0 API: MockObservable support for `onError`.
// This class is never used.
static class MockObservable<T> implements StyxObservable<T> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do.

@@ -144,6 +144,7 @@ public void onChange(Registry.Changes<BackendService> changes) {
};

//TODO: origins inventory builder assumes that appId/originId tuple is unique and it will fail on metrics registration.
// We have plans to entirely revamp the OriginsInventory, see https://github.com/HotelsDotCom/styx/issues/197
OriginsInventory inventory = new OriginsInventory.Builder(backendService.id())
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the comments.

@@ -40,6 +40,7 @@ public RouteHandlerAdapter(HttpRouter router) {
// TODO: NoServiceConfiguredException happens *after* routing. Therefore it doesn't contain
// any helpful information about the state of the router as to why service was not configured.
// It might be useful to think if there is a better way of addressing this issue.
// What kind of information might we want?
Copy link
Contributor

Choose a reason for hiding this comment

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

This needed to be removed, too.

@@ -89,6 +89,7 @@ public void styxStopping() {
try {
// TODO: Mikko: Styx 2.0 API:
// Check this:
// Check what about it?
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget this.

@mikkokar mikkokar merged commit 6a023ca into ExpediaGroup:styx-1.0-dev Jul 6, 2018
@kvosper kvosper deleted the todos branch July 6, 2018 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants