Skip to content

Commit

Permalink
Merge branch 'main' into missed-buildinfo-test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi authored Dec 20, 2021
2 parents 4cbf713 + 768e3c3 commit 1d8a917
Show file tree
Hide file tree
Showing 15 changed files with 424 additions and 356 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/containers_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: 'containers_main'

on:
push:
branches:
- main

env:
GOPATH: /home/runner/go
GOCACHE: /home/runner/go/cache
GOMODCACHE: /home/runner/go/cache/mod
GOPROXY: https://proxy.golang.org # remove direct

jobs:
container-build:
name: Container build
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ferretdb-bot
password: ${{ secrets.FERRETDB_PACKAGES }}

- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: test

- name: Initialize docker
run: make docker-init

- name: Push the continer images
env:
DOCKER_TAG: main
run: make docker-push
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Please use global .gitignore file for .vscode/, .idea/, etc.
# See https://git.io/JD5Zf

/bin/
/vendor/
cover.txt
Expand Down
7 changes: 2 additions & 5 deletions cmd/envtool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,8 @@ func main() {
logger.Fatal(err)
}

for _, q := range []string{
`CREATE SCHEMA monila`,
`CREATE SCHEMA test`,
} {
if _, err = pgPool.Exec(ctx, q); err != nil {
for _, db := range []string{`monila`, `test`} {
if err = pgPool.CreateSchema(ctx, db); err != nil {
logger.Fatal(err)
}
}
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/common/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (

ErrBadValue = ErrorCode(2) // BadValue
ErrNamespaceNotFound = ErrorCode(26) // NamespaceNotFound
ErrNamespaceExists = ErrorCode(48) // NamespaceExists
ErrCommandNotFound = ErrorCode(59) // CommandNotFound
ErrNotImplemented = ErrorCode(238) // NotImplemented
ErrRegexOptions = ErrorCode(51075) // Location51075
Expand Down
16 changes: 10 additions & 6 deletions internal/handlers/common/errorcode_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/handlers/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (h *Handler) msgStorage(ctx context.Context, msg *wire.OpMsg) (common.Stora
}
if !tableExist {
fields := []zap.Field{zap.String("schema", db), zap.String("table", collection)}
if err := shared.CreateCollection(ctx, h.pgPool, db, collection); err != nil {
if err := h.pgPool.CreateTable(ctx, db, collection); err != nil {
fields = append(fields, zap.Error(err))
h.l.Warn("Failed to create jsonb1 table.", fields...)
} else {
Expand Down
Loading

0 comments on commit 1d8a917

Please sign in to comment.