#8 RFE: improve helper functions in c3i.groovy
Closed by mikeb. Opened by rayson.

I tried c3i.wait() in WaiverDB C3I pipeline, and it works good and reduced code duplication dramatically. Following are some thoughts:

  1. Adding timeout parameter to wait().
  2. Adding waitForStart(). This function is similar to wait() but returns immediately once the build is scheduled and running. Similar logic is used in WaiverDB C3I pipeline to get information of started build and avoid to overwhelm downstream serial job.
  3. Throwing an exception rather than calling error step when error.
  4. Not sure if it is good to call openshift.withCluster() inside a helper function. If the user is using non-default cluster, this could forcefully change the cluster to the default one. Should we assume the user already have openshift.withCluster() wrapped outside helper functions?

@mikeb What do you think?


Agreed with 1 and 2. What's the advantage of throwing an error rather than using the error step? Agreed with 4, it should make things more flexible.

@mikeb Just in case someone wants to capture that error. But I don't have strong opinion on that.

This should be addressed by #25. There are new methods on the c3i variable that allow you to wait for builds and deployments, and take timeout values. There is also a new waitForBuildStart() method that waits until a build is running and then returns. And the entire API has been refactored so that it no longer calls openshift.withCluster().

Closing this, as it should be addressed by #25. Please file a new issue with new suggestions/RFEs. Thanks!

Metadata Update from @mikeb:
- Issue status updated to: Closed (was: Open)

Metadata