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
905a0f73
Commit
905a0f73
authored
Feb 09, 2022
by
Fernando Arias
Committed by
David Fernandez
Feb 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix corpus delete by updating corpus fetch
Filter out corpuses to only get :hidden ones Changelog: fixed EE: true
parent
7199516c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
15 deletions
+25
-15
ee/app/finders/app_sec/fuzzing/coverage/corpuses_finder.rb
ee/app/finders/app_sec/fuzzing/coverage/corpuses_finder.rb
+1
-1
ee/app/models/app_sec/fuzzing/coverage/corpus.rb
ee/app/models/app_sec/fuzzing/coverage/corpus.rb
+2
-2
ee/config/feature_flags/development/corpus_management.yml
ee/config/feature_flags/development/corpus_management.yml
+1
-1
ee/spec/factories/app_sec/fuzzing/coverage/corpuses.rb
ee/spec/factories/app_sec/fuzzing/coverage/corpuses.rb
+1
-1
ee/spec/models/app_sec/fuzzing/coverage/corpus_spec.rb
ee/spec/models/app_sec/fuzzing/coverage/corpus_spec.rb
+20
-10
No files found.
ee/app/finders/app_sec/fuzzing/coverage/corpuses_finder.rb
View file @
905a0f73
...
...
@@ -11,7 +11,7 @@ module AppSec
end
def
execute
AppSec
::
Fuzzing
::
Coverage
::
Corpus
.
by_project_id
(
project
)
AppSec
::
Fuzzing
::
Coverage
::
Corpus
.
by_project_id
_and_status_hidden
(
project
)
end
end
end
...
...
ee/app/models/app_sec/fuzzing/coverage/corpus.rb
View file @
905a0f73
...
...
@@ -18,8 +18,8 @@ module AppSec
validates
:package_id
,
uniqueness:
true
scope
:by_project_id
,
->
(
project_id
)
do
joins
(
:package
).
where
(
package:
{
project_id:
project_id
})
scope
:by_project_id
_and_status_hidden
,
->
(
project_id
)
do
joins
(
:package
).
where
(
package:
{
project_id:
project_id
,
status: :hidden
})
end
def
audit_details
...
...
ee/config/feature_flags/development/corpus_management.yml
View file @
905a0f73
...
...
@@ -5,4 +5,4 @@ rollout_issue_url:
milestone
:
'
13.9'
type
:
development
group
:
group::fuzz testing
default_enabled
:
false
default_enabled
:
false
\ No newline at end of file
ee/spec/factories/app_sec/fuzzing/coverage/corpuses.rb
View file @
905a0f73
...
...
@@ -4,6 +4,6 @@ FactoryBot.define do
factory
:corpus
,
class:
'AppSec::Fuzzing::Coverage::Corpus'
do
user
project
package
{
association
(
:generic_package
,
:with_zip_file
,
project:
project
)
}
package
{
association
(
:generic_package
,
:with_zip_file
,
project:
project
,
status: :hidden
)
}
end
end
ee/spec/models/app_sec/fuzzing/coverage/corpus_spec.rb
View file @
905a0f73
...
...
@@ -3,9 +3,7 @@
require
'spec_helper'
RSpec
.
describe
AppSec
::
Fuzzing
::
Coverage
::
Corpus
,
type: :model
do
let
(
:corpus
)
{
create
(
:corpus
)
}
subject
{
corpus
}
subject
(
:corpus
)
{
create
(
:corpus
)
}
describe
'associations'
do
it
{
is_expected
.
to
belong_to
(
:package
).
class_name
(
'Packages::Package'
)
}
...
...
@@ -75,15 +73,27 @@ RSpec.describe AppSec::Fuzzing::Coverage::Corpus, type: :model do
end
describe
'scopes'
do
describe
'by_project_id'
do
it
'includes the correct records'
do
another_corpus_profile
=
create
(
:corpus
)
describe
'.by_project_id_and_status_hidden'
do
subject
(
:find_corpuses
)
{
described_class
.
by_project_id_and_status_hidden
(
corpus
.
package
.
project_id
)
}
context
'with another_corpus having different project_id'
do
it
'includes the correct records'
do
another_corpus
=
create
(
:corpus
)
result
=
described_class
.
by_project_id
(
subject
.
package
.
project_id
)
aggregate_failures
do
expect
(
find_corpuses
).
to
include
(
corpus
)
expect
(
find_corpuses
).
not_to
include
(
another_corpus
)
end
end
end
context
"with another_corpus having same project with different status apart from hidden"
do
before
do
corpus
.
package
.
update!
(
status: :pending_destruction
)
end
aggregate_failures
do
expect
(
result
).
to
include
(
subject
)
expect
(
result
).
not_to
include
(
another_corpus_profile
)
it
'includes the correct records'
do
expect
(
find_corpuses
).
not_to
include
(
corpus
)
end
end
end
...
...
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