Skip to content

Conversation

@lukemassa
Copy link
Contributor

@lukemassa lukemassa commented Oct 12, 2025

what

Move workspace-related types from server/events to new subpackage server/events/workspace.

Moved:

  • WorkingDir interface
  • WorkingDirLocker interface
  • FileWorkspace struct
  • GithubAppWorkingDir struct

why

I noticed that there were two different mocks being created for WorkingDir: one in events/mocks/ and another in the events package itself (mock_workingdir_test.go). It is the only mock in the project which is written into a non-mock package, leading to oddities like in #5800 where it is formatted differently (because we have different formatting rules for mock and non-mock).

The duplicate existed because project_command_builder_internal_test.go (an internal test in package events) needed to import the mock, but importing events/mocks would create an import cycle (eventsevents/mocksevents).

This was an indication that the workspace code was getting big enough to be its own package. Moving it to a subpackage breaks the import cycle while keeping the code organized.

tests

  • go build ./...
  • go test ./server/events ./server/controllers/... -short
  • golangci-lint run

references

N/A

Signed-off-by: Luke Massa <[email protected]>
@dosubot dosubot bot added go Pull requests that update Go code refactoring Code refactoring that doesn't add additional functionality labels Oct 12, 2025
@lukemassa lukemassa changed the title Create new builder package chore: Create new workspace package Oct 12, 2025
@lukemassa
Copy link
Contributor Author

seems too heavy handed, I'll solve this another way

@lukemassa lukemassa closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code provider/github refactoring Code refactoring that doesn't add additional functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant