feat: Add native integration for OneDev DevOps Platform

Aperta
#376 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

The payload names no source files or tests, so start by finding the existing Gitea/Forgejo provider code in the repo and the integration settings screen. The issue's example webhook JSON and the POST /api/repositories/{repositoryId}/commits/{commitHash}/statuses endpoint are the concrete contracts to check against. Done would mean a maintainer-agreed design for auth (PAT vs OAuth), state mapping and webhook registration. This is design work, so confirm scope with maintainers before coding.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Feature Request: Add native integration for OneDev DevOps Platform
Is your feature request related to a problem? Please describe.

Currently, users hosting their source code and CI/CD pipelines on OneDev cannot seamlessly connect their repositories to Windshift. While Gitea and Forgejo enjoy native, out-of-the-box support, OneDev users are forced to rely on complex custom webhooks and REST API workarounds to sync workspaces and trigger automations.

Describe the solution you'd like

We need a native provider integration for OneDev within the Windshift ecosystem. This should include:

  • OAuth2 / Personal Access Token Authentication: Easy account linking via OneDev Personal Access Tokens (PAT) or OAuth applications.
  • Repository Syncing: The ability to import and track projects directly from a self-hosted OneDev instance.
  • Webhook Automation: Automatic registration of webhooks in OneDev to listen for code pushes, pull requests, and issue updates.
  • Windshift CLI (ws) Support: Commands to list, link, and trigger OneDev-backed workspaces natively.
Describe alternatives you've considered
  • Managing custom automation via ws CLI scripts embedded in OneDev CI/CD pipeline steps.
  • Manually configuring generic inbound webhooks in Windshift, which lacks bidirectional sync and deep repo visibility.

Implementation Details & Requirements
1. Authentication & Connection Layer
  • Add a OneDevProvider configuration block to the integration settings.
  • Required inputs: Instance URL, Token / OAuth Credentials, and Organization/User Namespace.
2. Specific Data & Field Mapping

To ensure smooth translation between Windshift objects and OneDev's flexible domain model, the following core schemas must be mapped:

A. State & Status Mapping

Windshift task states must map cleanly to OneDev issue states. Because OneDev allows custom workflows, the integration must default to standard transitions while allowing user overrides:

  • Windshift Backlog / Todo ➡️ OneDev Open state.
  • Windshift In Progress ➡️ OneDev In Progress state.
  • Windshift Done ➡️ OneDev Closed state.
B. User & Identity Resolution
  • Map Windshift.User.Email or Windshift.User.Username to OneDev.User.Name to correctly handle automated workload assignments and track commit attributions inside workspaces.
3. API Payload & Event Structures

Utilize OneDev's structural REST API to handle lifecycle events. The payload processing engine should support the following specifications:

A. Inbound Webhook Handling (OneDev to Windshift)

The integration endpoint must listen for OneDev event payloads (typically structured around OneDev.Issue or OneDev.PullRequest objects) to trigger workspace syncs:

{
  "event": "issue_opened",
  "issue": {
    "id": 1024,
    "number": 42,
    "title": "Implement feature X",
    "description": "Detailed requirement text...",
    "state": "Open",
    "submitter": {
      "name": "developer_username"
    }
  },
  "repository": {
    "id": 56,
    "name": "project-repo"
  }
}
B. Outbound Status Delivery (Windshift to OneDev)

To reflect Windshift workspace builds and check statuses directly inside the OneDev UI, the provider must send standard status updates to the OneDev commit tracking endpoint:

  • Endpoint: POST /api/repositories/{repositoryId}/commits/{commitHash}/statuses
  • Payload Structure:
{
  "context": "Windshift Workspace Build",
  "state": "SUCCESSFUL", 
  "description": "Windshift environment provisioned successfully.",
  "targetUrl": "https://windshift.local"
}

(Valid OneDev states to map: PENDING, RUNNING, SUCCESSFUL, FAILED)

4. User Interface (UI) Components
  • Add the OneDev logo to the "Connect a Git Provider" screen alongside GitHub, GitLab, and Gitea.
  • Provide clear validation states for self-hosted URLs (e.g., verifying https://onedev.local connectivity).

Additional Context
  • OneDev Project Home: https://github.com/theonedev/onedev
  • This will bridge the gap for users who prefer OneDev's heavy emphasis on built-in Kubernetes CI/CD pipelines over lighter alternatives like Gitea.
Lingua principale
Go
Stelle
421
Fork
50
Merge medio
17h 34m
PR unite (30g)
80

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Windshiftapp/core

Tutte le issue di Windshiftapp/core

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.