Skip to content

feat(dbkit/sqlite): let callers match the snapshot errors for an unsupported file system - #157

Merged
SirLouen merged 15 commits into
mainfrom
feat/156-sqlite-unsupported-file-system
Nov 14, 2026
Merged

SirLouen merged 15 commits into
mainfrom
feat/156-sqlite-unsupported-file-system

Conversation

@SirLouen

@SirLouen SirLouen commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Closes #156

What

  • New ErrUnsupportedFileSystem. A snapshot error matches it with errors.Is when the snapshot folder is on a network or FUSE file system, and when its file system cannot move a file without replacing one.
  • New UnsupportedFileSystemError, read with errors.As. Folder names the snapshot folder. FileSystem names the network or FUSE file system, and is empty in the move case. Err holds the error of the failed move, and is nil for the check before the lock.
  • The checks, their order, the cleanup of the copy and the error text stay as they are.
  • Every module moves to Go 1.27.4, which fixes GO-2026-6859 in net/http.

Why

A downstream application writes its own message for these two failures, with the setting its user should change. Until now it could only tell them apart by matching dbkit's text.

The vulnerability scan fails on Go 1.27.3 in every module that reaches the affected net/http code, so this pull request could not pass without the move.

Testing Instructions

  1. Run the testing toolchain in dbkit/sqlite.
  2. On a Mac, a snapshot into a mounted SMB share fails with the same text as before, and errors.As gives the folder and smbfs.

Summary by CodeRabbit

  • New Features
    • Snapshot errors now identify unsupported filesystems, such as network or FUSE filesystems, and provide guidance to use a local folder.
  • Changed
    • All modules now require Go 1.27.4.

@SirLouen SirLouen self-assigned this Nov 14, 2026
@greptile-apps

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The SQLite package adds ErrUnsupportedFileSystem and UnsupportedFileSystemError. Snapshot checks return this typed error when the snapshot folder uses an unsupported filesystem or cannot perform a no-replace move. Tests verify its fields and error matching. The listed Go modules now declare Go 1.27.4.

Changes: Snapshot filesystem error handling

Layer / File(s) Summary
Unsupported filesystem error contract
dbkit/sqlite/unsupported.go
Adds ErrUnsupportedFileSystem and UnsupportedFileSystemError. The typed error formats filesystem and move failures, matches the sentinel, and unwraps the move error.
Snapshot error returns and validation
dbkit/sqlite/snapshot.go, dbkit/sqlite/fs_linux_test.go, dbkit/sqlite/snapshot_internal_test.go, dbkit/sqlite/snapshot_linux_test.go, dbkit/sqlite/space_linux_test.go, dbkit/sqlite/CHANGELOG.md
Snapshot checks return the typed error for unsupported filesystems and no-replace move failures. Tests verify its fields, sentinel matching, and separation from other snapshot and space errors. The changelog documents the new error types.

Go version update

Layer / File(s) Summary
Module Go versions and changelogs
dbkit/..., goncierge/..., gonsole/..., mailkit/..., pluginkit/..., postgresblob/...
The listed modules’ Go directives and unreleased changelog entries now specify Go 1.27.4.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 2de2d

This adds matchable errors for unsupported snapshot file systems and moves the modules to Go 1.27.4. No concrete merge-blocking risk was identified in the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the feature and its scope: a new error surface that lets callers match snapshot errors for an unsupported file system in dbkit/sqlite. The changeset adds ErrUnsupportedFileSystem and U…
Linked Issues check Passed [#156] Requirement: one sentinel that both unsupported-file-system failures match with errors.Is. dbkit/sqlite/unsupported.go defines ErrUnsupportedFileSystem, and (*UnsupportedFileSystemError).Is ret…
Out of Scope Changes check Passed Changes in dbkit/sqlite support #156. unsupported.go adds the sentinel and error type. snapshot.go changes only the two error returns. The test files cover the new matching and the existing snapshot a…
Full details: Title check

Explanation

The title names the feature and its scope: a new error surface that lets callers match snapshot errors for an unsupported file system in dbkit/sqlite. The changeset adds ErrUnsupportedFileSystem and UnsupportedFileSystemError, which fits that description. The title is specific and conventional, and it does not mention the Go 1.27.4 bump, which is a secondary change.

Full details: Linked Issues check

Explanation

[#156] Requirement: one sentinel that both unsupported-file-system failures match with errors.Is. dbkit/sqlite/unsupported.go defines ErrUnsupportedFileSystem, and (*UnsupportedFileSystemError).Is returns true for it. Requirement: errors.As yields *UnsupportedFileSystemError with Folder, FileSystem and Err. The type has these fields and Unwrap returns Err. At the reviewed head, snapshot.go checkFolders returns &UnsupportedFileSystemError{Folder, FileSystem: name} before the lock for a network or FUSE folder. writeCopy returns &UnsupportedFileSystemError{Folder, Err} when rename reports noReplaceUnsupported, after checkCopy. Requirement: checks, order and copy cleanup unchanged. prepare still runs checkTarget, checkFolders, liveFile and the lock in that order. writeCopy still copies, checks and then renames. copyLocked still removes the partial copy on failure. Open uncertainty: the raw summary says checkFolders now returns the typed error 'instead of formatting a network/FUSE-specific error'. The whole-PR base blob for snapshot.go could not be read, so the claim that the error text is unchanged could not be compared with the old code. The new Error() text uses the same localFolderAdvice constant. The #156 coding requirements are met on the evidence read.

Full details: Out of Scope Changes check

Explanation

Changes in dbkit/sqlite support #156. unsupported.go adds the sentinel and error type. snapshot.go changes only the two error returns. The test files cover the new matching and the existing snapshot and space error paths. The CHANGELOG entries document the new exported names. The go.mod and CHANGELOG Go-version updates from 1.27.3 to 1.27.4 across all modules are not part of #156. The PR description gives a stated reason: GO-2026-6859 in net/http fails the vulnerability scan on 1.27.3. That reason is not verified here, but it is a concrete, documented connection, so these edits are not treated as unrelated. The base revision and full per-file diff were unavailable, so the snapshot.go diff could not be read directly.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: cae7ec30-5667-46a5-8a73-6bd767cfdc3f
Commits

Reviewing files that changed from the base of the PR and between d7ad657 and 2de2d45.

Files selected for processing: 25

  • dbkit/CHANGELOG.md
  • dbkit/go.mod
  • dbkit/postgres/CHANGELOG.md
  • dbkit/postgres/go.mod
  • dbkit/sqlite/CHANGELOG.md
  • dbkit/sqlite/go.mod
  • goncierge/CHANGELOG.md
  • goncierge/go.mod
  • gonsole/CHANGELOG.md
  • gonsole/auth/CHANGELOG.md
  • gonsole/auth/go.mod
  • gonsole/auth/postgres/CHANGELOG.md
  • gonsole/auth/postgres/go.mod
  • gonsole/auth/sqlite/CHANGELOG.md
  • gonsole/auth/sqlite/go.mod
  • gonsole/go.mod
  • mailkit/CHANGELOG.md
  • mailkit/go.mod
  • pluginkit/CHANGELOG.md
  • pluginkit/features/go.mod
  • pluginkit/go.mod
  • pluginkit/graphwire/CHANGELOG.md
  • pluginkit/graphwire/go.mod
  • postgresblob/CHANGELOG.md
  • postgresblob/go.mod

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

codescene-access[bot]

This comment was marked as outdated.

@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

This PR lets callers recognize unsupported snapshot folders without matching error text, and raises every Go module’s minimum version to 1.27.4.

  • SQLite snapshot errors identify unsupported file systems in a matchable way.
  • All repository modules now require Go 1.27.4.

Reviews (2) · Last reviewed commit: "chore(postgresblob): move to Go 1.27.4" · Reviewed by Greptile

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Passed
4 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@SirLouen
SirLouen merged commit 4933b8c into main Nov 14, 2026
51 checks passed
@SirLouen
SirLouen deleted the feat/156-sqlite-unsupported-file-system branch November 14, 2026 21:40
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.

Let callers match the snapshot errors for an unsupported file system

1 participant