Files
headquarter/openspec/changes/config-profile-git-mounts/tasks.md
T
2026-05-26 22:50:06 +02:00

3.4 KiB

1. Database and Models

  • 1.1 Create Alembic migration to add git_mounts column to config_profiles table (JSONB, nullable, default empty list)
  • 1.2 Update ConfigProfile SQLAlchemy model to include git_mounts field
  • 1.3 Create Pydantic models for GitMount and GitMountCreate schemas with validation
  • 1.4 Add validation for git mount fields (source_path relative or glob, target_path absolute, no path traversal)

2. Backend API

  • 2.1 Update POST /config-profiles endpoint to accept git_mounts in request body
  • 2.2 Update PUT /config-profiles/{id} endpoint to accept git_mounts updates
  • 2.3 Update config profile response schemas to include git_mounts in output
  • 2.4 Add validation that referenced repositories exist in the same project
  • 2.5 Update GET /config-profiles/{id}/preview to include resolved git mounts

3. Profile Resolution

  • 3.1 Update config_profile_resolver.py to include git mounts in resolved profile output
  • 3.2 Ensure git mounts from included profiles are merged (with override rules)
  • 3.3 Add tests for profile resolution with git mounts

4. Instance Startup Integration

  • 4.1 Modify instance startup pipeline to process git mounts from resolved profile
  • 4.2 Add helper function to clone repository if not present (reusing existing clone service)
  • 4.3 Add glob pattern expansion for source_path (using standard glob library)
  • 4.4 Add helper function to checkout specified branch after clone
  • 4.5 Generate bind mount entries in compose file for each valid git mount
  • 4.6 Add error logging for missing repos (non-blocking, mount skipped)
  • 4.7 Ensure git mounts are processed in parallel with other startup steps

5. Frontend Types and API

  • 5.1 Update TypeScript types in apps/web/src/api/config_profiles.ts to include GitMount interface
  • 5.2 Update API client functions to include git_mounts in create/update payloads
  • 5.3 Add validation helpers for git mount form fields

6. Frontend UI

  • 6.1 Add "Git Mounts" section to config profile editor (below existing mounts)
  • 6.2 Create GitMountEditor component with repo selector, source/target path inputs (with glob hint), branch selector
  • 6.3 Add "Add Git Mount" button that opens the editor
  • 6.4 Display existing git mounts with edit/delete actions
  • 6.5 Integrate git mounts into profile save flow (include in form submission)
  • 6.6 Add validation feedback in UI (repo exists, paths valid, branch exists)

7. Testing and Verification

  • 7.1 Backend unit tests for git mount validation
  • 7.2 Backend integration tests for profile CRUD with git mounts
  • 7.3 Test instance startup with git mounts (verify bind mounts created)
  • 7.4 Test auto-clone behavior (clone triggered, mount created)
  • 7.5 Test clone failure handling (error logged, mount skipped, startup continues)
  • 7.6 Test glob pattern expansion (files matched, limit enforced)
  • 7.7 Test branch checkout behavior (success and fallback)
  • 7.8 Frontend type check passes
  • 7.9 Frontend production build succeeds
  • 7.10 Manual end-to-end test: create profile with git mount, start instance, verify files mounted

8. Documentation

  • 8.1 Update API documentation with new git_mounts fields
  • 8.2 Add user guide section for using git repositories in config profiles
  • 8.3 Document branch pinning behavior and fallback rules