Skip to content
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

Downgrade go pg #374

Merged
merged 24 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3758b3d
downgrade go-pg from v10 to v6.14.5
Aug 23, 2024
21fe0b2
update modules.txt
Aug 23, 2024
fd03501
fix linting
Aug 23, 2024
75e4545
update golang CI version from 1.21.3 to 1.21.12 to fix some vulnarabi…
Aug 23, 2024
d257391
update golang.org/x/net from v0.20.0 to 0.23.0 to fix a vulnarability
Aug 23, 2024
6ca68f8
add installation of docker-compose to golang-ci.yml
Aug 23, 2024
ecdba7e
go back to docker/login-action v1 in golang-ci.yml
Aug 23, 2024
57afc4c
actually run the integration tests
Aug 23, 2024
6f82328
DEBUG skip the livetest
Aug 23, 2024
4898219
call integration in the ci Makefile command
Aug 23, 2024
7977e66
revert: call integration in the ci Makefile command
Aug 23, 2024
7c4e94d
increase wait time in integration test
Aug 23, 2024
ca950ea
increase wait time in integration test
Aug 23, 2024
566b3be
DEBUG add assertions
Aug 23, 2024
a23c40d
DEBUG adjust durations in test
Aug 23, 2024
864f9e8
DEBUG remove assertion for no error
Aug 23, 2024
97ab8d9
add coverage related flags to make test
Aug 23, 2024
3f72b08
don't skip one specific integration test anymore
Aug 23, 2024
c5c7aa7
go back to v3 of docker/login-action
Aug 23, 2024
4d2da8c
add linting step to CI
Aug 23, 2024
fb2bd81
execute gofumpt on the whole project
Aug 26, 2024
a9e8326
Revert "execute gofumpt on the whole project"
Aug 26, 2024
73d226b
execute gofumpt on the whole project - without generated files that m…
Aug 26, 2024
effb66d
add .golangci.yml that only - for now - applies the gofumpt linter
Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions .github/workflows/golang-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [ '1.21.3' ]
go: [ '1.21.12' ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand All @@ -17,12 +17,18 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Linting
run: make lint
- name: Unit tests
run: make test
- name: (Experimental) Vulnerability Scan
run: make vuln-scan
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Integration tests
run: docker-compose run testserver make ci
run: docker-compose run testserver make integration
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
Expand Down
11 changes: 11 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# for further options, see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
modules-download-mode: vendor
timeout: 4m
issues:
include:
- EXC0005
linters:
enable:
- gofumpt
linters-settings:
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ lint:
$(GO) run -mod=vendor github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout 2m

test:
$(GO) test $(GO_TEST_FLAGS) -short ./...
$(GO) test $(GO_TEST_FLAGS) -covermode=atomic -coverprofile=coverage.out -short ./...

integration:
$(GO) test $(GO_TEST_FLAGS) -run TestIntegration ./...
Expand Down
1 change: 0 additions & 1 deletion backend/objstore/objstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func registerHealthchecks() {
servicehealthcheck.RegisterHealthCheck("objstore", &HealthCheck{
Client: client,
})

})
}

Expand Down
6 changes: 2 additions & 4 deletions backend/postgres/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import (
"io"
"net"

"github.com/go-pg/pg/v10"
"github.com/go-pg/pg"
)

var (
ErrNotUnique = errors.New("not unique")
)
var ErrNotUnique = errors.New("not unique")

func IsErrConnectionFailed(err error) bool {
// go-pg has this check internally for network errors
Expand Down
2 changes: 1 addition & 1 deletion backend/postgres/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/go-pg/pg/v10"
"github.com/go-pg/pg"
"github.com/stretchr/testify/require"

pbpostgres "github.com/pace/bricks/backend/postgres"
Expand Down
3 changes: 1 addition & 2 deletions backend/postgres/health_postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"context"
"time"

"github.com/go-pg/pg/v10/orm"
"github.com/go-pg/pg/orm"
"github.com/pace/bricks/maintenance/health/servicehealthcheck"
)

Expand Down Expand Up @@ -56,7 +56,6 @@ func (h *HealthCheck) HealthCheck(ctx context.Context) servicehealthcheck.Health
// If no error occurred set the State of this Health Check to healthy
h.state.SetHealthy()
return h.state.GetState()

}

// CleanUp drops the test table.
Expand Down
2 changes: 1 addition & 1 deletion backend/postgres/health_postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/go-pg/pg/v10/orm"
"github.com/go-pg/pg/orm"
http2 "github.com/pace/bricks/http"
"github.com/pace/bricks/maintenance/errors"
"github.com/pace/bricks/maintenance/health/servicehealthcheck"
Expand Down
136 changes: 0 additions & 136 deletions backend/postgres/hooks.go

This file was deleted.

2 changes: 1 addition & 1 deletion backend/postgres/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"time"

"github.com/go-pg/pg/v10"
"github.com/go-pg/pg"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
Loading
Loading