Skip to content

Conversation

@ziflex
Copy link
Contributor

@ziflex ziflex commented Sep 1, 2025

  • Introduced new error types: ErrResourceAlreadyRegistered and ErrResourceNotFound.
  • Updated the options struct to include multiplier and randomization factor for exponential backoff.
  • Modified functions to use the new error types and updated the README with new error descriptions.
  • Changed import path for the backoff package to v5.

- Introduced new error types: ErrResourceAlreadyRegistered and ErrResourceNotFound.
- Updated the options struct to include multiplier and randomization factor for exponential backoff.
- Modified functions to use the new error types and updated the README with new error descriptions.
- Changed import path for the backoff package to v5.
@ziflex ziflex requested a review from Copilot September 1, 2025 03:08

This comment was marked as outdated.

Co-authored-by: Copilot <[email protected]>
@ziflex ziflex requested a review from Copilot September 1, 2025 03:15
Copy link
Contributor

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

This PR refactors error handling by introducing specific error types and updates the backoff configuration options. The changes improve error specificity and provide more control over exponential backoff behavior.

  • Introduced ErrResourceAlreadyRegistered and ErrResourceNotFound error types for better error classification
  • Updated backoff package to v5 and added multiplier/randomization factor configuration options
  • Changed Options struct to private options and updated all references accordingly

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
errors.go Added new error types for resource registration conflicts and missing resources
options.go Made options struct private, added multiplier and randomization factor fields with new setter functions
registry.go Updated error handling to use new structured error types with context
waitfor.go Updated backoff package import and applied new configuration options
go.mod Upgraded backoff dependency to v5
waitfor_test.go Updated test code to use new private options struct
options_test.go Updated tests for private struct and added tests for new options
README.md Added documentation for new error types
Comments suppressed due to low confidence (2)

waitfor.go:1

  • The backoff.Retry function is being called incorrectly. The function signature expects a single error return value, but line 188 returns two values (bool, error). This should be return rsc.Test(ctx) instead of return err != nil, err.
// Package waitfor provides utilities for testing and waiting for resource availability

waitfor.go:1

  • The variable err on line 191 is undefined in this scope. It should return the result of backoff.Retry directly: return backoff.Retry(...).
// Package waitfor provides utilities for testing and waiting for resource availability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ziflex ziflex merged commit e4968c7 into master Sep 1, 2025
1 check passed
@ziflex ziflex deleted the chore/backoff-v5 branch September 1, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants