Schedule Trigger only on NO changes
We have a strange trigger requirement that I am not finding any simple way to implement, and wanted to check if the community can see something I am missing. We need to trigger a build either whenever there is a VCS change, or on Saturday evening if there have been NO changes since the last Saturday evening.
Currently, the best we have come up with has two triggers on the build and a separate helper build. The actual build has two triggers: a VCS trigger, and a schedule trigger that runs on Saturday evening, but the build uses the REST API to disable its own schedule trigger when it runs. Then we set up another helper build that is scheduled to run just after the schedule trigger would fire each week that enables the schedule trigger on the first build. While this can work, I can't help feeling there must be something better.
Please sign in to leave a comment.
Hi Todd,
Currently, there is no easy way to set up such a trigger, unfortunately. Changing the build configuration settings using REST API with helper builds seems an adequate solution in this scenario. There could be alternatives without helper build configurations but they would involve REST API usage and conditional build steps, or some light scripting.
Also, I have to say your requirement is rather unusual. Would you mind sharing a bit more information about your use case? Why do you need to run the configuration only when there have been no changes for a certain period?
Cheers,
-Anatoly
The immediate need is for a build that contains a security scan that is expensive enough that we do not want to run it if we do not need to. We need it to run if there are any changes, but if we don't have any code changes, then once a week is sufficient (the scan will check the versions of third party components, and will alert us if security alerts have been issued for them since the last run). The system involved is primarily in maintenance mode, so more often than not, it will go the week with no builds. An alternative trigger that would work just as well (and might be easier to program) would be a trigger that fires if a configured interval of time has passed since the last build.
Thanks for explaining. I've filed a feature request in our tracker: https://youtrack.jetbrains.com/issue/TW-73522. Feel free to leave a vote to show your interest and to be automatically notified of any updates.