summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 06:07:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 06:07:52 +0000
commit7b875aa3fd1645e2e881997256ba94c6cb73ab3d (patch)
tree59b1637c36624ee863e12f9e176425627ab3deb5
parent9caed104bc903734d996161ba13a579f2be49d7c (diff)
downloadgitlab-ce-7b875aa3fd1645e2e881997256ba94c6cb73ab3d.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.markdownlint.json1
-rw-r--r--app/models/project.rb4
-rw-r--r--app/services/projects/hashed_storage/base_repository_service.rb31
-rw-r--r--app/services/projects/hashed_storage/migrate_repository_service.rb6
-rw-r--r--app/services/projects/hashed_storage/rollback_repository_service.rb6
-rw-r--r--danger/prettier/Dangerfile2
-rw-r--r--db/migrate/20191204192726_add_design_disk_path_to_geo_hashed_storage_migrated_events.rb12
-rw-r--r--db/schema.rb2
-rw-r--r--doc/api/graphql/getting_started.md20
-rw-r--r--doc/ci/yaml/README.md4
-rw-r--r--doc/development/fe_guide/frontend_faq.md4
-rw-r--r--doc/development/fe_guide/style/scss.md2
-rw-r--r--spec/models/project_spec.rb5
13 files changed, 70 insertions, 29 deletions
diff --git a/.markdownlint.json b/.markdownlint.json
index b2beffa6cdb..fe3790f47e6 100644
--- a/.markdownlint.json
+++ b/.markdownlint.json
@@ -47,7 +47,6 @@
"Facebook",
"Git LFS",
"git-annex",
- "gitlab-ui",
"Git",
"Gitaly",
"GitHub",
diff --git a/app/models/project.rb b/app/models/project.rb
index 88b66423e59..1cf69bf8403 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1577,7 +1577,9 @@ class Project < ApplicationRecord
end
def wiki
- @wiki ||= ProjectWiki.new(self, self.owner)
+ strong_memoize(:wiki) do
+ ProjectWiki.new(self, self.owner)
+ end
end
def jira_tracker_active?
diff --git a/app/services/projects/hashed_storage/base_repository_service.rb b/app/services/projects/hashed_storage/base_repository_service.rb
index 8b1bcaf17b7..09de8d9f0da 100644
--- a/app/services/projects/hashed_storage/base_repository_service.rb
+++ b/app/services/projects/hashed_storage/base_repository_service.rb
@@ -8,13 +8,12 @@ module Projects
class BaseRepositoryService < BaseService
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)
@project = project
@logger = logger || Gitlab::AppLogger
@old_disk_path = old_disk_path
- @old_wiki_disk_path = "#{old_disk_path}.wiki"
@move_wiki = has_wiki?
end
@@ -44,9 +43,21 @@ module Projects
gitlab_shell.mv_repository(project.repository_storage, from_name, to_name)
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
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
def try_to_set_repository_read_only!
@@ -58,6 +69,20 @@ module Projects
raise RepositoryInUseError, migration_error
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
+
+Projects::HashedStorage::BaseRepositoryService.prepend_if_ee('EE::Projects::HashedStorage::BaseRepositoryService')
diff --git a/app/services/projects/hashed_storage/migrate_repository_service.rb b/app/services/projects/hashed_storage/migrate_repository_service.rb
index 0a0bd90cd20..fd62ac37d27 100644
--- a/app/services/projects/hashed_storage/migrate_repository_service.rb
+++ b/app/services/projects/hashed_storage/migrate_repository_service.rb
@@ -11,11 +11,7 @@ module Projects
@new_disk_path = project.disk_path
- result = move_repository(old_disk_path, new_disk_path)
-
- if move_wiki
- result &&= move_repository(old_wiki_disk_path, "#{new_disk_path}.wiki")
- end
+ result = move_repositories
if result
project.write_repository_config
diff --git a/app/services/projects/hashed_storage/rollback_repository_service.rb b/app/services/projects/hashed_storage/rollback_repository_service.rb
index a705112ebe3..d6646e3765e 100644
--- a/app/services/projects/hashed_storage/rollback_repository_service.rb
+++ b/app/services/projects/hashed_storage/rollback_repository_service.rb
@@ -11,11 +11,7 @@ module Projects
@new_disk_path = project.disk_path
- result = move_repository(old_disk_path, new_disk_path)
-
- if move_wiki
- result &&= move_repository(old_wiki_disk_path, "#{new_disk_path}.wiki")
- end
+ result = move_repositories
if result
project.write_repository_config
diff --git a/danger/prettier/Dangerfile b/danger/prettier/Dangerfile
index 0be75db8baa..ee27aaf9228 100644
--- a/danger/prettier/Dangerfile
+++ b/danger/prettier/Dangerfile
@@ -36,6 +36,6 @@ if GitlabDanger.new(helper.gitlab_helper).ci?
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
end
diff --git a/db/migrate/20191204192726_add_design_disk_path_to_geo_hashed_storage_migrated_events.rb b/db/migrate/20191204192726_add_design_disk_path_to_geo_hashed_storage_migrated_events.rb
new file mode 100644
index 00000000000..39b5d5c7e97
--- /dev/null
+++ b/db/migrate/20191204192726_add_design_disk_path_to_geo_hashed_storage_migrated_events.rb
@@ -0,0 +1,12 @@
+# 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
diff --git a/db/schema.rb b/db/schema.rb
index 4f94c0accfa..42420e653aa 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1663,6 +1663,8 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do
t.text "new_wiki_disk_path", null: false
t.integer "old_storage_version", limit: 2
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"
end
diff --git a/doc/api/graphql/getting_started.md b/doc/api/graphql/getting_started.md
index 961d4da8c1e..57c0fcc659c 100644
--- a/doc/api/graphql/getting_started.md
+++ b/doc/api/graphql/getting_started.md
@@ -289,16 +289,16 @@ Example: Issues can be sorted by creation date:
```graphql
query {
- project(fullPath: "gitlab-org/graphql-sandbox") {
- name
- issues(sort: created_asc) {
- nodes {
- title
- createdAt
- }
+ project(fullPath: "gitlab-org/graphql-sandbox") {
+ name
+ issues(sort: created_asc) {
+ nodes {
+ title
+ createdAt
}
}
}
+}
```
## Pagination
@@ -324,9 +324,9 @@ query {
title
}
}
- pageInfo {
- endCursor
- hasNextPage
+ pageInfo {
+ endCursor
+ hasNextPage
}
}
}
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index f256977e31f..c352a5a4fd6 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -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.
- Changes outside of the working tree (depending on the Runner executor), like
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`
if you set it per-job:
diff --git a/doc/development/fe_guide/frontend_faq.md b/doc/development/fe_guide/frontend_faq.md
index aaa2fb0246b..cbe0a78370d 100644
--- a/doc/development/fe_guide/frontend_faq.md
+++ b/doc/development/fe_guide/frontend_faq.md
@@ -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
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
-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
banner on top of the component examples indicates that:
diff --git a/doc/development/fe_guide/style/scss.md b/doc/development/fe_guide/style/scss.md
index c6424e39ac2..4ec3c79b0ae 100644
--- a/doc/development/fe_guide/style/scss.md
+++ b/doc/development/fe_guide/style/scss.md
@@ -11,7 +11,7 @@ easy to maintain, and performant for the end-user.
### 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.
#### Where are utility classes defined?
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 2f382031714..e7abdf847e1 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1793,6 +1793,7 @@ describe Project do
let(:project) { create(:project, :repository) }
let(:repo) { double(:repo, exists?: true) }
let(:wiki) { double(:wiki, exists?: true) }
+ let(:design) { double(:wiki, exists?: false) }
it 'expires the caches of the repository and wiki' do
allow(Repository).to receive(:new)
@@ -1803,6 +1804,10 @@ describe Project do
.with('foo.wiki', project)
.and_return(wiki)
+ allow(Repository).to receive(:new)
+ .with('foo.design', project)
+ .and_return(design)
+
expect(repo).to receive(:before_delete)
expect(wiki).to receive(:before_delete)