summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2017-12-02 09:08:05 +1100
committerSimon Knox <psimyn@gmail.com>2017-12-02 09:08:05 +1100
commit560d52ce926c2bc7592ce0666ab9b287be1d2324 (patch)
tree29395b1e706c4e07d9a796c15b3164d8f60e0f1c /app
parentafa6359f1e047fb0b258eaf221a67ea749e2f980 (diff)
parente0f84130567dc34edf1ae75fcf595e24991d2fa9 (diff)
downloadgitlab-ce-psimyn-issue-note-refac.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into psimyn-issue-note-refacpsimyn-issue-note-refac
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/groups/components/group_item.vue14
-rw-r--r--app/assets/stylesheets/framework/lists.scss6
-rw-r--r--app/models/ci/pipeline.rb1
-rw-r--r--app/models/project.rb6
-rw-r--r--app/services/ci/create_pipeline_service.rb55
5 files changed, 33 insertions, 49 deletions
diff --git a/app/assets/javascripts/groups/components/group_item.vue b/app/assets/javascripts/groups/components/group_item.vue
index 356a95c05ca..0cd0c59a275 100644
--- a/app/assets/javascripts/groups/components/group_item.vue
+++ b/app/assets/javascripts/groups/components/group_item.vue
@@ -1,4 +1,5 @@
<script>
+import tooltip from '../../vue_shared/directives/tooltip';
import identicon from '../../vue_shared/components/identicon.vue';
import eventHub from '../event_hub';
@@ -8,6 +9,9 @@ import itemStats from './item_stats.vue';
import itemActions from './item_actions.vue';
export default {
+ directives: {
+ tooltip,
+ },
components: {
identicon,
itemCaret,
@@ -112,10 +116,16 @@ export default {
</a>
</div>
<div
- class="title">
+ class="title namespace-title">
<a
+ v-tooltip
:href="group.relativePath"
- class="no-expand">{{group.fullName}}</a>
+ :title="group.fullName"
+ class="no-expand"
+ data-placement="top"
+ >
+ {{group.name}}
+ </a>
<span
v-if="group.permission"
class="access-type"
diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss
index ad3bb0e35d1..cd505bcaf6d 100644
--- a/app/assets/stylesheets/framework/lists.scss
+++ b/app/assets/stylesheets/framework/lists.scss
@@ -449,6 +449,12 @@ ul.indent-list {
}
}
+.namespace-title {
+ .tooltip-inner {
+ max-width: 350px;
+ }
+}
+
ul.group-list-tree {
li.group-row {
&.has-description {
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index fd64670f6b0..eebbf7c4218 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -40,7 +40,6 @@ module Ci
validates :status, presence: { unless: :importing? }
validate :valid_commit_sha, unless: :importing?
- after_initialize :set_config_source, if: :new_record?
after_create :keep_around_commits, unless: :importing?
enum source: {
diff --git a/app/models/project.rb b/app/models/project.rb
index c6f7f56f311..eaf4f555d3b 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -234,8 +234,8 @@ class Project < ActiveRecord::Base
validates :creator, presence: true, on: :create
validates :description, length: { maximum: 2000 }, allow_blank: true
validates :ci_config_path,
- format: { without: /\.{2}/,
- message: 'cannot include directory traversal.' },
+ format: { without: /(\.{2}|\A\/)/,
+ message: 'cannot include leading slash or directory traversal.' },
length: { maximum: 255 },
allow_blank: true
validates :name,
@@ -599,7 +599,7 @@ class Project < ActiveRecord::Base
def ci_config_path=(value)
# Strip all leading slashes so that //foo -> foo
- super(value&.sub(%r{\A/+}, '')&.delete("\0"))
+ super(value&.delete("\0"))
end
def import_url=(value)
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 31a712ccc1b..7b9ea223d26 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -2,27 +2,24 @@ module Ci
class CreatePipelineService < BaseService
attr_reader :pipeline
- SEQUENCE = [Gitlab::Ci::Pipeline::Chain::Validate::Abilities,
+ SEQUENCE = [Gitlab::Ci::Pipeline::Chain::Build,
+ Gitlab::Ci::Pipeline::Chain::Validate::Abilities,
Gitlab::Ci::Pipeline::Chain::Validate::Repository,
Gitlab::Ci::Pipeline::Chain::Validate::Config,
Gitlab::Ci::Pipeline::Chain::Skip,
Gitlab::Ci::Pipeline::Chain::Create].freeze
def execute(source, ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil, &block)
- @pipeline = Ci::Pipeline.new(
- source: source,
- project: project,
- ref: ref,
- sha: sha,
- before_sha: before_sha,
- tag: tag_exists?,
- trigger_requests: Array(trigger_request),
- user: current_user,
- pipeline_schedule: schedule,
- protected: project.protected_for?(ref)
- )
-
- command = OpenStruct.new(ignore_skip_ci: ignore_skip_ci,
+ @pipeline = Ci::Pipeline.new
+
+ command = OpenStruct.new(source: source,
+ origin_ref: params[:ref],
+ checkout_sha: params[:checkout_sha],
+ after_sha: params[:after],
+ before_sha: params[:before],
+ trigger_request: trigger_request,
+ schedule: schedule,
+ ignore_skip_ci: ignore_skip_ci,
save_incompleted: save_on_errors,
seeds_block: block,
project: project,
@@ -45,14 +42,6 @@ module Ci
private
- def commit
- @commit ||= project.commit(origin_sha || origin_ref)
- end
-
- def sha
- commit.try(:id)
- end
-
def update_merge_requests_head_pipeline
return unless pipeline.latest?
@@ -76,26 +65,6 @@ module Ci
.created_or_pending
end
- def before_sha
- params[:checkout_sha] || params[:before] || Gitlab::Git::BLANK_SHA
- end
-
- def origin_sha
- params[:checkout_sha] || params[:after]
- end
-
- def origin_ref
- params[:ref]
- end
-
- def tag_exists?
- project.repository.tag_exists?(ref)
- end
-
- def ref
- @ref ||= Gitlab::Git.ref_name(origin_ref)
- end
-
def pipeline_created_counter
@pipeline_created_counter ||= Gitlab::Metrics
.counter(:pipelines_created_total, "Counter of pipelines created")