Azure DevOps backend: skeleton #49

Closed
opened 2026-11-20 15:14:34 +01:00 by dario · 0 comments
Owner

Part of #23. After #48 is merged.

Goal

An Azure DevOps backend that authenticates and reads the repository. Pull request operations follow in later issues.

Required facts

  • Forge types live in internal/config/config.go:25 (ForgeForgejo, ForgeGitHub); backends.New (internal/forge/backends/backends.go:17) has one case per type.
  • The organization is part of base_url (https://dev.azure.com/<org>); -repo is <project>/<repo> (Owner = project, Name = repository). forge.Repo and ParseRepo do not change.
  • FACTORY_FORGE_TOKEN holds the already base64-encoded credential. GitAuthorization(token) returns "Basic " + token; the API client sends the same header and encodes nothing.
  • The shared suite forgetest.Run (internal/forge/forgetest/forgetest.go:115) tests issue operations (from :143); a backend without issues must be able to skip them.

Changes

  • config.ForgeAzureDevOps = "azuredevops" and its case in backends.New.
  • New package internal/forge/azuredevops: Whoami, GetRepo, GetPermission, GitAuthorization.
  • GetIssue, ListIssues, SetLabels: error "not supported on Azure DevOps, use a tracker".
  • All other Forge methods: error "not supported yet".
  • forgetest: a capability for backends without issues (their issue tests are skipped), and a way to skip groups not implemented yet.

Tests

  • forgetest.Run against an httptest fake, issue tests and unimplemented groups skipped.
  • Unit tests for the Basic header and the error messages.

Docs (same pull request)

  • README forge table; docs/using-the-factory.md: Azure setup including the token encoding; factory.example.json.

Done criteria

  • just check passes.
Part of #23. After #48 is merged. ## Goal An Azure DevOps backend that authenticates and reads the repository. Pull request operations follow in later issues. ## Required facts - Forge types live in internal/config/config.go:25 (`ForgeForgejo`, `ForgeGitHub`); `backends.New` (internal/forge/backends/backends.go:17) has one case per type. - The organization is part of `base_url` (`https://dev.azure.com/<org>`); `-repo` is `<project>/<repo>` (`Owner` = project, `Name` = repository). `forge.Repo` and `ParseRepo` do not change. - `FACTORY_FORGE_TOKEN` holds the already base64-encoded credential. `GitAuthorization(token)` returns `"Basic " + token`; the API client sends the same header and encodes nothing. - The shared suite `forgetest.Run` (internal/forge/forgetest/forgetest.go:115) tests issue operations (from :143); a backend without issues must be able to skip them. ## Changes - `config.ForgeAzureDevOps = "azuredevops"` and its case in `backends.New`. - New package `internal/forge/azuredevops`: `Whoami`, `GetRepo`, `GetPermission`, `GitAuthorization`. - `GetIssue`, `ListIssues`, `SetLabels`: error "not supported on Azure DevOps, use a tracker". - All other `Forge` methods: error "not supported yet". - `forgetest`: a capability for backends without issues (their issue tests are skipped), and a way to skip groups not implemented yet. ## Tests - `forgetest.Run` against an `httptest` fake, issue tests and unimplemented groups skipped. - Unit tests for the `Basic` header and the error messages. ## Docs (same pull request) - README forge table; `docs/using-the-factory.md`: Azure setup including the token encoding; `factory.example.json`. ## Done criteria - `just check` passes.
dario closed this issue 2026-11-23 13:08:33 +01:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dario/factory#49
No description provided.