diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-20 15:06:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-20 15:06:12 +0000 |
commit | 434a995573f6e5cad4e4742af8d1d83d719f39ca (patch) | |
tree | da6dde462c04e1e9d2ca2d41eb07e142c38c1b4d /app | |
parent | d46287cc16ba244720c6d5c00491944336972988 (diff) | |
download | gitlab-ce-434a995573f6e5cad4e4742af8d1d83d719f39ca.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/framework.scss | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/card.scss | 9 | ||||
-rw-r--r-- | app/models/internal_id.rb | 10 |
3 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/stylesheets/framework.scss b/app/assets/stylesheets/framework.scss index c4a0ed63080..56a88ca44db 100644 --- a/app/assets/stylesheets/framework.scss +++ b/app/assets/stylesheets/framework.scss @@ -68,3 +68,4 @@ @import 'framework/flex_grid'; @import 'framework/system_messages'; @import "framework/spinner"; +@import 'framework/card'; diff --git a/app/assets/stylesheets/framework/card.scss b/app/assets/stylesheets/framework/card.scss new file mode 100644 index 00000000000..1e51d28bba2 --- /dev/null +++ b/app/assets/stylesheets/framework/card.scss @@ -0,0 +1,9 @@ +.card-header { + &:first-child { + // intended use case: card with only a header (for example empty related issues) + &.border-0, + &.border-bottom-0 { + @include border-radius($card-inner-border-radius); + } + } +} diff --git a/app/models/internal_id.rb b/app/models/internal_id.rb index 237401899db..946a3aafe18 100644 --- a/app/models/internal_id.rb +++ b/app/models/internal_id.rb @@ -16,6 +16,8 @@ # * Add `usage` value to enum # * (Optionally) add columns to `internal_ids` if needed for scope. class InternalId < ApplicationRecord + include Gitlab::Utils::StrongMemoize + belongs_to :project belongs_to :namespace @@ -47,10 +49,18 @@ class InternalId < ApplicationRecord def update_and_save(&block) lock! yield + update_and_save_counter.increment(usage: usage, changed: last_value_changed?) save! last_value end + # Temporary instrumentation to track for-update locks + def update_and_save_counter + strong_memoize(:update_and_save_counter) do + Gitlab::Metrics.counter(:gitlab_internal_id_for_update_lock, 'Number of ROW SHARE (FOR UPDATE) locks on individual records from internal_ids') + end + end + class << self def track_greatest(subject, scope, usage, new_value, init) return new_value unless available? |