Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughSSH configuration insertion now recognizes ChangesSSH Configuration
Windows kind Setup
Pre-commit Tool Version
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The supplied evidence does not identify a change that needs correction before merging. Proceed with normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning 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. Comment |
|
will review when status checks are passing |
findInsertPosition had two bugs that corrupted ~/.ssh/config when
inserting a new workspace block:
1. The Host keyword check was case-sensitive (strings.HasPrefix(...,
"Host")), so lowercase 'host' entries — which are equally valid per
SSH config syntax — were invisible to the scanner. It would skip past
all of them and land on the first uppercase 'Host' keyword, which
could be inside an already-present DevPod block.
2. '# DevPod Start <name>' marker lines were counted as plain comment
lines in the commentLines backtrack counter. When the first Host
found was preceded by such a marker, the backtrack subtracted 1 and
placed the insertion point inside the existing block, gluing the new
block's start marker onto the previous host entry line.
Fix 1: use strings.HasPrefix(strings.ToLower(trimmed), "host ") so
that both 'Host' and 'host' (and 'HOST' etc.) are recognised.
Fix 2: exclude lines matching MarkerStartPrefix / MarkerEndPrefix from
the commentLines counter so DevPod marker lines are never treated as
backtrack candidates.
Also fix the pre-existing test case 'Host addition to existing config
with DevPod host' which had a mismatched End marker
('# DevPod End testhost' instead of '# DevPod End existingtesthost'),
and add two new regression test cases:
- Host addition with lowercase host entries
- Host addition does not corrupt existing DevPod block followed by
plain host
73e1052 to
ee7913e
Compare
- Break long string literals (>120 chars) in new test cases into multi-line concatenations to satisfy the lll linter. - Let gofmt normalize struct field alignment to satisfy gci formatter.
|
not sure about the three ci fails ... can I fix it or is it a setup problem? |
This is a setup problem on my end. Things grew stale. I'm taking a look into it. Just for my own interest, is there a reason that you have a preference for DevPod over Devsy for your current setup? What I mean to say is I think there might be more fixes in Devsy than what exists in DevPod today. |
…acement - Add sshConfigKeyword and isSSHSectionStart helpers to recognize Host and Match section keywords case-insensitively with space, tab, or '='. - Avoid splitting existing DevPod blocks by including preceding comments and '# DevPod Start' markers in the backtrack. - Remove skipConfigContainsCheck test escape hatch and restore the contiguous config assertion. - Add test variants for casing, delimiters, HostName false-positive, Match section boundaries, and block integrity. Signed-off-by: Samuel K <skevetter@pm.me>
- Pin goimports to v0.49.0 in pre-commit.yml for Go 1.25 toolchain compatibility. - Download kind.exe on Windows using PowerShell Invoke-WebRequest with bounded retry and SHA256 checksum verification. Signed-off-by: Samuel K <skevetter@pm.me>
thx came from vs code plugin via devcontainer cli to devpod. trying Devsy next seems like the right thing to do ;) I'll give it a try maybe checking directly if this deficiency with the corrupted ssh config exits there as well (same code right?). |
findInsertPosition had two bugs that corrupted ~/.ssh/config when inserting a new workspace block:
The Host keyword check was case-sensitive (strings.HasPrefix(..., "Host")), so lowercase 'host' entries — which are equally valid per SSH config syntax — were invisible to the scanner. It would skip past all of them and land on the first uppercase 'Host' keyword, which could be inside an already-present DevPod block.
'# DevPod Start ' marker lines were counted as plain comment lines in the commentLines backtrack counter. When the first Host found was preceded by such a marker, the backtrack subtracted 1 and placed the insertion point inside the existing block, gluing the new block's start marker onto the previous host entry line.
Fix 1: use strings.HasPrefix(strings.ToLower(trimmed), "host ") so that both 'Host' and 'host' (and 'HOST' etc.) are recognised.
Fix 2: exclude lines matching MarkerStartPrefix / MarkerEndPrefix from the commentLines counter so DevPod marker lines are never treated as backtrack candidates.
Also fix the pre-existing test case 'Host addition to existing config with DevPod host' which had a mismatched End marker ('# DevPod End testhost' instead of '# DevPod End existingtesthost'), and add two new regression test cases:
Summary by CodeRabbit
HostandMatchsection headers regardless of capitalization or formatting, and place new workspace entries before existing sections and their associated comments or options.