Add Support for Azure DevOps as Git Forge #23

Open
opened 2026-11-18 16:33:13 +01:00 by dario · 6 comments
Owner

Acceptance Criteria

  • the factory works against a git server located at https://dev.azure.com/...
### Acceptance Criteria - the factory works against a git server located at `https://dev.azure.com/...`
Author
Owner

I have not started on this. The issue is too open-ended for one pull request, and a few design decisions need a human first.

Scope. A new internal/forge/azuredevops backend has to implement the whole Forge interface. It also needs the shared forgetest suite extended, a backends registration, an ADR and README updates. The repo rules also require every method to be covered.

Open questions:

  1. Repository addressing. Azure DevOps uses organization, project and repository (dev.azure.com/<org>/<project>/_git/<repo>). forge.Repo is currently owner/name. Should we map it to org/project/repo, or add a field? Which URL forms must be supported (dev.azure.com, the older *.visualstudio.com, Azure DevOps Server)?
  2. Issues. Azure DevOps has no repository issues. It has Boards work items, which have their own ID space separate from pull requests. GetIssue, ListIssues, CommentOnIssue and SetLabels need a decision. Should work items be mapped to issues, or should issues be unsupported with the tracker (MCP) path used instead (ADR 0006)? Pull request numbers and work item IDs can collide.
  3. Review verdicts and labels. Azure DevOps pull requests use votes (approve, wait for author) and tags rather than review comments with inline verdicts. How should PostReview and SetLabels map to these?
  4. CI status. Should this read from the commit statuses API, from Pipelines build results, or from both?
  5. Authentication. Azure DevOps uses a PAT sent as Basic auth, base64-encoded. That conflicts with the GitAuthorization requirement that the token appears verbatim for the egress proxy to swap (ADR 0013). A decision is needed on how to handle it.
  6. Testing. There is no local Azure DevOps equivalent of the Forgejo test instance. Verifying the backend needs a real organization and a PAT, which I can't provide from this run. Is a recorded-fixture approach acceptable?

Once these are answered, it would probably help to split the work into several issues: a design/ADR first, then repo and PR operations, then work items and CI.


🤖 Written by an AI agent (factory) using this account.

I have not started on this. The issue is too open-ended for one pull request, and a few design decisions need a human first. **Scope.** A new `internal/forge/azuredevops` backend has to implement the whole `Forge` interface. It also needs the shared `forgetest` suite extended, a `backends` registration, an ADR and README updates. The repo rules also require every method to be covered. **Open questions:** 1. **Repository addressing.** Azure DevOps uses organization, project and repository (`dev.azure.com/<org>/<project>/_git/<repo>`). `forge.Repo` is currently owner/name. Should we map it to `org/project/repo`, or add a field? Which URL forms must be supported (`dev.azure.com`, the older `*.visualstudio.com`, Azure DevOps Server)? 2. **Issues.** Azure DevOps has no repository issues. It has Boards work items, which have their own ID space separate from pull requests. `GetIssue`, `ListIssues`, `CommentOnIssue` and `SetLabels` need a decision. Should work items be mapped to issues, or should issues be unsupported with the tracker (MCP) path used instead (ADR 0006)? Pull request numbers and work item IDs can collide. 3. **Review verdicts and labels.** Azure DevOps pull requests use votes (approve, wait for author) and tags rather than review comments with inline verdicts. How should `PostReview` and `SetLabels` map to these? 4. **CI status.** Should this read from the commit statuses API, from Pipelines build results, or from both? 5. **Authentication.** Azure DevOps uses a PAT sent as Basic auth, base64-encoded. That conflicts with the `GitAuthorization` requirement that the token appears verbatim for the egress proxy to swap (ADR 0013). A decision is needed on how to handle it. 6. **Testing.** There is no local Azure DevOps equivalent of the Forgejo test instance. Verifying the backend needs a real organization and a PAT, which I can't provide from this run. Is a recorded-fixture approach acceptable? Once these are answered, it would probably help to split the work into several issues: a design/ADR first, then repo and PR operations, then work items and CI. --- <sub>🤖 Written by an AI agent (factory) using this account.</sub> <!-- factory:agent -->
Author
Owner

Answers:

  1. for now we only need to support dev.azure.com. since this is the only forge so far using this I'd just map it somehow.
  2. We can entirely ignore the issue topic for azure. There will be a different project management system involved which will be accessed via MCP. That is out of scope here.
  3. For azure, the agent should actually not post reviews itself automatically. Reviews are only done in interactive sessions, where the agent proposes comments and only posts the comments approved by the engineer.
  4. For now we do not need CI support, this is out of scope.
  5. the factory doesn't encode anything. For Azure DevOps, FACTORY_FORGE_TOKEN holds the already-encoded credential.
  • On the host, you encode the PAT once and store the result as the sandbox secret:
    printf ':%s' "$PAT" | base64
  • In the backend, GitAuthorization(token) returns "Basic " + token, and the API client sends the same header.
  • In a kit, the credential gets format: "Basic %s" and the proxy sets the header with the stored, already-encoded value. With sbx secret set-custom, the factory sends Basic and the proxy swaps the placeholder. Both work, because the secret sits in the header unchanged.
  1. we don't need end to end testing for azure
Answers: 1. for now we only need to support `dev.azure.com`. since this is the only forge so far using this I'd just map it somehow. 2. We can entirely ignore the issue topic for azure. There will be a different project management system involved which will be accessed via MCP. That is out of scope here. 3. For azure, the agent should actually not post reviews itself automatically. Reviews are only done in interactive sessions, where the agent proposes comments and only posts the comments approved by the engineer. 4. For now we do not need CI support, this is out of scope. 5. the factory doesn't encode anything. For Azure DevOps, FACTORY_FORGE_TOKEN holds the already-encoded credential. - On the host, you encode the PAT once and store the result as the sandbox secret: printf ':%s' "$PAT" | base64 - In the backend, GitAuthorization(token) returns "Basic " + token, and the API client sends the same header. - In a kit, the credential gets format: "Basic %s" and the proxy sets the header with the stored, already-encoded value. With sbx secret set-custom, the factory sends Basic <placeholder> and the proxy swaps the placeholder. Both work, because the secret sits in the header unchanged. 6. we don't need end to end testing for azure
dario referenced this issue from a commit 2026-11-19 17:24:14 +01:00
Author
Owner

Refined Specification: Add Azure DevOps Backend

Goal

Add an Azure DevOps backend to the factory's forge layer, implementing the forge.Forge interface for Azure DevOps Services (dev.azure.com). This enables agents to work with Azure DevOps repositories for pull request operations.

Required Facts

Based on the author's answers in issue comments:

  1. Repository addressing: Map org/project/repo to forge.Repo (currently owner/name). Only support dev.azure.com for now.
  2. Issues: Ignore issue operations for Azure DevOps. Use MCP for project management (ADR 0006). The backend will return ErrNotFound for issue-related methods.
  3. Review verdicts: The agent should not post reviews automatically. Reviews are only done in interactive sessions where the agent proposes comments and the engineer approves them. The backend should implement PostReview but it may be called only from interactive sessions.
  4. CI status: Not needed for now (out of scope).
  5. Authentication: Token is already base64-encoded (Basic <token>), stored as FACTORY_FORGE_TOKEN. The backend's GitAuthorization(token) returns "Basic " + token.
  6. Testing: No end-to-end testing for Azure. Unit tests with httptest fakes are sufficient.

Implementation Tasks (Split into Sub-items)

Sub-item 1: ADR for Azure DevOps Backend

Title: ADR: Add Azure DevOps Backend

Goal: Document the design decisions for Azure DevOps support.

Required facts:

  • Map org/project/repo to forge.Repo (use org/project as owner, repo as name)
  • Issue operations return ErrNotFound (use MCP for project management)
  • No CI status support (out of scope)
  • Review operations supported (for interactive sessions only)
  • Authentication uses base64-encoded PAT in Basic format

Done criteria:

  • ADR written at docs/decisions/NNNN-azure-devops-backend.md
  • Approved and merged

How to verify:

  • ADR exists and is merged

Sub-item 2: Azure DevOps Backend Implementation

Title: Add Azure DevOps Backend

Goal: Implement internal/forge/azuredevops with full forge.Forge interface.

Required facts:

  • Repository addressing: Parse dev.azure.com/<org>/<project>/_git/<repo> → Repo{Owner: "org/project", Name: "repo"}
  • Issue methods: Return ErrNotFound (issues unsupported, use MCP)
  • Pull request methods: Implement full support via Azure DevOps REST API
  • Review methods: Implement PostReview and ListReviews
  • CI status: Return CIStatus{State: CINone} (out of scope)
  • Authentication: GitAuthorization(token) returns "Basic " + token

Done criteria:

  • internal/forge/azuredevops/azuredevops.go implements all forge.Forge methods
  • Passes forgetest.Run with a fake HTTP server
  • Registered in internal/forge/backends/backends.go
  • just check passes

How to verify:

  • go test ./internal/forge/azuredevops/... passes
  • just check passes

Sub-item 3: Update Documentation

Title: Update README.md and docs for Azure DevOps Support

Goal: Document Azure DevOps as a supported forge.

Required facts:

  • Add Azure DevOps to the forge table in README.md
  • Update docs/using-the-factory.md with Azure DevOps setup
  • Update factory.example.json with Azure DevOps configuration example

Done criteria:

  • README.md lists Azure DevOps as supported
  • Using-the-factory guide updated
  • Example config updated

How to verify:

  • Documentation updated and merged

Open Questions

  1. Repository addressing format: The author suggested mapping org/project/repo to owner/name. Should we use:

    • Repo{Owner: "org/project", Name: "repo"} (simplest, keeps forge.Repo unchanged)?
    • Or add a new Project field to Repo struct?

    Decision: Use Repo{Owner: "org/project", Name: "repo"} for simplicity, keeping the existing Repo struct unchanged.

  2. Issue operations: The author said to ignore issue operations entirely. Should all issue-related methods return ErrNotFound, or should some return empty results?

    Decision: All issue operations return ErrNotFound since Azure DevOps uses a different system for work items.

  3. Review operations in interactive sessions: The author mentioned reviews are done in interactive sessions. Should the backend validate that reviews are only posted from interactive sessions, or is this handled by the agent/harness?

    Decision: The backend implements PostReview without session validation. Interactive session handling is managed by the agent/harness, not the forge backend.

  4. URL forms: Should we support the older *.visualstudio.com URLs, or only dev.azure.com?

    Decision: Only dev.azure.com for now (as stated by author).

  5. Pull request URL parsing: Azure DevOps PR URLs are dev.azure.com/<org>/<project>/_git/<repo>/pullrequest/<id>. How should we extract the repo parts?

    Decision: Parse dev.azure.com/<org>/<project>/_git/<repo> → Repo{Owner: "org/project", Name: "repo"}. The pull request ID is separate.


Decisions

  1. Repository addressing: Use Repo{Owner: "org/project", Name: "repo"} format, keeping the existing Repo struct unchanged.
  2. Issue operations: All issue-related methods return ErrNotFound.
  3. Review operations: Backend implements PostReview without session validation.
  4. URL forms: Only dev.azure.com supported (no *.visualstudio.com).
  5. Testing: Unit tests with httptest fakes only (no end-to-end testing).
  6. CI status: Return CIStatus{State: CINone} (out of scope).

🤖 Written by the factory's refiner, an AI agent, using this account.

# Refined Specification: Add Azure DevOps Backend ## Goal Add an Azure DevOps backend to the factory's forge layer, implementing the `forge.Forge` interface for Azure DevOps Services (dev.azure.com). This enables agents to work with Azure DevOps repositories for pull request operations. ## Required Facts Based on the author's answers in issue comments: 1. **Repository addressing**: Map `org/project/repo` to `forge.Repo` (currently `owner/name`). Only support `dev.azure.com` for now. 2. **Issues**: Ignore issue operations for Azure DevOps. Use MCP for project management (ADR 0006). The backend will return `ErrNotFound` for issue-related methods. 3. **Review verdicts**: The agent should not post reviews automatically. Reviews are only done in interactive sessions where the agent proposes comments and the engineer approves them. The backend should implement `PostReview` but it may be called only from interactive sessions. 4. **CI status**: Not needed for now (out of scope). 5. **Authentication**: Token is already base64-encoded (`Basic <token>`), stored as `FACTORY_FORGE_TOKEN`. The backend's `GitAuthorization(token)` returns `"Basic " + token`. 6. **Testing**: No end-to-end testing for Azure. Unit tests with httptest fakes are sufficient. ## Implementation Tasks (Split into Sub-items) ### Sub-item 1: ADR for Azure DevOps Backend **Title**: ADR: Add Azure DevOps Backend **Goal**: Document the design decisions for Azure DevOps support. **Required facts**: - Map `org/project/repo` to `forge.Repo` (use `org/project` as owner, `repo` as name) - Issue operations return `ErrNotFound` (use MCP for project management) - No CI status support (out of scope) - Review operations supported (for interactive sessions only) - Authentication uses base64-encoded PAT in `Basic` format **Done criteria**: - ADR written at `docs/decisions/NNNN-azure-devops-backend.md` - Approved and merged **How to verify**: - ADR exists and is merged --- ### Sub-item 2: Azure DevOps Backend Implementation **Title**: Add Azure DevOps Backend **Goal**: Implement `internal/forge/azuredevops` with full `forge.Forge` interface. **Required facts**: - Repository addressing: Parse `dev.azure.com/<org>/<project>/_git/<repo>` → `Repo{Owner: "org/project", Name: "repo"}` - Issue methods: Return `ErrNotFound` (issues unsupported, use MCP) - Pull request methods: Implement full support via Azure DevOps REST API - Review methods: Implement `PostReview` and `ListReviews` - CI status: Return `CIStatus{State: CINone}` (out of scope) - Authentication: `GitAuthorization(token)` returns `"Basic " + token` **Done criteria**: - `internal/forge/azuredevops/azuredevops.go` implements all `forge.Forge` methods - Passes `forgetest.Run` with a fake HTTP server - Registered in `internal/forge/backends/backends.go` - `just check` passes **How to verify**: - `go test ./internal/forge/azuredevops/...` passes - `just check` passes --- ### Sub-item 3: Update Documentation **Title**: Update README.md and docs for Azure DevOps Support **Goal**: Document Azure DevOps as a supported forge. **Required facts**: - Add Azure DevOps to the forge table in README.md - Update `docs/using-the-factory.md` with Azure DevOps setup - Update `factory.example.json` with Azure DevOps configuration example **Done criteria**: - README.md lists Azure DevOps as supported - Using-the-factory guide updated - Example config updated **How to verify**: - Documentation updated and merged --- ## Open Questions 1. **Repository addressing format**: The author suggested mapping `org/project/repo` to `owner/name`. Should we use: - `Repo{Owner: "org/project", Name: "repo"}` (simplest, keeps `forge.Repo` unchanged)? - Or add a new `Project` field to `Repo` struct? **Decision**: Use `Repo{Owner: "org/project", Name: "repo"}` for simplicity, keeping the existing `Repo` struct unchanged. 2. **Issue operations**: The author said to ignore issue operations entirely. Should all issue-related methods return `ErrNotFound`, or should some return empty results? **Decision**: All issue operations return `ErrNotFound` since Azure DevOps uses a different system for work items. 3. **Review operations in interactive sessions**: The author mentioned reviews are done in interactive sessions. Should the backend validate that reviews are only posted from interactive sessions, or is this handled by the agent/harness? **Decision**: The backend implements `PostReview` without session validation. Interactive session handling is managed by the agent/harness, not the forge backend. 4. **URL forms**: Should we support the older `*.visualstudio.com` URLs, or only `dev.azure.com`? **Decision**: Only `dev.azure.com` for now (as stated by author). 5. **Pull request URL parsing**: Azure DevOps PR URLs are `dev.azure.com/<org>/<project>/_git/<repo>/pullrequest/<id>`. How should we extract the repo parts? **Decision**: Parse `dev.azure.com/<org>/<project>/_git/<repo>` → `Repo{Owner: "org/project", Name: "repo"}`. The pull request ID is separate. --- ## Decisions 1. **Repository addressing**: Use `Repo{Owner: "org/project", Name: "repo"}` format, keeping the existing `Repo` struct unchanged. 2. **Issue operations**: All issue-related methods return `ErrNotFound`. 3. **Review operations**: Backend implements `PostReview` without session validation. 4. **URL forms**: Only `dev.azure.com` supported (no `*.visualstudio.com`). 5. **Testing**: Unit tests with httptest fakes only (no end-to-end testing). 6. **CI status**: Return `CIStatus{State: CINone}` (out of scope). --- <sub>🤖 Written by the factory's refiner, an AI agent, using this account.</sub> <!-- factory:agent -->
Author
Owner
  1. Repository addressing: Repo{Owner: "org/project"} does not work as is: ParseRepo (internal/forge/forge.go) splits at the first / and allows no / in either part. How Azure's org/project/repo is passed and parsed is a design decision for the ADR, not settled yet. Propose options.
  2. Issue operations: they cannot all return ErrNotFound. The factory comments on pull requests through CommentOnIssue (implement-issue step 6.4, run reports). On Azure, commenting on a pull request must work; only real issues are unsupported.
  3. Shared test suite: forgetest.Run tests issue operations. A backend without issues needs a way to skip them in the suite; that is part of the work.
  4. Reviews: on Azure the factory must not post reviews in headless runs. In interactive sessions the agent proposes comments and posts only those I approve. This must be a requirement in the split, with where it is enforced (policy, dispatcher or skill), not left to the harness.
  5. Documentation: no separate docs item. README and docs change in the same pull request as the behavior (AGENTS.md).
  6. Size: the backend item is too large for one pull request. Split it further, e.g. repo and pull request operations, pull request comments, the review rule.
1. **Repository addressing:** `Repo{Owner: "org/project"}` does not work as is: `ParseRepo` (internal/forge/forge.go) splits at the first `/` and allows no `/` in either part. How Azure's org/project/repo is passed and parsed is a design decision for the ADR, not settled yet. Propose options. 2. **Issue operations:** they cannot all return `ErrNotFound`. The factory comments on pull requests through `CommentOnIssue` (implement-issue step 6.4, run reports). On Azure, commenting on a pull request must work; only real issues are unsupported. 3. **Shared test suite:** `forgetest.Run` tests issue operations. A backend without issues needs a way to skip them in the suite; that is part of the work. 4. **Reviews:** on Azure the factory must not post reviews in headless runs. In interactive sessions the agent proposes comments and posts only those I approve. This must be a requirement in the split, with where it is enforced (policy, dispatcher or skill), not left to the harness. 5. **Documentation:** no separate docs item. README and docs change in the same pull request as the behavior (AGENTS.md). 6. **Size:** the backend item is too large for one pull request. Split it further, e.g. repo and pull request operations, pull request comments, the review rule.
Author
Owner

Azure DevOps backend: refined specification

Replaces the refiner's specifications in comments 414 and 418 (its original version is in this comment's edit history). Decisions marked (decided) are my answers
(comment 415 and the refine session on 2026-11-20); (proposal) still needs my confirmation before an implementer starts on it.

Decisions

  1. Scope (decided): only Azure DevOps Services at dev.azure.com. No issues (work items come from a tracker over MCP, ADR 0006), no CI, no end-to-end tests.
  2. Addressing (decided): the organization is part of the forge's base_url (https://dev.azure.com/<org>). -repo is <project>/<repo>, so forge.Repo and ParseRepo (internal/forge/forge.go:72, :82) stay unchanged: Owner holds the Azure project, Name the repository. Projects or repositories whose names contain characters repoPart does not allow ([A-Za-z0-9_.-], e.g. spaces) are unsupported for now; the ADR says so.
  3. Authentication (decided): FACTORY_FORGE_TOKEN holds the already encoded credential (printf ':%s' "$PAT" | base64, done once on the host). GitAuthorization(token) returns "Basic " + token, and the API client sends the same header. The factory encodes nothing, so a proxy can swap the placeholder (ADR 0013).
  4. Issue operations (decided): GetIssue, ListIssues and SetLabels return a clear error: not supported on Azure DevOps, use a tracker. CommentOnIssue on a pull request number creates a pull request thread: the factory comments on pull requests this way (implement-issue step 6.4, run reports).
  5. Shared test suite (decided): forgetest gets a capability that skips the issue tests for backends without issues (they test GetIssue, ListIssues and labels, internal/forge/forgetest/forgetest.go:143ff). Pull request comment tests still run.
  6. Reviews (decided): on Azure the factory never posts a review in a headless run. In interactive sessions the agent proposes comments and posts only those I approve. It is enforced in forge.WithPolicy, not only in the skill.
  7. Review config (proposal): forge config option "reviews": "interactive" (default "all"). forge.Policy (internal/forge/policy.go:17) does not know whether a run is interactive; the dispatcher passes it in (internal/dispatch/dispatch.go:272, and to factory mcp through a FACTORY_* variable read in internal/ops/env.go:87).
  8. Docs (decided): README and docs change in the same pull request as the behavior (AGENTS.md). No separate docs item.

Sub-items

Implement in this order. Each one is one pull request, with tests, docs and just check passing.

1. ADR: Azure DevOps backend

  • Goal: record decisions 1 to 8 as docs/decisions/0017-azure-devops-backend.md, including what is unsupported and why.
  • Prerequisites: none.
  • Done: the ADR is merged. No code changes.

2. Azure DevOps backend: skeleton (proposal: split from the PR operations)

  • Goal: a backend that authenticates and reads the repository.
  • Prerequisites: sub-item 1.
  • Changes:
    • config.ForgeAzureDevOps = "azuredevops" next to the existing types (internal/config/config.go:25);
    • a case in backends.New (internal/forge/backends/backends.go:17);
    • new internal/forge/azuredevops with Whoami, GetRepo, GetPermission, GitAuthorization (decision 3);
    • the issue methods with the "not supported" error (decision 4);
    • all other methods return the same "not supported yet" error for now;
    • the forgetest capability (decision 5).
  • Tests: forgetest.Run against an httptest fake, with issue tests and the not-yet-implemented groups skipped; unit tests for the error messages and the Basic header.
  • Docs: README forge table and docs/using-the-factory.md (Azure setup, token encoding); factory.example.json.

3. Azure DevOps backend: pull request operations

  • Goal: the factory can open and read pull requests on Azure.
  • Prerequisites: sub-item 2.
  • Changes: CreatePullRequest, GetPullRequest (including its comments, from the pull request threads), GetPullRequestDiff, ListPullRequests, ListReviews (reviewer votes and their comments); GetCIStatus returns CINone (decision 1).
  • Tests: the matching forgetest groups run against the fake.

4. Azure DevOps backend: pull request comments

  • Goal: CommentOnIssue with a pull request number creates a pull request thread (decision 4).
  • Prerequisites: sub-item 3.
  • Tests: the forgetest comment tests run against the fake; a comment on a number that is not a pull request returns the "not supported" error.

5. Reviews only in interactive sessions

  • Goal: decision 6, for every forge, switched on by decision 7's config option.
  • Prerequisites: sub-item 1. Independent of 2 to 4.
  • Changes:
    • forge.Policy gets the review setting and whether the run is interactive; the guarded PostReview refuses headless reviews when the setting is "interactive";
    • the dispatcher and factory mcp pass both in (decision 7);
    • skills/review-pr/SKILL.md: in an interactive session under this setting, propose each comment and post only the approved ones. The PR needs an Evidence section (AGENTS.md).
  • Tests: policy tests for headless (refused) and interactive (allowed); other settings unchanged.
# Azure DevOps backend: refined specification Replaces the refiner's specifications in comments 414 and 418 (its original version is in this comment's edit history). Decisions marked **(decided)** are my answers (comment 415 and the refine session on 2026-11-20); **(proposal)** still needs my confirmation before an implementer starts on it. ## Decisions 1. **Scope** (decided): only Azure DevOps Services at `dev.azure.com`. No issues (work items come from a tracker over MCP, ADR 0006), no CI, no end-to-end tests. 2. **Addressing** (decided): the organization is part of the forge's `base_url` (`https://dev.azure.com/<org>`). `-repo` is `<project>/<repo>`, so `forge.Repo` and `ParseRepo` (internal/forge/forge.go:72, :82) stay unchanged: `Owner` holds the Azure project, `Name` the repository. Projects or repositories whose names contain characters `repoPart` does not allow (`[A-Za-z0-9_.-]`, e.g. spaces) are unsupported for now; the ADR says so. 3. **Authentication** (decided): `FACTORY_FORGE_TOKEN` holds the already encoded credential (`printf ':%s' "$PAT" | base64`, done once on the host). `GitAuthorization(token)` returns `"Basic " + token`, and the API client sends the same header. The factory encodes nothing, so a proxy can swap the placeholder (ADR 0013). 4. **Issue operations** (decided): `GetIssue`, `ListIssues` and `SetLabels` return a clear error: not supported on Azure DevOps, use a tracker. `CommentOnIssue` on a pull request number creates a pull request thread: the factory comments on pull requests this way (implement-issue step 6.4, run reports). 5. **Shared test suite** (decided): `forgetest` gets a capability that skips the issue tests for backends without issues (they test `GetIssue`, `ListIssues` and labels, internal/forge/forgetest/forgetest.go:143ff). Pull request comment tests still run. 6. **Reviews** (decided): on Azure the factory never posts a review in a headless run. In interactive sessions the agent proposes comments and posts only those I approve. It is enforced in `forge.WithPolicy`, not only in the skill. 7. **Review config** (proposal): forge config option `"reviews": "interactive"` (default `"all"`). `forge.Policy` (internal/forge/policy.go:17) does not know whether a run is interactive; the dispatcher passes it in (internal/dispatch/dispatch.go:272, and to `factory mcp` through a `FACTORY_*` variable read in internal/ops/env.go:87). 8. **Docs** (decided): README and docs change in the same pull request as the behavior (AGENTS.md). No separate docs item. ## Sub-items Implement in this order. Each one is one pull request, with tests, docs and `just check` passing. ### 1. ADR: Azure DevOps backend - **Goal:** record decisions 1 to 8 as `docs/decisions/0017-azure-devops-backend.md`, including what is unsupported and why. - **Prerequisites:** none. - **Done:** the ADR is merged. No code changes. ### 2. Azure DevOps backend: skeleton (proposal: split from the PR operations) - **Goal:** a backend that authenticates and reads the repository. - **Prerequisites:** sub-item 1. - **Changes:** - `config.ForgeAzureDevOps = "azuredevops"` next to the existing types (internal/config/config.go:25); - a case in `backends.New` (internal/forge/backends/backends.go:17); - new `internal/forge/azuredevops` with `Whoami`, `GetRepo`, `GetPermission`, `GitAuthorization` (decision 3); - the issue methods with the "not supported" error (decision 4); - all other methods return the same "not supported yet" error for now; - the `forgetest` capability (decision 5). - **Tests:** `forgetest.Run` against an `httptest` fake, with issue tests and the not-yet-implemented groups skipped; unit tests for the error messages and the `Basic` header. - **Docs:** README forge table and `docs/using-the-factory.md` (Azure setup, token encoding); `factory.example.json`. ### 3. Azure DevOps backend: pull request operations - **Goal:** the factory can open and read pull requests on Azure. - **Prerequisites:** sub-item 2. - **Changes:** `CreatePullRequest`, `GetPullRequest` (including its comments, from the pull request threads), `GetPullRequestDiff`, `ListPullRequests`, `ListReviews` (reviewer votes and their comments); `GetCIStatus` returns `CINone` (decision 1). - **Tests:** the matching `forgetest` groups run against the fake. ### 4. Azure DevOps backend: pull request comments - **Goal:** `CommentOnIssue` with a pull request number creates a pull request thread (decision 4). - **Prerequisites:** sub-item 3. - **Tests:** the `forgetest` comment tests run against the fake; a comment on a number that is not a pull request returns the "not supported" error. ### 5. Reviews only in interactive sessions - **Goal:** decision 6, for every forge, switched on by decision 7's config option. - **Prerequisites:** sub-item 1. Independent of 2 to 4. - **Changes:** - `forge.Policy` gets the review setting and whether the run is interactive; the guarded `PostReview` refuses headless reviews when the setting is `"interactive"`; - the dispatcher and `factory mcp` pass both in (decision 7); - `skills/review-pr/SKILL.md`: in an interactive session under this setting, propose each comment and post only the approved ones. The PR needs an Evidence section (AGENTS.md). - **Tests:** policy tests for headless (refused) and interactive (allowed); other settings unchanged.
Author
Owner
  • #48 ADR
  • #49 skeleton
  • #50 pull request operations
  • #51 pull request comments
  • #52 reviews only in interactive sessions
- [ ] #48 ADR - [ ] #49 skeleton - [ ] #50 pull request operations - [ ] #51 pull request comments - [ ] #52 reviews only in interactive sessions
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#23
No description provided.