C04 - Projects
Purpose: The test cases for project identity: which repository a session belongs to, what happens when a repository moves, is cloned again or changes its remote, and the project commands.
Verifies: S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed., S07-01-per-vm-policyS07-01-per-vm-policy: Enforced per VMWhy the VM is the unit the gateway enforces, how the policies of its projects combine, and what happens when they conflict or change.
Conformance
Section titled “Conformance”Remotes and root commits
Section titled “Remotes and root commits”- Change a remote URL of a registered project’s repository, start a
session, and see it refused with both URLs named. Then run
wb project confirm, and see the next start pass,config_trustcleared, and a 5019 event with both URL sets. - Switch the remote between its SSH and HTTPS forms, and see the start pass.
- Start a session in a second
git worktreeof the repository, and see it use the same project (S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed.). - In a repository without a remote, replace it at the same path with another repository without a remote, and see the start refused with both root commit sets named.
- Register a repository with no remote and no commit, commit, start a session, and see the root commit recorded with a 5019 event. Then replace the repository, and see the start refused.
Moves and second clones
Section titled “Moves and second clones”- Move project A from
/xto/ywithwb project move, clone another repository into/x, start a session there, and see a new project with a new id, none of A’s settings, policy or approvals, and A still at/y. - Move a project’s directory without
wb project move, start a session at the new path, and see it refused with the old project named andwb project moveandwb project rmoffered. - Clone the same repository a second time while the first clone stays, and see the second registered as its own project, with a notice that names the first.
- Do the same for a project with
placement = isolated, and see the second clone start isolated, with none of the first’s approvals orconfig_trust. - On macOS, start sessions in one repository as
~/git/fooand~/Git/fooand through a symbolic link, and see one project.
Git directories that point elsewhere
Section titled “Git directories that point elsewhere”- Start a session in a directory whose
.gitfile readsgitdir: <project A>/.git, and in one whose.gitfile readsgitdir: <project A>/.git/modules/sub. See both refused with the reason and nothing registered. - Start a session in a directory whose
.gitdirectory setscore.worktreeto project A’s working tree, and see it refused with the reason and nothing registered. - Start a session in a linked worktree whose
core.worktree, in the commonconfigor itsconfig.worktree, names project A’s working tree, and see it refused with the reason and nothing registered. - Start a session in a directory whose
.gitis a symbolic link to project A’s.git, and see it refused with the reason and nothing registered. - Start a session in a repository whose
objects/info/alternatesnames project A’s objects, and in one whoseconfigincludes project A’sconfig, and see both refused with the fix and nothing registered. - Start a session in a directory whose
.gitdirectory holds a link into project A’s.git, once for each ofconfig,config.worktree,commondir,HEAD,objects,refs,worktreesandpacked-refs, once for a nestedrefs/heads/<name>andobjects/<name>, and once for a link to its own working tree. See each refused withproject-git-dir-link-outsidebefore git runs, and nothing registered. A link whose target doesn’t exist, or a link loop, is refused withproject-git-dir-link-unresolved. - Start a session in a directory whose
.gitdirectory holds links that stay inside it, and a top-levelhooksentry linked to the working tree, and see it resolve to the directory’s own repository. - Start a session in a directory whose
.gitdirectory has a subdirectory that can’t be read, and see it refused withproject-dir-unreadablebefore git runs. With more entries than the walk’s cap, or a request canceled during the walk, see it refused withproject-git-dir-walk-incomplete. - Start a session in a linked worktree whose
config.worktreeis a link out of the common directory, and in a submodule whoseobjectsis a link into its parent repository’s.git. See both refused withproject-git-dir-link-outsidebeforewbreads theircore.worktree. - Start a session with
GIT_DIR,GIT_CONFIG_PARAMETERSorGIT_CONFIG_COUNTset in the environment to point at project A or rewrite its configuration, and see it resolve to the directory’s own repository, not A. - Run
wb trustandwb project placein each directory whose.gitfile or link points elsewhere, and see them refused the same way.
Project commands
Section titled “Project commands”- Run
wb project rmwith the VM stopped, restartwb-hostd, start the VM, and see the guest user removal sent. - Send a removal reply from the guest for another project, and see that project’s record kept.
- Run
wb project place isolatedfor a project that has a home on a data disk, and see it refused with I232I232 (open): S06-vm-lifecycle: move a project's home between VM data disks on wb project placeS06-vm-lifecycle, "Changing placement", refuses wb project place for a project that has a home on a VM's data disk, because moving the home to the other VM's data disk "needs the data-disk design of I44". named. Run it while the project has a session, and see it refused with the session named. - Run
wb project place isolatedin a new clone before its first session, and see the first session start in the isolated VM. - Run
wb trust,wb untrust, and each changingwb projectcommand, and see a 5019 event with the values before and after.
Status: Draft