Skip to content

Commit

Permalink
Merge branch 'update-container-base-20' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
redhug1 committed Jan 9, 2023
2 parents 0395253 + dcccc13 commit 4014cf5
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.concourse
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM onsdigital/dp-concourse-tools-ubuntu
FROM onsdigital/dp-concourse-tools-ubuntu-20:ubuntu20.4-rc.1

WORKDIR /app/

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ debug: generate-debug
test: generate-prod
go test -race -cover -tags 'production' ./...

.PHONY: test-component
test-component:
exit

.PHONY: convey
convey:
goconvey ./...
Expand Down
2 changes: 1 addition & 1 deletion ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ image_resource:
type: docker-image
source:
repository: golang
tag: 1.18.6
tag: 1.19.2

inputs:
- name: dp-frontend-feedback-controller
Expand Down
15 changes: 15 additions & 0 deletions ci/component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

platform: linux

image_resource:
type: docker-image
source:
repository: golang
tag: 1.18.6

inputs:
- name: dp-frontend-feedback-controller

run:
path: dp-frontend-feedback-controller/ci/scripts/component.sh
2 changes: 1 addition & 1 deletion ci/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ image_resource:
type: docker-image
source:
repository: golang
tag: 1.18.3
tag: 1.19.2

inputs:
- name: dp-frontend-feedback-controller
Expand Down
5 changes: 5 additions & 0 deletions ci/scripts/component.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -eux

pushd dp-frontend-feedback-controller
make test-component
popd
2 changes: 1 addition & 1 deletion ci/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ image_resource:
type: docker-image
source:
repository: golang
tag: 1.18.6
tag: 1.19.2

inputs:
- name: dp-frontend-feedback-controller
Expand Down
29 changes: 15 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module github.com/ONSdigital/dp-frontend-feedback-controller

go 1.18
go 1.19

require (
github.com/ONSdigital/dp-frontend-models v1.10.1
github.com/ONSdigital/dp-healthcheck v1.1.0
github.com/ONSdigital/dp-net v1.4.1
github.com/ONSdigital/dp-healthcheck v1.5.0
github.com/ONSdigital/dp-net v1.5.0
github.com/ONSdigital/dp-renderer v1.49.0
github.com/ONSdigital/go-ns v0.0.0-20210831102424-ebdecc20fe9e
github.com/ONSdigital/log.go/v2 v2.0.9
github.com/davecgh/go-spew v1.1.0
github.com/ONSdigital/log.go/v2 v2.3.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/schema v1.2.0
github.com/kelseyhightower/envconfig v1.4.0
Expand All @@ -19,26 +18,28 @@ require (
require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/ONSdigital/dp-api-clients-go v1.43.0 // indirect
github.com/aws/aws-sdk-go v1.38.15 // indirect
github.com/ONSdigital/dp-api-clients-go/v2 v2.187.0 // indirect
github.com/ONSdigital/dp-net/v2 v2.6.0 // indirect
github.com/aws/aws-sdk-go v1.44.76 // indirect
github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2 // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gopherjs/gopherjs v0.0.0-20210202160940-bed99a852dfe // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/gosimple/slug v1.9.0 // indirect
github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect
github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/justinas/alice v1.2.0 // indirect
github.com/kevinburke/go-bindata v3.24.0+incompatible // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/nicksnyder/go-i18n/v2 v2.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
github.com/smartystreets/assertions v1.13.0 // indirect
github.com/unrolled/render v1.4.0 // indirect
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/text v0.4.0 // indirect
)
62 changes: 41 additions & 21 deletions go.sum

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions handlers/feedback.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package handlers
import (
"bytes"
"fmt"
"github.com/ONSdigital/dp-frontend-feedback-controller/config"
"net/http"
"regexp"

"github.com/ONSdigital/dp-frontend-feedback-controller/config"
"github.com/ONSdigital/dp-frontend-feedback-controller/email"
"github.com/ONSdigital/dp-frontend-feedback-controller/interfaces"

"github.com/ONSdigital/dp-frontend-feedback-controller/model"
dphandlers "github.com/ONSdigital/dp-net/handlers"
"github.com/ONSdigital/log.go/v2/log"
Expand Down Expand Up @@ -160,7 +159,7 @@ func addFeedback(w http.ResponseWriter, req *http.Request, isPositive bool, rend
returnTo = "https://www.ons.gov.uk"
}

redirectURL := "/feedback/thanks?returnTo=" + f.URL
redirectURL := "/feedback/thanks?returnTo=" + returnTo
http.Redirect(w, req, redirectURL, http.StatusMovedPermanently)
}

Expand Down
6 changes: 0 additions & 6 deletions handlers/feedback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ func Test_addFeedback(t *testing.T) {
}

func Test_feedbackThanks(t *testing.T) {

Convey("Given a valid request", t, func() {

req := httptest.NewRequest("GET", "http://localhost", nil)
w := httptest.NewRecorder()
url := "www.test.com"
Expand All @@ -275,15 +273,11 @@ func Test_feedbackThanks(t *testing.T) {
return coreModel.Page{}
},
}

Convey("When feedbackThanks is called", func() {

feedbackThanks(w, req, url, errorType, mockRenderer)

Convey("Then the renderer is called", func() {
So(len(mockRenderer.BuildPageCalls()), ShouldEqual, 1)
})

Convey("Then a 200 response is returned", func() {
So(w.Code, ShouldEqual, http.StatusOK)
})
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"os/signal"
"time"

health "github.com/ONSdigital/dp-healthcheck/healthcheck"
render "github.com/ONSdigital/dp-renderer"

"github.com/ONSdigital/dp-frontend-feedback-controller/assets"
"github.com/ONSdigital/dp-frontend-feedback-controller/config"
"github.com/ONSdigital/dp-frontend-feedback-controller/routes"
health "github.com/ONSdigital/dp-healthcheck/healthcheck"
render "github.com/ONSdigital/dp-renderer"
"github.com/ONSdigital/go-ns/server"
"github.com/ONSdigital/log.go/v2/log"
"github.com/gorilla/mux"
Expand Down Expand Up @@ -54,6 +53,7 @@ func main() {
os.Exit(1)
}

// nolint: typecheck
rend := render.NewWithDefaultClient(assets.Asset, assets.AssetNames, cfg.PatternLibraryAssetsPath, cfg.SiteDomain)

routes.Setup(ctx, r, cfg, rend, healthcheck)
Expand Down

0 comments on commit 4014cf5

Please sign in to comment.