Skip to content

feat: add --vendor-fullsend-binary for dev iteration - #277

Closed
ralphbean wants to merge 6 commits into
mainfrom
feature/vendor-binary
Closed

feat: add --vendor-fullsend-binary for dev iteration#277
ralphbean wants to merge 6 commits into
mainfrom
feature/vendor-binary

Conversation

@ralphbean

Copy link
Copy Markdown
Member

Summary

  • Adds --vendor-fullsend-binary flag to fullsend admin install
  • When set, cross-compiles the fullsend binary for linux/amd64 and uploads it to .fullsend/bin/fullsend
  • The GitHub Action (action.yml) checks for a vendored binary before downloading from releases
  • Enables rapid dev iteration without cutting a release — just make go-build && ./bin/fullsend admin install --vendor-fullsend-binary ...

Test plan

  • go vet ./... passes
  • go test -race ./... passes (all packages)
  • make lint passes
  • New flag test in admin_test.go

🤖 Generated with Claude Code

When passed to `fullsend admin install`, cross-compiles the fullsend
binary for linux/amd64 and uploads it to .fullsend/bin/fullsend. The
GitHub Action checks for a vendored binary before downloading from
releases, enabling rapid iteration without cutting a release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 20, 2026

Copy link
Copy Markdown

Site preview

Preview: https://0a36d2ca-site.fullsend-ai.workers.dev

Commit: f6cba5050227f71fe232344376db2c40dfb38b6a

GitHub's Contents API does not preserve file permissions, so the
vendored binary needs chmod +x after copying. Check -f not -x.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address code review findings on the vendor-fullsend-binary feature:

Security:
- Gate vendored binary in action.yml behind FULLSEND_USE_VENDORED_BINARY
  repo variable (must be "true") to prevent supply chain attacks
- Use minimal allowlisted env for go build subprocess to avoid leaking
  GH_TOKEN and other sensitive variables
- Validate vendored binary with `fullsend version` before trusting it

Correctness:
- Use full module path instead of relative ./cmd/fullsend/ to fix CWD
  dependency that broke builds from non-root directories
- Add 100MB size check before GitHub Contents API upload
- Set FULLSEND_USE_VENDORED_BINARY=true on vendor, =false on normal
  install to prevent stale dev binaries persisting into production
- Reject --vendor-fullsend-binary with --dry-run instead of silently
  ignoring the flag
- Fix float formatting for binary size display (was showing "0 MB")

Docs/style:
- Fix misleading flag description and doc comment path references
- Move vendorFullsendBinary to helper section, not between constructors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix double-marshal bug: pass payload map directly to do() instead of
  manually marshaling and wrapping in bytes.NewReader
- Add checkStatus calls for both GET (SHA fetch) and DELETE responses
- Add DeleteFile stub to FakeClient so the project compiles
- Add doc comment for DeleteFile on the forge.Client interface
- Add else branch in runInstall to remove vendored binary when
  --vendor-fullsend-binary is not passed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use defer resp.Body.Close() for consistency with other methods
- Add DeletedFiles call recorder to FakeClient (matches DeletedRepos pattern)
- Add DeleteFile to error injection and thread safety tests in fake_test.go
- Add LiveClient.DeleteFile unit tests: happy path and idempotent 404

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the binary upload logic into an exported layers.VendorBinary
function so it can be called from both the CLI and e2e tests. The CLI
retains the cross-compilation, size check, and repo variable logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ralphbean

Copy link
Copy Markdown
Member Author

This got merged as a part of #279

@ralphbean ralphbean closed this Apr 21, 2026
@ben-alkov
ben-alkov deleted the feature/vendor-binary branch April 23, 2026 16:58
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