Add GitHub Action to detect Parameter Group version increment issues#11272
Merged
sensei-hacker merged 2 commits intoiNavFlight:maintenance-9.xfrom Jan 22, 2026
Merged
Conversation
Create automated check that runs on PRs to detect when parameter group structs are modified without incrementing the version number. This prevents settings corruption issues like those seen in PR iNavFlight#11236. Detection logic: - Scans changed C/H files for PG_REGISTER entries - Detects struct typedef modifications in git diff - Verifies version parameter was incremented - Posts helpful comment if version not incremented Files added: - .github/scripts/check-pg-versions.sh - Detection script - .github/workflows/pg-version-check.yml - Workflow definition - .github/workflows/README.md - Workflow documentation The check is non-blocking (comment only) to avoid false positive build failures, but provides clear guidance on when versions must be incremented.
Contributor
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
Improve PG version check robustness and efficiency per Qodo feedback: 1. Struct detection: Use sed/grep pipeline to better filter comments and whitespace, reducing false positives. Isolates struct body boundaries more reliably before checking for modifications. 2. File iteration: Use while/read loop instead of for loop to correctly handle filenames that contain spaces. 3. Workflow efficiency: Capture script output once and pass between steps using GITHUB_OUTPUT multiline strings, eliminating redundant execution. Changes reduce false positives and improve compatibility while maintaining the same detection logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Add automated CI check that detects when parameter group structs are modified without incrementing the version number. This prevents settings corruption issues like the one highlighted in PR #11236.
Changes
.github/scripts/check-pg-versions.sh- Detection script that analyzes git diffs.github/workflows/pg-version-check.yml- GitHub Actions workflow.github/workflows/README.md- Documentation for all workflowsHow It Works
PG_REGISTERentriesDetection Logic
The script:
PG_REGISTERlinestypedef structdefinitionsComment Behavior
Example Scenarios
Scenario 1: Field removed without version increment ✅ Detects
Result:⚠️ Comment posted explaining the issue
Scenario 2: Field removed with proper version increment ✅ No comment
Result: ✅ No comment (correct behavior detected)
Scenario 3: Only PG_RESET_TEMPLATE defaults changed ✅ No comment
Result: ✅ No comment (struct layout unchanged)
Why This Matters
When PG struct layout changes without version increment:
pgLoad()sees matching versions (4==4) and copies old EEPROM dataWith version increment (4→5):
pgLoad()detects version mismatchReferences
Related Work
This automation follows the PG system documentation created in PR #11271.