Skip to content

feat(overrides): add acknowledge action pinned to an attribute's current value - #804

Merged
Starosdev merged 1 commit into
developfrom
feature/775-acknowledge-attribute-value
Sep 6, 2026
Merged

feat(overrides): add acknowledge action pinned to an attribute's current value#804
Starosdev merged 1 commit into
developfrom
feature/775-acknowledge-attribute-value

Conversation

@Starosdev

Copy link
Copy Markdown
Owner

Closes #775

Problem

ignore and force_status both mask an attribute permanently. A user who has looked at one bad value and accepted it - reallocated sectors that settled a year ago, a packed Command Timeout value that Scrutiny misreads - loses the signal for every later change too. The request in #775 is to accept the current state without giving up on the next one.

Solution

A third action, acknowledge, pinned to a value:

  • The attribute passes only while its value equals the pinned one.
  • Any change restores the underlying evaluation, so a new event alerts normally.
  • A manufacturer SMART failure is never masked. This matches ApplyDeltaEvaluation: the drive reporting its own failure is not a Scrutiny verdict a user can acknowledge away.
  • Acknowledge requires a device (device_id or wwn). A fleet-wide rule cannot express a pinned value, because the same attribute holds a different value on every device.

The status reason distinguishes the two states: Acknowledged at value 3, or Acknowledgement no longer applies: value changed from 3 to 4.

Where the pinned value comes from

The server resolves it from the device's latest SMART submission rather than trusting a client-sent value. Which field an attribute is evaluated against differs by protocol - ATA compares the raw value, every other protocol the normalized one - and that rule already lives in the evaluation path. Restating it in the frontend would let the two drift apart silently, so it is exported as measurements.AttributeThresholdValue and the handler pins whatever that returns. The UI sends no value at all.

Sending pinned_value with any other action is rejected.

Migration

m20260906000000 adds pinned_value via AutoMigrate, which only adds the missing column and is a no-op on a database that already has it. The column is nullable rather than defaulted: 0 is a legitimate acknowledged value, and a defaulted column would read every pre-existing override as acknowledged at zero.

UI

Device detail page: Acknowledge current value in the attribute actions menu and beside the inline Ignore button. Active overrides now describe themselves through one overrideDescription helper, so an acknowledge row reads Acknowledged at 3 rather than falling through to a wrong label.

Dashboard settings: the action is selectable and the form requires a device for it.

The menu icon is check_circle_outline; task_alt was tried first and is not present in material-twotone.svg, which fails silently at runtime.

Testing

  • go build ./webapp/... clean; go vet clean on all changed packages.
  • New backend tests: passes at pinned value, re-fails when the value changes, never masks AttributeStatusFailedSmart, AttributeThresholdValue returns the field each protocol is evaluated on.
  • New handler tests: device required, pinned_value rejected for other actions, pinned value resolved from the latest submission, attribute absent from that submission rejected.
  • New migration test: a pre-existing override reads back with pinned_value NULL, and 0 round-trips as 0.
  • webapp/backend/pkg/{overrides,models,web/handler,database} suites pass.
  • Frontend: ng build clean, 193 specs pass.

Docs

README override table and both UI walkthroughs, docs/openapi.yaml schema (including the previously missing device_id), and a config-file example. CHANGELOG.md is left alone - semantic-release generates it.

…ent value

Ignore and force_status both mask an attribute permanently, so a user who has
looked at one bad value and accepted it loses the signal for every later change
too. Acknowledge accepts the value as it stands: the attribute passes only while
its value equals the pinned one, and any change restores the normal verdict.

The pinned value is resolved server-side from the device's latest SMART
submission rather than sent by the client. Which field an attribute is evaluated
against differs by protocol - ATA compares the raw value, every other protocol
the normalized one - and that rule already lives in the evaluation path. Restating
it in the frontend would let the two drift apart silently, so it is exported as
measurements.AttributeThresholdValue and the handler pins whatever it returns.

A manufacturer SMART failure is never masked, matching ApplyDeltaEvaluation: the
drive reporting its own failure is not a Scrutiny verdict a user can acknowledge
away. Acknowledge also requires a device, because a fleet-wide rule cannot express
a pinned value - the same attribute holds a different value on every device.

The pinned_value column is nullable rather than defaulted, since 0 is a legitimate
acknowledged value and a defaulted column would read every pre-existing override
as acknowledged at zero.

Closes #775
@Starosdev
Starosdev merged commit 4c5e408 into develop Sep 6, 2026
23 checks passed
@Starosdev
Starosdev deleted the feature/775-acknowledge-attribute-value branch September 6, 2026 23:24
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.

1 participant