Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

The tests folder was overlooked during the repository-wide migration to protobuf's Opaque API. Test files continued using direct struct field access, which is incompatible with the opaque message representation.

Changes

  • Regenerated proto files with API_OPAQUE flag (Makefile already configured)
  • Migrated message construction from struct literals to builder pattern
  • Replaced direct field access with getter/setter methods

API Migration Pattern

// Before: Direct struct access
resp := &Response{
    Name: srv.name,
    Num:  req.Num,
}

// After: Builder pattern with getters
resp := Response_builder{
    Name: srv.name,
    Num:  req.GetNum(),
}.Build()

Affected Test Packages

  • config - Configuration and node management
  • correctable - Correctable quorum calls
  • metadata - gRPC metadata handling
  • oneway - Unicast/multicast operations
  • ordering - Message ordering guarantees
  • qf - Quorum function benchmarks
  • tls - TLS authentication

All tests pass with the new API.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>chore: update tests to use protobuf's Opaque API</issue_title>
<issue_description>When we converted the repository to the opaque API, we forgot the different tests in the tests folder. We should fix that. This includes using the new protobuf _builder{Field: ...} instead of directly accessing struct fields, and invoking Build() at the end. In addition, all direct field accesses must use the field's Get and Set methods instead.

We need to run make in the tests folder to generate the new .pb.go files.

Here is an overview of the files to be updated in the tests folder:

$ tree
.
├── config
│   ├── config_gorums.pb.go
│   ├── config_test.go
│   ├── config.pb.go
│   └── config.proto
├── correctable
│   ├── correctable_gorums.pb.go
│   ├── correctable_test.go
│   ├── correctable.pb.go
│   └── correctable.proto
├── dummy
│   ├── dummy_gorums.pb.go
│   ├── dummy.pb.go
│   └── dummy.proto
├── Makefile
├── metadata
│   ├── metadata_gorums.pb.go
│   ├── metadata_test.go
│   ├── metadata.pb.go
│   └── metadata.proto
├── mock
│   ├── mock.pb.go
│   └── mock.proto
├── oneway
│   ├── oneway_gorums.pb.go
│   ├── oneway_test.go
│   ├── oneway.pb.go
│   └── oneway.proto
├── ordering
│   ├── order_gorums.pb.go
│   ├── order_test.go
│   ├── order.pb.go
│   └── order.proto
├── qf
│   ├── qf_gorums.pb.go
│   ├── qf_test.go
│   ├── qf.pb.go
│   ├── qf.proto
│   └── readme.md
├── tls
│   ├── cert.go
│   ├── tls_gorums.pb.go
│   ├── tls_test.go
│   ├── tls.pb.go
│   └── tls.proto
└── unresponsive
    ├── unreponsive_test.go
    ├── unresponsive_gorums.pb.go
    ├── unresponsive.pb.go
    └── unresponsive.proto

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@deepsource-io
Copy link
Contributor

deepsource-io bot commented Nov 13, 2025

Here's the code health analysis summary for commits e2dce59..fb5e27f. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGo✅ Success
🎯 5 occurences resolved
View Check ↗
DeepSource Shell LogoShell✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copilot AI changed the title [WIP] Update tests to use protobuf's Opaque API chore: migrate tests to protobuf Opaque API Nov 13, 2025
Copilot AI requested a review from meling November 13, 2025 22:31
@meling meling marked this pull request as ready for review November 14, 2025 00:11
@meling meling merged commit 87ed370 into master Nov 14, 2025
5 checks passed
@meling meling deleted the copilot/update-tests-to-use-protobuf-api branch November 14, 2025 00:22
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.

chore: update tests to use protobuf's Opaque API

2 participants