dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

Make background tasks periodicity configurable

Open syalioune opened this issue 2 years ago • 2 comments

Enhancement request described in #1542.

Signed-off-by: Alioune SY [email protected]

Please find below related PRs to review :

Design decisions :

  • Task are not rescheduled after period update because it would require updates on Alpine framework to be able to cancel a given task. It is also tricky because, if the task ran 5min ago, we don't want to run it again after a reschedule. With a restart, we don't have to handle all those edge cases
  • I've introduced scanner.analysis.cache.validity.period configuration property used in BaseComponentAnalyzerTask instead of the previous hard coded value. It can be configured through API by experienced users but not through the new UI as it is not really related to task scheduling
  • For now, I haven't add a check that scanner.analysis.cache.validity.period is strictly inferior to task-scheduler.component.analysis.cache.clear.period as the first one is not really exposed to the end users
  • No specific documentation update as the UI seems self-descriptive

Please find a sneak peak of the UI below

image

syalioune avatar Jul 29 '22 08:07 syalioune

I suggest interval. Cadence, to my understanding, is more like the number of times per period, i.e twice a day. Not sure if cadence = 24 is intuitively understood as "every 24 hours"? interval=24h is more clear.

valentijnscholten avatar Aug 03 '22 17:08 valentijnscholten

I suggest interval. Cadence, to my understanding, is more like the number of times per period, i.e twice a day. Not sure if cadence = 24 is intuitively understood as "every 24 hours"? interval=24h is more clear.

I agree, but the downside is that cadence is already used for other tasks (Fortify and DefectDojo sync for example). If we were to switch to interval now, we should change the existing names as well. And that would be a breaking change, which is something we'd really like to avoid.

nscuro avatar Aug 03 '22 18:08 nscuro

@stevespringett To me it looks like all your points have been addressed. Anything else you want done before we can merge?

nscuro avatar Aug 26 '22 16:08 nscuro

Awesome. Thanks for the collaboration and quality PR @syalioune. Much appreciated.

stevespringett avatar Aug 26 '22 19:08 stevespringett