-
Notifications
You must be signed in to change notification settings - Fork 0
feat(workspace): persistent project workspace + pluggable git backend + per-project push queue #2021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat(workspace): persistent project workspace + pluggable git backend + per-project push queue #2021
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
78e7761
feat: persistent per-project workspace + pluggable git backend + push…
e94e607
refactor(workspace): apply pre-PR review triage fixes
Aureliolo fbf19ce
fix(workspace): relax over-eager nested-worktree guards
Aureliolo 045e8c1
fix(workspace): sanitise GIT_* env in git subprocesses
4f59c9f
fix: babysit round 1, 25 findings (21 coderabbit, 3 gemini, 6 CI)
38d3c06
Merge remote-tracking branch 'origin/main' into feat/persistent-proje…
95f2b4f
fix: babysit round 1 fix-forward, hook-caught issues
8340417
Merge remote-tracking branch 'origin/main' into feat/persistent-proje…
eebfa83
fix: share migrated SQLite template across pytest-xdist workers
5d914a7
fix: babysit round 2, 2 coderabbit findings + defensive filelock timeout
c242361
fix: raise unit-test wall-clock cap 8.0 -> 12.0 to absorb migration c…
d01e8a2
fix: babysit round 3, 2 coderabbit + 2 pip-audit ignores
cd6d917
Merge remote-tracking branch 'origin/main' into feat/persistent-proje…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| """Persistent per-project workspace domain model. | ||
|
|
||
| A :class:`ProjectWorkspace` is the 1:1 mapping between a | ||
| :class:`~synthorg.core.project.Project` and the persistent, git-backed | ||
| working tree that survives across agents, tasks and sessions. The row | ||
| records where the workspace lives on the persistent volume and which git | ||
| backend provisioned it, so a session restart re-locates the same | ||
| directory without re-deriving environment precedence and a configured | ||
| backend switch can be detected against the persisted kind. | ||
| """ | ||
|
|
||
| from typing import Final | ||
|
|
||
| from pydantic import AwareDatetime, BaseModel, ConfigDict, Field | ||
|
|
||
| from synthorg.core.enums import GitBackendType # noqa: TC001 | ||
| from synthorg.core.types import NotBlankStr | ||
|
|
||
| _DEFAULT_BRANCH: Final[str] = "main" | ||
|
|
||
|
|
||
| class ProjectWorkspace(BaseModel): | ||
| """Persistent git-backed workspace bound to a single project. | ||
|
|
||
| Attributes: | ||
| project_id: Owning project identifier (primary key, 1:1 with | ||
| ``Project.id``). | ||
| workspace_path: Absolute on-volume path of the project working | ||
| tree (``<base>/projects/<project_id>``). Persisted so a | ||
| restart re-locates the same directory deterministically. | ||
| git_backend_kind: Which backend provisioned the repository; lets | ||
| a config switch detect a mismatch against the live config. | ||
| remote_ref: External remote URL or connection-catalog name for | ||
| the ``EXTERNAL_REMOTE`` backend; ``None`` for embedded/local. | ||
| default_branch: Default branch the backend provisions and the | ||
| merge/push queue targets. | ||
| created_at: Provisioning timestamp (timezone-aware, UTC). | ||
| updated_at: Last mutation timestamp (timezone-aware, UTC). | ||
| """ | ||
|
|
||
| model_config = ConfigDict(frozen=True, allow_inf_nan=False, extra="forbid") | ||
|
|
||
| project_id: NotBlankStr = Field(description="Owning project identifier (PK)") | ||
| workspace_path: NotBlankStr = Field( | ||
| description="Absolute on-volume path of the project working tree", | ||
| ) | ||
| git_backend_kind: GitBackendType = Field( | ||
| description="Backend that provisioned this workspace", | ||
| ) | ||
| remote_ref: NotBlankStr | None = Field( | ||
| default=None, | ||
| description="External remote URL / connection name (external backend)", | ||
| ) | ||
| default_branch: NotBlankStr = Field( | ||
| default=NotBlankStr(_DEFAULT_BRANCH), | ||
| description="Default branch the backend provisions", | ||
| ) | ||
| created_at: AwareDatetime = Field(description="Provisioning timestamp (UTC)") | ||
| updated_at: AwareDatetime = Field(description="Last mutation timestamp (UTC)") |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.