You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by dneuman64 <gi...@git.apache.org> on 2017/01/09 22:03:05 UTC

[GitHub] incubator-trafficcontrol pull request #173: [TC-92] -- Add RPM build for goT...

GitHub user dneuman64 opened a pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/173

    [TC-92] -- Add RPM build for goTM

    A goTM RPM can now be built by running `./build/build.sh traffic_monitor/experimental` from the incubator-trafficcontrol directory.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dneuman64/incubator-trafficcontrol goTM-rpm-build

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafficcontrol/pull/173.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #173
    
----
commit abba425fafd346287bb937b31c8504c402e1f5f7
Author: David Neuman <da...@gmail.com>
Date:   2017-01-05T23:27:30Z

    initial commit of RPM packaging

commit 0ee3772e930cf3b9ef0147c5de8c8852ae15406e
Author: David Neuman <da...@gmail.com>
Date:   2017-01-09T19:46:56Z

    get RPM to build correctly

commit 27b7bca521354b6655b1e5a10772e46deb42cced
Author: David Neuman <da...@gmail.com>
Date:   2017-01-09T21:00:00Z

    add config option for static http and js file

commit 7afbf26f95a73e0d71e28a438bf2d015a0f0bc63
Author: David Neuman <da...@gmail.com>
Date:   2017-01-09T21:40:54Z

    move index.html and sorttable.js to static dir

commit 0ab782b025ddba7470b54516b1db03d83dd49604
Author: David Neuman <da...@gmail.com>
Date:   2017-01-09T22:01:43Z

    remove unncessary echo

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #173: [TC-92] -- Add RPM build for goT...

Posted by dneuman64 <gi...@git.apache.org>.
Github user dneuman64 closed the pull request at:

    https://github.com/apache/incubator-trafficcontrol/pull/173


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #173: [TC-92] -- Add RPM build for goT...

Posted by dneuman64 <gi...@git.apache.org>.
Github user dneuman64 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/173#discussion_r95441958
  
    --- Diff: traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go ---
    @@ -134,22 +136,29 @@ func ParametersStr(params url.Values) string {
     	return pp
     }
     
    +//CommonAPIDataDataFormat is a common Date format for the API
     const CommonAPIDataDateFormat = "Mon Jan 02 15:04:05 UTC 2006"
     
     // DateStr returns the given time in the format expected by Traffic Monitor 1.0 API users
     func DateStr(t time.Time) string {
     	return t.UTC().Format(CommonAPIDataDateFormat)
     }
     
    -func (s Server) handleRootFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("index.html")
    +func (s *Server) handleRootFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "index.html")
    +	}
    +	return s.handleFile(staticFileDir + "/index.html")
     }
     
    -func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("sorttable.js")
    +func (s *Server) handleSortableFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "sorttable.js")
    +	}
    +	return s.handleFile(staticFileDir + "/sorttable.js")
     }
     
    -func (s Server) handleFile(name string) (http.HandlerFunc, error) {
    +func (s *Server) handleFile(name string) (http.HandlerFunc, error) {
    --- End diff --
    
    It was recommended by Go Vet because the methods pass locks by value (srvhttp.Server contains sync.WaitGroup contains sync.NoCopy)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol issue #173: [TC-92] -- Add RPM build for goTM

Posted by dneuman64 <gi...@git.apache.org>.
Github user dneuman64 commented on the issue:

    https://github.com/apache/incubator-trafficcontrol/pull/173
  
    got into git hell, closing this to fix and re-opening a new PR


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #173: [TC-92] -- Add RPM build for goT...

Posted by rob05c <gi...@git.apache.org>.
Github user rob05c commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/173#discussion_r95421340
  
    --- Diff: traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go ---
    @@ -134,22 +136,29 @@ func ParametersStr(params url.Values) string {
     	return pp
     }
     
    +//CommonAPIDataDataFormat is a common Date format for the API
     const CommonAPIDataDateFormat = "Mon Jan 02 15:04:05 UTC 2006"
     
     // DateStr returns the given time in the format expected by Traffic Monitor 1.0 API users
     func DateStr(t time.Time) string {
     	return t.UTC().Format(CommonAPIDataDateFormat)
     }
     
    -func (s Server) handleRootFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("index.html")
    +func (s *Server) handleRootFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "index.html")
    +	}
    +	return s.handleFile(staticFileDir + "/index.html")
     }
     
    -func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("sorttable.js")
    +func (s *Server) handleSortableFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "sorttable.js")
    +	}
    +	return s.handleFile(staticFileDir + "/sorttable.js")
     }
     
    -func (s Server) handleFile(name string) (http.HandlerFunc, error) {
    +func (s *Server) handleFile(name string) (http.HandlerFunc, error) {
    --- End diff --
    
    Why were the Server functions changed to pointers?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #173: [TC-92] -- Add RPM build for goT...

Posted by dneuman64 <gi...@git.apache.org>.
Github user dneuman64 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/173#discussion_r95441968
  
    --- Diff: traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go ---
    @@ -134,22 +136,29 @@ func ParametersStr(params url.Values) string {
     	return pp
     }
     
    +//CommonAPIDataDataFormat is a common Date format for the API
     const CommonAPIDataDateFormat = "Mon Jan 02 15:04:05 UTC 2006"
     
     // DateStr returns the given time in the format expected by Traffic Monitor 1.0 API users
     func DateStr(t time.Time) string {
     	return t.UTC().Format(CommonAPIDataDateFormat)
     }
     
    -func (s Server) handleRootFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("index.html")
    +func (s *Server) handleRootFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "index.html")
    +	}
    +	return s.handleFile(staticFileDir + "/index.html")
     }
     
    -func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("sorttable.js")
    +func (s *Server) handleSortableFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "sorttable.js")
    +	}
    +	return s.handleFile(staticFileDir + "/sorttable.js")
    --- End diff --
    
    fair enough.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #173: [TC-92] -- Add RPM build for goT...

Posted by rob05c <gi...@git.apache.org>.
Github user rob05c commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/173#discussion_r95421273
  
    --- Diff: traffic_monitor/experimental/traffic_monitor/srvhttp/srvhttp.go ---
    @@ -134,22 +136,29 @@ func ParametersStr(params url.Values) string {
     	return pp
     }
     
    +//CommonAPIDataDataFormat is a common Date format for the API
     const CommonAPIDataDateFormat = "Mon Jan 02 15:04:05 UTC 2006"
     
     // DateStr returns the given time in the format expected by Traffic Monitor 1.0 API users
     func DateStr(t time.Time) string {
     	return t.UTC().Format(CommonAPIDataDateFormat)
     }
     
    -func (s Server) handleRootFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("index.html")
    +func (s *Server) handleRootFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "index.html")
    +	}
    +	return s.handleFile(staticFileDir + "/index.html")
     }
     
    -func (s Server) handleSortableFunc() (http.HandlerFunc, error) {
    -	return s.handleFile("sorttable.js")
    +func (s *Server) handleSortableFunc(staticFileDir string) (http.HandlerFunc, error) {
    +	if strings.HasSuffix(staticFileDir, "/") {
    +		return s.handleFile(staticFileDir + "sorttable.js")
    +	}
    +	return s.handleFile(staticFileDir + "/sorttable.js")
    --- End diff --
    
    Not a fan of duplicating this line. POSIX guarantees ignoring duplicated slashes, so could we just remove the `if` and always `return s.handleFile(staticFileDir + "/sorttable.js")`? So it could be "path/to//sortable.js", but that's ok?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---