Correct partition index loop in translate.go#722
Conversation
Fix loop to start from the next partition index.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughRoot partition constraint checks across FCOS v1.3 through v1.8 experimental translations now inspect only partitions after the root partition. Regression tests cover final root partitions with explicitly sized preceding partitions and expect no warning. ChangesRoot partition constraint validation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request optimizes the partition iteration logic in config/fcos/v1_5/translate.go by starting the loop from p + 1 instead of iterating over all partitions. However, this optimization makes the inner check idx == p redundant, and it should be removed to clean up the code.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
btw, I tried compiling locally and testing out this with the butane file containing the code above, for some reason even though this should start from the partitions after root (if any), it seems the same error message, so I'm guessing either the array of partitions isn't in the declared order, or some partition is part of that array that isn't one the ones defined. |
|
Thanks for the fix @skewballfox! I agree this is a bug; the loop should only check partitions declared after root, since sgdisk processes them in declaration order and only subsequent auto-positioned partitions would constrain root's expansion. This won't break anyone since it only removes a false warning.
|
|
sorry, been afk a bit. I'll push the changes today or tomorrow |
…sequent partitions
currently trying to override the default sizes for the boot partitions.
In my butain file, I have:
which should be valid. root is the last partition, and all the others have a set size. currently this throws:
this shoud only check the partitions after root
Summary by CodeRabbit
rootentry, preventing incorrect or overly broad warnings for valid disk layouts.rootis the last partition (with preceding partitions explicitly sized), no root constraint warning is emitted.