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
679ebf13
Commit
679ebf13
authored
Oct 07, 2021
by
Jonathan Schafer
Committed by
Michael Kozono
Oct 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add jsonb field for Finding Evidence
Changelog: changed
parent
c2ecd08e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
1 deletion
+14
-1
db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb
...10908195506_add_data_to_vulnerability_finding_evidence.rb
+7
-0
db/schema_migrations/20210908195506
db/schema_migrations/20210908195506
+1
-0
db/structure.sql
db/structure.sql
+1
-0
ee/app/models/vulnerabilities/finding/evidence.rb
ee/app/models/vulnerabilities/finding/evidence.rb
+1
-0
ee/spec/models/vulnerabilities/finding/evidence_spec.rb
ee/spec/models/vulnerabilities/finding/evidence_spec.rb
+2
-0
spec/db/schema_spec.rb
spec/db/schema_spec.rb
+2
-1
No files found.
db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb
0 → 100644
View file @
679ebf13
# frozen_string_literal: true
class
AddDataToVulnerabilityFindingEvidence
<
Gitlab
::
Database
::
Migration
[
1.0
]
def
change
add_column
:vulnerability_finding_evidences
,
:data
,
:jsonb
,
default:
{},
null:
false
end
end
db/schema_migrations/20210908195506
0 → 100644
View file @
679ebf13
1ad794ac96f6297203046562c2ec422fbb4d1818a65266bb92179096040f7d82
\ No newline at end of file
db/structure.sql
View file @
679ebf13
...
@@ -20340,6 +20340,7 @@ CREATE TABLE vulnerability_finding_evidences (
...
@@ -20340,6 +20340,7 @@ CREATE TABLE vulnerability_finding_evidences (
updated_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
vulnerability_occurrence_id bigint NOT NULL,
vulnerability_occurrence_id bigint NOT NULL,
summary text,
summary text,
data jsonb DEFAULT '{}'::jsonb NOT NULL,
CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000))
CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000))
);
);
ee/app/models/vulnerabilities/finding/evidence.rb
View file @
679ebf13
...
@@ -33,6 +33,7 @@ module Vulnerabilities
...
@@ -33,6 +33,7 @@ module Vulnerabilities
foreign_key:
'vulnerability_finding_evidence_id'
foreign_key:
'vulnerability_finding_evidence_id'
validates
:summary
,
length:
{
maximum:
8_000_000
}
validates
:summary
,
length:
{
maximum:
8_000_000
}
validates
:data
,
length:
{
maximum:
16_000_000
},
presence:
true
end
end
end
end
end
end
ee/spec/models/vulnerabilities/finding/evidence_spec.rb
View file @
679ebf13
...
@@ -46,4 +46,6 @@ RSpec.describe Vulnerabilities::Finding::Evidence do
...
@@ -46,4 +46,6 @@ RSpec.describe Vulnerabilities::Finding::Evidence do
}
}
it
{
is_expected
.
to
validate_length_of
(
:summary
).
is_at_most
(
8_000_000
)
}
it
{
is_expected
.
to
validate_length_of
(
:summary
).
is_at_most
(
8_000_000
)
}
it
{
is_expected
.
to
validate_presence_of
(
:data
)
}
it
{
is_expected
.
to
validate_length_of
(
:data
).
is_at_most
(
16_000_000
)
}
end
end
spec/db/schema_spec.rb
View file @
679ebf13
...
@@ -204,7 +204,8 @@ RSpec.describe 'Database schema' do
...
@@ -204,7 +204,8 @@ RSpec.describe 'Database schema' do
"Operations::FeatureFlags::Strategy"
=>
%w[parameters]
,
"Operations::FeatureFlags::Strategy"
=>
%w[parameters]
,
"Packages::Composer::Metadatum"
=>
%w[composer_json]
,
"Packages::Composer::Metadatum"
=>
%w[composer_json]
,
"RawUsageData"
=>
%w[payload]
,
# Usage data payload changes often, we cannot use one schema
"RawUsageData"
=>
%w[payload]
,
# Usage data payload changes often, we cannot use one schema
"Releases::Evidence"
=>
%w[summary]
"Releases::Evidence"
=>
%w[summary]
,
"Vulnerabilities::Finding::Evidence"
=>
%w[data]
# Validation work in progress
}.
freeze
}.
freeze
# We are skipping GEO models for now as it adds up complexity
# We are skipping GEO models for now as it adds up complexity
...
...
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