3
26
Fork
You've already forked mere
1

fix/cache-error-messages #79

Merged
jhuntwork merged 2 commits from fix/cache-error-messages into main 2026年06月04日 18:44:18 +02:00

Commit 1:

Distinguish CacheError variants in package staging

When restorePackageArchiveRequest failed, the same generic
"failed to resolve package cache" message was returned for
every CacheError variant (OutOfMemory, FileSystem,
PermissionDenied, InvalidInput). Users hitting the failure
had no way to tell whether they were looking at a permissions
problem, a missing path, an OOM, or invalid input.

Replace the catch-all else branch with explicit handling
of each variant, surfacing a distinct hint in the diagnostic
message. The PackageError mapping is unchanged.

Ref #75

Commit 2:

Test the rootless guard in finalizeAdmittedStoreObject

The rootless support PR (#78) added a guard that skips
rollback-state updates when running unprivileged. The
existing "fails hard on rollback-state update after
admission" test relied on running unprivileged and chmod'ing
the cache directory to trigger PermissionDenied — the new
guard makes that path unreachable, so the test fails on
unprivileged hosts (and skips silently on the privileged CI
container).

Replace it with a test that verifies the intended behavior:
when unprivileged, finalizeAdmittedStoreObject succeeds and
does not write a rollback-state file. Error propagation in
the privileged path is the standard switch-and-return pattern
used throughout the codebase.

Commit 1: Distinguish CacheError variants in package staging When restorePackageArchiveRequest failed, the same generic "failed to resolve package cache" message was returned for every CacheError variant (OutOfMemory, FileSystem, PermissionDenied, InvalidInput). Users hitting the failure had no way to tell whether they were looking at a permissions problem, a missing path, an OOM, or invalid input. Replace the catch-all `else` branch with explicit handling of each variant, surfacing a distinct hint in the diagnostic message. The PackageError mapping is unchanged. Ref #75 Commit 2: Test the rootless guard in finalizeAdmittedStoreObject The rootless support PR (#78) added a guard that skips rollback-state updates when running unprivileged. The existing "fails hard on rollback-state update after admission" test relied on running unprivileged and chmod'ing the cache directory to trigger PermissionDenied — the new guard makes that path unreachable, so the test fails on unprivileged hosts (and skips silently on the privileged CI container). Replace it with a test that verifies the intended behavior: when unprivileged, finalizeAdmittedStoreObject succeeds and does not write a rollback-state file. Error propagation in the privileged path is the standard switch-and-return pattern used throughout the codebase.
When restorePackageArchiveRequest failed, the same generic
"failed to resolve package cache" message was returned for
every CacheError variant (OutOfMemory, FileSystem,
PermissionDenied, InvalidInput). Users hitting the failure
had no way to tell whether they were looking at a permissions
problem, a missing path, an OOM, or invalid input.
Replace the catch-all `else` branch with explicit handling
of each variant, surfacing a distinct hint in the diagnostic
message. The PackageError mapping is unchanged.
Ref #75 
Test the rootless guard in finalizeAdmittedStoreObject
All checks were successful
/ test (pull_request) Successful in 6m18s
b5411fa19b
The rootless support PR (#78) added a guard that skips
rollback-state updates when running unprivileged. The
existing "fails hard on rollback-state update after
admission" test relied on running unprivileged and chmod'ing
the cache directory to trigger PermissionDenied — the new
guard makes that path unreachable, so the test fails on
unprivileged hosts (and skips silently on the privileged CI
container).
Replace it with a test that verifies the intended behavior:
when unprivileged, finalizeAdmittedStoreObject succeeds and
does not write a rollback-state file. Error propagation in
the privileged path is the standard switch-and-return pattern
used throughout the codebase.
jhuntwork deleted branch fix/cache-error-messages 2026年06月04日 18:44:18 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
merelinux/mere!79
Reference in a new issue
merelinux/mere
No description provided.
Delete branch "fix/cache-error-messages"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?