Skip to content

R6: dependency hygiene - #233

Merged
can3p merged 14 commits into
masterfrom
chore/r6-deps
Oct 13, 2026
Merged

can3p merged 14 commits into
masterfrom
chore/r6-deps

Conversation

@can3p

@can3p can3p commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Closes the R6 wave: no unmaintained or duplicate dependencies left from its list, and a lint rule that keeps them out. Closes #232.

Changes

  • D1 alecthomas/assert → testify. The last 9 test files move to require, which stops at the first failure like alecthomas did. Assertions are unchanged.
  • D2 pkg/errors → stdlib. 12 files move to errors / fmt.Errorf("...: %w"), with every message unchanged.
    • SetLoginAttempt now checks session.Save() before wrapping it: Wrap(nil) was nil, fmt.Errorf never is.
    • Capitalized messages carry //nolint:staticcheck // ST1005.
  • D3 sessions via gogo's sessions/pgstore (Add sessions/pgstore: a gin session store in PostgreSQL gogo#8, gogo v0.3.0). This replaces antonlindstrom/pgstore.
    • Same rows and cookies, so nobody is logged out.
    • Migration: the table is copied with gogo's pgstore-migrations command (IF NOT EXISTS; production only records it), and a test fails when a gogo upgrade ships another migration.
    • Cleanup: web serve now deletes expired sessions every --session-cleanup-interval (default 1h); pgstore's cleanup never ran.
    • Session age: the hard-coded 30 days is now --session-max-age (default 720h).
    • Binary: lib/pq is gone from it.
  • D4.
  • Tooling. The session-start hook clears the stale containerd pid file a container restart leaves, which stopped dockerd from starting.
  • Docs and skills.
    • docs/architecture.md, docs/gogo-extraction.md and docs/testing.md are updated.
    • "Planning a wave" covers dropping a dependency that other modules require.
    • wave-run covers task_prompt.py's guessed PKG= paths and lint findings in shared packages.
    • History is in docs/archive/history/r6.md.

Left out: jmoiron/sqlx (#229, after gogo drops it) and goldmark-highlighting/chroma v2 (#228).

Testing

  • make check-q passes (51 packages); make cover + make cover-check pass, total 87.3% (floor 84.7%).
  • Mutation checks:
    • the header shift (D1);
    • the Wrap(nil) login trap (D2), caught by pkg/forms;
    • the router ignoring --session-max-age (D3);
    • the lint rule rejecting a pkg/errors import (D4).
  • make test-ui: everything passes except the three tests docs/testing.md lists as failing only in the sandbox (TestWriting_RenderedPostFeatures, TestWriting_PostVisibility, TestActions_ShareLifecycle); CI's browser job decides those.

Merge note

On deploy, release_command runs the gogo-pgstore migration, which is a no-op on the existing http_sessions table apart from recording itself.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG


Generated by Claude Code

claude added 14 commits October 11, 2026 23:42
Turn the four bullets into tasks D1-D4 with owned files and done-when
checks, record what the code holds today (pgstore's unstarted cleanup and
lib/pq, the Wrap(nil) trap in auth.go, .devin already gone), and list the
owner decisions Q1-Q3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
…uire

require keeps alecthomas's stop-on-first-failure behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Wrap(nil) returned nil; SetLoginAttempt now checks Save's error before
wrapping it. Error texts are unchanged; the capitalized ones carry a
nolint for ST1005, which only stdlib constructors trigger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
go mod tidy drops alecthomas/assert (with repr and gotextdiff); pkg/errors
stays as an indirect requirement of gogo. depguard refuses importing
either. pkg/pgsession uses stdlib errors too.

plan.txt's open ideas are GitHub issues #221-#227; dismissing RSS items
and storing feed images in pcom's media already shipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
antonlindstrom/pgstore is replaced by gogo v0.3.0's sessions/pgstore, which
reads the same rows and cookies, so nobody is logged out. Its table is now
a migration, copied with gogo's pgstore-migrations command; a test fails
when a gogo upgrade ships another. web serve deletes expired sessions
every --session-cleanup-interval (pgstore's cleanup never ran), and the
30-day session age is --session-max-age. lib/pq leaves the binary;
depguard refuses pgstore.

Closes #232

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
A container restart leaves dockerd's managed-containerd pid file behind and
dockerd then times out waiting for the dead pid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLdnenF9tokN9o3SLsrZjG
@can3p
can3p merged commit bbfa50b into master Oct 13, 2026
8 checks passed
@can3p
can3p deleted the chore/r6-deps branch October 13, 2026 00:38
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.

Switch sessions to gogo's sessions/pgstore (after R7)

2 participants