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
1bcecc94
Commit
1bcecc94
authored
Jul 12, 2021
by
Fabio Pitino
Committed by
Adam Hegyi
Jul 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset job_token_scope_enabled setting to false
parent
8157dc31
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb
...t_migrate/20210628124505_reset_job_token_scope_enabled.rb
+16
-0
db/schema_migrations/20210628124505
db/schema_migrations/20210628124505
+1
-0
spec/migrations/reset_job_token_scope_enabled_spec.rb
spec/migrations/reset_job_token_scope_enabled_spec.rb
+25
-0
No files found.
db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb
0 → 100644
View file @
1bcecc94
# frozen_string_literal: true
class
ResetJobTokenScopeEnabled
<
ActiveRecord
::
Migration
[
6.1
]
include
Gitlab
::
Database
::
MigrationHelpers
def
up
with_lock_retries
do
remove_column
:project_ci_cd_settings
,
:job_token_scope_enabled
add_column
:project_ci_cd_settings
,
:job_token_scope_enabled
,
:boolean
,
default:
false
,
null:
false
end
end
def
down
# Irreversible
end
end
db/schema_migrations/20210628124505
0 → 100644
View file @
1bcecc94
7add197fec50d8da5bcdbca83115558480668c26ad3a3fefc4ab93c07f34f63a
\ No newline at end of file
spec/migrations/reset_job_token_scope_enabled_spec.rb
0 → 100644
View file @
1bcecc94
# frozen_string_literal: true
require
'spec_helper'
require_migration!
RSpec
.
describe
ResetJobTokenScopeEnabled
do
let
(
:settings
)
{
table
(
:project_ci_cd_settings
)
}
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:namespaces
)
{
table
(
:namespaces
)
}
let
(
:namespace
)
{
namespaces
.
create!
(
name:
'gitlab'
,
path:
'gitlab-org'
)
}
let
(
:project_1
)
{
projects
.
create!
(
name:
'proj-1'
,
path:
'gitlab-org'
,
namespace_id:
namespace
.
id
)}
let
(
:project_2
)
{
projects
.
create!
(
name:
'proj-2'
,
path:
'gitlab-org'
,
namespace_id:
namespace
.
id
)}
before
do
settings
.
create!
(
id:
1
,
project_id:
project_1
.
id
,
job_token_scope_enabled:
true
)
settings
.
create!
(
id:
2
,
project_id:
project_2
.
id
,
job_token_scope_enabled:
false
)
end
it
'migrates job_token_scope_enabled to be always false'
do
expect
{
migrate!
}
.
to
change
{
settings
.
where
(
job_token_scope_enabled:
false
).
count
}
.
from
(
1
).
to
(
2
)
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