Skip to content

Commit

Permalink
CI and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhb committed Sep 10, 2024
1 parent 0a9c421 commit a8188bb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

name: Go

on:
push:
branches: [ develop ]
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.23"
- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1
./bin/golangci-lint run --verbose
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.23"
- name: Test
run: ENV=test go test -coverprofile=coverage.out -tags test -v -short $(go list ./... | grep -v /test/integration)
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittest
6 changes: 0 additions & 6 deletions pkg/decoder/pg_logical_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ type v1LogicalDecoder struct {

schema *schema.PGXSchemaLoader
relations map[uint32]*pglogrepl.RelationMessage

// Postgres batches every individual insert, update, etc. within a BEGIN/COMMIT message.
// This is great for replication. However, for Inngest events, we don't want superflous begin
// or commit messages as events.
//
// We store the current txn LSN and number of operations.
}

func (v1LogicalDecoder) ReplicationPluginArgs() []string {
Expand Down
3 changes: 0 additions & 3 deletions pkg/replicator/txn_unwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ func (t *txnUnwrapper) Process(cs *changeset.Changeset) {

switch cs.Operation {
case changeset.OperationBegin:
if t.begin != nil {
// LOG WARNING
}
t.begin = cs
case changeset.OperationCommit:
if atomic.LoadInt32(&t.sequence) == 1 {
Expand Down
2 changes: 1 addition & 1 deletion scripts/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/jackc/pgx/v5/pgconn"
)

func main() {
func init() {
ctx := context.Background()
c, err := pgconn.Connect(ctx, os.Getenv("DATABASE_URL"))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion scripts/push_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func hash(in any) string {
}
}

func main() {
func push() {
ctx := context.Background()
c, err := pgconn.Connect(ctx, os.Getenv("DATABASE_URL"))
if err != nil {
Expand Down

0 comments on commit a8188bb

Please sign in to comment.