Skip to content

test: ResourceCloserList.Release continues on error (Copilot review test)#3

Open
shreyanshjain7174 wants to merge 2 commits intomainfrom
test/copilot-review-trigger
Open

test: ResourceCloserList.Release continues on error (Copilot review test)#3
shreyanshjain7174 wants to merge 2 commits intomainfrom
test/copilot-review-trigger

Conversation

@shreyanshjain7174
Copy link
Copy Markdown
Owner

Test PR to validate Copilot Code Review configuration.

Changes ResourceCloserList.Release() to continue cleanup on error instead of returning early. This touches internal/resources/ which is in the v2 shim path filter.

Expected behavior:

  1. Copilot Review (V2 Shim) workflow triggers (path match: internal/resources/**)
  2. Copilot is auto-requested as a reviewer
  3. Review comments use [BLOCKER]/[ISSUE]/[SUGGESTION] prefixes
  4. Comments follow Go conventions and hcsshim resource lifecycle rules

Shreyansh Sancheti added 2 commits March 18, 2026 18:14
Add automated GitHub Copilot review that triggers only when v2 shim
code paths are modified. Copilot is guidance-only; CI remains the gate.

- copilot-instructions.md: global review tone and format rules
- v2-shim.instructions.md: Go best practices + hcsshim-specific rules
  (resource lifecycle, handle leaks, concurrency, package layering)
- copilot-review.yml: workflow to auto-request Copilot review on PRs
  touching shim binaries, internal/hcs*, uvm, controller, vm packages

Signed-off-by: Shreyansh Sancheti <shreyanshjain7174@gmail.com>
Signed-off-by: Shreyansh Sancheti <shsancheti@microsoft.com>
ResourceCloserList.Release() previously returned on the first error,
which could leak remaining resources. Changed to collect all errors
and continue releasing, matching the behavior documented in the review
instructions (cleanup functions MUST continue releasing remaining
resources even if one fails).

Signed-off-by: Shreyansh Sancheti <shreyanshjain7174@gmail.com>
Signed-off-by: Shreyansh Sancheti <shsancheti@microsoft.com>
Copilot AI review requested due to automatic review settings March 18, 2026 12:58
Repository owner deleted a comment from chatgpt-codex-connector bot Mar 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the internal/resources cleanup helper to ensure resource release continues even when individual Release() calls fail, reducing the risk of leaks during error unwinding in the v2 shim resource lifecycle.

Changes:

  • Modify ResourceCloserList.Release() to attempt all releases (reverse order) and aggregate errors.
  • Return a combined error via errors.Join(...) instead of returning early on first failure.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 190 to +195
if oErr := l.closers[i].Release(ctx); oErr != nil {
return oErr
log.G(ctx).WithError(oErr).Error("failed to release resource in ResourceCloserList")
errs = append(errs, oErr)
}
}
return nil
return errors.Join(errs...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants