2

What I want to achieve: run pipeline ONLY on cron timer and run it on timer ALWAYS ignoring previous run status

trigger: none # No CI build

pr: none # Not for pull requests

schedules:
- cron: "0 0 * * *"
  displayName: Daily midnight build
  branches:
    include:
    - integration-tests
  always: true

What I currently have:

  1. Failing pipeline works as expected

enter image description here

  1. Successful pipeline stopped working after first successful run. It won't even start when manually triggered run failed.

enter image description here

  1. All pipelines have correct "Scheduled runs" tab.

enter image description here

  1. Every pipeline does not have any trigger/schedule configured over UI

enter image description here

What am I doing wrong?

Yehor Androsov
  • 4,885
  • 2
  • 23
  • 40
  • Did someone manually schedule a run of this pipeline? According to the documentation, your scheduled runs will not be honored if someone scheduled a run via the UI. – WaitingForGuacamole Feb 24 '21 at 15:04
  • @WaitingForGuacamole yes, it was scheduled manually for second case (failing pipeline, you can see it on second screenshot). But it happened few days after last run, not sure if it is relevant. I have 6 pipelines, 2 of which are always running (they never were successful) and 4 other never executed again after first successful scheduled run. – Yehor Androsov Feb 24 '21 at 15:12
  • I'm wondering if you might need to "kick" it back into running the schedule by pushing a trivial change? It's the only thing I can see that might be relevant - they mention that a UI-scheduled run means the schedule is not honored, but they don't indicate the time scale (is that permanent?) – WaitingForGuacamole Feb 24 '21 at 15:44
  • 1
    @WaitingForGuacamole ok, will create pipeline with same yml from scratch and push something to master to try to "refresh" existing pipelines. will mention you after couple of days of observation, if you are interested :) – Yehor Androsov Feb 24 '21 at 18:15
  • I am indeed interested. – WaitingForGuacamole Feb 24 '21 at 18:43
  • Hi, Just checking in to see whether this issue is still blocking you now? Any update for this issue? – Vito Liu Mar 01 '21 at 02:05
  • 1
    @VitoLiu-MSFT Hi, thanks for asking. I am still watching at new and existing pipelines behaviour to make sure I did not fail at any step. Will post an update tomorrow – Yehor Androsov Mar 01 '21 at 13:35
  • Hi @YegorAndrosov, Got it, you could kindly share the result here, If you have any follow-up questions about this issue, we will continue to help you here. Have a nice day. :) – Vito Liu Mar 02 '21 at 03:04
  • @WaitingForGuacamole please check the answer I posted. the issue looks very simple now. but the workflow overall is not that transparent for me, I had (and still have) hard time understanding UI for schedules – Yehor Androsov Mar 02 '21 at 18:28

2 Answers2

3

You could check this FAQ:

I see the planned run in the Scheduled runs panel. However, it does not run at that time. Why?

  • The Scheduled runs panel shows all potential schedules. However, it may not actually run unless you have made real updates to the code. To force a schedule to always run, ensure that you have set the always property in the YAML pipeline, or checked the option to always run in a classic pipeline.

And this My YAML schedules were working fine. But, they stopped working now. How do I debug this?

According to the description, you could make a small trivial change to you YAML file, and push the update to your repository.

You could also try to create a new YAML build and check the result.

Vito Liu
  • 7,525
  • 1
  • 8
  • 17
0

Oof, looks like I found the reason. Scheduled runs tab made everything a bit confusing to me.

enter image description here

So, according to description should I put cron timer into master to make this tab work?

Here you can see that it mentions default branch (master for me). I had to put the exact yml into master to make this tab display future scheduled runs. But always: true in the master branch seems to be irrelevant, it should be applied to the branch you are running pipeline from (integration-tests for me). Looks like at some point during trying to fix stuff I have put always: true into master's pipeline.yml, but not in integration-tests's

When I have put option to both yml's, everything started working as expected.

However, when I look at pipelines that have schedule binded, I become even more confused. It was mentioning default branch when there were no schedule, and now it shows refs/heads/integration-tests?? where does it take cron from?

enter image description here

Yehor Androsov
  • 4,885
  • 2
  • 23
  • 40