Only run build if other Plans are currently passing isn't working

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      Problem

      Bamboo does not follow the "Only run build if other Plans are currently passing isn't working" when using a scheduled trigger in a Plan.

      Environment

      Bamboo 8.0.4

      Steps to Reproduce

      1. Create 2 Plans
      2. Add to the First plan a task that will always fail
      3. Add to the Second plan a scheduled trigger (0 * * ? * * *) and mark "Only run Build if other Plans are currently passing"
      4. Add the First plan Key to the Plan Keys on the scheduled trigger conditions
      5. Run the First plan (it should fail)
      6. Observe that the Second Plan will run, even after the First plan has failed

      Expected Results

      The Second Plan should not be triggered unless the First Plan is passing its build

      Actual Results

      The Second Plan gets triggered all the time, even after the First Plan has failed

      Workaround

      1. On the Second Plan, add a script task at the beginning of the First job of the First Stage.
      2. The task should run a script that will wait for the right time to finish, so the other subsequent Tasks on the same Stages/Jobs/Tasks should be triggered at the right time.
      3. Make sure to output some kind of marker on your "sleeping" script every X minutes so it will prevent Bamboo from considering the build as stalled and kill it.
      4. The Second Plan needs to be added as a child Plan under Dependencies on the First Plan properties.
      5. As the Second Plan will be triggered immediately after the First Plan finishes, an Agent may be blocked/busy until the Second Plan finishes. So be mindful that you have a small number of Agents.
      6. Don't forget to disable the Scheduled trigger on the Second Plan.

      Notes

      bamboo-plugins/bamboo-plugin-triggercondition/src/main/java/com/atlassian/bamboo/buildtrigger could not locate useful DEBUG output for ScheduledBuildDetectionAction/childs.

      2022-01-07 15:20:00,001 INFO [scheduler_Worker-2] [QuartzTriggerJob] Running quartz strategy job for CHAIN:MYS-BM
      2022-01-07 15:20:00,004 INFO [10-BAM::PlanExec:pool-16-thread-2] [ScheduledBuildDetectionAction] Detecting changes for MYS-BM...
      2022-01-07 15:20:00,008 INFO [10-BAM::PlanExec:pool-16-thread-2] [ScheduledBuildDetectionAction] : Schedule build MYS-BM-112 triggered
      2022-01-07 15:20:00,271 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-14] [BitbucketServerBuildStatusUpdater] Sending build notification to Stash (build key: MYS-BM-112, repository: MySuper-Plan)
      2022-01-07 15:20:00,272 INFO [10-BAM::PlanExec:pool-16-thread-2] [ChainExecutionManagerImpl] Build MYS-BM-JOB2-112 has been dispatched 

            Assignee:
            Mateusz Szmal
            Reporter:
            Eduardo Alvarenga (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: