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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5a6bb98e
Commit
5a6bb98e
authored
May 19, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
May 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove constant usage from retry build service
parent
d194f3dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
.rubocop.yml
.rubocop.yml
+0
-1
changelogs/unreleased/leaky-constant-fix-10.yml
changelogs/unreleased/leaky-constant-fix-10.yml
+5
-0
spec/services/ci/retry_build_service_spec.rb
spec/services/ci/retry_build_service_spec.rb
+7
-7
No files found.
.rubocop.yml
View file @
5a6bb98e
...
...
@@ -393,7 +393,6 @@ RSpec/LeakyConstantDeclaration:
-
'
spec/requests/api/statistics_spec.rb'
-
'
spec/rubocop/cop/rspec/env_assignment_spec.rb'
-
'
spec/serializers/commit_entity_spec.rb'
-
'
spec/services/ci/retry_build_service_spec.rb'
-
'
spec/services/clusters/applications/check_installation_progress_service_spec.rb'
-
'
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb'
-
'
spec/services/clusters/applications/check_upgrade_progress_service_spec.rb'
...
...
changelogs/unreleased/leaky-constant-fix-10.yml
0 → 100644
View file @
5a6bb98e
---
title
:
Fix leaky constant issue in retry build service check
merge_request
:
32038
author
:
Rajendra Kadam
type
:
fixed
spec/services/ci/retry_build_service_spec.rb
View file @
5a6bb98e
...
...
@@ -22,9 +22,9 @@ describe Ci::RetryBuildService do
described_class
.
new
(
project
,
user
)
end
CLONE_ACCESSORS
=
described_class
::
CLONE_ACCESSORS
clone_accessors
=
described_class
::
CLONE_ACCESSORS
REJECT_ACCESSORS
=
reject_accessors
=
%i[id status user token token_encrypted coverage trace runner
artifacts_expire_at
created_at updated_at started_at finished_at queued_at erased_by
...
...
@@ -40,7 +40,7 @@ describe Ci::RetryBuildService do
job_artifacts_network_referee job_artifacts_dotenv
job_artifacts_cobertura needs job_artifacts_accessibility]
.
freeze
IGNORE_ACCESSORS
=
ignore_accessors
=
%i[type lock_version target_url base_tags trace_sections
commit_id deployment erased_by_id project_id
runner_id tag_taggings taggings tags trigger_request_id
...
...
@@ -91,7 +91,7 @@ describe Ci::RetryBuildService do
end
end
CLONE_ACCESSORS
.
each
do
|
attribute
|
clone_accessors
.
each
do
|
attribute
|
it
"clones
#{
attribute
}
build attribute"
do
expect
(
attribute
).
not_to
be_in
(
forbidden_associations
),
"association
#{
attribute
}
must be `belongs_to`"
expect
(
build
.
send
(
attribute
)).
not_to
be_nil
...
...
@@ -121,7 +121,7 @@ describe Ci::RetryBuildService do
end
describe
'reject accessors'
do
REJECT_ACCESSORS
.
each
do
|
attribute
|
reject_accessors
.
each
do
|
attribute
|
it
"does not clone
#{
attribute
}
build attribute"
do
expect
(
new_build
.
send
(
attribute
)).
not_to
eq
build
.
send
(
attribute
)
end
...
...
@@ -129,8 +129,8 @@ describe Ci::RetryBuildService do
end
it
'has correct number of known attributes'
do
processed_accessors
=
CLONE_ACCESSORS
+
REJECT_ACCESSORS
known_accessors
=
processed_accessors
+
IGNORE_ACCESSORS
processed_accessors
=
clone_accessors
+
reject_accessors
known_accessors
=
processed_accessors
+
ignore_accessors
# :tag_list is a special case, this accessor does not exist
# in reflected associations, comes from `act_as_taggable` and
...
...
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