Skip to content

Conversation

@akrem-chabchoub
Copy link
Contributor

Add redundancy level option to smoke tests

Summary

Adds support for configuring erasure coding redundancy level in smoke tests via the r-level YAML option.

Changes

  • Added RLevel field to smoke test options (defaults to redundancy.NONE for backward compatibility)
  • Added r-level YAML configuration option for smoke checks
  • Updated upload/download logic to pass redundancy level to Bee API
  • Added conditional Swarm-Redundancy-Level HTTP header for uploads
  • Enabled RedundancyFallbackMode for downloads when redundancy is used

Configuration

ci-smoke:
  options:
    r-level: 2  # 0-4 (0 = NONE, 1 = MEDIUM, 2 = STRONG, 3 = INSANE, 4 = PARANOID)

Files Changed

  • pkg/check/smoke/smoke.go - Added RLevel option
  • pkg/config/check.go - Added YAML parsing for r-level
  • pkg/test/test.go - Updated upload/download to accept redundancy level
  • pkg/bee/api/options.go - Added RLevel to UploadOptions
  • pkg/bee/api/bytes.go - Added conditional redundancy header
  • pkg/bee/api/api.go - Added redundancy header constant
  • config/local.yaml - Updated ci-smoke check with r-level: 2

Copilot AI review requested due to automatic review settings January 2, 2026 14:07
@akrem-chabchoub akrem-chabchoub self-assigned this Jan 2, 2026
Copy link

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 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 RLevel field to smoke test options with configurable YAML parameter r-level
  • Extended upload/download test methods to accept and handle redundancy levels
  • Added conditional Swarm-Redundancy-Level HTTP 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.

Comment on lines +750 to +762
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)
}
}
}
Copy link

Copilot AI Jan 2, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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.

@bcsorvasi bcsorvasi added this to the bee-v2.7.0 milestone Jan 6, 2026
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.

3 participants