[builds-api]: handle other types of cancel operation
- refactor getBuildConditionFromPipelineRun to handle other types of cancel operation.
- remove some unnecessary Debug logs
- improve tests
Bug: T344656 Signed-off-by: Ndibe Raymond Olisaemeka rolisaemeka-ctr@wikimedia.org