-
Notifications
You must be signed in to change notification settings - Fork 932
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
Fix create-app-manifest only includes one host [92530254] #425
Conversation
Hey SrinivasChilveri! Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you've already signed the CLA. |
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/93178282. |
@SrinivasChilveri just FYI that when pasting code (Golang, Ruby, etc or even JSON and YAML) if you use the Github Markdown within ``` the resulting code will keep it's formatting. You can even tell it what language and it will syntax highlight. This will help in many communications and keep things clearer IMO, so for instance, cutting and pasting part of your comment above would result in: [...]
if len(app.Routes) == 1 {
if _, err := fmt.Fprintf(f, " host: %s\n", app.Routes[0].Host); err != nil {
return err
}
[...]
} If you click on the "Markdown supported" link on each Github comment box you can get details. Finally, just a matter of style, since we are on the subject, I would write code above as:
Which I think is clearer. More lines but easier to parse (for humans). OK, now back to the regularly scheduled reviewing session. |
} | ||
if _, err := fmt.Fprintf(f, " domain: %s\n", app.Routes[0].Domain.Name); err != nil { | ||
return err | ||
|
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.
get rid of unnecessary new line here and other such places.
ac2bc02
to
f6586c0
Compare
Hi @maximilien , Thanks a lot for review comments. The comments are fixed.I have not fixed if style comment because i had followed the style which was there in that file.Any other suggestions are welcome. |
Yeah I agree with max's comment, could you separate the single context in the test into multiple contexts like "multiple host, multiple domains", "single host, multiple domains", etc. Would make the test much easier to parse. |
@SrinivasChilveri The story to pull in this PR is at the top of the LCI backlog. Can you separate the single context in to multiple as per @jberkhahn ? thx |
0760c23
to
6858561
Compare
Hi @goehmen , Sorry for late reply because i was on leave. Any how i have changed the test cases as suggested & updated but CI is failing because of below reason: 147# code.google.com/p/go.tools/cmd/vet 148../../../code.google.com/p/go.tools/cmd/vet/shadow.go:216: not enough arguments in call to obj.Parent().Parent().LookupParent 149../../../code.google.com/p/go.tools/cmd/vet/types.go:21: undefined: types.New 150../../../code.google.com/p/go.tools/cmd/vet/types.go:22: undefined: types.New 151../../../code.google.com/p/go.tools/cmd/vet/types.go:23: undefined: types.New 152 153The command "go get -v code.google.com/p/go.tools/cmd/vet" failed and exited with 2 during . 154 155Your build has been stopped. Any suggestions are welcome. Thanks & Regards, |
After fixing the issue cli create-app-manifest will cosiders hosts,domains based on multiple routes to an app,so when ever has more then one host or domain uses the hosts & domains key word respectively. the changed code doesn't have perf impact if an app has single route Fixed Review Comments Fixed review comments
Hi @jberkhahn 147# code.google.com/p/go.tools/cmd/vet 148../../../code.google.com/p/go.tools/cmd/vet/shadow.go:216: not enough arguments in call to obj.Parent().Parent().LookupParent 149../../../code.google.com/p/go.tools/cmd/vet/types.go:21: undefined: types.New 150../../../code.google.com/p/go.tools/cmd/vet/types.go:22: undefined: types.New 151../../../code.google.com/p/go.tools/cmd/vet/types.go:23: undefined: types.New 152 153The command "go get -v code.google.com/p/go.tools/cmd/vet" failed and exited with 2 during . 154 155Your build has been stopped. Any suggestions are welcome. Thanks & Regards, |
@SrinivasChilveri Yes - we're working on the Travis issue. |
|
||
It("generates a manifest containing two hosts two domains", func() { | ||
m.Memory("app1", 128) | ||
m.StartupCommand("app1", "run main.go") |
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.
StartupCommand
doesn't seem to be a thing, not defined anywhere
We pulled and tried this PR, but it doesn't pass the unit tests. ~Thanks |
Hi @simonleung8 , I ran all test cases locally with the branch, its working fine. I am not sure where is wrong, can you please provide more info. The StartupCommand is part of AppManifest as shown below. The type AppManifest interface { Thanks & Regards, |
Hi, looks like this PR needs to be rebased. It is not showing you the PR status since travis has failed, you could close and open a new PR to get a green travis if you want, or we can just work out of this one, it is up to you. |
Hi @simonleung8 , I have raised new PR #514 , so we can close this PR |
After fixing the issue cli create-app-manifest will cosiders
hosts,domains based on multiple routes to an app,so when ever
has more then one host or domain uses the hosts & domains
key word respectively.
the changed code doesn't have perf impact if an app has single route...
story: #92530254
Any comments/suggestions are welcome. From my side i have some other options as follows
Option1: I can remove the below code which hits on single route case because which has taken care in writeRoutesToFile but will have little less performance.
if len(app.Routes) == 1 {
if _, err := fmt.Fprintf(f, " host: %s\n", app.Routes[0].Host); err != nil {
return err
}
if _, err := fmt.Fprintf(f, " domain: %s\n", app.Routes[0].Domain.Name); err != nil {
return err
}
}
Option 2: Option 1 & always use only the hosts & domains keys in manifest.yml file so i can remove below code from writeRoutesToFile & change the required test cases
if len(hosts) == 1 {
if _, err := fmt.Fprintf(f, " host: %s\n", hosts[0]); err != nil {
return err
}
}
if len(domains) == 1 {
if _, err := fmt.Fprintf(f, " domain: %s\n", domains[0]); err != nil {
return err
}
}