pkg/manifests: fix dropped walk errors#495
Conversation
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds early error handling at the start of filepath.WalkFunc implementations to propagate errors received from the walker before attempting further processing.
Changes:
- Return early when the incoming
errparameter is non-nil inLoadPackagesWalkFuncandLoadBundleWalkFuncinpackagemanifestloader.go. - Apply the same early-return guard in
bundleLoader.LoadBundleWalkFunc.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/manifests/packagemanifestloader.go | Propagates walker errors early in both walk functions before file inspection. |
| pkg/manifests/bundleloader.go | Propagates walker errors early in the bundle loader's walk function. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@alrs Thanks for this ^^ the functions changed are exported - should we add a unit test for each for the changes? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #495 +/- ##
==========================================
- Coverage 22.13% 22.12% -0.02%
==========================================
Files 60 60
Lines 7869 7875 +6
==========================================
Hits 1742 1742
- Misses 5969 5972 +3
- Partials 158 161 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
A
filepath.Walk()function takes an error as one of its arguments. Usually the first thing to do in aWalk()is to check if theerrprovided is notniland should be returned. This fixes three places inpkg/manifestswhere aWalkFunc()was not handling theerr.Tests continue to pass.