Skip to content

fix(yaml): correctly write signed enum values - #7470

Merged
pfeerick merged 1 commit into
mainfrom
pfeerick/fix-antenna-mode-ask
Jun 18, 2026
Merged

pfeerick merged 1 commit into
mainfrom
pfeerick/fix-antenna-mode-ask

Conversation

@pfeerick

@pfeerick pfeerick commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

Handle signed enum values in yaml_tree_walker. AntennaMode is the outlier in question - and appears to have been broken since we moved to yaml.

Discovered during v12 antennamode refactoring.

There are several old issues that somewhat hint at this, but were more about UI crashes and inconsistencies, none seemed to pick this up.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved YAML serialization handling for enum-typed fields to ensure proper conversion in edge cases where standard conversion may not yield output.

Handle signed enum values in yaml_tree_walker. AntennaMode is the outlier in question - and appears to have been broken since we moved to yaml. 

Discovered during v12 antennamode refactoring.
@pfeerick pfeerick added the bug/regression ↩️ A new version of EdgeTX broke something label Jun 18, 2026
@pfeerick pfeerick added this to the 2.11.7 milestone Jun 18, 2026
@pfeerick pfeerick added backport/2.11 To be backported to a 2.11 release also. backport/2.12 To be backported to a 2.12 release also. labels Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c1e077a1-fd67-4af4-8825-d7b492a78044

📥 Commits

Reviewing files that changed from the base of the PR and between f13f049 and 1c2e780.

📒 Files selected for processing (1)
  • radio/src/storage/yaml/yaml_tree_walker.cpp

📝 Walkthrough

Walkthrough

In yaml_output_attr, a fallback is added for enum-typed field serialization: if yaml_output_enum returns no output string for the raw value, the stored bits are reinterpreted as a signed integer via yaml_to_signed, and yaml_output_enum is retried with that signed value.

Changes

Signed enum fallback in YAML serialization

Layer / File(s) Summary
Signed enum fallback in yaml_output_attr
radio/src/storage/yaml/yaml_tree_walker.cpp
If yaml_output_enum returns no string for a raw enum value, the bits are reinterpreted as a signed integer and yaml_output_enum is retried.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description explains the bug context and discovery but lacks the required template structure, missing issue reference and formal 'Summary of changes' section. Add 'Fixes #' reference and use the repository's description template with clearly labeled sections.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding fallback logic to correctly serialize signed enum values in YAML output.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pfeerick/fix-antenna-mode-ask

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pfeerick
pfeerick merged commit d67604f into main Jun 18, 2026
40 checks passed
@pfeerick
pfeerick deleted the pfeerick/fix-antenna-mode-ask branch June 18, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.11 To be backported to a 2.11 release also. backport/2.12 To be backported to a 2.12 release also. bug/regression ↩️ A new version of EdgeTX broke something

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant