Skip to content

refactor: Simplify union message field parsing and fix incell list field properties#388

Open
Kybxd wants to merge 1 commit intomasterfrom
parse-list
Open

refactor: Simplify union message field parsing and fix incell list field properties#388
Kybxd wants to merge 1 commit intomasterfrom
parse-list

Conversation

@Kybxd
Copy link
Copy Markdown
Collaborator

@Kybxd Kybxd commented Apr 13, 2026

Summary

This PR refactors the union message field parsing logic and fixes issues with incell list field properties. The changes simplify the code structure and improve maintainability.

Changes Made

Core Refactoring

  • Simplified parseIncellList function: Removed the separate parseListElems function and merged its logic directly into parseIncellList
  • Streamlined parseUnionMessageField: Simplified the union field parsing logic for better readability
  • Removed fixed size list handling: Eliminated complex fixed size list logic that was no longer needed

Key Files Modified

  • internal/confgen/parser.go - Major refactoring of incell list and union message field parsing
  • internal/confgen/table_parser.go - Minor adjustments to maintain consistency
  • internal/protogen/ files - Corresponding updates in protogen package
  • Test files - Updated test data to reflect the changes

Technical Details

  • Function signature changes: parseIncellList now returns only error instead of (bool, error)
  • Code simplification: Reduced code duplication by merging related functions
  • Improved error handling: More consistent error reporting across parsing functions

Testing

  • All existing tests pass with the refactored code
  • No functional changes to the parsing behavior
  • Maintains backward compatibility with existing configuration files

This refactoring makes the codebase more maintainable and easier to understand while preserving all existing functionality.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 84.31373% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.13%. Comparing base (5a4e7fc) to head (7e3e4bc).

Files with missing lines Patch % Lines
internal/confgen/parser.go 77.77% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #388      +/-   ##
==========================================
+ Coverage   74.05%   74.13%   +0.07%     
==========================================
  Files          87       87              
  Lines        8819     8798      -21     
==========================================
- Hits         6531     6522       -9     
+ Misses       1718     1710       -8     
+ Partials      570      566       -4     

☔ 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.

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