Skip to content

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.

  • 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_trust cleared, 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 worktree of 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.
  • Move project A from /x to /y with wb 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 and wb project move and wb project rm offered.
  • 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 or config_trust.
  • On macOS, start sessions in one repository as ~/git/foo and ~/Git/foo and through a symbolic link, and see one project.
  • Start a session in a directory whose .git file reads gitdir: <project A>/.git, and in one whose .git file reads gitdir: <project A>/.git/modules/sub. See both refused with the reason and nothing registered.
  • Start a session in a directory whose .git directory sets core.worktree to 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 common config or its config.worktree, names project A’s working tree, and see it refused with the reason and nothing registered.
  • Start a session in a directory whose .git is 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/alternates names project A’s objects, and in one whose config includes project A’s config, and see both refused with the fix and nothing registered.
  • Start a session in a directory whose .git directory holds a link into project A’s .git, once for each of config, config.worktree, commondir, HEAD, objects, refs, worktrees and packed-refs, once for a nested refs/heads/<name> and objects/<name>, and once for a link to its own working tree. See each refused with project-git-dir-link-outside before git runs, and nothing registered. A link whose target doesn’t exist, or a link loop, is refused with project-git-dir-link-unresolved.
  • Start a session in a directory whose .git directory holds links that stay inside it, and a top-level hooks entry linked to the working tree, and see it resolve to the directory’s own repository.
  • Start a session in a directory whose .git directory has a subdirectory that can’t be read, and see it refused with project-dir-unreadable before git runs. With more entries than the walk’s cap, or a request canceled during the walk, see it refused with project-git-dir-walk-incomplete.
  • Start a session in a linked worktree whose config.worktree is a link out of the common directory, and in a submodule whose objects is a link into its parent repository’s .git. See both refused with project-git-dir-link-outside before wb reads their core.worktree.
  • Start a session with GIT_DIR, GIT_CONFIG_PARAMETERS or GIT_CONFIG_COUNT set 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 trust and wb project place in each directory whose .git file or link points elsewhere, and see them refused the same way.

Status: Draft