Skip to content

Remove generated protobuf code from git tracking and add cross-platform Makefile build system - #2

Merged
JonasGao merged 13 commits into
mainfrom
copilot/remove-gen-directories
Feb 1, 2026
Merged

JonasGao merged 13 commits into
mainfrom
copilot/remove-gen-directories

Conversation

Copilot AI commented Dec 13, 2025 •

Copy link
Copy Markdown

This PR removes auto-generated protobuf code directories from git tracking and introduces a comprehensive cross-platform Makefile build system to manage code generation and builds.

Changes Made

Generated Files Management

  • Added gen/go/ and webui/gen/ts/ to .gitignore
  • Removed 26 generated protobuf files from git index while preserving them on filesystem
  • Generated code will now be excluded from version control and regenerated automatically during builds

Build System

  • Added a comprehensive cross-platform Makefile with organized targets:
    • Main targets: all (default), build, run, dev
    • Component builds: build-go, build-ui, build-ui-windows
    • Dependency management: install-deps, install-deps-go, install-deps-ui (using pnpm)
    • Code generation: generate-proto - runs buf generate directly (cross-platform)
    • Testing: test, test-go
    • Cleanup: clean to remove build artifacts
    • Help: make help displays comprehensive usage information
  • Build dependencies properly structured:
    • build target depends on generate-proto and build-go
    • build-go depends on build-ui (to ensure UI artifacts are available for embedding)
  • Removed proto/update.sh shell script and integrated buf generate command directly into Makefile for Windows compatibility
  • All Makefile targets use pnpm instead of npm to align with the project's existing pnpm-lock.yaml
  • Updated README.md with instructions for using the new Makefile

CI/CD Workflows

  • Created reusable composite action (.github/actions/setup-build-deps) to centralize dependency installation and protobuf generation
  • Updated test workflows (test-nix and test-win) to use the composite action, eliminating code duplication
  • Updated release workflow (reusable-release.yml) to use the composite action for consistent setup
  • Added protobuf file generation step before building in CI
  • Added sqlite3_dotlk build tags to match Makefile configuration
  • Updated .goreleaser.yaml to use environment variables (GITHUB_OWNER, PROJECT_NAME) for dynamic repository configuration, allowing the release process to adapt to any forked repository

Benefits

  • Cross-platform compatibility: All build commands work on Windows, Linux, and macOS
  • Automated proto generation: Protobuf files are automatically generated during builds
  • Consistent package management: Uses pnpm throughout for consistency
  • Flexible release configuration: GoReleaser now dynamically adapts to the current repository owner and name
  • Improved developer experience: Clear documentation and organized build targets via make help
  • DRY workflows: Reusable composite action eliminates duplication of setup steps across CI/CD workflows
Original prompt

remove and ignore directories gen/go and webui/gen/ts


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Remove and ignore directories gen/go and webui/gen/ts Remove generated protobuf code from git tracking Dec 13, 2025
Copilot AI requested a review from JonasGao December 13, 2025 13:15
@JonasGao

Copy link
Copy Markdown

@copilot Add a makefile mechanism to organize Go builds and npm builds.

Copilot AI commented Dec 16, 2025

Copy link
Copy Markdown
Author

@copilot Add a makefile mechanism to organize Go builds and npm builds.

Added a comprehensive Makefile with targets for building Go backend (make build-go), building npm UI (make build-ui), installing dependencies (make install-deps), running tests (make test), and cleaning artifacts (make clean). Run make help for all available commands. Updated README.md with build instructions. (465627c)

Copilot AI changed the title Remove generated protobuf code from git tracking Remove generated protobuf code from git tracking and add Makefile build system Dec 16, 2025
@JonasGao

Copy link
Copy Markdown

@copilot replace npm to pnpm in makefile

@JonasGao

Copy link
Copy Markdown

@copilot remove proto/update.sh, move the commands to makefile, and update commands in makefile to adapter windows.

Copilot AI commented Jan 25, 2026

Copy link
Copy Markdown
Author

@copilot replace npm to pnpm in makefile

Replaced all npm references with pnpm in the Makefile (install-deps-ui, build-ui, build-ui-windows, dev, clean targets) and updated the manual build instructions in README.md to use pnpm. (86b29dc)

Copilot AI commented Jan 25, 2026

Copy link
Copy Markdown
Author

@copilot remove proto/update.sh, move the commands to makefile, and update commands in makefile to adapter windows.

Removed proto/update.sh and moved the buf generate command directly into the Makefile's generate-proto target. The command cd proto && buf generate is now cross-platform compatible and works on Windows, Linux, and macOS. Updated help text to remove Unix/Linux/macOS limitation. (45a15f8)

Copilot AI changed the title Remove generated protobuf code from git tracking and add Makefile build system Remove generated protobuf code from git tracking and add cross-platform Makefile build system Jan 25, 2026
Copilot AI and others added 6 commits January 25, 2026 20:49
Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
…ile for cross-platform support

Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
@JonasGao
JonasGao force-pushed the copilot/remove-gen-directories branch from 45a15f8 to 0f8f094 Compare January 25, 2026 12:50
@JonasGao
JonasGao marked this pull request as ready for review January 30, 2026 15:07
@JonasGao

Copy link
Copy Markdown

@copilot fix these test actions

Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>

Copilot AI commented Jan 31, 2026

Copy link
Copy Markdown
Author

@copilot fix these test actions

Fixed test workflows for both Unix and Windows by:

  1. Installing buf and all required protoc plugins (protoc-gen-go, protoc-gen-go-grpc, protoc-gen-connect-go, protoc-gen-es)
  2. Adding Node.js setup to install protoc-gen-es via npm
  3. Generating protobuf files before building with buf generate
  4. Adding sqlite3_dotlk build tags to match the Makefile configuration

The test workflows will now generate the required protobuf files that were removed from git tracking. (4d13b38)

Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Copilot AI requested a review from JonasGao January 31, 2026 14:29
@JonasGao

JonasGao commented Feb 1, 2026

Copy link
Copy Markdown

@copilot the test actions still has errors, please read the latest test actions error and fix them.

…installation

Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>

Copilot AI commented Feb 1, 2026

Copy link
Copy Markdown
Author

@copilot the test actions still has errors, please read the latest test actions error and fix them.

Fixed the test workflow errors. The issue was that pnpm requires running pnpm setup to configure the global bin directory after installation, which was causing failures in both Unix and Windows tests.

Changed the workflow to use npm for installing protoc-gen-es instead of pnpm, which is simpler and avoids the global bin directory configuration issue. This is acceptable since the workflow only needs to install a single global package, and npm is already available by default in GitHub Actions runners. (16d0a6f)

Copilot AI requested a review from JonasGao February 1, 2026 05:49
@JonasGao

JonasGao commented Feb 1, 2026

Copy link
Copy Markdown

@copilot fix .github/workflows/release-preview.yml, add protobuf setups, and update .goreleaser.yaml to use env to adpater current project name and group name.

… env variables for repo owner/name

Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>

Copilot AI commented Feb 1, 2026

Copy link
Copy Markdown
Author

@copilot fix .github/workflows/release-preview.yml, add protobuf setups, and update .goreleaser.yaml to use env to adpater current project name and group name.

Fixed release-preview.yml and .goreleaser.yaml:

Protobuf setup in release workflow:

  • Added buf installation and protoc plugins (protoc-gen-go, protoc-gen-go-grpc, protoc-gen-connect-go)
  • Added protoc-gen-es installation via npm
  • Added protobuf generation step before running GoReleaser

Environment variables in .goreleaser.yaml:

  • Added GITHUB_OWNER and PROJECT_NAME environment variables with fallback defaults
  • Updated all Docker image templates to use {{ .Env.GITHUB_OWNER }}/{{ .Env.PROJECT_NAME }}
  • Updated all docker manifests to use environment variables
  • Updated brews and release sections to use environment variables
  • Added GITHUB_REPOSITORY_OWNER and PROJECT_NAME to reusable-release.yml workflow env

The configuration now dynamically adapts to the current repository owner and name from GitHub context. (884ad9e)

@JonasGao JonasGao left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot extracte project's dependency installation and protobuf generation preparations unified into a single workflow definition, allowing other workflows to reference it.

… composite action

Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>

Copilot AI commented Feb 1, 2026

Copy link
Copy Markdown
Author

@copilot extracte project's dependency installation and protobuf generation preparations unified into a single workflow definition, allowing other workflows to reference it.

Created a reusable composite action at .github/actions/setup-build-deps/action.yml that handles all dependency installation and protobuf generation:

Composite Action Features:

  • Configurable Go version (default: 1.24)
  • Configurable Node.js version (default: 20)
  • Optional pnpm setup with configurable version
  • Installs buf and all protoc plugins (protoc-gen-go, protoc-gen-go-grpc, protoc-gen-connect-go, protoc-gen-es)
  • Generates protobuf files automatically

Updated Workflows:

  • test.yml (both test-nix and test-win jobs) now use the composite action
  • reusable-release.yml now uses the composite action with pnpm enabled

This eliminates code duplication across workflows and makes it easier to maintain dependency setup in one central location. (b182ca8)

Copilot AI requested a review from JonasGao February 1, 2026 06:41
@JonasGao
JonasGao merged commit 2df556d into main Feb 1, 2026
4 checks passed
@JonasGao
JonasGao deleted the copilot/remove-gen-directories branch February 1, 2026 07:45
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.

3 participants