Add workspace-admin git backup service for private/common workspace trees#58
Draft
Add workspace-admin git backup service for private/common workspace trees#58
private/common workspace trees#58Conversation
Co-authored-by: prasadtalasila <9206466+prasadtalasila@users.noreply.github.com>
Co-authored-by: prasadtalasila <9206466+prasadtalasila@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add feature for git backup of workspace files
Add workspace-admin git backup service for Feb 16, 2026
private/common workspace trees
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.
This PR adds git-backed workspace persistence to
workspace-admin: users can configureprivateandcommonrepositories, have them materialized under$WORKSPACE_DIR, and keep them synchronized from inside/outside the container. It also splits the admin code so API, CLI, and git backup concerns are isolated.Service decomposition (maintainability)
admin/main.py(CLI + process wiring)admin/api.py(FastAPI routes)admin/services.py(service template loading)admin/git_backup.py(repo config/clone/sync logic)Git backup feature in
workspace-adminassets.privateandassets.common.GIT_REPO_USERNAME+GIT_REPO_TOKEN.GIT_DIRlocations (private/common).-X ours) → add/commit → push.logs/workspace-admin.logunder workspace app directory.CLI surface
--config(default$HOME/.workspace/config.env)--git-sync-interval(default300)--disable-git-backupConfiguration/docs updates
config.env.exampleandconfig.envtemplates for private/common repo mapping.Tests updated with modular structure
test_main.pywith:test_api.pytest_cli.pytest_git_backup.pyOriginal prompt
This section details on the original issue you should resolve
<issue_title>[FEATURE] git backup of workspace files</issue_title>
<issue_description>### Describe the feature
As a user, I want to backup my workspace to git repos via workspace admin
so that I can access them both inside and outside the workspace
Describe the problems your feature request solves
The
~/workspaceis currently mounted as a directory from host to the container. This means that the user can only access the workspace from inside the container. If the user wants to access the workspace from outside the container, they need to set up additional mechanisms, which can be cumbersome and slow. By allowing the user to backup their workspace to git repositories, they can access their workspace from anywhere and also have version control for their work. This also allows the user to easily share their workspace with others by giving them access to the git repository. Additionally, it provides a backup solution for the user's work in case of any issues with the container or host machine.Describe the solution you'd like
The users should have access to the git repositories via the
$WORKSPACE_DIR/privateand$WORKSPACE_DIR/commondirectories, which are linked to the working tree directories specified in the config file. This allows the users to easily access their workspace from both inside and outside the container without needing to set up additional mechanisms. The workspace-admin application will handle the cloning of the git repositories and serving them to the users, making it a seamless experience for the users to access their workspace from anywhere.The user places git config in
$WORKSPACE_APP_DIR/config.env. The$WORKSPACE_APP_DIR/config.env.examplefile provides a template. The format of config file isThe workspace-admin clones the git repository specified in the config file and serves it to the user. The working tree directory of the git repositories is stored in the
$WORKSPACE_APP_DIR/assetsdirectory as specified in the config file. The users can then access the git directories from the$WORKSPACE_DIR/privateand$WORKSPACE_DIR/commondirectories.A short description of git directory and working tree definitions is as follows:
The
workspace-adminwill also handle the authentication to the git repositories using the provided credentials in the config file. The users can then use git commands to interact with the repositories, such as committing changes, pushing to remote, etc. In addition, theworkspace-adminmustworkspace-adminlogs ($WORKSPACE_APP_DIR/logs/workspace-admin.log).Additional context
This feature needs to be implemented in
workspace/src/adminand the configuration file is located inworkspace/src/admin/config.env. Theworkspace-adminw...💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.