Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add head and base commit to request renderer #840

Merged
merged 4 commits into from Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/travis/api/v3/renderer/request.rb
@@ -1,7 +1,7 @@
module Travis::API::V3
class Renderer::Request < ModelRenderer
representation(:minimal, :id, :state, :result, :message)
representation(:standard, *representations[:minimal], :repository, :branch_name, :commit, :builds, :owner, :created_at, :event_type)
representation(:standard, *representations[:minimal], :repository, :branch_name, :commit, :builds, :owner, :created_at, :event_type, :base_commit, :head_commit)

def self.available_attributes
super + ['yaml_config']
Expand Down
8 changes: 6 additions & 2 deletions spec/v3/services/request/find_spec.rb
Expand Up @@ -19,7 +19,9 @@
"repository",
"owner",
"event_type",
"push")
"push",
"base_commit",
"head_commit")
}
end

Expand Down Expand Up @@ -52,7 +54,9 @@
"repository",
"owner",
"event_type",
"push")
"push",
"base_commit",
"head_commit")
}

end
Expand Down
8 changes: 6 additions & 2 deletions spec/v3/services/requests/find_spec.rb
Expand Up @@ -23,7 +23,9 @@
"sha",
"svenfuchs/minimal",
"event_type",
"push")
"push",
"base_commit",
"head_commit")
}
example 'reverse ordered' do
expect(JSON.load(body)['requests'].map { |r| r['id'] }).to eq repo.requests.pluck(:id).sort.reverse
Expand Down Expand Up @@ -56,7 +58,9 @@
"sha",
"svenfuchs/minimal",
"event_type",
"push")
"push",
"base_commit",
"head_commit")
}

end
Expand Down