screwdriver icon indicating copy to clipboard operation
screwdriver copied to clipboard

Switching `Group events` does the reverse to `Show triggers`

Open jweingarten opened this issue 3 years ago • 3 comments

When you go to the Options page and turn on Show Triggers (which by the way takes ~1 minute for the actual PUT to be done) and then reload the page, you will notice that Group Events is being turned off. The same thing happens when switching Group Events, at which point Show Triggers is turned off.

jweingarten avatar Feb 22 '22 19:02 jweingarten

@klu909 @adong

jithine avatar Feb 22 '22 19:02 jithine

This issue is due to the pipeline preference parameter used in the data-schema being due to default (false).

Solution

This issue can be resolved by changing the default (false) in the pipeline preference data-schema to optional(). I checked to see if this fix would cause problems when creating the pipeline, but it wasn't a problem.

groupedEvents: Joi.boolean().default(false),
showEventTriggers: Joi.boolean().default(false)

groupedEvents: Joi.boolean().optional(),
showEventTriggers: Joi.boolean().optional()

reference: https://github.com/screwdriver-cd/data-schema/blob/ab138fcb9c83eaee5e0be0b4218751ac57f2daa7/config/settings.js#L32

ryoshimm avatar Feb 25 '22 08:02 ryoshimm

Cause

I investigated the cause of this.

When groupedEvents in pipeline preference is turned on.

DB settings before change:

groupedEvents: false
showEventTriggers: true

Request sent from UI:

settings: {
  groupedEvents: true
}

Parameters received by API:

settings: {
  groupedEvents: true,
  showEventTriggers: false,
  otherPropertyA: false,
  otherPropertyB: false
  ...
}

In this way, on the API side, everything other than the parameters sent from the UI will be false depending on the data-schema settings.

ryoshimm avatar Feb 25 '22 08:02 ryoshimm