Skip to content

docs(#6247): add error-handling and constant-usage conventions to go-code.md - #6248

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/6247-add-error-handling-conventions
Open

docs(#6247): add error-handling and constant-usage conventions to go-code.md#6248
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/6247-add-error-handling-conventions

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds an "Error handling and naming conventions" section to docs/contributing/go-code.md, placed after "Concurrency testing" and before "Running the fullsend CLI". This documents four Go conventions that caused rework on PR #6242 but are not enforceable by linters.

Changes

  • Use typed constants over string literals — use repos.ForgeGitHub/repos.ForgeGitLab instead of raw "github"/"gitlab" strings; search for existing constants before introducing literals
  • Prefer sentinel errors — define package-level var errXxx = errors.New(...) and check with errors.Is; do not use strings.Contains(err.Error(), ...)
  • Use %q for values in error messages — consistent quoting, matches existing patterns in tracker_client.go and forge_client.go
  • Consistent error message content — parallel error paths for different forges should mention the same remediation options

Testing

  • Documentation-only change — no Go code modified, no tests applicable
  • Verified section placement matches issue specification (after "Concurrency testing")
  • Code examples reference real codebase files and patterns
  • Secret scan passed
  • make lint — pre-commit could not run in sandbox (network restriction); post-script runs it authoritatively

Closes #6247

Post-script verification

  • Branch is not main/master (agent/6247-add-error-handling-conventions)
  • Secret scan passed (gitleaks — 3614b61b96067c6afaf8d92bc88899b711eb3330..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

…code.md

Add an "Error handling and naming conventions" section covering four
patterns identified from PR #6242 rework:

1. Use typed constants (e.g., repos.ForgeGitHub) over string literals
2. Prefer sentinel errors with errors.Is over string matching
3. Use %q for values in error messages instead of manual quoting
4. Keep error messages consistent across forges/providers

These conventions are not enforceable by linters and were previously
undocumented, causing repeated review findings on code agent PRs.

Note: pre-commit could not run (sandbox network policy blocked
git fetch during hook environment setup). The post-script runs
pre-commit authoritatively on the runner.

Closes #6247
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 15, 2026 02:34
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Aug 15, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 15, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:35 AM UTC · Completed 2:47 AM UTC

Commit: 6c453c1 · View workflow run →

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://fb2b3115-site.fullsend-ai.workers.dev

Commit: 6c453c10916ee8c6cdf3bd909d627baaf981c0cb

@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me


Labels: PR modifies contributing documentation under docs/contributing/

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/docs User-facing documentation labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation ready-for-merge All reviewers approved — ready to merge ready-for-review Agent PR ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Go error-handling and constant-usage conventions to go-code.md

0 participants