Skip to content

Commit a4530ac

Browse files
authored
#269 Update to template (#272)
* 269 Update dependencies * #269 Prepare for versioned release * #269 Fix linting issues * #269 Fix linting issues * #269 Fix linting issues
1 parent 36cc3eb commit a4530ac

32 files changed

+422
-278
lines changed

.claude/CLAUDE.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1010
- Swagger UI
1111
- Xterm terminal interface
1212

13-
It connects to a Senzing database (local or via gRPC) to provide entity resolution services over HTTP.
13+
It connects to a Senzing database (local SQLite/PostgreSQL or remote via gRPC) to provide entity resolution services over HTTP.
1414

1515
## Build and Development Commands
1616

@@ -33,6 +33,10 @@ make lint
3333
# Run tests (requires setup first)
3434
make clean setup test
3535

36+
# Run a single test
37+
export LD_LIBRARY_PATH=/opt/senzing/er/lib
38+
go test -v -run TestFunctionName ./path/to/package
39+
3640
# Run tests with coverage
3741
make clean setup coverage
3842

@@ -56,14 +60,21 @@ export LD_LIBRARY_PATH=/opt/senzing/er/lib
5660

5761
The server runs on port 8261 by default. Use `--enable-all` to enable all services.
5862

63+
Configuration via environment variables (prefixed `SENZING_TOOLS_`) or command-line flags:
64+
65+
- `SENZING_TOOLS_DATABASE_URL` - Database connection (e.g., `sqlite3://na:na@/tmp/sqlite/G2C.db`)
66+
- `SENZING_TOOLS_GRPC_URL` - Connect to remote Senzing via gRPC instead of local database
67+
- `SENZING_TOOLS_ENABLE_ALL` - Enable all services (API, Swagger, Xterm)
68+
- `SENZING_TOOLS_HTTP_PORT` - Server port (default 8261)
69+
5970
## Architecture
6071

6172
### Package Structure
6273

6374
- `main.go` - Entry point, calls `cmd.Execute()`
6475
- `cmd/` - Cobra command implementation with Viper configuration
6576
- `root.go` - Main command definition with `RootCmd`, `PreRun`, `RunE`
66-
- `context_*.go` - Platform-specific context variables
77+
- `context_*.go` - Platform-specific context variables (Xterm command differs by OS)
6778
- `httpserver/` - HTTP server implementation
6879
- `httpserver_basic.go` - `BasicHTTPServer` struct and `Serve()` method
6980
- `static/` - Embedded static files and templates
@@ -78,7 +89,10 @@ The server runs on port 8261 by default. Use `--enable-all` to enable all servic
7889
- `/site/` - Static site templates
7990
- `/` - Static root files
8091

81-
**Command Configuration** (`cmd/root.go`): Uses `go-cmdhelping` for CLI options. Configuration via environment variables (prefixed `SENZING_TOOLS_`) or command-line flags.
92+
**Command Configuration** (`cmd/root.go`): Uses `go-cmdhelping` for CLI options. The `RunE` function builds a `BasicHTTPServer` from Viper config and calls `Serve()`. Supports two modes:
93+
94+
- Local mode: Connects directly to database via `SENZING_TOOLS_DATABASE_URL`
95+
- gRPC mode: Connects to remote Senzing server via `SENZING_TOOLS_GRPC_URL`
8296

8397
### Dependencies
8498

@@ -91,4 +105,4 @@ Key Senzing packages:
91105

92106
### Test Data
93107

94-
Test setup copies `testdata/sqlite/G2C.db` to `/tmp/sqlite/G2C.db` for testing.
108+
Test setup (`make setup`) copies `testdata/sqlite/G2C.db` to `/tmp/sqlite/G2C.db`. Tests use this SQLite database.

.claude/commands/senzing-code-review.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

.claude/commands/senzing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Senzing
2+
3+
- Perform the steps specified by <https://raw.githubusercontent.com/senzing-factory/claude/refs/tags/v1/commands/senzing.md>

.github/linters/.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ linters:
110110
disable:
111111
- gochecknoglobals
112112
- gochecknoinits
113+
- prealloc
113114
exclusions:
114115
generated: lax
115116
presets:

.github/linters/.jscpd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

.github/linters/README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@
2424
- [jscpd configuration]
2525
- Example:
2626

27-
```json
28-
{
29-
"ignore": [
30-
"**/*.go,**/go-test*.yaml"
31-
],
27+
```json
28+
{
29+
"ignore": ["**/*.go,**/go-test*.yaml"],
3230
"threshold": 10
33-
}
34-
```
31+
}
32+
```
3533

3634
## .yaml-lint.yml
3735

@@ -40,10 +38,23 @@
4038
- [yaml-lint]
4139
- [yaml-lint configuration]
4240

43-
[.checkov.yaml]: .checkov.yaml
41+
## bearer.yml
42+
43+
- [bearer.yml]
44+
- Used by [bearer.yaml]
45+
- [bearer]
46+
- [bearer repository]
47+
- [bearer configuration]
48+
49+
[.checkov.yaml]: .checkov.yaml
4450
[.golangci.yaml]: .golangci.yaml
4551
[.jscpd.json]: .jscpd.json
4652
[.yaml-lint.yml]: .yaml-lint.yml
53+
[bearer configuration]: https://docs.bearer.com/reference/config/
54+
[bearer repository]: https://github.com/Bearer/bearer/tree/main
55+
[bearer.yaml]: ../workflows/README.md#beareryaml
56+
[bearer.yml]: bearer.yml
57+
[bearer]: https://docs.bearer.com/
4758
[checkov configuration]: https://www.checkov.io/2.Basics/CLI%20Command%20Reference.html
4859
[checkov]: https://www.checkov.io/
4960
[golangci linters]: https://golangci-lint.run/usage/linters/

.github/renovate.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"enabledManagers": ["dockerfile", "docker-compose"],
43
"extends": [
54
"config:recommended",
65
":disableDependencyDashboard",
76
"docker:pinDigests"
87
],
8+
"enabledManagers": ["dockerfile", "docker-compose"],
99
"schedule": ["on sunday"],
10-
"minimumReleaseAge": "21 days"
10+
"prCreation": "not-pending",
11+
"packageRules": [
12+
{
13+
"matchUpdateTypes": ["major", "minor", "patch"],
14+
"minimumReleaseAge": "21 days"
15+
}
16+
]
1117
}

.github/workflows/bearer.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
name: bearer
1+
name: Bearer
22

33
on:
4-
push:
5-
branches-ignore: [main]
64
pull_request:
75
branches: [main]
86

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
9+
cancel-in-progress: true
10+
911
permissions: {}
1012

1113
jobs:
1214
rule_check:
1315
permissions:
1416
contents: read
1517
runs-on: ubuntu-latest
18+
timeout-minutes: 10
1619

1720
steps:
1821
- name: Checkout repository

.github/workflows/claude-pr-review.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Claude PR Review
22

3-
concurrency:
4-
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
5-
cancel-in-progress: true
6-
73
on:
84
pull_request:
95
types: [opened, synchronize]
106

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
9+
cancel-in-progress: true
10+
1111
permissions: {}
1212

1313
jobs:

.github/workflows/dependabot-approve-and-merge.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
branches: [main]
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
9+
cancel-in-progress: true
10+
711
permissions: {}
812

913
jobs:

0 commit comments

Comments
 (0)