Commit graph

14 commits

Author SHA1 Message Date
ClaudiaFang
684551b8f8
fix: resolve SonarCloud Quality Gate failures and improve marketplace readiness (#10)
This commit consolidates several improvements to satisfy SonarCloud Quality Gate and enhance the overall plugin stability:

- Code Quality & Refactoring:
  - Reduced duplication to 0% by refactoring SyncManager and SyncStatusView.
  - Implemented centralized 'processBatch' logic for multi-file sync operations.
  - Fixed security hotspots by replacing legacy atob/btoa with Buffer.
  - Added memory safety limits to the diff algorithm to prevent DoS.

- Test Coverage & Reliability:
  - Improved SyncManager coverage to 81.8% and GitignoreManager to 92.8%.
  - Added comprehensive unit tests for batch operations and complex .gitignore patterns.
  - Resolved all ESLint 'unsafe-member-access' and 'unbound-method' warnings in tests.

- Infrastructure & Metadata:
  - Consolidated GitHub Actions into a single optimized 'ci.yml' using latest versions (v6-v8).
  - Synchronized manifest.json and versions.json to v1.1.0.
  - Fixed workflow permission issues identified by CodeQL.
2026-04-25 23:35:32 +08:00
ClaudiaFang
a6104d991c fix: ensure type-safe mocks in sync-manager.test.ts and resolve lint errors 2026-04-25 03:34:57 +00:00
ClaudiaFang
bad9dad097 chore: fix status check names and finalize sonar configuration 2026-04-25 03:33:40 +00:00
ClaudiaFang
662cb83cf9 test: fix tsc compilation error (TS2532) in tests 2026-04-25 03:29:46 +00:00
ClaudiaFang
60e3790c73 test: fix lint errors in tests by using type-safe mocks and assertions 2026-04-25 03:27:10 +00:00
ClaudiaFang
f354749d4c test: add github service tests and fix existing gitlab/sync-manager tests 2026-04-25 03:24:22 +00:00
ClaudiaFang
ecd2aabfca fix: resolve obsidian community guidelines and lint errors 2026-04-25 03:13:04 +00:00
ClaudiaFang
d5539434dc
feat(core,ui,ci,docs): add GitHub support, sync status view, batch operations, and CI/CD workflows (#1)
Major feature release including:
- GitHub service support alongside GitLab
- Sync status view with visual diff
- Batch push/pull operations
- Conflict resolution modal
- Vault folder filtering
- File rename detection
- Complete CI/CD workflows (check, auto-release, semantic-release)
- Comprehensive documentation (CHANGELOG, COMPLIANCE, RELEASE guides)

Co-authored-by: tianyao <tianyao@heavendev01.royal-powan.ts.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:03:05 +08:00
Tianyao
c2a6bb5fba perf(sync): optimize GitLab push by avoiding redundant getFile calls 2026-04-02 19:55:41 +08:00
Tianyao
6161bd75cd fix(build): resolve dependencies, fix Vitest 4 mocking, and handle file existence 2026-04-02 19:50:43 +08:00
tianyao
cccf096103 feat: implement rootPath setting and Test connection button
- Added rootPath to GitLabFilesPushSettings and DEFAULT_SETTINGS
- Implemented testConnection in GitLabService to verify credentials
- Added rootPath support to GitLabService API URL generation
- Added UI fields for rootPath and Test connection button in settings tab
- Updated tests to include rootPath in mock settings and services

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-01 17:13:12 +00:00
tianyao
b472594d31 task(gitlab-service): enhance getFile robustness and handle 404
- Update getFile to return empty content and sha on 404
- Use presence of sha to determine if push should be POST or PUT
- Fix test setup for Obsidian TFile mock
- Handle ESLint and TypeScript issues in tests and sync manager

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:45:55 +00:00
tianyao
362def7cd3 feat: integrate SyncConflictModal into SyncManager
- Implement conflict detection in pushFile and pullFile using SHA comparison.
- Use SyncConflictModal to prompt users for manual resolution ('Use local' or 'Use remote').
- Added unit tests in sync-manager.test.ts to verify conflict handling logic.
- Fixed linting issues related to unhandled promises and mock type safety.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:43:10 +00:00
tianyao
bb80936834 Implement conflict detection in SyncManager using syncMetadata
- Add SHA comparison in pushFile to detect remote changes before pushing
- Update syncMetadata (lastSyncedSha) after successful push and pull
- Add comprehensive test cases for conflict scenarios and metadata updates
- Use syncMetadata to track state and prevent overwriting remote work

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:40:29 +00:00