Currenty non-security updates are marked as 'INFO', while drupal core marks them as REQUIREMENT_WARNING. So to be consistent with core, it would seem logical to mark the sensor result as warning too. Patch incoming.

Issue fork monitoring-3107066

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jelle_S created an issue. See original summary.

jelle_s’s picture

Assigned: jelle_s » Unassigned
Status: Active » Needs review
StatusFileSize
new728 bytes
jelle_s’s picture

Alternatively, we could make the mapping of the REQUIREMENT_* constants to SensorResultInterface::STATUS_* configurable on the sensor, but I'm not sure if that is desired?

berdir’s picture

I'd prefer to keep them as info because I don't really consider it a warning that we need to see in our monitoring infrastructure. So it would need to be configurable then..

berdir’s picture

That said, a single checkbox as setting for this specific case might be enough and we don't need full-blown status mapping UI.

jelle_s’s picture

New patch attached.

jelle_s’s picture

Oops, IDE was a bit enthusiastic adding a method return type.

berdir’s picture

Status: Needs review » Needs work
+++ b/src/Plugin/monitoring/SensorPlugin/UpdateStatusSensorPlugin.php
+++ b/src/Plugin/monitoring/SensorPlugin/UpdateStatusSensorPlugin.php
@@ -6,6 +6,7 @@

@@ -202,11 +203,34 @@ class UpdateStatusSensorPlugin extends SensorPluginBase {
+   * {@inheritdoc}
+   */
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
+    $form['update_warning'] = [
+      '#type' => 'checkbox',
+      '#title' => $this->t('Mark updates as warning'),
+      '#description' => $this->t('Mark available updates as a warning. By default updates are marked as info. Security updates and unsupported modules are always marked as critical.'),
+      '#default_value' => $this->sensorConfig->getSetting('update_warning', false),
+    ];
+
+    return $form;
+  }

We need to document this setting in the config schema in monitoring.schema.yml. Also now that we have this UI, we need to make sure that we don't break the type configuration setting which is currently there as a non-configurable setting.

jonasanne made their first commit to this issue’s fork.

jonasanne’s picture

StatusFileSize
new2.49 KB

I converted Jelle his changes into a MR and added the change in monitoring.schema.yml.

Also uploaded the diff of the MR as patch here.

jonasanne’s picture

Status: Needs work » Needs review
jonasanne’s picture

Does anything needs to be done for this ticket?

jonasanne’s picture

Rebase MR & added diff to use as patch