Skip to content

fix: bump dalgo to v0.74.0, close duplicate-insert conformance gap - #5

Merged
trakhimenok merged 1 commit into
mainfrom
chore/dalgo-v0.74.0
Aug 26, 2026
Merged

fix: bump dalgo to v0.74.0, close duplicate-insert conformance gap#5
trakhimenok merged 1 commit into
mainfrom
chore/dalgo-v0.74.0

Conversation

@trakhimenok

Copy link
Copy Markdown
Contributor

Summary

  • Bumps github.com/dal-go/dalgo v0.64.2 -> v0.74.0 and github.com/dal-go/record v0.1.1 -> v0.1.3. dal.DB's sealing (unexported dalgoDB() marker) is unchanged in shape since this adapter adopted it in chore: adopt sealed dal.DB from dalgo v0.64.2 #4 for v0.64.2 — no redesign needed, this is a pure version bump.
  • Closes the duplicate-insert conformance gap: dal-go/record v0.1.3 added the cross-adapter ErrRecordExists / IsAlreadyExists sentinel, and dalgo's dalgotest.Checks() conformance suite now mandates it ("rejects an Insert over an existing key with record.IsAlreadyExists"). Insert's existing-key error now wraps record.ErrRecordExists in both the MapOfRecords and single-record branches instead of returning a bare fmt.Errorf.
  • Fixes a latent bug in the test double (newGitHubContentsServer in db_github_test.go) that the new conformance check exposed: its GET handler 404'd any path not present in the server's static fixture list, even after that same path had just been written via PUT during the test. That made every dynamically-written record read back as "not found" on a second Insert, which silently defeated duplicate-key detection in the test harness (not in production code — the real GitHub Contents API doesn't have this gap).

Before/after test output

Before (dalgo v0.74.0 + record v0.1.3, adapter code unchanged):

--- FAIL: TestConformance/rejects_an_Insert_over_an_existing_key_with_record.IsAlreadyExists
    conformance_test.go:61: a second Insert at an existing key was accepted, want a duplicate-key error
--- FAIL: TestReadwriteTx_InsertMapOfRecords_AlreadyExists
    tx_readwrite_test.go:351: Insert() error = "record already exists: todo.tags/active: record already exists", want "record already exists: todo.tags/active"

After (this PR):

ok  	github.com/ingitdb/dalgo2ingitdb4github	0.327s

TestReadwriteTx_InsertMapOfRecords_AlreadyExists was updated to assert errors.Is(err, record.ErrRecordExists) / record.IsAlreadyExists(err) instead of an exact error string, since the string now has an appended : record already exists from the wrapped sentinel.

Test plan

  • gofmt -l . clean
  • go build ./...
  • go vet ./...
  • go test ./... (including the full dalgotest.Checks() conformance suite)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KFsyYhYi9h9Am1JbAMxuhv

…conformance gap

dal.DB's sealing (the unexported dalgoDB() marker method) has not changed
shape since this adapter adopted it for v0.64.2; the interface is satisfied
unchanged at v0.74.0 with no adapter redesign required.

dal-go/record v0.1.3 added the cross-adapter ErrRecordExists / IsAlreadyExists
sentinel that dalgo's dalgotest.Checks() conformance suite now mandates
("rejects an Insert over an existing key with record.IsAlreadyExists").
Insert's existing-key error in tx_readwrite.go now wraps
record.ErrRecordExists in both the MapOfRecords and single-record branches,
so callers can distinguish "created" from "duplicate key" via
record.IsAlreadyExists(err) instead of string-matching an ad hoc message.

Fixture fix: newGitHubContentsServer's GET handler 404'd any path not present
in the server's static fixture set, even after that path had been written via
PUT during the test. That masked the new conformance check: a record written
by a seed Insert always read back as "not found" on the next Insert, so
duplicate-key detection looked broken. Directory listings still come from the
static fixtures; file content now comes from the live contents map for any
path, matching what the real GitHub Contents API does.

go.mod's `go` directive moved from 1.26.0+toolchain 1.27.0 to a plain 1.27.0
as a mechanical side effect of `go get`/`go mod tidy` against dalgo v0.74.0's
own go.mod floor.

go build ./... && go vet ./... && go test ./... all green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFsyYhYi9h9Am1JbAMxuhv
@trakhimenok
trakhimenok merged commit df67d4c into main Aug 26, 2026
3 checks passed
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 33022483860

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 84.572%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1413
Covered Lines: 1195
Line Coverage: 84.57%
Coverage Strength: 0.85 hits per line

💛 - Coveralls

@trakhimenok
trakhimenok deleted the chore/dalgo-v0.74.0 branch August 26, 2026 23:17
trakhimenok added a commit that referenced this pull request Aug 26, 2026
dalgo v0.74.0 declared `go 1.27.0` incidentally (a go get run on a 1.27
machine; its real floor was 1.24.0). dalgo v0.74.1 fixed that upstream and
declares the founder's convention (go 1.26.0 + toolchain go1.27.0) itself,
so this repo's own directive - bumped to 1.27.0 by the previous dalgo v0.74.0
bump (#5) - can now be restored without go mod tidy fighting it.

Bumped github.com/dal-go/dalgo v0.74.0 -> v0.74.1 (dal-go/record unchanged
at v0.1.3, it did not move). Verified go mod tidy, run AFTER restoring the
directive, leaves it at go 1.26.0 + toolchain go1.27.0 (does not rewrite it
back to 1.27.0 the way it would have against v0.74.0).

GOTOOLCHAIN=go1.26.0 go build ./... && go vet ./... && go test ./... all
green; gofmt clean.


Claude-Session: https://claude.ai/code/session_01KFsyYhYi9h9Am1JbAMxuhv

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants