nasa / openmct

A web based mission control framework.
https://nasa.github.io/openmct/
Other
12.03k stars 1.25k forks source link

[Fault Management] Providers should be able to specify shelve durations #7853

Open ozyx opened 2 weeks ago

ozyx commented 2 weeks ago

Is your feature request related to a problem? Please describe. Currently, shelve durations are hard-coded and only provide a few different options.

Describe the solution you'd like Fault providers should be able to define their own shelve durations. An optional API method such as getShelveDurations can be defined by the fault provider and return a list of options with label and duration (in ms):

[
  {
    name: '1 minute',
    duration: 60 * 60 * 1000
  },
  {
    name: '5 minutes',
    duration: 5 * 60 * 60 * 1000
  }
]
ozyx commented 2 weeks ago

Testing Instructions

openmct core

openmct-yamcs

  1. Modify that yamcs fault provider's getShelveDurations() to add some custom durations (a short duration would be helpful to test the unshelving)
  2. Start openmct-yamcs with YAMCS quickstart running
  3. Add an mdb-override to a parameter to get it to trigger a fault. Here's an example using Latitude:
curl -X PATCH "http://localhost:8090/api/mdb-overrides/myproject/realtime/parameters/myproject/Latitude" \
-H "Content-Type: application/json" \
-d '{
  "action": "SET_DEFAULT_ALARMS",
  "defaultAlarm": {
    "staticAlarmRange": [
      {
        "level": "WATCH",
        "minInclusive": 808,
        "maxInclusive": 810
      },
      {
        "level": "WARNING",
        "minInclusive": 810.01,
        "maxInclusive": 812
      },
      {
        "level": "DISTRESS",
        "minInclusive": 812.01,
        "maxInclusive": 814
      },
      {
        "level": "CRITICAL",
        "minInclusive": 814.01,
        "maxInclusive": 820
      },
      {
        "level": "SEVERE",
        "minInclusive": 820.01,
        "maxInclusive": 824
      }
    ]
  }
}'
  1. Goto fault management and verify fault(s) has/have been triggered
  2. Shelve a fault and verify your custom durations show in the dropdown
  3. Shelve a fault for a short amount of time and verify that it unshelves when its time is up
  4. Shelve a fault selecting "indefinite" as the option for duration. Verify that it never unshelves (waiting 5+ min is probably enough here?)
jvigliotta commented 1 week ago

Partially Fixed - Testathon 10/3/24

Getting an error when removing the getShelveDurations() from the provider.

shefalijoshi commented 1 week ago

Testing with core Open MCT:

  1. Setting to a custom duration - Verified
  2. Remove getShelveDurations() completely - failed with console error: Uncaught (in promise) TypeError: this.provider.getShelveDurations is not a function getShelveDurations FaultManagementAPI.js:142 created FaultManagementView.vue:143
  3. Set getShelveDuration() to return []. On Clicking the shelve button- failed with console error: Uncaught (in promise) TypeError: this.shelveDurations[0] is undefined toggleShelveSelected FaultManagementView.vue:313 callWithErrorHandling runtime-core.esm-bundler.js:195