Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- Swagger UI
- Xterm terminal interface

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

## Build and Development Commands

Expand All @@ -33,6 +33,10 @@ make lint
# Run tests (requires setup first)
make clean setup test

# Run a single test
export LD_LIBRARY_PATH=/opt/senzing/er/lib
go test -v -run TestFunctionName ./path/to/package

# Run tests with coverage
make clean setup coverage

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

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

Configuration via environment variables (prefixed `SENZING_TOOLS_`) or command-line flags:

- `SENZING_TOOLS_DATABASE_URL` - Database connection (e.g., `sqlite3://na:na@/tmp/sqlite/G2C.db`)
- `SENZING_TOOLS_GRPC_URL` - Connect to remote Senzing via gRPC instead of local database
- `SENZING_TOOLS_ENABLE_ALL` - Enable all services (API, Swagger, Xterm)
- `SENZING_TOOLS_HTTP_PORT` - Server port (default 8261)

## Architecture

### Package Structure

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

**Command Configuration** (`cmd/root.go`): Uses `go-cmdhelping` for CLI options. Configuration via environment variables (prefixed `SENZING_TOOLS_`) or command-line flags.
**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:

- Local mode: Connects directly to database via `SENZING_TOOLS_DATABASE_URL`
- gRPC mode: Connects to remote Senzing server via `SENZING_TOOLS_GRPC_URL`

### Dependencies

Expand All @@ -91,4 +105,4 @@ Key Senzing packages:

### Test Data

Test setup copies `testdata/sqlite/G2C.db` to `/tmp/sqlite/G2C.db` for testing.
Test setup (`make setup`) copies `testdata/sqlite/G2C.db` to `/tmp/sqlite/G2C.db`. Tests use this SQLite database.
3 changes: 0 additions & 3 deletions .claude/commands/senzing-code-review.md

This file was deleted.

3 changes: 3 additions & 0 deletions .claude/commands/senzing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Senzing

- Perform the steps specified by <https://raw.githubusercontent.com/senzing-factory/claude/refs/tags/v1/commands/senzing.md>
1 change: 1 addition & 0 deletions .github/linters/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ linters:
disable:
- gochecknoglobals
- gochecknoinits
- prealloc
exclusions:
generated: lax
presets:
Expand Down
2 changes: 1 addition & 1 deletion .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
27 changes: 19 additions & 8 deletions .github/linters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
- [jscpd configuration]
- Example:

```json
{
"ignore": [
"**/*.go,**/go-test*.yaml"
],
```json
{
"ignore": ["**/*.go,**/go-test*.yaml"],
"threshold": 10
}
```
}
```

## .yaml-lint.yml

Expand All @@ -40,10 +38,23 @@
- [yaml-lint]
- [yaml-lint configuration]

[.checkov.yaml]: .checkov.yaml
## bearer.yml

- [bearer.yml]
- Used by [bearer.yaml]
- [bearer]
- [bearer repository]
- [bearer configuration]

[.checkov.yaml]: .checkov.yaml
[.golangci.yaml]: .golangci.yaml
[.jscpd.json]: .jscpd.json
[.yaml-lint.yml]: .yaml-lint.yml
[bearer configuration]: https://docs.bearer.com/reference/config/
[bearer repository]: https://github.com/Bearer/bearer/tree/main
[bearer.yaml]: ../workflows/README.md#beareryaml
[bearer.yml]: bearer.yml
[bearer]: https://docs.bearer.com/
[checkov configuration]: https://www.checkov.io/2.Basics/CLI%20Command%20Reference.html
[checkov]: https://www.checkov.io/
[golangci linters]: https://golangci-lint.run/usage/linters/
Expand Down
10 changes: 8 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"enabledManagers": ["dockerfile", "docker-compose"],
"extends": [
"config:recommended",
":disableDependencyDashboard",
"docker:pinDigests"
],
"enabledManagers": ["dockerfile", "docker-compose"],
"schedule": ["on sunday"],
"minimumReleaseAge": "21 days"
"prCreation": "not-pending",
"packageRules": [
{
"matchUpdateTypes": ["major", "minor", "patch"],
"minimumReleaseAge": "21 days"
}
]
}
9 changes: 6 additions & 3 deletions .github/workflows/bearer.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: bearer
name: Bearer

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
rule_check:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/claude-pr-review.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Claude PR Review

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

on:
pull_request:
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dependabot-approve-and-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/docker-build-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ name: Docker build container

on:
pull_request:
branches:
- main
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
docker-build-container:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Get repository name
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/docker-verify-refreshed-at-updated.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docker verify REFRESHED_AT Updated

# Required status check: Verify Dockerfiles REFRESHED_AT Updated / Dockerfile Check Status
# The other status checks beginning with "Verify Dockerfiles REFRESHED_AT Updated / ..." are not required.

on:
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
verify-dockerfiles:
name: Verify Dockerfiles REFRESHED_AT Updated
permissions:
contents: read
uses: senzing-factory/build-resources/.github/workflows/verify-dockerfile-refreshed-at-updated.yaml@v3
1 change: 1 addition & 0 deletions .github/workflows/go-proxy-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Pull new module version
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Go test darwin

on: [pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
Expand All @@ -20,6 +24,7 @@ jobs:
go: ["1.24"]
os: [macos-latest]
senzingsdk-version: [production-v4, staging-v4]
timeout-minutes: 30

steps:
- name: Checkout repository
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Go test linux

on: [push, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Go test windows

on: [pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

env:
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: "sqlite3://na:na@nowhere/C:\\Temp\\sqlite\\G2C.db"
Expand All @@ -19,6 +23,7 @@ jobs:
matrix:
go: ["1.24"]
senzingsdk-version: [production-v4, staging-v4]
timeout-minutes: 30

steps:
- name: Checkout repository
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Golangci lint

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
golangci:
name: lint
name: Lint
permissions:
# Required: allow read access to the content for analysis.
contents: read
Expand All @@ -22,6 +24,7 @@ jobs:
matrix:
go: ["1.24"]
senzingsdk-version: [production-v4, staging-v4]
timeout-minutes: 10

steps:
- name: Checkout repository
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/govulncheck.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: govulncheck
name: Govulncheck

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
Expand All @@ -18,6 +20,7 @@ jobs:
matrix:
go: ["1.24"]
senzingsdk-version: [production-v4, staging-v4]
timeout-minutes: 10

steps:
- name: Checkout repository
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/lint-workflows.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Lint workflows

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/make-go-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/spellcheck.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: spellcheck
name: Spellcheck

on:
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down
Loading
Loading