Skip to content

Commit 5ffd97e

Browse files
authored
#343 Prepare for versioned release (#346)
1 parent 11060e3 commit 5ffd97e

File tree

15 files changed

+109
-77
lines changed

15 files changed

+109
-77
lines changed

.github/linters/bearer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rule:
2+
skip-rule: []

.github/workflows/bearer.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: bearer
2+
3+
on:
4+
push:
5+
branches-ignore: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
rule_check:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Bearer
20+
uses: bearer/bearer-action@v2
21+
with:
22+
config-file: .github/linters/bearer.yml

.github/workflows/go-test-windows.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
2119

2220
- name: Setup go ${{ matrix.go }}
2321
uses: actions/setup-go@v5

.vscode/cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@
6666
".dockerignore",
6767
".git/*",
6868
".github/linters/.golangci.yaml",
69-
".history/*",
7069
".gitignore",
70+
".history/*",
7171
"**/*.go",
7272
"**/*.mod",
7373
"**/*.sum",
74+
"bearer.ignore",
7475
"Makefile"
7576
]
7677
}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning].
99

1010
-
1111

12+
## [0.4.4] - 2025-05-21
13+
14+
### Changed in 0.4.4
15+
16+
- Improved error messages
17+
1218
## [0.4.3] - 2025-04-30
1319

1420
### Changed in 0.4.3

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ dependencies-for-development: dependencies-for-development-osarch-specific
7171
@go install github.com/vladopajic/go-test-coverage/v2@latest
7272
@go install golang.org/x/tools/cmd/godoc@latest
7373
@go install golang.org/x/vuln/cmd/govulncheck@latest
74+
@go install mvdan.cc/gofumpt@latest
7475
@sudo npm install -g cspell@latest
7576

7677

@@ -191,6 +192,11 @@ update-pkg-cache:
191192
# Specific programs
192193
# -----------------------------------------------------------------------------
193194

195+
.PHONY: bearer
196+
bearer:
197+
@bearer scan --config-file .github/linters/bearer.yml .
198+
199+
194200
.PHONY: cspell
195201
cspell:
196202
@cspell lint --dot .

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ require (
88
github.com/aws/aws-sdk-go-v2/service/sqs v1.38.5
99
github.com/rabbitmq/amqp091-go v1.10.0
1010
github.com/roncewind/go-util v0.0.5
11-
github.com/senzing-garage/go-helpers v0.6.11
12-
github.com/senzing-garage/go-logging v1.5.2
11+
github.com/senzing-garage/go-helpers v0.6.12
12+
github.com/senzing-garage/go-logging v1.5.3
1313
github.com/senzing-garage/sz-sdk-go v0.15.3
1414
github.com/sourcegraph/conc v0.3.0
1515
github.com/stretchr/testify v1.10.0
@@ -31,6 +31,6 @@ require (
3131
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
3232
github.com/senzing-garage/go-messaging v1.5.3 // indirect
3333
go.uber.org/multierr v1.11.0 // indirect
34-
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
34+
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
3535
gopkg.in/yaml.v3 v3.0.1 // indirect
3636
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
4242
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
4343
github.com/roncewind/go-util v0.0.5 h1:SiXs7Si68b/5paClS7QPyJ4yDnOQ3lJdi7SXhxgjBFo=
4444
github.com/roncewind/go-util v0.0.5/go.mod h1:3W93f0MuKIQJA21OqGPcjzw87zc1TFFTn/O0lWB2Ahg=
45-
github.com/senzing-garage/go-helpers v0.6.11 h1:cwXZLVFKRnriyX+RCaS1Rg9+x7/sJcJjN0TIVZo/vdo=
46-
github.com/senzing-garage/go-helpers v0.6.11/go.mod h1:xjTBckB68M54X5fPyG1ArjXsqfs4rW4CKLNkMDFxAmo=
47-
github.com/senzing-garage/go-logging v1.5.2 h1:9Rhsvxu6jLHfCLIoDxSMXX0sf/w0TY/L7i7fFfSdP64=
48-
github.com/senzing-garage/go-logging v1.5.2/go.mod h1:+QsFSi/qKmCC3YAyuXcRbQlBpvpmhTWLWVH2Miap1Fw=
45+
github.com/senzing-garage/go-helpers v0.6.12 h1:RnoDm2pnVMMGslDbJxtgZpGpuSR5dK+T7BZYoXjRaeM=
46+
github.com/senzing-garage/go-helpers v0.6.12/go.mod h1:/gceFlOcg8+0ujQH/CzLjqVAsXtR9xRJgMWDlpSqHGY=
47+
github.com/senzing-garage/go-logging v1.5.3 h1:RYF5hHL4fAUzOFMQwwotT5/I0YD3ItDF589wKtw73X4=
48+
github.com/senzing-garage/go-logging v1.5.3/go.mod h1:AAZvO6ectkKzD1ZbUl24X1TOd3riCQLYaMKgBnuiZF0=
4949
github.com/senzing-garage/go-messaging v1.5.3 h1:bH+LtEgNJj/PRbg1VMK9/Gk457CdfdcjMiubxffbTog=
5050
github.com/senzing-garage/go-messaging v1.5.3/go.mod h1:7qvSNAVyWcSIcsnDAm8obCxHItljN295O3fX4bOgfp0=
5151
github.com/senzing-garage/sz-sdk-go v0.15.3 h1:fq5eZgEooZaQZCv6Knt1zkpo0C9QU1CLS9LCOkRanqo=
@@ -58,8 +58,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
5858
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
5959
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
6060
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
61-
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
62-
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
61+
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
62+
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
6363
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6464
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
6565
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

queues/rabbitmq/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ var IDMessages = map[int]string{
5454
// Status strings for specific messages.
5555
var IDStatuses = map[int]string{}
5656

57-
var errPackage = errors.New("rabbitmq")
57+
var errForPackage = errors.New("rabbitmq")

queues/rabbitmq/managedConsumer.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package rabbitmq
22

33
import (
44
"context"
5-
"fmt"
65
"runtime"
76

87
amqp "github.com/rabbitmq/amqp091-go"
@@ -43,26 +42,25 @@ func (job *RabbitConsumerJob) Execute(ctx context.Context) error {
4342
flags = senzing.SzWithInfo
4443
}
4544

46-
result, err := (*job.engine).AddRecord(ctx, record.DataSource, record.ID, record.JSON, flags)
45+
_, err := (*job.engine).AddRecord(ctx, record.DataSource, record.ID, record.JSON, flags)
4746
if err != nil {
48-
return fmt.Errorf(
49-
"add record error, record id: %s, message id: %s, result: %s, %w",
47+
return wraperror.Errorf(
48+
err,
49+
"add record error, record id: %s, message id: %s",
5050
job.delivery.MessageId,
5151
record.ID,
52-
result,
53-
err,
5452
)
5553
}
5654

5755
// when we successfully process a delivery, acknowledge it.
5856
err = job.delivery.Ack(false)
5957

60-
return wraperror.Errorf(err, "queues.rabbitmq.Execute.Ack error: %w", err)
58+
return wraperror.Errorf(err, "Ack")
6159
}
6260
// when we get an invalid delivery, negatively acknowledge and send to the dead letter queue
6361
err := job.delivery.Nack(false, false)
6462

65-
return fmt.Errorf("invalid deliver from RabbitMQ, message id: %s, %w", job.delivery.MessageId, err)
63+
return wraperror.Errorf(err, "invalid deliver from RabbitMQ, message id: %s", job.delivery.MessageId)
6664
}
6765

6866
// Whenever Execute() returns an error or panics, this is called.
@@ -126,13 +124,13 @@ func StartManagedConsumer(
126124

127125
client, err := NewClient(urlString)
128126
if err != nil {
129-
return fmt.Errorf("unable to get a new RabbitMQ client %w", err)
127+
return wraperror.Errorf(err, "unable to get a new RabbitMQ client")
130128
}
131129
defer client.Close()
132130

133131
deliveries, err := client.Consume(numberOfWorkers)
134132
if err != nil {
135-
return fmt.Errorf("unable to get a new RabbitMQ delivery channel %w", err)
133+
return wraperror.Errorf(err, "unable to get a new RabbitMQ delivery channel")
136134
}
137135

138136
workerPool := pool.New().WithMaxGoroutines(numberOfWorkers)

0 commit comments

Comments
 (0)