Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
ddca49e4
Commit
ddca49e4
authored
Jul 05, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string in apps/uploaders/*.rb
Partially addresses #47424.
parent
05af3768
Changes
48
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
119 additions
and
13 deletions
+119
-13
app/services/access_token_validation_service.rb
app/services/access_token_validation_service.rb
+2
-0
app/services/after_branch_delete_service.rb
app/services/after_branch_delete_service.rb
+2
-0
app/services/akismet_service.rb
app/services/akismet_service.rb
+2
-0
app/services/audit_event_service.rb
app/services/audit_event_service.rb
+2
-0
app/services/base_count_service.rb
app/services/base_count_service.rb
+2
-0
app/services/base_renderer.rb
app/services/base_renderer.rb
+2
-0
app/services/base_service.rb
app/services/base_service.rb
+2
-0
app/services/cohorts_service.rb
app/services/cohorts_service.rb
+2
-0
app/services/compare_service.rb
app/services/compare_service.rb
+2
-0
app/services/create_branch_service.rb
app/services/create_branch_service.rb
+2
-0
app/services/create_deployment_service.rb
app/services/create_deployment_service.rb
+2
-0
app/services/create_release_service.rb
app/services/create_release_service.rb
+2
-0
app/services/create_snippet_service.rb
app/services/create_snippet_service.rb
+2
-0
app/services/delete_branch_service.rb
app/services/delete_branch_service.rb
+2
-0
app/services/delete_merged_branches_service.rb
app/services/delete_merged_branches_service.rb
+2
-0
app/services/event_create_service.rb
app/services/event_create_service.rb
+2
-0
app/services/git_push_service.rb
app/services/git_push_service.rb
+2
-0
app/services/git_tag_push_service.rb
app/services/git_tag_push_service.rb
+2
-0
app/services/gravatar_service.rb
app/services/gravatar_service.rb
+2
-0
app/services/ham_service.rb
app/services/ham_service.rb
+2
-0
app/services/import_export_clean_up_service.rb
app/services/import_export_clean_up_service.rb
+2
-0
app/services/issuable_base_service.rb
app/services/issuable_base_service.rb
+2
-0
app/services/merge_request_metrics_service.rb
app/services/merge_request_metrics_service.rb
+2
-0
app/services/metrics_service.rb
app/services/metrics_service.rb
+2
-0
app/services/note_summary.rb
app/services/note_summary.rb
+2
-0
app/services/notification_recipient_service.rb
app/services/notification_recipient_service.rb
+2
-0
app/services/notification_service.rb
app/services/notification_service.rb
+2
-0
app/services/preview_markdown_service.rb
app/services/preview_markdown_service.rb
+2
-0
app/services/push_event_payload_service.rb
app/services/push_event_payload_service.rb
+2
-0
app/services/repair_ldap_blocked_user_service.rb
app/services/repair_ldap_blocked_user_service.rb
+2
-0
app/services/repository_archive_clean_up_service.rb
app/services/repository_archive_clean_up_service.rb
+2
-0
app/services/reset_project_cache_service.rb
app/services/reset_project_cache_service.rb
+2
-0
app/services/search_service.rb
app/services/search_service.rb
+2
-0
app/services/spam_check_service.rb
app/services/spam_check_service.rb
+2
-0
app/services/spam_service.rb
app/services/spam_service.rb
+2
-0
app/services/submit_usage_ping_service.rb
app/services/submit_usage_ping_service.rb
+2
-0
app/services/system_hooks_service.rb
app/services/system_hooks_service.rb
+2
-0
app/services/system_note_service.rb
app/services/system_note_service.rb
+22
-13
app/services/todo_service.rb
app/services/todo_service.rb
+2
-0
app/services/update_release_service.rb
app/services/update_release_service.rb
+2
-0
app/services/update_snippet_service.rb
app/services/update_snippet_service.rb
+2
-0
app/services/upload_service.rb
app/services/upload_service.rb
+2
-0
app/services/user_agent_detail_service.rb
app/services/user_agent_detail_service.rb
+2
-0
app/services/user_project_access_changed_service.rb
app/services/user_project_access_changed_service.rb
+2
-0
app/services/validate_new_branch_service.rb
app/services/validate_new_branch_service.rb
+2
-0
app/services/verify_pages_domain_service.rb
app/services/verify_pages_domain_service.rb
+2
-0
app/services/web_hook_service.rb
app/services/web_hook_service.rb
+2
-0
changelogs/unreleased/frozen-string-enable-app-services.yml
changelogs/unreleased/frozen-string-enable-app-services.yml
+5
-0
No files found.
app/services/access_token_validation_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
AccessTokenValidationService
# Results:
VALID
=
:valid
...
...
app/services/after_branch_delete_service.rb
View file @
ddca49e4
# frozen_string_literal: true
##
# Branch can be deleted either by DeleteBranchService
# or by GitPushService.
...
...
app/services/akismet_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
AkismetService
attr_accessor
:owner
,
:text
,
:options
...
...
app/services/audit_event_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
AuditEventService
def
initialize
(
author
,
entity
,
details
=
{})
@author
,
@entity
,
@details
=
author
,
entity
,
details
...
...
app/services/base_count_service.rb
View file @
ddca49e4
# frozen_string_literal: true
# Base class for services that count a single resource such as the number of
# issues for a project.
class
BaseCountService
...
...
app/services/base_renderer.rb
View file @
ddca49e4
# frozen_string_literal: true
class
BaseRenderer
attr_reader
:current_user
...
...
app/services/base_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
BaseService
include
Gitlab
::
Allowable
...
...
app/services/cohorts_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
CohortsService
MONTHS_INCLUDED
=
12
...
...
app/services/compare_service.rb
View file @
ddca49e4
# frozen_string_literal: true
require
'securerandom'
# Compare 2 refs for one repo or between repositories
...
...
app/services/create_branch_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
CreateBranchService
<
BaseService
def
execute
(
branch_name
,
ref
)
create_master_branch
if
project
.
empty_repo?
...
...
app/services/create_deployment_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
CreateDeploymentService
attr_reader
:job
...
...
app/services/create_release_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
CreateReleaseService
<
BaseService
def
execute
(
tag_name
,
release_description
)
repository
=
project
.
repository
...
...
app/services/create_snippet_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
CreateSnippetService
<
BaseService
include
SpamCheckService
...
...
app/services/delete_branch_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
DeleteBranchService
<
BaseService
def
execute
(
branch_name
)
repository
=
project
.
repository
...
...
app/services/delete_merged_branches_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
DeleteMergedBranchesService
<
BaseService
def
async_execute
DeleteMergedBranchesWorker
.
perform_async
(
project
.
id
,
current_user
.
id
)
...
...
app/services/event_create_service.rb
View file @
ddca49e4
# frozen_string_literal: true
# EventCreateService class
#
# Used for creating events feed on dashboard after certain user action
...
...
app/services/git_push_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
GitPushService
<
BaseService
attr_accessor
:push_data
,
:push_commits
include
Gitlab
::
Access
...
...
app/services/git_tag_push_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
GitTagPushService
<
BaseService
attr_accessor
:push_data
...
...
app/services/gravatar_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
GravatarService
def
execute
(
email
,
size
=
nil
,
scale
=
2
,
username:
nil
)
return
unless
Gitlab
::
CurrentSettings
.
gravatar_enabled?
...
...
app/services/ham_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
HamService
attr_accessor
:spam_log
...
...
app/services/import_export_clean_up_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
ImportExportCleanUpService
LAST_MODIFIED_TIME_IN_MINUTES
=
1440
...
...
app/services/issuable_base_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
IssuableBaseService
<
BaseService
private
...
...
app/services/merge_request_metrics_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
MergeRequestMetricsService
delegate
:update!
,
to: :@merge_request_metrics
...
...
app/services/metrics_service.rb
View file @
ddca49e4
# frozen_string_literal: true
require
'prometheus/client/formats/text'
class
MetricsService
...
...
app/services/note_summary.rb
View file @
ddca49e4
# frozen_string_literal: true
class
NoteSummary
attr_reader
:note
attr_reader
:metadata
...
...
app/services/notification_recipient_service.rb
View file @
ddca49e4
# frozen_string_literal: true
#
# Used by NotificationService to determine who should receive notification
#
...
...
app/services/notification_service.rb
View file @
ddca49e4
# frozen_string_literal: true
# rubocop:disable GitlabSecurity/PublicSend
# NotificationService class
...
...
app/services/preview_markdown_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
PreviewMarkdownService
<
BaseService
def
execute
text
,
commands
=
explain_quick_actions
(
params
[
:text
])
...
...
app/services/push_event_payload_service.rb
View file @
ddca49e4
# frozen_string_literal: true
# Service class for creating push event payloads as stored in the
# "push_event_payloads" table.
#
...
...
app/services/repair_ldap_blocked_user_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
RepairLdapBlockedUserService
attr_accessor
:user
...
...
app/services/repository_archive_clean_up_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
RepositoryArchiveCleanUpService
LAST_MODIFIED_TIME_IN_MINUTES
=
120
...
...
app/services/reset_project_cache_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
ResetProjectCacheService
<
BaseService
def
execute
@project
.
increment!
(
:jobs_cache_index
)
...
...
app/services/search_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
SearchService
include
Gitlab
::
Allowable
...
...
app/services/spam_check_service.rb
View file @
ddca49e4
# frozen_string_literal: true
# SpamCheckService
#
# Provide helper methods for checking if a given spammable object has
...
...
app/services/spam_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
SpamService
attr_accessor
:spammable
,
:request
,
:options
attr_reader
:spam_log
...
...
app/services/submit_usage_ping_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
SubmitUsagePingService
URL
=
'https://version.gitlab.com/usage_data'
.
freeze
...
...
app/services/system_hooks_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
SystemHooksService
def
execute_hooks_for
(
model
,
event
)
data
=
build_event_data
(
model
,
event
)
...
...
app/services/system_note_service.rb
View file @
ddca49e4
# frozen_string_literal: true
# SystemNoteService
#
# Used for creating system notes (e.g., when a user references a merge request
...
...
@@ -21,9 +23,11 @@ module SystemNoteService
total_count
=
new_commits
.
length
+
existing_commits
.
length
commits_text
=
"
#{
total_count
}
commit"
.
pluralize
(
total_count
)
body
=
"added
#{
commits_text
}
\n\n
"
body
<<
commits_list
(
noteable
,
new_commits
,
existing_commits
,
oldrev
)
body
<<
"
\n\n
[Compare with previous version](
#{
diff_comparison_url
(
noteable
,
project
,
oldrev
)
}
)"
text_parts
=
[
"added
#{
commits_text
}
"
]
text_parts
<<
commits_list
(
noteable
,
new_commits
,
existing_commits
,
oldrev
)
text_parts
<<
"[Compare with previous version](
#{
diff_comparison_url
(
noteable
,
project
,
oldrev
)
}
)"
body
=
text_parts
.
join
(
"
\n\n
"
)
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'commit'
,
commit_count:
total_count
))
end
...
...
@@ -103,18 +107,19 @@ module SystemNoteService
added_labels
=
added_labels
.
map
(
&
references
).
join
(
' '
)
removed_labels
=
removed_labels
.
map
(
&
references
).
join
(
' '
)
body
=
''
text_parts
=
[]
if
added_labels
.
present?
body
<<
"added
#{
added_labels
}
"
body
<<
' and
'
if
removed_labels
.
present?
text_parts
<<
"added
#{
added_labels
}
"
text_parts
<<
'and
'
if
removed_labels
.
present?
end
if
removed_labels
.
present?
body
<<
"removed
#{
removed_labels
}
"
text_parts
<<
"removed
#{
removed_labels
}
"
end
body
<<
' '
<<
'label'
.
pluralize
(
labels_count
)
text_parts
<<
'label'
.
pluralize
(
labels_count
)
body
=
text_parts
.
join
(
' '
)
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'label'
))
end
...
...
@@ -188,8 +193,10 @@ module SystemNoteService
spent_at
=
noteable
.
spent_at
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
time_spent
.
abs
)
action
=
time_spent
>
0
?
'added'
:
'subtracted'
body
=
"
#{
action
}
#{
parsed_time
}
of time spent"
body
<<
" at
#{
spent_at
}
"
if
spent_at
text_parts
=
[
"
#{
action
}
#{
parsed_time
}
of time spent"
]
text_parts
<<
"at
#{
spent_at
}
"
if
spent_at
body
=
text_parts
.
join
(
' '
)
end
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'time_tracking'
))
...
...
@@ -268,17 +275,19 @@ module SystemNoteService
diff_refs
=
change_position
.
diff_refs
version_index
=
merge_request
.
merge_request_diffs
.
viewable
.
count
body
=
"changed this line in"
text_parts
=
[
"changed this line in"
]
if
version_params
=
merge_request
.
version_params_for
(
diff_refs
)
line_code
=
change_position
.
line_code
(
project
.
repository
)
url
=
url_helpers
.
diffs_project_merge_request_url
(
project
,
merge_request
,
version_params
.
merge
(
anchor:
line_code
))
body
<<
"
[version
#{
version_index
}
of the diff](
#{
url
}
)"
text_parts
<<
"
[version
#{
version_index
}
of the diff](
#{
url
}
)"
else
body
<<
"
version
#{
version_index
}
of the diff"
text_parts
<<
"
version
#{
version_index
}
of the diff"
end
body
=
text_parts
.
join
(
' '
)
note_attributes
=
discussion
.
reply_attributes
.
merge
(
project:
project
,
author:
author
,
note:
body
)
note
=
Note
.
create
(
note_attributes
.
merge
(
system:
true
))
note
.
system_note_metadata
=
SystemNoteMetadata
.
new
(
action:
'outdated'
)
...
...
app/services/todo_service.rb
View file @
ddca49e4
# frozen_string_literal: true
# TodoService class
#
# Used for creating/updating todos after certain user actions
...
...
app/services/update_release_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
UpdateReleaseService
<
BaseService
def
execute
(
tag_name
,
release_description
)
repository
=
project
.
repository
...
...
app/services/update_snippet_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
UpdateSnippetService
<
BaseService
include
SpamCheckService
...
...
app/services/upload_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
UploadService
def
initialize
(
model
,
file
,
uploader_class
=
FileUploader
,
**
uploader_context
)
@model
,
@file
,
@uploader_class
,
@uploader_context
=
model
,
file
,
uploader_class
,
uploader_context
...
...
app/services/user_agent_detail_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
UserAgentDetailService
attr_accessor
:spammable
,
:request
...
...
app/services/user_project_access_changed_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
UserProjectAccessChangedService
def
initialize
(
user_ids
)
@user_ids
=
Array
.
wrap
(
user_ids
)
...
...
app/services/validate_new_branch_service.rb
View file @
ddca49e4
# frozen_string_literal: true
require_relative
'base_service'
class
ValidateNewBranchService
<
BaseService
...
...
app/services/verify_pages_domain_service.rb
View file @
ddca49e4
# frozen_string_literal: true
require
'resolv'
class
VerifyPagesDomainService
<
BaseService
...
...
app/services/web_hook_service.rb
View file @
ddca49e4
# frozen_string_literal: true
class
WebHookService
class
InternalErrorResponse
attr_reader
:body
,
:headers
,
:code
...
...
changelogs/unreleased/frozen-string-enable-app-services.yml
0 → 100644
View file @
ddca49e4
---
title
:
Enable frozen string in apps/uploaders/*.rb
merge_request
:
20401
author
:
gfyoung
type
:
other
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment