Skip to content

Comments

feat: dev cli in go#367

Draft
shadowfax92 wants to merge 1 commit intomainfrom
feat/dev-cli-in-go
Draft

feat: dev cli in go#367
shadowfax92 wants to merge 1 commit intomainfrom
feat/dev-cli-in-go

Conversation

@shadowfax92
Copy link
Contributor

No description provided.

@shadowfax92
Copy link
Contributor Author

@greptileai review pls

@greptile-apps
Copy link

greptile-apps bot commented Feb 16, 2026

Greptile Summary

This PR implements a comprehensive Go-based CLI tool (bros) to replace existing build and development tooling, adding ~9000 lines of production-quality code across 59 files.

Major Components:

  • Build Pipeline: Complete Chromium build orchestration with modular phases (setup, prep, build, sign, package, upload)
  • Dev Tools: Patch development workflow with feature classification, annotation, and git integration
  • Release Automation: GitHub release creation, artifact management, and R2 storage integration
  • OTA Updates: Sparkle-based update system with appcast generation and binary signing
  • Cross-Platform Signing: macOS notarization, Windows eSigner integration, and Linux packaging

Code Quality:

  • Well-structured with clear separation of concerns
  • Comprehensive error handling with custom exit codes
  • Unit tests for critical components (R2 client, appcast generation, version comparison)
  • Proper resource cleanup with defer statements throughout
  • Environment variable management with .env file support

Key Features:

  • Modular build system with 19+ configurable modules
  • Multi-platform support (macOS arm64/x64, Windows, Linux)
  • Universal binary creation for macOS
  • Cloudflare R2 integration for artifact storage
  • GitHub CLI integration for release automation

Confidence Score: 4/5

  • This PR is safe to merge with minor considerations for production deployment
  • The implementation is well-structured with good error handling, proper resource cleanup, and unit tests for critical components. Code follows Go best practices with clear separation of concerns. Score is 4 (not 5) due to the large scope (~9000 lines), sensitive credential handling in signing operations, and platform-specific code that requires testing across all target environments before production use
  • Pay close attention to credential-handling files (sign_macos.go, sign_windows_impl.go, sign_binary.go) and ensure proper secrets management in production environments

Important Files Changed

Filename Overview
packages/browseros/tools/bros/cmd/root.go Implements root command using Cobra with proper silence settings for clean output
packages/browseros/tools/bros/cmd/build.go Adds build command with comprehensive flags for phases, modules, and configuration
packages/browseros/tools/bros/cmd/dev.go Implements patch development commands with feature management and annotation support
packages/browseros/tools/bros/cmd/release.go Implements release automation with GitHub, appcast, and OTA commands
packages/browseros/tools/bros/internal/native/r2/client.go Implements Cloudflare R2 client with S3-compatible operations and version sorting
packages/browseros/tools/bros/internal/native/build/run.go Orchestrates build pipeline with module execution and phase-based organization
packages/browseros/tools/bros/internal/native/build/modules.go Implements all build modules from git setup through compilation and packaging
packages/browseros/tools/bros/internal/native/build/sign_macos.go Implements macOS code signing and notarization with proper credential handling
packages/browseros/tools/bros/internal/native/build/sign_windows_impl.go Implements Windows code signing using eSigner with TOTP authentication
packages/browseros/tools/bros/internal/native/ota/sign_binary.go Signs and notarizes binaries for all platforms with proper credential validation
packages/browseros/tools/bros/internal/native/release/github.go Creates GitHub releases with artifact uploads using gh CLI

Flowchart

flowchart TD
    Start([bros CLI]) --> Root{Command}
    
    Root -->|build| Build[Build Command]
    Root -->|dev| Dev[Dev Command]
    Root -->|release| Release[Release Command]
    Root -->|ota| OTA[OTA Command]
    
    Build --> BuildMode{Mode}
    BuildMode -->|--config| ConfigMode[YAML Config]
    BuildMode -->|--modules| ModulesMode[Module List]
    BuildMode -->|phase flags| PhaseMode[Phase Flags]
    
    ConfigMode --> BuildCtx[Build Context]
    ModulesMode --> BuildCtx
    PhaseMode --> BuildCtx
    
    BuildCtx --> Pipeline[Module Pipeline]
    Pipeline --> Setup[Setup Phase]
    Pipeline --> Prep[Prep Phase]
    Pipeline --> BuildPhase[Build Phase]
    Pipeline --> Sign[Sign Phase]
    Pipeline --> Package[Package Phase]
    Pipeline --> Upload[Upload Phase]
    
    Setup --> GitSetup[Git Setup]
    Setup --> SparkleSetup[Sparkle Setup]
    
    Prep --> Patches[Apply Patches]
    Prep --> Resources[Copy Resources]
    Prep --> Configure[GN Configure]
    
    BuildPhase --> Compile[Autoninja Compile]
    
    Sign --> SignOS{OS}
    SignOS -->|macOS| SignMac[Code Sign + Notarize]
    SignOS -->|Windows| SignWin[eSigner + TOTP]
    SignOS -->|Linux| SignLinux[No-op]
    
    Package --> PackageOS{OS}
    PackageOS -->|macOS| DMG[Create DMG]
    PackageOS -->|Windows| Installer[Mini Installer]
    PackageOS -->|Linux| AppImage[AppImage + deb]
    
    Upload --> R2Upload[Upload to R2]
    
    Dev --> DevCmd{Subcommand}
    DevCmd -->|status| DevStatus[Show Status]
    DevCmd -->|annotate| DevAnnotate[Create Commits]
    DevCmd -->|feature| DevFeature[Feature Mgmt]
    
    DevFeature --> FeatureList[List Features]
    DevFeature --> FeatureShow[Show Feature]
    DevFeature --> FeatureAdd[Add/Update]
    DevFeature --> FeatureClassify[Classify Patches]
    
    Release --> ReleaseCmd{Subcommand}
    ReleaseCmd -->|list| ReleaseList[List Versions]
    ReleaseCmd -->|appcast| Appcast[Generate XML]
    ReleaseCmd -->|publish| Publish[Publish to CDN]
    ReleaseCmd -->|download| Download[Download Artifacts]
    ReleaseCmd -->|github| GitHub[GitHub Release]
    
    GitHub --> GHCreate[Create Release]
    GHCreate --> GHUpload[Upload Assets]
    
    OTA --> OTACmd{Subcommand}
    OTACmd -->|server release| ServerRelease[Server OTA]
    OTACmd -->|publish-appcast| PublishAppcast[Publish Appcast]
    OTACmd -->|test-signing| TestSign[Test Signing]
    
    ServerRelease --> SignBinary[Sign Binary]
    ServerRelease --> CreateZip[Create Zip]
    ServerRelease --> SparkleSign[Sparkle Sign]
    ServerRelease --> UploadOTA[Upload to R2]
    
    R2Upload --> R2[Cloudflare R2]
    UploadOTA --> R2
    Publish --> R2
    Download --> R2
Loading

Last reviewed commit: d215ff5

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.

1 participant