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
6dff1a9a
Commit
6dff1a9a
authored
Apr 22, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Error 500 due to stale cache when projects are renamed or transferred
Closes gitlab-org/gitlab-ee#506
parent
be85fde6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
CHANGELOG
CHANGELOG
+1
-0
app/models/project.rb
app/models/project.rb
+2
-4
app/services/projects/transfer_service.rb
app/services/projects/transfer_service.rb
+2
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+2
-5
No files found.
CHANGELOG
View file @
6dff1a9a
...
@@ -8,6 +8,7 @@ v 8.7.1 (unreleased)
...
@@ -8,6 +8,7 @@ v 8.7.1 (unreleased)
- Fix license detection to detect all license files, not only known licenses. !3878
- Fix license detection to detect all license files, not only known licenses. !3878
- Use the `can?` helper instead of `current_user.can?`. !3882
- Use the `can?` helper instead of `current_user.can?`. !3882
- Prevent users from deleting Webhooks via API they do not own
- Prevent users from deleting Webhooks via API they do not own
- Fix Error 500 due to stale cache when projects are renamed or transferred
v 8.7.0
v 8.7.0
- Gitlab::GitAccess and Gitlab::GitAccessWiki are now instrumented
- Gitlab::GitAccess and Gitlab::GitAccessWiki are now instrumented
...
...
app/models/project.rb
View file @
6dff1a9a
...
@@ -820,13 +820,11 @@ class Project < ActiveRecord::Base
...
@@ -820,13 +820,11 @@ class Project < ActiveRecord::Base
wiki
=
Repository
.
new
(
"
#{
old_path
}
.wiki"
,
self
)
wiki
=
Repository
.
new
(
"
#{
old_path
}
.wiki"
,
self
)
if
repo
.
exists?
if
repo
.
exists?
repo
.
expire_cache
repo
.
before_delete
repo
.
expire_emptiness_caches
end
end
if
wiki
.
exists?
if
wiki
.
exists?
wiki
.
expire_cache
wiki
.
before_delete
wiki
.
expire_emptiness_caches
end
end
end
end
...
...
app/services/projects/transfer_service.rb
View file @
6dff1a9a
...
@@ -34,6 +34,8 @@ module Projects
...
@@ -34,6 +34,8 @@ module Projects
raise
TransferError
.
new
(
"Project with same path in target namespace already exists"
)
raise
TransferError
.
new
(
"Project with same path in target namespace already exists"
)
end
end
project
.
expire_caches_before_rename
(
old_path
)
# Apply new namespace id and visibility level
# Apply new namespace id and visibility level
project
.
namespace
=
new_namespace
project
.
namespace
=
new_namespace
project
.
visibility_level
=
new_namespace
.
visibility_level
unless
project
.
visibility_level_allowed_by_group?
project
.
visibility_level
=
new_namespace
.
visibility_level
unless
project
.
visibility_level_allowed_by_group?
...
...
spec/models/project_spec.rb
View file @
6dff1a9a
...
@@ -719,11 +719,8 @@ describe Project, models: true do
...
@@ -719,11 +719,8 @@ describe Project, models: true do
with
(
'foo.wiki'
,
project
).
with
(
'foo.wiki'
,
project
).
and_return
(
wiki
)
and_return
(
wiki
)
expect
(
repo
).
to
receive
(
:expire_cache
)
expect
(
repo
).
to
receive
(
:before_delete
)
expect
(
repo
).
to
receive
(
:expire_emptiness_caches
)
expect
(
wiki
).
to
receive
(
:before_delete
)
expect
(
wiki
).
to
receive
(
:expire_cache
)
expect
(
wiki
).
to
receive
(
:expire_emptiness_caches
)
project
.
expire_caches_before_rename
(
'foo'
)
project
.
expire_caches_before_rename
(
'foo'
)
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