change # between closed and open on top of the `stoplight` API, that uses # transitions between 'green' and 'red' states to signal the state change. # # For more details on the API, please see the `Notifiers` section of the # `stoplight` documentation: https://github.com/orgsync/stoplight#notifiers class CircuitBreakerNotifier # Public: Initialize the `CircuitBreakerNotifier`. # # integration - The `Integration` that is associated with the Circuit Breaker. def initialize(integration) @integration = integration end
application # logic that needs to take place due the transition. # # stoplight - The `Stoplight::Light` that holds the Circuit Breaker. # from - The current color of the stoplight. # to - The color the stoplight is transitioning to. # error - The exception that might have been raised inside the Circuit # Breaker. # # Returns nothing. def notify(_, from, to, error) if opened?(from, to) failed!(error) if error elsif closed?(from, to) succeeded! end end
client end # Public: Create a new `Repository` record based on a existing GitHub # repository. # # repo_name - A `String` with the GitHub repo's full name. # attributes - A `Hash` with extra attributes to be assigned to # the `Repository` (default: {}). # # Returns a `Result` object with the `Repository` record or a failure # message if it fails. def create(repo_name, attributes = {}) with_resource(repo_name) do |resource| attrs = attributes.merge(repo_attrs(resource)) Repository.create!(attrs) { |record| activate_repo(resource, record) } end end
running a feature branch is a different animal to CI. I've heard people say they are doing CI because they are running builds, perhaps using a CI server, on every branch with every commit. That's continuous building, and a Good Thing, but there's no integration, so it's not CI.”