Skip to content

Conversation

@pseudomuto
Copy link
Owner

@pseudomuto pseudomuto commented Oct 16, 2025

This update migrates the codebase from the deprecated github.com/golang/protobuf (v1) to the modern google.golang.org/protobuf (v2) API to ensure long-term compatibility and access to latest protobuf features.

Key changes:

  • Updated go.mod to use google.golang.org/protobuf v1.36.10
  • Migrated import paths from github.com/golang/protobuf/* to google.golang.org/protobuf/*
  • Updated type references from descriptor.* to descriptorpb.*
  • Changed plugin types from plugin_go.* to pluginpb.*
  • Replaced deprecated google.golang.org/genproto with google.golang.org/genproto/googleapis/api
  • Modernized extension handling to work with v2's reflection API
  • Implemented custom protobuf parser for OptionExtensions backward compatibility
  • Updated test suite to handle v2 API changes (parallel execution, error messages)
  • Fixed import organization and code formatting

The migration maintains full API compatibility while providing access to the modern protobuf ecosystem. All existing functionality continues to work, including the OptionExtensions feature which required custom parsing logic to bridge v1/v2 differences.

Breaking changes: None for public APIs
Tests: All passing (17/17)
Lint: Clean

@pseudomuto pseudomuto requested a review from Copilot October 16, 2025 14:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the protobuf dependencies by migrating from the deprecated github.com/golang/protobuf (v1) to the modern google.golang.org/protobuf (v2) API. The migration ensures long-term compatibility and access to the latest protobuf features while maintaining full API compatibility.

  • Replaced all import paths from v1 to v2 protobuf libraries
  • Implemented custom protobuf extension parsing to maintain backward compatibility
  • Updated test suite to use modern testing patterns with parallel execution

Reviewed Changes

Copilot reviewed 26 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
go.mod Updated dependencies from v1 to v2 protobuf, bumped Go version to 1.25.1
types.go Added complex custom extension parsing logic for v2 API compatibility
utils/protobuf.go Migrated import paths and replaced deprecated ioutil with os.ReadFile
parser.go Updated import paths and improved string formatting with strconv.Itoa
plugin.go Replaced deprecated ioutil.ReadAll with io.ReadAll and fmt.Errorf with errors.New
*_test.go Modernized tests with parallel execution and require assertions
utils/strings.go Removed entire utility file and associated tests
version.go Removed version constant file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

This update migrates the codebase from the deprecated github.com/golang/protobuf
(v1) to the modern google.golang.org/protobuf (v2) API to ensure long-term
compatibility and access to latest protobuf features.

Key changes:
- Updated go.mod to use google.golang.org/protobuf v1.36.10
- Migrated import paths from github.com/golang/protobuf/* to google.golang.org/protobuf/*
- Updated type references from descriptor.* to descriptorpb.*
- Changed plugin types from plugin_go.* to pluginpb.*
- Replaced deprecated google.golang.org/genproto with google.golang.org/genproto/googleapis/api
- Modernized extension handling to work with v2's reflection API
- Implemented custom protobuf parser for OptionExtensions backward compatibility
- Updated test suite to handle v2 API changes (parallel execution, error messages)
- Fixed import organization and code formatting

The migration maintains full API compatibility while providing access to the
modern protobuf ecosystem. All existing functionality continues to work,
including the OptionExtensions feature which required custom parsing logic
to bridge v1/v2 differences.

Breaking changes: None for public APIs
Tests: All passing (17/17)
Lint: Clean
@pseudomuto pseudomuto merged commit 6fb15d9 into master Oct 21, 2025
3 checks passed
@pseudomuto pseudomuto deleted the modernize branch October 21, 2025 13:20
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