Repository navigation
e2e: create the harness's test users as Roles only, so the rbac and group tests pass again - #786
Merged
Merged
Conversation
`TestServer::create_user` invited its accounts with `POST /admin/users` and no `role`, which since the built-in reader role (#733) makes them readers: an unscoped read of every repository, which lifts any selector-scoped or missing grant the tests give them. Seven rbac tests and a group test expected such a user to be refused and failed on main once credforward no longer stopped the e2e run before them. The harness's users are now Roles only, holding the roles a test assigns and nothing else. Fixes #785 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012e6DJb6V3DHD5wQrsYhKda
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.
Fixes #785
What
With #780 merged, the
e2ejob onmaingets pastcredforwardand fails ingroup.cargo teststops after the first failing test binary, so these tests had not run onmainsince #734. A local run of every e2e test file on 8ced3fe found eight failures:group:prefer_hosted_shields_internal_id_from_selector_scoped_tokens.rbac, seven tests:matrix_read_write_any_and_fail_closedcontent_selector_filters_reads_and_package_mutationsfresh_install_defaults_closed_over_httpsigned_in_user_gets_no_public_reach_when_anonymous_access_is_offsigned_in_user_reads_anonymous_readable_reposnested_group_visibility_honors_privilegescross_instance_cache_invalidation_on_grant_changeAll eight have the cause of #748.
TestServer::create_userinvited its accounts withPOST /admin/usersand norole, which since #734 (#733) makes them readers: the built-inreaderrole, an unscoped read of every repository. The tests use these accounts as roleless. A reader's unscoped read lifts every selector-scoped or missing grant, because grants combine as a union (EffectiveSet::package_filter_for). The product behaves as #733 intends; the tests predate it.create_usernow invites Roles-only accounts ("role": "roles_only"), which hold the roles a test assigns and nothing else. A test-only change, so there is no changelog fragment.Why it blocks 2.2.0
release.ymlneeds a CI run of the tagged commit that passed every job inREQUIRED_JOBS,e2eincluded.Tests
Locally, with this change, every e2e file that calls
create_userpasses:rbacgroupauthclient_loginscredforwardtoken_exchangeThe other 15 e2e files passed on 8ced3fe already and don't call
create_user.cargo clippy -p forge-e2e --features forge-e2e --all-targets -- -D warningsandcargo fmt --checkare clean.Generated by Claude Code