-
Notifications
You must be signed in to change notification settings - Fork 32
feat(redundancy): add redundancy level configuration for smoke check #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds support for configuring erasure coding redundancy levels in smoke tests to enable testing of Bee's redundancy features. The implementation adds a new r-level configuration option that can be set from 0 (NONE) to 4 (PARANOID), allowing smoke tests to verify proper redundancy behavior.
Key changes:
- Added
RLevelfield to smoke test options with configurable YAML parameterr-level - Extended upload/download test methods to accept and handle redundancy levels
- Added conditional
Swarm-Redundancy-LevelHTTP header for uploads when redundancy is enabled - Enabled redundancy fallback mode for downloads when using redundancy levels
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/check/smoke/smoke.go | Added RLevel option field with default value of redundancy.NONE and logging of redundancy level during test execution |
| pkg/config/check.go | Added YAML parsing for r-level option with uint8-to-Level type conversion in applyCheckConfig |
| pkg/test/test.go | Updated Upload and Download methods to accept redundancy level parameter and conditionally set download options |
| pkg/bee/api/options.go | Added RLevel field to UploadOptions struct to pass redundancy level to API |
| pkg/bee/api/bytes.go | Added conditional Swarm-Redundancy-Level HTTP header when redundancy level is not NONE |
| pkg/bee/api/api.go | Added redundancyLevelHeader constant definition |
| pkg/check/load/load.go | Updated to pass redundancy.NONE to maintain backward compatibility for load tests |
| config/local.yaml | Added example configuration with r-level: 2 (STRONG) for ci-smoke check |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case "RLevel": | ||
| if !lv.Field(i).IsNil() { // set locally | ||
| fieldValue := lv.FieldByName(fieldName).Elem() | ||
| level := uint8(fieldValue.Uint()) | ||
| rLevel := beeRedundancy.Level(level) | ||
| ft, ok := ot.FieldByName(fieldName) | ||
| if ok { | ||
| v := reflect.ValueOf(rLevel) | ||
| if v.Type().AssignableTo(ft.Type) { | ||
| ov.FieldByName(fieldName).Set(v) | ||
| } | ||
| } | ||
| } |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing validation for the redundancy level value. The configuration accepts any uint8 value (0-255), but only values 0-4 are valid according to the PR description. Values outside this range will silently create invalid redundancy.Level values. Consider adding validation in the applyCheckConfig function to ensure the value is within the valid range of 0-4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally omitted validation in Beekeeper.
The Bee API validates redundancy levels, so invalid values (e.g., 5+) are rejected with clear errors.
This keeps Beekeeper future-proof: if Bee adds level 5 or higher, Beekeeper supports it without code changes.
Add redundancy level option to smoke tests
Summary
Adds support for configuring erasure coding redundancy level in smoke tests via the
r-levelYAML option.Changes
RLevelfield to smoke test options (defaults toredundancy.NONEfor backward compatibility)r-levelYAML configuration option for smoke checksSwarm-Redundancy-LevelHTTP header for uploadsRedundancyFallbackModefor downloads when redundancy is usedConfiguration
Files Changed
pkg/check/smoke/smoke.go- Added RLevel optionpkg/config/check.go- Added YAML parsing for r-levelpkg/test/test.go- Updated upload/download to accept redundancy levelpkg/bee/api/options.go- Added RLevel to UploadOptionspkg/bee/api/bytes.go- Added conditional redundancy headerpkg/bee/api/api.go- Added redundancy header constantconfig/local.yaml- Updated ci-smoke check with r-level: 2