Skip to content

Make GitAutomation interface GitHub agnostic - #2223

Merged
lbussell merged 3 commits into
mainfrom
lbussell/gitautomation-provider-neutral
Sep 3, 2026
Merged

lbussell merged 3 commits into
mainfrom
lbussell/gitautomation-provider-neutral

Conversation

@lbussell

@lbussell lbussell commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

This PR reworks the GitAutomation API to be provider neutral before adding Azure DevOps support. Trying to retrofit the provider-agnostic requirements on to the previous implementation resulted in a lot of tension because we support forks on GitHub but not on Azure DevOps. The boundary had to be reworked a little bit.

All remote operations are now behind a new IPullRequestEndpoint interface. Git and GitContext are now also behind one GitWorkingCopy implementation.

Part of:

Stack created with GitHub Stacks CLI • Give Feedback 💬

@lbussell
lbussell requested a review from a team as a code owner September 1, 2026 16:48
@lbussell lbussell changed the title lbussell/gitautomation provider neutral Make GitAutomation interface GitHub agnostic Sep 1, 2026
@lbussell
lbussell force-pushed the lbussell/gitautomation-provider-neutral branch from 28b192a to 4d1deef Compare September 1, 2026 17:07
extension(CommitInfo)
{
public static CommitInfo FromPullRequestCommit(PullRequestCommit prCommit) =>
new CommitInfo(prCommit.Sha, prCommit.Author.Name, prCommit.Author.Email);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently the recommendation is to use prCommit.Commit.Author instead of prCommit.Author. You can see in Octokit's own tests that they don't populate Name/Email for prCommit.Author: https://github.com/octokit/octokit.net/blob/main/Octokit.Tests/Models/PullRequestCommitTests.cs.

FWIW, the previous implementation of this code used the recommended way:

.Select(commit => new CommitInfo(commit.Sha, commit.Commit.Author.Name, commit.Commit.Author.Email))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Thought I could simplify it! Guess not. I will make sure this gotcha is captured in a comment.

@lbussell
lbussell force-pushed the lbussell/gitautomation-provider-neutral branch 2 times, most recently from d243299 to 2b85da4 Compare September 1, 2026 22:09
@lbussell
lbussell requested a review from mthalman September 2, 2026 14:30
Base automatically changed from lbussell/azure-devops-api-client to main September 2, 2026 21:26
lbussell and others added 3 commits September 2, 2026 14:26
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 43e0dbdb-c6a4-4dbf-bf78-b620f850990d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 43e0dbdb-c6a4-4dbf-bf78-b620f850990d
@lbussell
lbussell force-pushed the lbussell/gitautomation-provider-neutral branch from 2b85da4 to 5d8ba4c Compare September 2, 2026 21:26
@lbussell
lbussell merged commit 1847c50 into main Sep 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants