Skip to content

ios: e2e hello world demo for swift#353

Merged
junr03 merged 6 commits intomasterfrom
e2e-swift
Aug 20, 2019
Merged

ios: e2e hello world demo for swift#353
junr03 merged 6 commits intomasterfrom
e2e-swift

Conversation

@junr03
Copy link
Copy Markdown
Member

@junr03 junr03 commented Aug 20, 2019

Description: this PR fixes a couple bugs to allow e2e use of the Envoy Mobile library in the swift iOS demo.
Risk Level: low - fixing bugs
Testing: ./bazelw build --config=ios --xcode_version=10.3.0.10G8 //:ios_dist and then ./bazelw run --config=ios --xcode_version=10.3.0.10G8 //examples/swift/hello_world:app

Signed-off-by: Jose Nino jnino@lyft.com

Jose Nino added 4 commits August 20, 2019 11:31
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
fmt
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
@junr03 junr03 requested review from goaway and rebello95 August 20, 2019 19:21
Copy link
Copy Markdown
Contributor

@rebello95 rebello95 left a comment

Choose a reason for hiding this comment

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

Looks good overall!


/// Performs necessary setup after Envoy has initialized and started running.
/// TODO: create a post-initialization callback from Envoy to handle this automatically.
- (void)setup;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯

_platformObserver = observer;

// Create callback context
ios_context *context = (ios_context *)malloc(sizeof(ios_context));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did these actually cause problems?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

nope, the cast is just not needed. I'll open another PR to homogenize this style.

extension Envoy: Client {
public func startStream(with request: Request, handler: ResponseHandler) -> StreamEmitter {
let httpStream = self.engine.startStream(with: handler.underlyingObserver)
NSLog("Sending request with headers: \(request.outboundHeaders())")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's remove this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sure. I thought this was a pretty good log line to have. Is there a way to define log levels with NSLog?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For the future. I will remove this for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nope, unfortunately no log levels with NSLog. I think this would be good to have in the demos but maybe not the engine for now

goaway
goaway previously approved these changes Aug 20, 2019
Copy link
Copy Markdown
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

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

Looks great.

Signed-off-by: Jose Nino <jnino@lyft.com>
rebello95
rebello95 previously approved these changes Aug 20, 2019
Signed-off-by: Jose Nino <jnino@lyft.com>
@junr03 junr03 merged commit 9c92e67 into master Aug 20, 2019
@junr03 junr03 deleted the e2e-swift branch August 20, 2019 20:47
rebello95 added a commit that referenced this pull request Aug 20, 2019
**This is a working end-to-end iOS implementation using Envoy Mobile as a library!**

Depends on #312 and #353.

Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using `URLSession` and Envoy as a listener.

Note: For now, we are no longer showing the text response of the response body due to the fact that the underlying implementation is not yet complete for bodied requests (headers-only).

Signed-off-by: Michael Rebello <me@michaelrebello.com>

![Simulator Screen Shot - TestDevice - 2019-08-20 at 13 57 44](https://user-images.githubusercontent.com/2643476/63383898-8f466280-c352-11e9-8c2e-944efda59ea2.png)
rebello95 added a commit that referenced this pull request Aug 20, 2019
#353 broke the `format_all` test on CI on master.

This fixes it by running the formatter and pushing the diff.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
rebello95 added a commit that referenced this pull request Aug 20, 2019
#353 broke the `format_all` test on CI on master.

This fixes it by running the formatter and pushing the diff.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 28, 2022
**This is a working end-to-end iOS implementation using Envoy Mobile as a library!**

Depends on envoyproxy/envoy-mobile#312 and envoyproxy/envoy-mobile#353.

Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using `URLSession` and Envoy as a listener.

Note: For now, we are no longer showing the text response of the response body due to the fact that the underlying implementation is not yet complete for bodied requests (headers-only).

Signed-off-by: Michael Rebello <me@michaelrebello.com>

![Simulator Screen Shot - TestDevice - 2019-08-20 at 13 57 44](https://user-images.githubusercontent.com/2643476/63383898-8f466280-c352-11e9-8c2e-944efda59ea2.png)

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 28, 2022
envoyproxy/envoy-mobile#353 broke the `format_all` test on CI on master.

This fixes it by running the formatter and pushing the diff.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 29, 2022
**This is a working end-to-end iOS implementation using Envoy Mobile as a library!**

Depends on envoyproxy/envoy-mobile#312 and envoyproxy/envoy-mobile#353.

Updates our Swift example app to use the Envoy Mobile direct interfaces rather than using `URLSession` and Envoy as a listener.

Note: For now, we are no longer showing the text response of the response body due to the fact that the underlying implementation is not yet complete for bodied requests (headers-only).

Signed-off-by: Michael Rebello <me@michaelrebello.com>

![Simulator Screen Shot - TestDevice - 2019-08-20 at 13 57 44](https://user-images.githubusercontent.com/2643476/63383898-8f466280-c352-11e9-8c2e-944efda59ea2.png)

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 29, 2022
envoyproxy/envoy-mobile#353 broke the `format_all` test on CI on master.

This fixes it by running the formatter and pushing the diff.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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