Repository navigation
test(decomposedfs): purge project spaces as a delete-all-spaces user - #709
Closed
michaelstingl wants to merge 1 commit into
Closed
michaelstingl wants to merge 1 commit into
michaelstingl wants to merge 1 commit into
Conversation
Three tests in the "can delete (purge) project spaces" context purge a project space as its owner (a space manager) and expect success. A space manager may disable but not purge a project space; only a delete-all-spaces user can. So these tests fail on main with "permission denied". Purge as a delete-all-spaces user, the same actor the sibling "succeeds as delete-all-spaces" test already uses. Also assert that a space manager can disable a project space, the counterpart to the existing "fails as a space manager" purge test. Test-only, no production change.
This was referenced Jun 27, 2026
Member
|
@michaelstingl I guess this was fixed already with #716? Is this still needed? |
3 of 9 tasks
Author
|
Yes. #716 fixes all three purge tests the same way this PR does (purge as #716 did not carry over one thing: a positive counterpart to 🤖 drafted with Claude Code, reviewed before submitting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three tests in
pkg/storage/pkg/decomposedfs/spaces_test.go(the "can delete (purge) project spaces" context) purge a project space as its owner, a space manager, and assert success:removes the space from the by-user-id indexremoves the space from the by-user-id and by-group indexes for granteeskeeps a sibling space in the by-user-id index when another is purgedA space manager may disable a project space but not purge it; only a delete-all-spaces user may purge.
canDeleteSpacenow denies the purge, so the three tests fail onmainwithpermission denied: user is not allowed to delete space ....This change purges as a delete-all-spaces user instead, the same actor the sibling
succeeds as a user with 'delete-all-spaces privilegetest already uses. It also adds the missing counterpart assertion: a space manager can still disable a project space. The change is limited to tests, with no production code change.Related Issue
No issue to close. This change realigns the tests with the permission model from #672. The tests were added in #695, which predated that restriction.
Motivation and Context
The
decomposedfspackage currently fails onmain: these three tests returnpermission denied, which blocks a clean CI run on every reva pull request. This change restores the package to passing and covers both sides of the space-manager permission, disable allowed and purge denied.How Has This Been Tested?
golang:1.25container, source on an ext4 volume foruser.*xattr support (the native macOS filesystem is unreliable for these decomposedfs tests)go test ./pkg/storage/pkg/decomposedfs/: red onmainfor the three tests, green with this change, including the new space-manager-disable assertiongofmt,go vetandgolangci-lint v2.10.1: clean on the packageTypes of changes
Checklist:
Type:*label via ready-release-go, so no fragment is needed)cc @aduffeck, familiar with both #672 and #695.
🤖 drafted with Claude Code, reviewed before submitting.