-
Notifications
You must be signed in to change notification settings - Fork 511
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
-app-port for listen port, mm installation #659
Conversation
validate.mk
Outdated
@@ -2,4 +2,5 @@ | |||
MM_SHELL ?= bash -c | |||
|
|||
validate: | |||
type mm.py || sudo pip install mechanical_markdown |
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.
Probably move this to a new make-command, like ensure-mm
- that installs mechanical markdown if needed.
validate.mk
Outdated
@@ -2,4 +2,5 @@ | |||
MM_SHELL ?= bash -c | |||
|
|||
validate: | |||
type mm.py || sudo pip install mechanical_markdown |
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.
Typo: mechanical-markdown
@@ -18,7 +19,13 @@ var sub = &common.Subscription{ | |||
} | |||
|
|||
func main() { | |||
s := daprd.NewService(":6001") | |||
//read app-port passed thru command line |
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.
//read app-port passed thru command line | |
// read the app-port from the environment variable |
However, it seems unnecessary.
@@ -18,7 +19,13 @@ var sub = &common.Subscription{ | |||
} | |||
|
|||
func main() { | |||
s := daprd.NewService(":6001") | |||
//read app-port passed thru command line | |||
appPort, isSet := os.LookupEnv("APP_PORT") |
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.
appPort, isSet := os.LookupEnv("APP_PORT") | |
if appPort, ok := os.LookupEnv("APP_PORT"); !ok { | |
// fail | |
} |
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.
@shubham1172 the intent is to initialize and declare the variables based on os.Lookup. Including them in 'if' would require a declaration of appPort since it is used outside the if condition. I am not in favour of adding an else condition since it impacts readability of the simple flow. Will leave this as-is.
//read app-port passed thru command line | ||
appPort, isSet := os.LookupEnv("APP_PORT") | ||
if !isSet { | ||
log.Fatalf("--app-port is not set") |
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.
The error message should mention that the environment variable was not set. It is set by passing the --app-port
option to Dapr, but this message can be misleading for users. We can additionally add a hint to the error message that this environment variable is set by Dapr. Thoughts?
@@ -18,7 +19,13 @@ var sub = &common.Subscription{ | |||
} | |||
|
|||
func main() { | |||
s := daprd.NewService(":6001") | |||
//read app-port passed thru command line | |||
appPort, isSet := os.LookupEnv("APP_PORT") |
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.
How an argument in daprd gets linked to environment variable?
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.
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.
Thanks for this question @surenderssm. I have added comment in the code to explore the dapr command line options and corresponding environment variables. It makes the quickstart code more comprehensible.
ping @akhilac1 |
This change applies universally across all the quickstarts. At least this PR should also apply to Go examples for HTTP and SDK for Pub/Sub, Service Invocation and State Management. This only fixes Pub/Sub currently. |
validate: | ||
mm.py -l -s "${MM_SHELL}" README.md | ||
|
||
install_mm: |
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.
change ideally not needed ... see the validate.yaml workflow ... @akhilac1
c1c0308
to
9688c6a
Compare
@akhilac1 Can you rebase this PR with master and push the changes for the builds to be successful? |
9688c6a
to
a3fde65
Compare
Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com> Resolve PR comments Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com> Update pub_sub/go/sdk/order-processor/app.go Co-authored-by: Shubham Sharma <shubhash@microsoft.com> Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
a3fde65
to
22a3dc3
Compare
@amulyavarote - The tests are passing now. Can you please approve the PR so that merge can be completed. Thank you!! |
@msfussell - Will cover this in #661 |
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.
lgtm
Issue reference
We strive to have all PRs being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #656
##Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: