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
5e9541ee
Commit
5e9541ee
authored
Feb 23, 2021
by
Philip Cunningham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add branch_name to Dast::Profile
Adds new field to track which branch a scan runs against.
parent
b4ad8f3d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
0 deletions
+33
-0
changelogs/unreleased/philipcunningham-add-branch-to-dast-profile-322526.yml
...ed/philipcunningham-add-branch-to-dast-profile-322526.yml
+5
-0
db/migrate/20210223053451_add_branch_name_to_dast_profile.rb
db/migrate/20210223053451_add_branch_name_to_dast_profile.rb
+23
-0
db/schema_migrations/20210223053451
db/schema_migrations/20210223053451
+1
-0
db/structure.sql
db/structure.sql
+2
-0
ee/app/models/dast/profile.rb
ee/app/models/dast/profile.rb
+1
-0
ee/spec/models/dast/profile_spec.rb
ee/spec/models/dast/profile_spec.rb
+1
-0
No files found.
changelogs/unreleased/philipcunningham-add-branch-to-dast-profile-322526.yml
0 → 100644
View file @
5e9541ee
---
title
:
Add branch_name to dast_profiles table
merge_request
:
54891
author
:
type
:
added
db/migrate/20210223053451_add_branch_name_to_dast_profile.rb
0 → 100644
View file @
5e9541ee
# frozen_string_literal: true
class
AddBranchNameToDastProfile
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
with_lock_retries
do
add_column
:dast_profiles
,
:branch_name
,
:text
end
add_text_limit
:dast_profiles
,
:branch_name
,
255
end
def
down
with_lock_retries
do
remove_column
:dast_profiles
,
:branch_name
end
end
end
db/schema_migrations/20210223053451
0 → 100644
View file @
5e9541ee
1266bf92f23a42d96778bf546534882f03d2388f22640e4cfaa2a9a1aad19093
\ No newline at end of file
db/structure.sql
View file @
5e9541ee
...
@@ -11632,7 +11632,9 @@ CREATE TABLE dast_profiles (
...
@@ -11632,7 +11632,9 @@ CREATE TABLE dast_profiles (
updated_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
name text NOT NULL,
name text NOT NULL,
description text NOT NULL,
description text NOT NULL,
branch_name text,
CONSTRAINT check_5fcf73bf61 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_5fcf73bf61 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_6c9d775949 CHECK ((char_length(branch_name) <= 255)),
CONSTRAINT check_c34e505c24 CHECK ((char_length(description) <= 255))
CONSTRAINT check_c34e505c24 CHECK ((char_length(description) <= 255))
);
);
ee/app/models/dast/profile.rb
View file @
5e9541ee
...
@@ -10,6 +10,7 @@ module Dast
...
@@ -10,6 +10,7 @@ module Dast
validates
:description
,
length:
{
maximum:
255
}
validates
:description
,
length:
{
maximum:
255
}
validates
:name
,
length:
{
maximum:
255
},
uniqueness:
{
scope: :project_id
},
presence:
true
validates
:name
,
length:
{
maximum:
255
},
uniqueness:
{
scope: :project_id
},
presence:
true
validates
:branch_name
,
length:
{
maximum:
255
}
validates
:project_id
,
:dast_site_profile_id
,
:dast_scanner_profile_id
,
presence:
true
validates
:project_id
,
:dast_site_profile_id
,
:dast_scanner_profile_id
,
presence:
true
validate
:project_ids_match
validate
:project_ids_match
...
...
ee/spec/models/dast/profile_spec.rb
View file @
5e9541ee
...
@@ -15,6 +15,7 @@ RSpec.describe Dast::Profile, type: :model do
...
@@ -15,6 +15,7 @@ RSpec.describe Dast::Profile, type: :model do
it
{
is_expected
.
to
be_valid
}
it
{
is_expected
.
to
be_valid
}
it
{
is_expected
.
to
validate_length_of
(
:name
).
is_at_most
(
255
)
}
it
{
is_expected
.
to
validate_length_of
(
:name
).
is_at_most
(
255
)
}
it
{
is_expected
.
to
validate_length_of
(
:description
).
is_at_most
(
255
)
}
it
{
is_expected
.
to
validate_length_of
(
:description
).
is_at_most
(
255
)
}
it
{
is_expected
.
to
validate_length_of
(
:branch_name
).
is_at_most
(
255
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:name
).
scoped_to
(
:project_id
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:name
).
scoped_to
(
:project_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:dast_site_profile_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:dast_site_profile_id
)
}
...
...
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