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.
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.