Skip to content

feat: add bitbucket support #37

Description

@ClaudiaFang

目標

git-files-sync 中新增 Bitbucket 作為可選的 Git provider,比照現有 GitHub / GitLab / Gitea 的整合方式。

背景

目前架構已透過 GitServiceInterface 抽象出 provider 操作(getFilepushFilelistFiles(Detailed)deleteFiletestConnectiongetRepoGitignores),並由 BaseGitService 提供共用邏輯。Gitea 因 API 風格與 GitHub 高度相容,僅需新增 gitea-service.ts(約 120 行)即可整合。

Bitbucket 的 REST API 風格差異較大:

  • 檔案異動多為 PR-based,非直接 commit + blob SHA 的樂觀鎖模式
  • 無原生 blob SHA 概念,需要評估如何對應 GitFile.sha
  • 認證機制與分支/樹狀查詢 API 需另外確認

待辦

  • 確認 Bitbucket Cloud/Server REST API 對應方式(file contents, tree listing, commit)
  • 評估是否需調整 GitServiceInterface(例如 sha 欄位語意)
  • 新增 bitbucket-service.ts,繼承 BaseGitService 並實作 GitServiceInterface
  • settings.ts 新增 provider 選項與設定欄位
  • main.ts 註冊 provider 初始化邏輯
  • 測試 push/pull/delete/symlink fallback 行為

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions