Skip to content

chore(xmtp_proto): canonicalize generated protos to sorted input order - #3849

Merged
tylerhawkes merged 1 commit into
mainfrom
tyler/proto-gen-canonicalize
Jul 13, 2026
Merged

chore(xmtp_proto): canonicalize generated protos to sorted input order#3849
tylerhawkes merged 1 commit into
mainfrom
tyler/proto-gen-canonicalize

Conversation

@tylerhawkes

@tylerhawkes tylerhawkes commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

One-time canonicalization of the checked-in generated protos to the sorted input order introduced by the parent PR, plus a proto_version correction. Stacked on tyler/proto-gen-sort.

Two things worth knowing:

  • proto_version was stale. The checked-in gen files already contain the add TaskRunner scheduling protos: PullInDeadline, KpRotation, KpDeletion proto#339 TaskRunner messages (PullInDeadline, KpRotation, KpDeletion — used by worker/tasks.rs and friends), but the pin still pointed at f04e01a9, which predates them. A pin-faithful regen would have deleted types the workspace uses. This PR moves the pin to b51de7f3 (Group members listing #339), the rev the files actually correspond to.
  • The reorder is provably content-free. Only xmtp.xmtpv4.message_api.rs was sitting in non-canonical order (plus the descriptor blob, which records file order). Old and new files hash identically after line-sorting — pure reordering, zero semantic change. Everything else was already canonical.

Verified: regen run twice produces no further changes; cargo check -p xmtp_proto -p xmtp_mls green.

🤖 Generated with Claude Code

https://claude.ai/code/session_017AVuJ7VAgen2fFhtJQ6zid

Note

Canonicalize generated protos in xmtp_proto to sorted input order

Regenerates protobuf output in xmtp.xmtpv4.message_api.rs and the binary descriptor after updating the proto commit hash to b51de7f3f89cb872ea4044544ad0c12c9373b00f. The only changes are reordering of emitted server module blocks (NotificationApiServer, PublishApiServer, MisbehaviorApiServer) to match sorted input order; service names, method paths, and request/response types are unchanged.

Macroscope summarized 3096f13.

@tylerhawkes
tylerhawkes requested a review from a team as a code owner July 13, 2026 21:17
@claude

claude Bot commented Jul 13, 2026

Copy link
Copy Markdown

Claude finished @tylerhawkes's task —— View job


Code Review Complete ✓

Review Date: 2026-07-13 21:36 UTC

Tasks

  • Read and analyze changed files
  • Verify proto_version update
  • Review xmtp.xmtpv4.message_api.rs changes
  • Formulate review feedback
  • Post final review

Review Summary

This PR accomplishes what it claims: a pure canonicalization of generated protobuf code to match sorted input order, plus a proto_version correction. The changes are mechanical and low-risk.

Findings

✅ Proto Version Correction (proto_version)

The update from f04e01a9b51de7f3 is correct and addresses a legitimate staleness issue. The TaskRunner types (PullInDeadline, KpRotation, KpDeletion) were added in PR #3805 but the proto_version wasn't updated at that time. This PR fixes that discrepancy.

Location: crates/xmtp_proto/proto_version:1

✅ Pure Module Reordering (xmtp.xmtpv4.message_api.rs)

The changes are exactly as described: reordering of server module implementations to match sorted input order. The diff shows:

  • misbehavior_api_server moved before notification_api_server
  • publish_api_server remains after notification_api_server
  • 445 lines deleted, 445 lines added (zero net change)
  • No changes to struct definitions, method signatures, or service implementations

Location: crates/xmtp_proto/src/gen/xmtp.xmtpv4.message_api.rs

✅ Binary Descriptor Update (proto_descriptor.bin)

The descriptor blob changed from 386,348 → 385,679 bytes (~669 byte reduction), consistent with the file order change. This is expected when protobuf file ordering changes.

Location: crates/xmtp_proto/src/gen/proto_descriptor.bin

Code Quality Assessment

  • Best Practices: ✅ Following through on deterministic codegen from parent PR
  • Potential Bugs: ✅ None identified (pure reordering)
  • Performance: ✅ No runtime impact (generated code only)
  • Security: ✅ No security implications
  • Test Coverage: ✅ Author verified cargo check -p xmtp_proto -p xmtp_mls passes

Recommendation

LGTM - This is a clean-up PR that makes the generated code match the new canonical ordering. The proto_version correction is particularly valuable as it prevents future confusion about which proto definitions are actually in use.

No action items identified.


macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 13, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Build infrastructure change that adds sorting to proto file processing for deterministic code generation. The large diff is auto-generated proto code reordered by the new sorting. Author owns all changed files.

You can customize Macroscope's approvability policy. Learn more.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.21%. Comparing base (87b55b8) to head (ba60fc1).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           tyler/proto-gen-sort    #3849      +/-   ##
========================================================
- Coverage                 85.24%   85.21%   -0.04%     
========================================================
  Files                       413      413              
  Lines                     64733    64733              
========================================================
- Hits                      55183    55161      -22     
- Misses                     9550     9572      +22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from tyler/proto-gen-sort to main July 13, 2026 21:51
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 13, 2026 21:51

Dismissing prior approval to re-evaluate ba60fc1

@tylerhawkes
tylerhawkes force-pushed the tyler/proto-gen-canonicalize branch from ba60fc1 to 3096f13 Compare July 13, 2026 21:53
@tylerhawkes
tylerhawkes enabled auto-merge (squash) July 13, 2026 21:58
@tylerhawkes
tylerhawkes merged commit 95ef3bd into main Jul 13, 2026
42 checks passed
@tylerhawkes
tylerhawkes deleted the tyler/proto-gen-canonicalize branch July 13, 2026 22:01
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