Commit d57faaa0 authored by Regis's avatar Regis

Merge branch 'master' into auto-pipelines-vue

parents e56254d3 645412b5
...@@ -15,10 +15,10 @@ To see how GitLab looks please see the [features page on our website](https://ab ...@@ -15,10 +15,10 @@ To see how GitLab looks please see the [features page on our website](https://ab
- Manage Git repositories with fine grained access controls that keep your code secure - Manage Git repositories with fine grained access controls that keep your code secure
- Perform code reviews and enhance collaboration with merge requests - Perform code reviews and enhance collaboration with merge requests
- Each project can also have an issue tracker and a wiki - Complete continuous integration (CI) and CD pipelines to builds, test, and deploy your applications
- Each project can also have an issue tracker, issue board, and a wiki
- Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises - Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises
- Completely free and open source (MIT Expat license) - Completely free and open source (MIT Expat license)
- Powered by [Ruby on Rails](https://github.com/rails/rails)
## Hiring ## Hiring
...@@ -74,11 +74,11 @@ Instructions on how to start GitLab and how to run the tests can be found in the ...@@ -74,11 +74,11 @@ Instructions on how to start GitLab and how to run the tests can be found in the
GitLab is a Ruby on Rails application that runs on the following software: GitLab is a Ruby on Rails application that runs on the following software:
- Ubuntu/Debian/CentOS/RHEL - Ubuntu/Debian/CentOS/RHEL/OpenSUSE
- Ruby (MRI) 2.3 - Ruby (MRI) 2.3
- Git 2.8.4+ - Git 2.8.4+
- Redis 2.8+ - Redis 2.8+
- MySQL or PostgreSQL - PostgreSQL (preferred) or MySQL
For more information please see the [architecture documentation](https://docs.gitlab.com/ce/development/architecture.html). For more information please see the [architecture documentation](https://docs.gitlab.com/ce/development/architecture.html).
......
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
} }
.stage-header { .stage-header {
width: 28%; width: 26%;
padding-left: $gl-padding; padding-left: $gl-padding;
} }
.median-header { .median-header {
width: 12%; width: 14%;
} }
.event-header { .event-header {
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
.dismiss-icon { .dismiss-icon {
position: absolute; position: absolute;
right: $cycle-analytics-dismiss-icon-color; right: $cycle-analytics-box-padding;
cursor: pointer; cursor: pointer;
color: $cycle-analytics-dismiss-icon-color; color: $cycle-analytics-dismiss-icon-color;
} }
...@@ -215,7 +215,6 @@ ...@@ -215,7 +215,6 @@
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
border-right: 1px solid $border-color; border-right: 1px solid $border-color;
background-color: $gray-light; background-color: $gray-light;
cursor: default;
&.active { &.active {
background-color: transparent; background-color: transparent;
...@@ -247,11 +246,11 @@ ...@@ -247,11 +246,11 @@
float: left; float: left;
&.stage-name { &.stage-name {
width: 70%; width: 65%;
} }
&.stage-median { &.stage-median {
width: 30%; width: 35%;
} }
} }
......
...@@ -93,8 +93,11 @@ module Ci ...@@ -93,8 +93,11 @@ module Ci
.select("max(#{quoted_table_name}.id)") .select("max(#{quoted_table_name}.id)")
.group(:ref, :sha) .group(:ref, :sha)
relation = ref ? where(ref: ref) : self if ref
relation.where(id: max_id).order(id: :desc) where(id: max_id, ref: ref)
else
where(id: max_id)
end
end end
def self.latest_status(ref = nil) def self.latest_status(ref = nil)
......
...@@ -418,7 +418,7 @@ class Project < ActiveRecord::Base ...@@ -418,7 +418,7 @@ class Project < ActiveRecord::Base
repository.commit(ref) repository.commit(ref)
end end
# ref can't be HEAD or SHA, can only be branch/tag name # ref can't be HEAD, can only be branch/tag name or SHA
def latest_successful_builds_for(ref = default_branch) def latest_successful_builds_for(ref = default_branch)
latest_pipeline = pipelines.latest_successful_for(ref) latest_pipeline = pipelines.latest_successful_for(ref)
......
---
title: Fix finding the latest pipeline
merge_request: 8286
author:
...@@ -134,7 +134,6 @@ This behaviour is caused by Git LFS using HTTPS connections by default when a ...@@ -134,7 +134,6 @@ This behaviour is caused by Git LFS using HTTPS connections by default when a
To prevent this from happening, set the lfs url in project Git config: To prevent this from happening, set the lfs url in project Git config:
```bash ```bash
git config --add lfs.url "http://gitlab.example.com/group/project.git/info/lfs" git config --add lfs.url "http://gitlab.example.com/group/project.git/info/lfs"
``` ```
......
...@@ -424,18 +424,20 @@ describe Ci::Pipeline, models: true do ...@@ -424,18 +424,20 @@ describe Ci::Pipeline, models: true do
context 'when no ref is specified' do context 'when no ref is specified' do
let(:pipelines) { described_class.latest.all } let(:pipelines) { described_class.latest.all }
it 'gives the latest pipelines for the same ref and different sha in reverse chronological order' do it 'returns the latest pipeline for the same ref and different sha' do
expect(pipelines.map(&:sha)).to eq(%w[C B A]) expect(pipelines.map(&:sha)).to contain_exactly('A', 'B', 'C')
expect(pipelines.map(&:status)).to eq(%w[skipped failed success]) expect(pipelines.map(&:status)).
to contain_exactly('success', 'failed', 'skipped')
end end
end end
context 'when ref is specified' do context 'when ref is specified' do
let(:pipelines) { described_class.latest('ref').all } let(:pipelines) { described_class.latest('ref').all }
it 'gives the latest pipelines for ref and different sha in reverse chronological order' do it 'returns the latest pipeline for ref and different sha' do
expect(pipelines.map(&:sha)).to eq(%w[B A]) expect(pipelines.map(&:sha)).to contain_exactly('A', 'B')
expect(pipelines.map(&:status)).to eq(%w[failed success]) expect(pipelines.map(&:status)).
to contain_exactly('success', 'failed')
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment