Skip to content

refactor(git): split github.go into per-domain files - #282

Merged
patrick-hermann-sva merged 1 commit into
mainfrom
refactor/git-split-github-go
May 28, 2026
Merged

refactor(git): split github.go into per-domain files#282
patrick-hermann-sva merged 1 commit into
mainfrom
refactor/git-split-github-go

Conversation

@patrick-hermann-sva

Copy link
Copy Markdown
Contributor

Summary

Splits git/github.go (530 LOC) into five files grouped by GitHub domain. Pure code move — no behavior changes.

New file LOC Functions
github_clone.go 43 CloneGithub
github_branch.go 115 CreateGithubBranch, DeleteGithubBranch
github_pull_request.go 70 CreateGithubPullRequest
github_issue.go 71 CreateGithubIssue
github_commit.go 263 AddFileToGithubBranch, AddFolderToGithubBranch, AddFilesToGithubBranch

The package-level workDir = "/src" var moved from github.go into container.go (its natural home alongside the container helper).

Refs #262 — P3 "Split oversized files: git/github.go". Follow-up PR will tackle dependencies/ansible.go (314 LOC).

Side effects worth a glance

Two pre-existing comment-glued-to-code quirks resolved as an unavoidable side effect of the split:

  • } // DeleteGithubBranch — closing brace had the next func's doc comment glued to it
  • WithExec(...) // Copy the source directory — block comment glued to end of statement

Both are cosmetic; neither changes behavior.

Test plan

  • go build ./... clean
  • go vet ./... clean
  • gofmt -l clean
  • dagger functions -m ./git lists same 11 functions with same descriptions as main

🤖 Generated with Claude Code

Splits the 530-LOC git/github.go into five files grouped by GitHub
domain, with no behavior changes:

- github_clone.go        CloneGithub
- github_branch.go       CreateGithubBranch, DeleteGithubBranch
- github_pull_request.go CreateGithubPullRequest
- github_issue.go        CreateGithubIssue
- github_commit.go       AddFile/Folder/FilesToGithubBranch

Also moves the package-level `workDir` var into container.go (its
natural home alongside the container helper).

`dagger functions -m ./git` lists the same 11 functions with the
same descriptions as before the split. `go build`, `go vet` and
`gofmt -l` all clean.

Refs #262 (P3 — split oversized files; `git/github.go` slice).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@patrick-hermann-sva
patrick-hermann-sva merged commit a7f24cc into main May 28, 2026
3 checks passed
@patrick-hermann-sva
patrick-hermann-sva deleted the refactor/git-split-github-go branch May 28, 2026 07:19
@patrick-hermann-sva

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.115.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant