Skip to content

fix(overrides): address gaps in attribute override system #345

@Starosdev

Description

@Starosdev

Summary

Several verified gaps were found in the attribute override system during a code review against upstream discussion AnalogJ#922.

Why

These issues affect correctness (silent duplicate overrides), visibility (config file overrides invisible in UI), safety (missing threshold validation), and confidence (no handler-level tests).

Acceptance Criteria

  • Add unique index on (protocol, attribute_id, wwn) in the attribute_overrides migration to prevent silent duplicates
  • Config file overrides are returned by GET /api/settings/overrides so they appear in the settings UI (read-only, source: config)
  • Handler validates that warn_above < fail_above, values are non-negative, and at least one threshold is set when action == ""
  • Add handler-level tests for GET/POST/DELETE /api/settings/overrides
  • UI form default action changed from ignore to "" (Custom Threshold) so threshold fields are visible by default; form resets to same
  • Fix misleading comment in applier.go that says thresholds "can be combined with force_status" — they are mutually exclusive in practice
  • Add basic WWN format validation in handler

Additional Context

  • Migration file: webapp/backend/pkg/database/migrations/m20260122000000/attribute_override.go
  • Handler: webapp/backend/pkg/web/handler/attribute_overrides.go
  • Applier: webapp/backend/pkg/overrides/applier.go
  • DB repo: webapp/backend/pkg/database/scrutiny_repository_overrides.go
  • UI: webapp/frontend/src/app/layout/common/dashboard-settings/dashboard-settings.component.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions