Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

When condition is not met for a conditional task, why the whole build fails?

Chitrarth Sahai July 3, 2020

I have a conditional task for which i have used a plan variable isRCBuild to trigger.

When isRCBuild=0 it should run otherwise no.

When the isRCBuild=1 the condition is not met but the whole builds stops, why is that? shouldn't it just be skipped??

Build.PNG

1 answer

1 accepted

0 votes
Answer accepted
Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 3, 2020

If it's the only task then build fails because there were no tasks for execution. Add dummy Script task "echo hi" to avoid it

Chitrarth Sahai July 5, 2020

If it's only task then it should go to next job. I think this qualifies as a bug.

@Alexey Chystoprudov Do you think this should qualify as a bug?

For the workaround, i now check the bamboo variable from the script itself and EXIT if required. Bamboo conditional tasks are not that robust from my POV.

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2020

@Chitrarth Sahai , it's existing behaviour. When you create job without task Bamboo fails it as we decided it's not a good situation.

The same when all tasks are skipped, it means job had no executable tasks and its state is unknown. 

Dana Smoot March 17, 2023

Well then it would be nice if there was a conditional Job and not just conditional tasks :)

Right now the only way to get a conditional job, is to set the same condition on each task in the job, except a final dummy task that always runs.  That seems like a bad way to have something change in the future, but forget to change it everywhere.

Like pBogey likes this
pBogey June 30, 2023

You cannot skip the default checkout task for a job. You need a workaround in order to not do this.

 

You cannot skip a job from running, you need to set conditions on every task inside that job, but then the job will fail so you need a workaround for this too.

 

You cannot set conditions on artifacts (unless I am missing something), so when the task that generates the artifact is skipped due to a condition, the job will fail if the artifact is required.

 

It doesn't make sense, do bamboo developers not use bamboo?

Like Dana Smoot likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events