Skip to content

protogen(BREAKING)!: support multiple union type definitions in a sheet#176

Merged
Kybxd merged 5 commits intomasterfrom
multi-union-definitions-in-sheet
Feb 15, 2025
Merged

protogen(BREAKING)!: support multiple union type definitions in a sheet#176
Kybxd merged 5 commits intomasterfrom
multi-union-definitions-in-sheet

Conversation

@wenchy
Copy link
Copy Markdown
Member

@wenchy wenchy commented Feb 14, 2025

❗BREAKING CHANGE

In file proto/tableau/protobuf/tableau.proto, we changed the union option type from bool to UnionOptions for more better extensibility and design consistency.

Old:

extend google.protobuf.MessageOptions {
  WorksheetOptions worksheet = 50000;
  bool union = 50001;
}

New:

extend google.protobuf.MessageOptions {
  WorksheetOptions worksheet = 50000;
  StructOptions struct = 50001;
  UnionOptions union = 50002;
}

message StructOptions {
  string name = 1;  // Worksheet name.
  string note = 2;  // Struct type note. Maybe in another language (Chinese).
}

message UnionOptions {
  string name = 1;   // Worksheet name.
  string note = 2;   // Oneof note, maybe in another language (Chinese).
}

Compatibility resolution

  • If union type is defined in a sheet, please regenerate all union types.
  • If union type is defined in proto file, then change the union option from bool to UnionOptions. For example:
    image

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 78.01047% with 42 lines in your changes missing coverage. Please review.

Project coverage is 63.56%. Comparing base (6039b69) to head (0f31aba).
Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
internal/protogen/protogen.go 54.54% 12 Missing and 13 partials ⚠️
internal/protogen/sheet_mode.go 85.34% 11 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
- Coverage   63.62%   63.56%   -0.07%     
==========================================
  Files          75       75              
  Lines       10162    10191      +29     
==========================================
+ Hits         6466     6478      +12     
- Misses       3096     3106      +10     
- Partials      600      607       +7     

☔ View full report in Codecov by Sentry.
📢 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.

@wenchy wenchy changed the title protogen: support multiple union type definitions in a sheet protogen(BREAKING)!: support multiple union type definitions in a sheet Feb 14, 2025
@Kybxd Kybxd merged commit 3a1cdc4 into master Feb 15, 2025
@Kybxd Kybxd deleted the multi-union-definitions-in-sheet branch February 15, 2025 02:08
@wenchy wenchy mentioned this pull request Sep 25, 2024
42 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

protogen: support multiple union type definitions in a sheet

2 participants