Skip to content
Snippets Groups Projects
Commit ea930e5a authored by Mayra Cabrera's avatar Mayra Cabrera
Browse files

Revert "Merge branch 'security-ag-contribution-analytics' into 'master'"

This reverts merge request !58
parent ca358373
No related branches found
No related tags found
No related merge requests found
Showing
with 68 additions and 92 deletions
Loading
Loading
@@ -419,8 +419,7 @@ end
 
gem 'octokit', '~> 4.15'
 
# https://gitlab.com/gitlab-org/gitlab/issues/207207
gem 'gitlab-mail_room', '~> 0.0.2', require: 'mail_room'
gem 'mail_room', '~> 0.10.0'
 
gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text'
Loading
Loading
Loading
Loading
@@ -388,7 +388,6 @@ GEM
opentracing (~> 0.4)
redis (> 3.0.0, < 5.0.0)
gitlab-license (1.0.0)
gitlab-mail_room (0.0.2)
gitlab-markup (1.7.0)
gitlab-net-dns (0.9.1)
gitlab-puma (4.3.1.gitlab.2)
Loading
Loading
@@ -617,6 +616,7 @@ GEM
lumberjack (1.0.13)
mail (2.7.1)
mini_mime (>= 0.1.1)
mail_room (0.10.0)
marcel (0.3.3)
mimemagic (~> 0.3.2)
marginalia (1.8.0)
Loading
Loading
@@ -1235,7 +1235,6 @@ DEPENDENCIES
gitlab-chronic (~> 0.10.5)
gitlab-labkit (= 0.10.0)
gitlab-license (~> 1.0)
gitlab-mail_room (~> 0.0.2)
gitlab-markup (~> 1.7.0)
gitlab-net-dns (~> 0.9.1)
gitlab-puma (~> 4.3.1.gitlab.2)
Loading
Loading
@@ -1285,6 +1284,7 @@ DEPENDENCIES
loofah (~> 2.2)
lru_redux
mail (= 2.7.1)
mail_room (~> 0.10.0)
marginalia (~> 1.8.0)
memory_profiler (~> 0.9)
method_source (~> 0.8)
Loading
Loading
Loading
Loading
@@ -166,7 +166,6 @@ export default {
:href="lineHref"
@click="setHighlightedRow(lineCode)"
>
{{ lineNumber }}
</a>
<diff-gutter-avatars
v-if="shouldShowAvatarsOnGutter"
Loading
Loading
Loading
Loading
@@ -28,8 +28,6 @@ export const getUserData = state => state.userData || {};
 
export const getUserDataByProp = state => prop => state.userData && state.userData[prop];
 
export const descriptionVersion = state => state.descriptionVersion;
export const notesById = state =>
state.discussions.reduce((acc, note) => {
note.notes.every(n => Object.assign(acc, { [n.id]: n }));
Loading
Loading
Loading
Loading
@@ -54,8 +54,8 @@ export default {
};
},
computed: {
...mapGetters(['targetNoteHash', 'descriptionVersion']),
...mapState(['isLoadingDescriptionVersion']),
...mapGetters(['targetNoteHash']),
...mapState(['descriptionVersion', 'isLoadingDescriptionVersion']),
noteAnchorId() {
return `note_${this.note.id}`;
},
Loading
Loading
Loading
Loading
@@ -485,6 +485,10 @@ table.code {
}
}
}
&:not(.js-unfold-bottom) a::before {
content: attr(data-linenumber);
}
}
 
&.line_content {
Loading
Loading
Loading
Loading
@@ -20,10 +20,6 @@ def skip_project_check?
false
end
 
def can_cache_field?(field)
true
end
# Returns the default Banzai render context for the cached markdown field.
def banzai_render_context(field)
raise ArgumentError.new("Unknown field: #{field.inspect}") unless
Loading
Loading
@@ -42,23 +38,17 @@ def banzai_render_context(field)
context
end
 
def rendered_field_content(markdown_field)
return unless can_cache_field?(markdown_field)
options = { skip_project_check: skip_project_check? }
Banzai::Renderer.cacheless_render_field(self, markdown_field, options)
end
# Update every applicable column in a row if any one is invalidated, as we only store
# Update every column in a row if any one is invalidated, as we only store
# one version per row
def refresh_markdown_cache
options = { skip_project_check: skip_project_check? }
updates = cached_markdown_fields.markdown_fields.map do |markdown_field|
[
cached_markdown_fields.html_field(markdown_field),
rendered_field_content(markdown_field)
Banzai::Renderer.cacheless_render_field(self, markdown_field, options)
]
end.to_h
updates['cached_markdown_version'] = latest_cached_markdown_version
 
updates.each { |field, data| write_markdown_field(field, data) }
Loading
Loading
# frozen_string_literal: true
 
class ResourceEvent < ApplicationRecord
include Gitlab::Utils::StrongMemoize
include Importable
module ResourceEventTools
extend ActiveSupport::Concern
 
self.abstract_class = true
included do
belongs_to :user
 
validates :user, presence: { unless: :importing? }, on: :create
validates :user, presence: { unless: :importing? }, on: :create
 
belongs_to :user
validate :exactly_one_issuable
 
scope :created_after, ->(time) { where('created_at > ?', time) }
def discussion_id
strong_memoize(:discussion_id) do
Digest::SHA1.hexdigest(discussion_id_key.join("-"))
end
end
private
def discussion_id_key
[self.class.name, created_at, user_id]
scope :created_after, ->(time) { where('created_at > ?', time) }
end
 
def exactly_one_issuable
Loading
Loading
Loading
Loading
@@ -406,15 +406,11 @@ def mattermost_team_params
end
 
def ci_variables_for(ref, project)
cache_key = "ci_variables_for:group:#{self&.id}:project:#{project&.id}:ref:#{ref}"
::Gitlab::SafeRequestStore.fetch(cache_key) do
list_of_ids = [self] + ancestors
variables = Ci::GroupVariable.where(group: list_of_ids)
variables = variables.unprotected unless project.protected_for?(ref)
variables = variables.group_by(&:group_id)
list_of_ids.reverse.flat_map { |group| variables[group.id] }.compact
end
list_of_ids = [self] + ancestors
variables = Ci::GroupVariable.where(group: list_of_ids)
variables = variables.unprotected unless project.protected_for?(ref)
variables = variables.group_by(&:group_id)
list_of_ids.reverse.flat_map { |group| variables[group.id] }.compact
end
 
def group_member(user)
Loading
Loading
Loading
Loading
@@ -1963,14 +1963,6 @@ def default_environment
end
 
def ci_variables_for(ref:, environment: nil)
cache_key = "ci_variables_for:project:#{self&.id}:ref:#{ref}:environment:#{environment}"
::Gitlab::SafeRequestStore.fetch(cache_key) do
uncached_ci_variables_for(ref: ref, environment: environment)
end
end
def uncached_ci_variables_for(ref:, environment: nil)
result = if protected_for?(ref)
variables
else
Loading
Loading
# frozen_string_literal: true
 
class ResourceLabelEvent < ResourceEvent
class ResourceLabelEvent < ApplicationRecord
include Importable
include Gitlab::Utils::StrongMemoize
include CacheMarkdownField
include ResourceEventTools
 
cache_markdown_field :reference
 
Loading
Loading
@@ -10,11 +13,8 @@ class ResourceLabelEvent < ResourceEvent
belongs_to :label
 
scope :inc_relations, -> { includes(:label, :user) }
scope :by_issue, ->(issue) { where(issue_id: issue.id) }
scope :by_merge_request, ->(merge_request) { where(merge_request_id: merge_request.id) }
 
validates :label, presence: { unless: :importing? }, on: :create
validate :exactly_one_issuable
 
after_save :expire_etag_cache
after_destroy :expire_etag_cache
Loading
Loading
@@ -41,6 +41,12 @@ def issuable
issue || merge_request
end
 
def discussion_id(resource = nil)
strong_memoize(:discussion_id) do
Digest::SHA1.hexdigest(discussion_id_key.join("-"))
end
end
def project
issuable.project
end
Loading
Loading
@@ -103,6 +109,10 @@ def local_label?
def resource_parent
issuable.project || issuable.group
end
def discussion_id_key
[self.class.name, created_at, user_id]
end
end
 
ResourceLabelEvent.prepend_if_ee('EE::ResourceLabelEvent')
# frozen_string_literal: true
 
class ResourceMilestoneEvent < ResourceEvent
class ResourceMilestoneEvent < ApplicationRecord
include Gitlab::Utils::StrongMemoize
include Importable
include ResourceEventTools
belongs_to :issue
belongs_to :merge_request
belongs_to :milestone
Loading
Loading
@@ -8,8 +12,6 @@ class ResourceMilestoneEvent < ResourceEvent
scope :by_issue, ->(issue) { where(issue_id: issue.id) }
scope :by_merge_request, ->(merge_request) { where(merge_request_id: merge_request.id) }
 
validate :exactly_one_issuable
enum action: {
add: 1,
remove: 2
Loading
Loading
@@ -21,4 +23,8 @@ class ResourceMilestoneEvent < ResourceEvent
def self.issuable_attrs
%i(issue merge_request).freeze
end
def resource
issue || merge_request
end
end
# frozen_string_literal: true
 
class ResourceWeightEvent < ResourceEvent
class ResourceWeightEvent < ApplicationRecord
include Gitlab::Utils::StrongMemoize
validates :user, presence: true
validates :issue, presence: true
 
belongs_to :user
belongs_to :issue
 
scope :by_issue, ->(issue) { where(issue_id: issue.id) }
scope :created_after, ->(time) { where('created_at > ?', time) }
def discussion_id(resource = nil)
strong_memoize(:discussion_id) do
Digest::SHA1.hexdigest(discussion_id_key.join("-"))
end
end
private
def discussion_id_key
[self.class.name, created_at, user_id]
end
end
Loading
Loading
@@ -301,10 +301,6 @@ def track_snippet_repository
repository.update!(shard_name: repository_storage, disk_path: disk_path)
end
 
def can_cache_field?(field)
field != :content || MarkupHelper.gitlab_markdown?(file_name)
end
class << self
# Searches for snippets with a matching title or file name.
#
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
module UserBotTypeEnums
def self.bots
# When adding a new key, please ensure you are not conflicting with EE-only keys in app/models/user_bot_type_enums.rb
# When adding a new key, please ensure you are not conflicting with EE-only keys in app/models/user_bot_types_enums.rb
{
alert_bot: 2
}
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ get_mail_room_pid()
 
start()
{
bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room --log-exit-as json -q -c $mail_room_config >> $mail_room_logfile 2>&1
bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1
}
 
stop()
Loading
Loading
---
title: Replace content_viewer_spec setTimeouts with semantic actions / events
merge_request:
author: Oregand
type: other
---
title: Replace line diff number css selector with actual HTML inside MRs
merge_request:
author: Oregand
type: other
---
title: Improve error messages of failed migrations
merge_request: 25457
author:
type: changed
---
title: Fix Snippet content incorrectly caching
merge_request: 25985
author:
type: fixed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment