Commit 7b875aa3 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 9caed104
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
"Facebook", "Facebook",
"Git LFS", "Git LFS",
"git-annex", "git-annex",
"gitlab-ui",
"Git", "Git",
"Gitaly", "Gitaly",
"GitHub", "GitHub",
......
...@@ -1577,7 +1577,9 @@ class Project < ApplicationRecord ...@@ -1577,7 +1577,9 @@ class Project < ApplicationRecord
end end
def wiki def wiki
@wiki ||= ProjectWiki.new(self, self.owner) strong_memoize(:wiki) do
ProjectWiki.new(self, self.owner)
end
end end
def jira_tracker_active? def jira_tracker_active?
......
...@@ -8,13 +8,12 @@ module Projects ...@@ -8,13 +8,12 @@ module Projects
class BaseRepositoryService < BaseService class BaseRepositoryService < BaseService
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
attr_reader :old_disk_path, :new_disk_path, :old_wiki_disk_path, :old_storage_version, :logger, :move_wiki attr_reader :old_disk_path, :new_disk_path, :old_storage_version, :logger, :move_wiki
def initialize(project:, old_disk_path:, logger: nil) def initialize(project:, old_disk_path:, logger: nil)
@project = project @project = project
@logger = logger || Gitlab::AppLogger @logger = logger || Gitlab::AppLogger
@old_disk_path = old_disk_path @old_disk_path = old_disk_path
@old_wiki_disk_path = "#{old_disk_path}.wiki"
@move_wiki = has_wiki? @move_wiki = has_wiki?
end end
...@@ -44,9 +43,21 @@ module Projects ...@@ -44,9 +43,21 @@ module Projects
gitlab_shell.mv_repository(project.repository_storage, from_name, to_name) gitlab_shell.mv_repository(project.repository_storage, from_name, to_name)
end end
def move_repositories
result = move_repository(old_disk_path, new_disk_path)
project.reload_repository!
if move_wiki
result &&= move_repository(old_wiki_disk_path, new_wiki_disk_path)
project.clear_memoization(:wiki)
end
result
end
def rollback_folder_move def rollback_folder_move
move_repository(new_disk_path, old_disk_path) move_repository(new_disk_path, old_disk_path)
move_repository("#{new_disk_path}.wiki", old_wiki_disk_path) move_repository(new_wiki_disk_path, old_wiki_disk_path)
end end
def try_to_set_repository_read_only! def try_to_set_repository_read_only!
...@@ -58,6 +69,20 @@ module Projects ...@@ -58,6 +69,20 @@ module Projects
raise RepositoryInUseError, migration_error raise RepositoryInUseError, migration_error
end end
end end
def wiki_path_suffix
@wiki_path_suffix ||= Gitlab::GlRepository::WIKI.path_suffix
end
def old_wiki_disk_path
@old_wiki_disk_path ||= "#{old_disk_path}#{wiki_path_suffix}"
end
def new_wiki_disk_path
@new_wiki_disk_path ||= "#{new_disk_path}#{wiki_path_suffix}"
end
end end
end end
end end
Projects::HashedStorage::BaseRepositoryService.prepend_if_ee('EE::Projects::HashedStorage::BaseRepositoryService')
...@@ -11,11 +11,7 @@ module Projects ...@@ -11,11 +11,7 @@ module Projects
@new_disk_path = project.disk_path @new_disk_path = project.disk_path
result = move_repository(old_disk_path, new_disk_path) result = move_repositories
if move_wiki
result &&= move_repository(old_wiki_disk_path, "#{new_disk_path}.wiki")
end
if result if result
project.write_repository_config project.write_repository_config
......
...@@ -11,11 +11,7 @@ module Projects ...@@ -11,11 +11,7 @@ module Projects
@new_disk_path = project.disk_path @new_disk_path = project.disk_path
result = move_repository(old_disk_path, new_disk_path) result = move_repositories
if move_wiki
result &&= move_repository(old_wiki_disk_path, "#{new_disk_path}.wiki")
end
if result if result
project.write_repository_config project.write_repository_config
......
...@@ -36,6 +36,6 @@ if GitlabDanger.new(helper.gitlab_helper).ci? ...@@ -36,6 +36,6 @@ if GitlabDanger.new(helper.gitlab_helper).ci?
Also consider auto-formatting [on-save]. Also consider auto-formatting [on-save].
[on-save]: https://docs.gitlab.com/ee/development/new_fe_guide/style/prettier.html [on-save]: https://docs.gitlab.com/ee/development/fe_guide/tooling.html#formatting-with-prettier
MARKDOWN MARKDOWN
end end
# frozen_string_literal: true
class AddDesignDiskPathToGeoHashedStorageMigratedEvents < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
add_column :geo_hashed_storage_migrated_events, :old_design_disk_path, :text
add_column :geo_hashed_storage_migrated_events, :new_design_disk_path, :text
end
end
...@@ -1663,6 +1663,8 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do ...@@ -1663,6 +1663,8 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do
t.text "new_wiki_disk_path", null: false t.text "new_wiki_disk_path", null: false
t.integer "old_storage_version", limit: 2 t.integer "old_storage_version", limit: 2
t.integer "new_storage_version", limit: 2, null: false t.integer "new_storage_version", limit: 2, null: false
t.text "old_design_disk_path"
t.text "new_design_disk_path"
t.index ["project_id"], name: "index_geo_hashed_storage_migrated_events_on_project_id" t.index ["project_id"], name: "index_geo_hashed_storage_migrated_events_on_project_id"
end end
......
...@@ -289,16 +289,16 @@ Example: Issues can be sorted by creation date: ...@@ -289,16 +289,16 @@ Example: Issues can be sorted by creation date:
```graphql ```graphql
query { query {
project(fullPath: "gitlab-org/graphql-sandbox") { project(fullPath: "gitlab-org/graphql-sandbox") {
name name
issues(sort: created_asc) { issues(sort: created_asc) {
nodes { nodes {
title title
createdAt createdAt
}
} }
} }
} }
}
``` ```
## Pagination ## Pagination
...@@ -324,9 +324,9 @@ query { ...@@ -324,9 +324,9 @@ query {
title title
} }
} }
pageInfo { pageInfo {
endCursor endCursor
hasNextPage hasNextPage
} }
} }
} }
......
...@@ -293,6 +293,10 @@ Scripts specified in `after_script` are executed in a new shell, separate from a ...@@ -293,6 +293,10 @@ Scripts specified in `after_script` are executed in a new shell, separate from a
- Command aliases and variables exported in `script` scripts. - Command aliases and variables exported in `script` scripts.
- Changes outside of the working tree (depending on the Runner executor), like - Changes outside of the working tree (depending on the Runner executor), like
software installed by a `before_script` or `script` script. software installed by a `before_script` or `script` script.
- Have a separate timeout, which is hard coded to 5 minutes. See
[related issue](https://gitlab.com/gitlab-org/gitlab-runner/issues/2716) for details.
- Do not affect the job's exit code. If the `script` section succeeds and the
`after_script` times out or fails, the job will exit with code `0` (`Job Succeeded`).
It's possible to overwrite a globally defined `before_script` or `after_script` It's possible to overwrite a globally defined `before_script` or `after_script`
if you set it per-job: if you set it per-job:
......
...@@ -51,10 +51,10 @@ bound on mounting and destroyed when the button is, mitigating the above ...@@ -51,10 +51,10 @@ bound on mounting and destroyed when the button is, mitigating the above
issue. It also has bindings to a particular container or modal ID issue. It also has bindings to a particular container or modal ID
available, to work with the focus trap created by our GlModal. available, to work with the focus trap created by our GlModal.
### 3. A gitlab-ui component not conforming to [Pajamas Design System](https://design.gitlab.com/) ### 3. A `gitlab-ui` component not conforming to [Pajamas Design System](https://design.gitlab.com/)
Some [Pajamas Design System](https://design.gitlab.com/) components implemented in Some [Pajamas Design System](https://design.gitlab.com/) components implemented in
gitlab-ui do not conform with the design system specs because they lack some `gitlab-ui` do not conform with the design system specs because they lack some
planned features or are not correctly styled yet. In the Pajamas website, a planned features or are not correctly styled yet. In the Pajamas website, a
banner on top of the component examples indicates that: banner on top of the component examples indicates that:
......
...@@ -11,7 +11,7 @@ easy to maintain, and performant for the end-user. ...@@ -11,7 +11,7 @@ easy to maintain, and performant for the end-user.
### Utility Classes ### Utility Classes
As part of the effort for [cleaning up our CSS and moving our components into gitlab-ui](https://gitlab.com/groups/gitlab-org/-/epics/950) As part of the effort for [cleaning up our CSS and moving our components into `gitlab-ui`](https://gitlab.com/groups/gitlab-org/-/epics/950)
led by the [GitLab UI WG](https://gitlab.com/gitlab-com/www-gitlab-com/merge_requests/20623) we prefer the use of utility classes over adding new CSS. However, complex CSS can be addressed by adding component classes. led by the [GitLab UI WG](https://gitlab.com/gitlab-com/www-gitlab-com/merge_requests/20623) we prefer the use of utility classes over adding new CSS. However, complex CSS can be addressed by adding component classes.
#### Where are utility classes defined? #### Where are utility classes defined?
......
...@@ -1793,6 +1793,7 @@ describe Project do ...@@ -1793,6 +1793,7 @@ describe Project do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:repo) { double(:repo, exists?: true) } let(:repo) { double(:repo, exists?: true) }
let(:wiki) { double(:wiki, exists?: true) } let(:wiki) { double(:wiki, exists?: true) }
let(:design) { double(:wiki, exists?: false) }
it 'expires the caches of the repository and wiki' do it 'expires the caches of the repository and wiki' do
allow(Repository).to receive(:new) allow(Repository).to receive(:new)
...@@ -1803,6 +1804,10 @@ describe Project do ...@@ -1803,6 +1804,10 @@ describe Project do
.with('foo.wiki', project) .with('foo.wiki', project)
.and_return(wiki) .and_return(wiki)
allow(Repository).to receive(:new)
.with('foo.design', project)
.and_return(design)
expect(repo).to receive(:before_delete) expect(repo).to receive(:before_delete)
expect(wiki).to receive(:before_delete) expect(wiki).to receive(:before_delete)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment