docs: add Go developer cookbook for contributors - #1995
Conversation
Comprehensive guide covering project layout, Go conventions (error handling, interfaces, DI, Cobra CLI), testing patterns (testify, fakes, httptest), and deep-dives into the mint, inference, forge, and GitHub reusable workflow systems. Signed-off-by: Wayne Sun <gsun@redhat.com>
Site previewPreview: https://0f003a77-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsMedium
Low
Previous runReviewFindingsLow
Info
Previous run (2)ReviewFindingsHigh
Medium
Low
Info
|
|
|
||
| ```go | ||
| var canonicalRolePermissions = map[string]map[string]string{ | ||
| "triage": {"contents": "read", "issues": "write", "pull_requests": "read"}, |
There was a problem hiding this comment.
[high] api-contract
The canonicalRolePermissions table is materially incorrect across all 7 roles. Every role is missing "metadata": "read", and many roles are missing other permissions that exist in the actual code at internal/mintcore/github.go:57-64. Specific discrepancies: triage adds "pull_requests": "read" (does not exist) and is missing "metadata": "read"; coder is missing "checks": "read" and "metadata": "read"; review is missing "issues": "write", "checks": "read", and "metadata": "read"; fix is missing "metadata": "read"; retro is missing "pull_requests": "write" and "metadata": "read"; prioritize is missing "organization_projects": "write" and "metadata": "read"; fullsend is missing "actions_variables": "read", "pull_requests": "write", and "metadata": "read".
Suggested fix: Copy the actual canonicalRolePermissions map from internal/mintcore/github.go:57-64 into the cookbook verbatim.
| } | ||
|
|
||
| func (c *LiveClient) CommitFiles(ctx context.Context, owner, repo, branch, message string, files []TreeFile) (bool, error) | ||
| ``` |
There was a problem hiding this comment.
[medium] api-contract
The CommitFiles method signature includes a branch parameter that does not exist in the actual interface. Cookbook shows: CommitFiles(ctx, owner, repo, branch, message string, files []TreeFile). Actual signature at internal/forge/forge.go:168: CommitFiles(ctx, owner, repo, message string, files []TreeFile).
Suggested fix: Remove the branch parameter from the CommitFiles signature in the cookbook.
|
|
||
| | Category | Methods | | ||
| |----------|---------| | ||
| | **Repositories** | `ListOrgRepos`, `GetRepo`, `CreateRepo`, `DeleteRepo` | |
There was a problem hiding this comment.
[low] api-contract
The forge.Client interface method table omits several method categories present in the actual interface (internal/forge/forge.go:128-269): org-level secrets/variables, workflow run logs/annotations, PR file diffs, org plan, app installations.
| @@ -0,0 +1,983 @@ | |||
| # Go Developer Cookbook | |||
|
|
|||
| A practical guide for Go developers contributing to the fullsend codebase. Covers project conventions, key patterns, and deep-dives into the mint, inference, GitHub forge, and reusable workflow systems. | |||
There was a problem hiding this comment.
[low] naming-convention
Introduction uses 'A practical guide for...' while all other dev/ guides use the pattern 'This guide [verb]...'.
| 4. [The Mint System](#the-mint-system) | ||
| 5. [The Inference System](#the-inference-system) | ||
| 6. [The Forge Abstraction (GitHub Code Guide)](#the-forge-abstraction) | ||
| 7. [GitHub Reusable Workflows & Actions](#github-reusable-workflows--actions) |
There was a problem hiding this comment.
[low] naming-convention
Section 6 ToC title 'The Forge Abstraction (GitHub Code Guide)' parenthetical is confusing since the forge abstraction is designed to be forge-agnostic.
Fix code accuracy issues in the Go developer cookbook identified by multi-agent review: - Use regexp.MustCompile() for pattern variables (not raw strings) - Combine ValidateOrgName into single conditional (matches source) - Fix canonicalRolePermissions for all 7 roles (missing metadata:read, checks:read, organization_projects:write, actions_variables:read) - Use forge.NewFakeClient() constructor (not struct literal) - Fix LiveClient field name (http, not httpClient) - Fix APIError field (Errors []APIErrorDetail, not Details) - Fix TreeFile.Content type ([]byte, not string) - Fix CommitFiles signature (no branch parameter) - Fix mintcore dependency description (separate go.mod) - Remove phantom DeleteRepoSecret from forge.Client table Signed-off-by: Wayne Sun <gsun@redhat.com>
| ### CLI Wiring | ||
|
|
||
| ```go | ||
| // internal/cli/admin.go (simplified) |
There was a problem hiding this comment.
[low] api-contract
The forge.Client method table omits 11 of 54 methods across several categories including PR file operations, workflow run details, and org secret/variable repo management.
Suggested fix: Add missing method categories to the table, or add an explicit note like 'Key categories shown; see internal/forge/forge.go for all ~54 methods' to set expectations.
| @@ -0,0 +1,978 @@ | |||
| # Go Developer Cookbook | |||
|
|
|||
| A practical guide for Go developers contributing to the fullsend codebase. Covers project conventions, key patterns, and deep-dives into the mint, inference, GitHub forge, and reusable workflow systems. | |||
There was a problem hiding this comment.
[low] naming-convention
Introduction uses 'A practical guide for...' while all three other dev/ guides consistently use 'This guide [verb]...' pattern.
Suggested fix: Change to: 'This guide covers Go conventions, testing patterns, and deep-dives into the mint, inference, forge, and workflow systems for contributors to the fullsend codebase.'
| Guides for contributors developing and testing fullsend itself. | ||
|
|
||
| - [Local development](dev/local-dev.md) — Run fullsend agents locally on macOS and Linux (amd64 + arm64) | ||
| - [Go developer cookbook](dev/go-cookbook.md) — Go patterns, mint, inference, forge, and workflow internals for contributors |
There was a problem hiding this comment.
[low] naming-convention
The cookbook entry description does not match the document introduction.
Suggested fix: Align the README entry description with the cookbook introduction.
Cover the two remaining major subsystems: - Sandbox system: container lifecycle, command execution, file transfer with symlink sanitization, provider management, runtime interface, bootstrap sequence, and harness configuration - Security scanner: multi-phase pipeline architecture, scanner implementations (unicode, injection, redactor, SSRF, ONNX), Claude Code hooks, CLI commands, harness security config, and trace/audit system Signed-off-by: Wayne Sun <gsun@redhat.com>
Retro: PR #1995 — Go developer cookbook (docs-only, closed without merge)Timeline: Human contributor ( Review quality assessment:
Signal-to-noise ratio degraded across runs: 40% → 0% → 0%. Existing issue coverage: Several candidate proposals were filtered because they're already covered by open issues:
One novel proposal is included below. Proposals filed
|
Summary
docs/guides/dev/go-cookbook.mdTest plan
make lint)