Skip to content

Conversation

@jonasfj
Copy link
Contributor

@jonasfj jonasfj commented Oct 9, 2018

Adds a helloworld-dart sample based on helloworld-nodejs

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 9, 2018
@knative-prow-robot
Copy link
Contributor

Hi @jonasfj. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 9, 2018

A simple web app written in Dart that you can use for testing.
It reads in the env variable `TARGET` and prints "Hello World: ${TARGET". If
`TARGET` is not specified, it will use `"NOT SPECIFIED"` as `TARGET`.
Copy link
Contributor

@steren steren Oct 9, 2018

Choose a reason for hiding this comment

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

I just updated the other samples so that they display Hello World if no TARGET is specified, see #443. Can you also update yours?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, sorry I missed the feedback... should be done now :)

@jonasfj jonasfj force-pushed the dart-serving-sample branch from 7f869e2 to 9d79c1a Compare October 16, 2018 12:46
FROM google/dart-runtime

# google/dart-runtime expects us to listen on port 8080
ENV PORT 8080 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed, Knative injects a PORT env var with the appropriate value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sweet :)

var port = int.tryParse(Platform.environment['PORT']);

// Read $TARGET from environment variable
var target = Platform.environment['TARGET'] ?? 'NOT SPECIFIED';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update "World" here to?

FROM google/dart-runtime

# google/dart-runtime expects us to listen on port 8080
ENV PORT 8080
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove here too

FROM google/dart-runtime

# google/dart-runtime expects us to listen on port 8080
ENV PORT 8080 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing newline at the end?

image: docker.io/{username}/helloworld-dart
env:
- name: TARGET
value: "Dart Sample v1" No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing newline at the end?

import 'package:shelf/shelf_io.dart';

void main() {
// Find port to listen on (defined in Dockerfile)
Copy link
Contributor

Choose a reason for hiding this comment

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

Terminate comments (throughout) with a full stop .

return Response.ok('Hello $target');
});

// Server on port
Copy link
Contributor

Choose a reason for hiding this comment

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

'Server on port' reads like a partial sentence.

@@ -0,0 +1,165 @@
# Hello World - Dart sample

A simple web app written in Dart that you can use for testing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please s/Dart/the [Dart](www.dartlang.org) programming language/

## Recreating the sample code

While you can clone all of the code from this directory, it is useful to know how
to build a hello world dart application step-by-step. This application can be
Copy link
Contributor

Choose a reason for hiding this comment

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

s/dart/Dart/


## Building and deploying the sample

Once you have recreated the sample code files (or used the files in the sample
Copy link
Contributor

Choose a reason for hiding this comment

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

s/sample/`sample`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The word sample here is not an identifier, why would you format as such?

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought sample was a named folder; if not, just leave as is

@jonasfj jonasfj force-pushed the dart-serving-sample branch from 9d79c1a to cca42d4 Compare October 18, 2018 12:26
@mit-mit
Copy link
Contributor

mit-mit commented Oct 24, 2018

@mchmarny @vaikas-google can we merge this?

@mit-mit
Copy link
Contributor

mit-mit commented Oct 26, 2018

paging @mchmarny @vaikas-google

@vaikas
Copy link
Contributor

vaikas commented Oct 26, 2018

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonasfj, mit-mit, vaikas-google

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vaikas
Copy link
Contributor

vaikas commented Oct 26, 2018

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2018
@knative-prow-robot knative-prow-robot merged commit 6dc822e into knative:master Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants