Skip to content
Snippets Groups Projects
Commit b92c6d36 authored by Changzheng Liu's avatar Changzheng Liu Committed by Thong Kuah
Browse files

Clarified some backend code comments

parent 751d82f7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -34,7 +34,6 @@ def group_members
# We need `.connected_to_user` here otherwise when a group has an
# invitee, it would make the following query return 0 rows since a NULL
# user_id would be present in the subquery
# See http://stackoverflow.com/questions/129077/not-in-clause-and-null-values
non_null_user_ids = project.project_members.connected_to_user.select(:user_id)
GroupMembersFinder.new(project.group).execute.where.not(user_id: non_null_user_ids)
end
Loading
Loading
Loading
Loading
@@ -17,9 +17,8 @@
# 3: high priority
# 5: _super_ high priority, this should only be used for _very_ important queues
#
# As per http://stackoverflow.com/a/21241357/290102 the formula for calculating
# the likelihood of a job being popped off a queue (given all queues have work
# to perform) is:
# The formula for calculating the likelihood of a job being popped off a queue
# (given all queues have work to perform) is:
#
# chance = (queue weight / total weight of all queues) * 100
---
Loading
Loading
Loading
Loading
@@ -53,7 +53,6 @@ def sort_findings(findings)
# environment.
# This is easier to address from within the class rather than from tests because this leads to bad class design
# and exposing too much of its implementation details to the test suite.
# See also https://stackoverflow.com/questions/15442298/is-sort-in-ruby-stable.
Gitlab::Utils.stable_sort_by(findings) { |x| [-x.severity_value, -x.confidence_value] }
end
 
Loading
Loading
Loading
Loading
@@ -114,7 +114,7 @@ def analyze_parents(commit)
# If child commit is a direct ancestor, its first parent is also a direct ancestor.
# We assume direct ancestors matches the trail of the target branch over time,
# This assumption is correct most of the time, especially for gitlab managed merges,
# but there are exception cases which can't be solved (https://stackoverflow.com/a/49754723/474597)
# but there are exception cases which can't be solved.
def mark_all_direct_ancestors(commit)
loop do
commit = get_commit(commit.parent_ids.first)
Loading
Loading
Loading
Loading
@@ -21,7 +21,7 @@
#
# The deploy stage copies the exe and msi from build stage to a network drive
# You need to have the network drive mapped as Local System user for gitlab-runner service to see it
# The best way to persist the mapping is via a scheduled task (see: https://stackoverflow.com/a/7867064/1288473),
# The best way to persist the mapping is via a scheduled task
# running the following batch command: net use P: \\x.x.x.x\Projects /u:your_user your_pass /persistent:yes
 
# place project specific paths in variables to make the rest of the script more generic
Loading
Loading
Loading
Loading
@@ -3,7 +3,6 @@
module Gitlab
module Ci
class Trace
# This was inspired from: http://stackoverflow.com/a/10219411/1520132
class Stream
BUFFER_SIZE = 4096
LIMIT_SIZE = 500.kilobytes
Loading
Loading
Loading
Loading
@@ -5,7 +5,6 @@
module Gitlab
module Git
# The ID of empty tree.
# See http://stackoverflow.com/a/40884093/1856239 and
# https://github.com/git/git/blob/3ad8b5bf26362ac67c9020bf8c30eee54a84f56d/cache.h#L1011-L1012
EMPTY_TREE_ID = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
BLANK_SHA = ('0' * 40).freeze
Loading
Loading
# GitLab logrotate settings
# based on: http://stackoverflow.com/a/4883967
 
/home/git/gitlab/log/*.log {
su git git
Loading
Loading
Loading
Loading
@@ -86,9 +86,8 @@ namespace :gitlab do
# 3: high priority
# 5: _super_ high priority, this should only be used for _very_ important queues
#
# As per http://stackoverflow.com/a/21241357/290102 the formula for calculating
# the likelihood of a job being popped off a queue (given all queues have work
# to perform) is:
# The formula for calculating the likelihood of a job being popped off a queue
# (given all queues have work to perform) is:
#
# chance = (queue weight / total weight of all queues) * 100
BANNER
Loading
Loading
Loading
Loading
@@ -17,7 +17,6 @@ def commit_tree(tree_id, msg, parent: Gitlab::Git::EMPTY_TREE_ID)
commit_id[0]
end
 
# Based on https://stackoverflow.com/a/25556917/1856239
def commit_file(file, dst_path, branch = 'master')
head_id = execute(['show', '--format=format:%H', '--no-patch', branch], allow_failure: true)[0] || Gitlab::Git::EMPTY_TREE_ID
 
Loading
Loading
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