Skip to content

Commit

Permalink
Fix remove ack (#9)
Browse files Browse the repository at this point in the history
* Removed path prefix for gtg endpoint, logged input params and updated documentation

* Fixed log

* Added more tests

* Moved gtg handler a few lines up in the file to emphasize the fact that it uses the main router

* Decreased timeout value for httpClient

* Added parallel severity check

* Fixed pod severity checking, decreased httpClient timeout

* Fixed tests

* Fixed tests and code format

* Updated readme

* Fixed remove ack endpoint

* Moved cache-control header to services healthcheck handler

* Added all cache control headers

* Removed cache control headers from services health endpoint

* Fixed circle CI
  • Loading branch information
davidbalazs93 authored May 19, 2017
1 parent 12b3037 commit 29636bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
25 changes: 12 additions & 13 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
machine:
environment:
GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace:${HOME}/.go_project"
GO_PROJECT_PATH: "${HOME}/.go_project/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
PROJECT_GOPATH: "${HOME}/.go_project"
PROJECT_PARENT_PATH: "${PROJECT_GOPATH}/src/github.com/${CIRCLE_PROJECT_USERNAME}"
PROJECT_PATH: "${PROJECT_PARENT_PATH}/${CIRCLE_PROJECT_REPONAME}"
GOPATH: "${HOME}/.go_workspace:${PROJECT_GOPATH}"

checkout:
post:
- mkdir -p $(dirname ${GO_PROJECT_PATH})
- ln -fs $HOME/$CIRCLE_PROJECT_REPONAME $GO_PROJECT_PATH
- mkdir -p "${PROJECT_PARENT_PATH}"
- rsync -avC "${HOME}/${CIRCLE_PROJECT_REPONAME}/" "${PROJECT_PATH}"

dependencies:
pre:
- go get -u github.com/kardianos/govendor
override:
- cd $GO_PROJECT_PATH && govendor sync
- cd $GO_PROJECT_PATH && go build -v
- cd $PROJECT_PATH && govendor sync
- cd $PROJECT_PATH && go build -v

test:
pre:
- go get -u github.com/jstemmer/go-junit-report
- go get -u github.com/mattn/goveralls
- cd $PROJECT_PATH && wget https://raw.githubusercontent.com/Financial-Times/cookiecutter-upp-golang/master/coverage.sh && chmod +x coverage.sh
override:
- mkdir -p $CIRCLE_TEST_REPORTS/golang
- cd $GO_PROJECT_PATH && govendor test -race -v +local | go-junit-report > $CIRCLE_TEST_REPORTS/golang/junit.xml
- cd $GO_PROJECT_PATH && govendor test -v -cover -race -coverprofile=$CIRCLE_ARTIFACTS/coverage.out +local
- cd $CIRCLE_ARTIFACTS && sed -i '1d' *.out
- |
echo "mode: atomic" > $CIRCLE_ARTIFACTS/overall-coverage.result
- cd $CIRCLE_ARTIFACTS && cat *.out >> overall-coverage.result
- cd $PROJECT_PATH && govendor test -race -v +local | go-junit-report > $CIRCLE_TEST_REPORTS/golang/junit.xml
- cd $PROJECT_PATH && ./coverage.sh
post:
- goveralls -coverprofile=$CIRCLE_ARTIFACTS/overall-coverage.result -service=circle-ci -repotoken=$COVERALLS_TOKEN
- goveralls -coverprofile=$CIRCLE_ARTIFACTS/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN
3 changes: 3 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ func (h *httpHandler) handleEnableCategory(w http.ResponseWriter, r *http.Reques
}

func (h *httpHandler) handleRemoveAck(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control","no-cache, no-store, must-revalidate")
w.Header().Set("Pragma","no-cache")
w.Header().Set("Expires","0")
serviceName := getServiceNameFromURL(r.URL)
if serviceName == "" {
w.WriteHeader(http.StatusBadRequest)
Expand Down

0 comments on commit 29636bb

Please sign in to comment.