Sha256: 26bd5999b251c9ef309e5afbff05906234748126372416ef39eded82e485e3ac

Contents?: true

Size: 729 Bytes

Versions: 15

Compression:

Stored size: 729 Bytes

Contents

module Shipit
  class CommitChecksController < ShipitController
    def show
      checks.schedule
    end

    params do
      accepts :since, Integer, default: 0
    end
    def tail
      output = checks.output(since: params.since)
      url = nil
      unless checks.finished?
        next_offset = params.since + output.bytesize
        url = stack_tail_commit_checks_path(stack, sha: commit.sha, since: next_offset)
      end

      render json: {url: url, output: output, status: checks.status}
    end

    private

    delegate :checks, to: :commit

    def commit
      @commit ||= stack.commits.find_by!(sha: params[:sha])
    end

    def stack
      @stack ||= Stack.from_param!(params[:stack_id])
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.30.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.29.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.28.1 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.28.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.27.1 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.27.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.26.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.25.1 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.25.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.24.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.23.1 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.23.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.22.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.21.0 app/controllers/shipit/commit_checks_controller.rb