Работает создание коммитов и перенос в новый enviroment
This commit is contained in:
@@ -1,83 +1,88 @@
|
||||
# Tasks: Git Integration Plugin for Dashboard Development
|
||||
# Tasks: Git Integration Plugin
|
||||
|
||||
Feature: 011-git-integration-dashboard
|
||||
**Feature**: Git Integration for Dashboard Development
|
||||
**Status**: Completed
|
||||
**Total Tasks**: 35
|
||||
|
||||
## Phase 1: Setup
|
||||
Goal: Initialize project structure and dependencies.
|
||||
**Goal**: Initialize project structure and dependencies.
|
||||
|
||||
- [ ] T001 Add `GitPython` to `backend/requirements.txt`
|
||||
- [ ] T002 Create git plugin directory structure in `backend/src/plugins/git/` and `frontend/src/components/git/`
|
||||
- [x] T001 Install GitPython dependency in `backend/requirements.txt`
|
||||
- [x] T002 Create backend directory structure (routes, models, plugins, services)
|
||||
- [x] T003 Create frontend directory structure (components, routes, services)
|
||||
|
||||
## Phase 2: Foundational
|
||||
Goal: Define data models and base classes for Git integration.
|
||||
**Goal**: Implement core data models and service skeletons.
|
||||
**Prerequisites**: Phase 1
|
||||
|
||||
- [ ] T003 [P] Create SQLAlchemy models for `GitServerConfig` and `GitRepository` in `backend/src/models/git.py`
|
||||
- [ ] T004 [P] Create Pydantic schemas for Git entities in `backend/src/api/routes/git_schemas.py`
|
||||
- [ ] T005 Implement `GitService` base logic (init, clone) in `backend/src/services/git_service.py`
|
||||
- [ ] T006 Implement `GitPlugin(PluginBase)` skeleton in `backend/src/plugins/git_plugin.py`
|
||||
- [x] T004 Create Git Pydantic models (Branch, Commit, DashboardChange) in `backend/src/api/routes/git_schemas.py`
|
||||
- [x] T005 Create GitServerConfig and Environment SQLAlchemy models in `backend/src/models/git.py`
|
||||
- [x] T006 Implement GitService class skeleton with GitPython init in `backend/src/services/git_service.py`
|
||||
- [x] T007 Implement GitPlugin class skeleton inheriting PluginBase in `backend/src/plugins/git_plugin.py`
|
||||
|
||||
## Phase 3: User Story 1 - Configure Git Server Connection (P1)
|
||||
Goal: Enable connection to Git servers (GitHub, GitLab, Gitea) via PAT.
|
||||
Independent Test: Configure a Git server connection and verify "Test Connection" succeeds.
|
||||
## Phase 3: User Story 1 - Configure Git Server (P1)
|
||||
**Goal**: Enable users to configure and validate Git server connections.
|
||||
**Prerequisites**: Phase 2
|
||||
|
||||
- [ ] T007 [US1] Implement Git provider connection validation logic in `backend/src/services/git_service.py`
|
||||
- [ ] T008 [US1] Implement `/api/git/config` and `/api/git/config/test` endpoints in `backend/src/api/routes/git.py`
|
||||
- [ ] T009 [P] [US1] Create Git configuration service in `frontend/src/services/gitService.js`
|
||||
- [ ] T010 [US1] Implement Git server settings page in `frontend/src/routes/settings/git/+page.svelte`
|
||||
- [x] T008 [US1] Implement `GitService.test_connection` method in `backend/src/services/git_service.py`
|
||||
- [x] T009 [US1] Implement GET/POST `/api/git/config` endpoints in `backend/src/api/routes/git.py`
|
||||
- [x] T010 [US1] Create `frontend/src/services/gitService.js` API client
|
||||
- [x] T011 [US1] Create `frontend/src/components/tools/ConnectionForm.svelte` (or similar) for Git config
|
||||
- [x] T012 [US1] Implement Settings page at `frontend/src/routes/settings/git/+page.svelte`
|
||||
|
||||
## Phase 4: User Story 2 - Dashboard Branch Management (P1)
|
||||
Goal: Manage branches for dashboard repositories.
|
||||
Independent Test: Create a new branch, switch to it, and verify the local repository state updates.
|
||||
## Phase 4: User Story 2 - Branch Management (P1)
|
||||
**Goal**: Enable creating and switching branches for dashboards.
|
||||
**Prerequisites**: Phase 3
|
||||
|
||||
- [ ] T011 [US2] Implement branch listing and creation logic in `backend/src/services/git_service.py`
|
||||
- [ ] T012 [US2] Implement branch checkout logic in `backend/src/services/git_service.py`
|
||||
- [ ] T013 [US2] Implement branch management endpoints in `backend/src/api/routes/git.py`
|
||||
- [ ] T014 [P] [US2] Create `BranchSelector` component in `frontend/src/components/git/BranchSelector.svelte`
|
||||
- [ ] T015 [US2] Integrate branch management into Dashboard view in `frontend/src/pages/Dashboard.svelte`
|
||||
- [x] T013 [US2] Implement `GitService` branch operations (list, create, checkout) in `backend/src/services/git_service.py`
|
||||
- [x] T014 [US2] Implement `GitService.init_repo` (clone/init strategy) in `backend/src/services/git_service.py`
|
||||
- [x] T015 [US2] Implement GET/POST `/api/git/branches` endpoints in `backend/src/api/routes/git.py`
|
||||
- [x] T016 [US2] Implement POST `/api/git/checkout` endpoint in `backend/src/api/routes/git.py`
|
||||
- [x] T017 [US2] Create `frontend/src/components/git/BranchSelector.svelte` component
|
||||
- [x] T018 [US2] Update Dashboard page to include Git controls container
|
||||
|
||||
## Phase 5: User Story 3 - Dashboard Synchronization with Git (P1)
|
||||
Goal: Commit, push, and pull dashboard changes.
|
||||
Independent Test: Modify a dashboard, commit changes, push to remote, and verify changes on the Git server.
|
||||
## Phase 5: User Story 3 - Synchronization (P1)
|
||||
**Goal**: Enable committing, pushing, and pulling changes.
|
||||
**Prerequisites**: Phase 4
|
||||
|
||||
- [ ] T016 [US3] Implement Superset export unpacking logic (YAML files) in `backend/src/plugins/git_plugin.py`
|
||||
- [ ] T017 [US3] Implement commit, push, and pull logic in `backend/src/services/git_service.py`
|
||||
- [ ] T018 [US3] Implement sync endpoints (commit, push, pull) in `backend/src/api/routes/git.py`
|
||||
- [ ] T019 [P] [US3] Create `CommitModal` component in `frontend/src/components/git/CommitModal.svelte`
|
||||
- [ ] T020 [US3] Implement sync controls (Commit/Push/Pull) in `frontend/src/pages/Dashboard.svelte`
|
||||
- [ ] T021 [US3] Implement conflict detection and resolution logic in `backend/src/services/git_service.py`
|
||||
- [ ] T022 [US3] Implement conflict resolution endpoints in `backend/src/api/routes/git.py`
|
||||
- [ ] T023 [P] [US3] Create `ConflictResolver` component in `frontend/src/components/git/ConflictResolver.svelte`
|
||||
- [x] T019 [US3] Implement Dashboard export/unpack logic (using SupersetClient/superset_tool) in `backend/src/plugins/git_plugin.py`
|
||||
- [x] T020 [US3] Implement `GitService` status and diff generation methods in `backend/src/services/git_service.py`
|
||||
- [x] T021 [US3] Implement `GitService` commit, push, and pull methods in `backend/src/services/git_service.py`
|
||||
- [x] T022 [US3] Implement `/api/git/sync`, `/commit`, `/push`, `/pull` endpoints in `backend/src/api/routes/git.py`
|
||||
- [x] T023 [US3] Create `frontend/src/components/git/CommitModal.svelte` with diff viewer
|
||||
- [x] T024 [US3] Create `frontend/src/components/git/ConflictResolver.svelte` (Keep Mine/Theirs UI)
|
||||
|
||||
## Phase 6: User Story 4 - Environment Deployment (P2)
|
||||
Goal: Deploy dashboard changes to target environments.
|
||||
Independent Test: Select a target environment and trigger deployment, verifying the dashboard is updated on the target Superset instance.
|
||||
## Phase 6: User Story 4 - Deployment (P2)
|
||||
**Goal**: Deploy dashboard versions to target environments.
|
||||
**Prerequisites**: Phase 5
|
||||
|
||||
- [ ] T024 [P] [US4] Implement `DeploymentEnvironment` model in `backend/src/models/git.py`
|
||||
- [ ] T025 [US4] Implement deployment logic (Superset Import API) in `backend/src/plugins/git_plugin.py`
|
||||
- [ ] T026 [US4] Implement deployment endpoints in `backend/src/api/routes/git.py`
|
||||
- [ ] T027 [US4] Create environment management UI in `frontend/src/routes/settings/environments/+page.svelte`
|
||||
- [ ] T028 [US4] Implement deployment trigger in `frontend/src/pages/Dashboard.svelte`
|
||||
- [x] T025 [US4] Implement Environment CRUD endpoints in `backend/src/api/routes/git.py`
|
||||
- [x] T026 [US4] Implement deployment logic (zip packing + Import API) in `backend/src/plugins/git_plugin.py`
|
||||
- [x] T027 [US4] Implement POST `/api/git/deploy` endpoint in `backend/src/api/routes/git.py`
|
||||
- [x] T028 [US4] Create Deployment modal/interface in `frontend/src/components/git/DeploymentModal.svelte`
|
||||
|
||||
## Phase 7: User Story 5 - Git History and Change Tracking (P3)
|
||||
Goal: View dashboard commit history and changes.
|
||||
Independent Test: Open the history view and verify the list of commits matches the Git repository history.
|
||||
## Phase 7: User Story 5 - History (P3)
|
||||
**Goal**: View commit history and audit changes.
|
||||
**Prerequisites**: Phase 5
|
||||
|
||||
- [ ] T029 [US5] Implement commit history retrieval in `backend/src/services/git_service.py`
|
||||
- [ ] T030 [US5] Implement history endpoint in `backend/src/api/routes/git.py`
|
||||
- [ ] T031 [P] [US5] Create `CommitHistory` component in `frontend/src/components/git/CommitHistory.svelte`
|
||||
- [x] T029 [US5] Implement `GitService.get_history` method in `backend/src/services/git_service.py`
|
||||
- [x] T030 [US5] Implement GET `/api/git/history` endpoint in `backend/src/api/routes/git.py`
|
||||
- [x] T031 [US5] Create `frontend/src/components/git/CommitHistory.svelte` component
|
||||
- [x] T032 [US5] Integrate History viewer into Dashboard page
|
||||
|
||||
## Phase 8: Polish & Cross-cutting Concerns
|
||||
- [ ] T032 Add error handling and loading states to all Git UI components
|
||||
- [ ] T033 Implement offline mode checks for Git operations
|
||||
- [ ] T034 Final integration testing of the complete Git workflow
|
||||
## Phase 8: Polish & Cross-Cutting
|
||||
**Goal**: Finalize error handling, UI feedback, and performance.
|
||||
|
||||
- [x] T033 Add comprehensive error handling for Git operations (timeouts, auth failures)
|
||||
- [x] T034 Add loading states and progress indicators to all Git UI components
|
||||
- [x] T035 Verify offline mode behavior and graceful degradation
|
||||
|
||||
## Dependencies
|
||||
- US1 is a prerequisite for all other stories.
|
||||
- US2 and US3 are closely related; US2 (branches) should precede US3 (sync).
|
||||
- US4 depends on US3 (changes must be committed to be deployed).
|
||||
- US5 is independent but requires commits to exist.
|
||||
|
||||
- US1 -> US2 -> US3 -> US4
|
||||
- US3 -> US5
|
||||
- US1 is the critical path.
|
||||
|
||||
## Implementation Strategy
|
||||
1. **MVP**: Complete Phase 1-3 (Setup, Foundational, and US1) to allow Git server configuration.
|
||||
2. **Core Workflow**: Complete Phase 4-5 (Branches and Sync) to enable version control.
|
||||
3. **Extension**: Complete Phase 6-7 (Deployment and History).
|
||||
- MVP: Complete US1, US2, and US3 (Configure, Branch, Sync). This allows local-only versioning if remote is optional, or full sync if remote is configured.
|
||||
- Incremental: Add Deployment (US4) and History (US5) after core sync workflow is stable.
|
||||
Reference in New Issue
Block a user