Add initial implementation of Microsoft.DotNet.GitAutomation library#2158
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces an initial Microsoft.DotNet.Automation library intended to provide a service-agnostic reconciliation API for automating git commits, branches, and (currently GitHub-only) pull requests, forming the foundation for the broader automation library described in #2152.
Changes:
- Adds a new
Microsoft.DotNet.Automationproject with branch and pull request “ensure desired state” APIs. - Implements git operations via the git CLI (
GitWorkspace/GitCli) and GitHub PR operations via Octokit (GitHubPullRequestApi). - Wires the new project into the repo solution (
Microsoft.DotNet.DockerTools.slnx).
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Automation/RepoHostEngine.cs | Core reconciliation engine for ensuring branch content and PR state; contains create/update logic and foreign-commit policy handling. |
| src/Automation/RemoteRepo.cs | Abstraction for remote repositories, including authenticated clone URL construction. |
| src/Automation/README.md | Usage docs and examples for ensuring PRs/branches and configuring policies. |
| src/Automation/PullRequestUpdateStrategy.cs | Defines append vs replace strategy for PR updates. |
| src/Automation/PullRequestSpec.cs | Defines desired-state contract for an automated PR (key, target branch, apply callback, policies). |
| src/Automation/PullRequestResult.cs | Result object for PR ensure operations (outcome, URL, commits, details). |
| src/Automation/PullRequestOutcome.cs | Enumerates possible PR ensure outcomes (unchanged/created/updated/stopped/dry-run). |
| src/Automation/PullRequestInfo.cs | Internal representation of a PR as seen via IPullRequestApi. |
| src/Automation/Microsoft.DotNet.Automation.csproj | New packable library project with logging abstractions + Octokit dependencies. |
| src/Automation/IRepoHost.cs | Public interface for ensuring PRs and direct branch updates. |
| src/Automation/IPullRequestApi.cs | Internal service-specific PR API surface used by the engine. |
| src/Automation/IGitContext.cs | Public interface for producing commits in a temporary workspace. |
| src/Automation/GitWorkspace.cs | Temporary clone implementation and git operations (clone, fetch, commit, push, diff logging). |
| src/Automation/GitHub/GitHubRepoHost.cs | Public GitHub-backed IRepoHost implementation wiring engine + GitHub API client. |
| src/Automation/GitHub/GitHubRepo.cs | GitHub RemoteRepo implementation and clone/auth URL handling. |
| src/Automation/GitHub/GitHubPullRequestApi.cs | Octokit-backed PR/comment operations used by the engine. |
| src/Automation/GitException.cs | Exception type that masks credentials in command/error text. |
| src/Automation/GitContext.cs | Default IGitContext implementation that commits via GitWorkspace. |
| src/Automation/GitCommit.cs | Commit model plus helper to extract subject line. |
| src/Automation/GitCliResult.cs | Wrapper for git stdout output plus trimming helper. |
| src/Automation/GitCli.cs | Git CLI execution wrapper with secret masking in logs/errors. |
| src/Automation/GitAutomationOptions.cs | Shared options (token, author, dry run). |
| src/Automation/GitAuthor.cs | Commit author identity record. |
| src/Automation/ForeignCommitPolicy.cs | Policy for handling commits not authored by automation. |
| src/Automation/BranchSpec.cs | Desired-state contract for direct branch updates. |
| src/Automation/BranchResult.cs | Result object for branch ensure operations (outcome, commits). |
| src/Automation/BranchOutcome.cs | Enumerates possible branch ensure outcomes. |
| Microsoft.DotNet.DockerTools.slnx | Adds the new Automation project to the solution for CI build/test inclusion. |
lbussell
force-pushed
the
lbussell/automation-code
branch
from
July 8, 2026 00:15
495bf39 to
559c3f8
Compare
lbussell
force-pushed
the
lbussell/automation-code
branch
from
July 8, 2026 17:28
ff8f1f9 to
2162a40
Compare
lbussell
marked this pull request as ready for review
July 8, 2026 17:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lbussell
force-pushed
the
lbussell/automation-code
branch
from
July 8, 2026 17:31
2162a40 to
7c634c9
Compare
Member
Author
|
@mthalman This one is finally ready for review. |
mthalman
reviewed
Jul 8, 2026
When updating an existing pull request in append mode, clone the configured PR source repo instead of always cloning upstream. This allows fork-backed PR branches to be updated from their actual source repository. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Expose internals to the test assembly and make planner-only models, operations, results, and helpers internal so the package only exposes caller-facing pull request automation types. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Generate XML documentation for the Automation package and remove Arcade's CS1591 suppression so missing public API docs fail under TreatWarningsAsErrors. Add the currently missing public XML comments. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Microsoft.DotNet.Automation libraryMicrosoft.DotNet.GitAutomation library
mthalman
reviewed
Jul 13, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54d39da9-5918-4058-ad46-95935dcc127c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54d39da9-5918-4058-ad46-95935dcc127c
mthalman
approved these changes
Jul 13, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54d39da9-5918-4058-ad46-95935dcc127c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54d39da9-5918-4058-ad46-95935dcc127c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54d39da9-5918-4058-ad46-95935dcc127c
lbussell
requested review from
Copilot and
mthalman
and removed request for
Copilot
July 13, 2026 21:00
mthalman
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is the start of #2152. It has a small initial scope focusing only on creating pull requests on GitHub.