Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 09:09:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 09:09:23 +0300
commit8ccbb53e68d2830e766e1cae4e9d158840d115b6 (patch)
tree4ca7a3714d4eadb3acba2a4b14ec92b6523e1884
parentf5703a054cadf9f99314fde617c2792f707ed52f (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab/issue_templates/Feature Flag Roll Out.md2
-rw-r--r--app/finders/packages/npm/package_finder.rb3
-rw-r--r--app/views/shared/wikis/_sidebar_wiki_page.html.haml2
-rw-r--r--changelogs/unreleased/sh-fix-npm-package-finder-all-projects.yml5
-rw-r--r--doc/api/group_boards.md16
-rw-r--r--qa/qa.rb5
-rw-r--r--qa/qa/page/component/wiki.rb74
-rw-r--r--qa/qa/page/component/wiki_page_form.rb52
-rw-r--r--qa/qa/page/component/wiki_sidebar.rb48
-rw-r--r--qa/qa/page/project/wiki/edit.rb40
-rw-r--r--qa/qa/page/project/wiki/show.rb64
-rw-r--r--qa/qa/page/project/wiki/sidebar.rb50
-rw-r--r--qa/qa/resource/wiki/group_page.rb48
13 files changed, 247 insertions, 162 deletions
diff --git a/.gitlab/issue_templates/Feature Flag Roll Out.md b/.gitlab/issue_templates/Feature Flag Roll Out.md
index 615fb644967..fe263b932ae 100644
--- a/.gitlab/issue_templates/Feature Flag Roll Out.md
+++ b/.gitlab/issue_templates/Feature Flag Roll Out.md
@@ -18,7 +18,7 @@ Remove the `:feature_name` feature flag ...
### What can we monitor to detect problems with this?
-<!-- Which dashboards from https://dashboards.gitlab.net are most relevant? Sentry errors reports can alse be useful to review -->
+<!-- Which dashboards from https://dashboards.gitlab.net are most relevant? Sentry errors reports can also be useful to review -->
## Beta groups/projects
diff --git a/app/finders/packages/npm/package_finder.rb b/app/finders/packages/npm/package_finder.rb
index 04b124ddd83..3b79785d0e1 100644
--- a/app/finders/packages/npm/package_finder.rb
+++ b/app/finders/packages/npm/package_finder.rb
@@ -35,8 +35,7 @@ module Packages
end
def packages_for_namespace
- projects = ::Project.in_namespace(@namespace.self_and_descendants.select(:id))
- ::Packages::Package.for_projects(projects.select(:id))
+ ::Packages::Package.for_projects(@namespace.all_projects)
end
end
end
diff --git a/app/views/shared/wikis/_sidebar_wiki_page.html.haml b/app/views/shared/wikis/_sidebar_wiki_page.html.haml
index 4259633280a..38a7e6fc813 100644
--- a/app/views/shared/wikis/_sidebar_wiki_page.html.haml
+++ b/app/views/shared/wikis/_sidebar_wiki_page.html.haml
@@ -1,3 +1,3 @@
%li{ class: active_when(params[:id] == wiki_page.slug) }
- = link_to wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.slug } do
+ = link_to wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.human_title } do
= wiki_page.human_title
diff --git a/changelogs/unreleased/sh-fix-npm-package-finder-all-projects.yml b/changelogs/unreleased/sh-fix-npm-package-finder-all-projects.yml
new file mode 100644
index 00000000000..909e2baa449
--- /dev/null
+++ b/changelogs/unreleased/sh-fix-npm-package-finder-all-projects.yml
@@ -0,0 +1,5 @@
+---
+title: Use `Namespace#all_projects` for NPM package finder
+merge_request: 56415
+author:
+type: performance
diff --git a/doc/api/group_boards.md b/doc/api/group_boards.md
index 16ab81af1fe..a0121388194 100644
--- a/doc/api/group_boards.md
+++ b/doc/api/group_boards.md
@@ -33,14 +33,14 @@ Example response:
[
{
"id": 1,
- "name:": "group issue board",
+ "name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
- "id": 12
+ "id": 12,
"title": "10.0"
},
"lists" : [
@@ -85,14 +85,14 @@ Example response:
[
{
"id": 1,
- "name:": "group issue board",
+ "name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
- "id": 12
+ "id": 12,
"title": "10.0"
},
"lists" : [
@@ -150,14 +150,14 @@ Example response:
```json
{
"id": 1,
- "name:": "group issue board",
+ "name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
- "id": 12
+ "id": 12,
"title": "10.0"
},
"lists" : [
@@ -200,14 +200,14 @@ Example response:
```json
{
"id": 1,
- "name:": "group issue board",
+ "name": "group issue board",
"group": {
"id": 5,
"name": "Documentcloud",
"web_url": "http://example.com/groups/documentcloud"
},
"milestone": {
- "id": 12
+ "id": 12,
"title": "10.0"
},
"lists" : [
diff --git a/qa/qa.rb b/qa/qa.rb
index fadb0b964d5..2ac199c9d26 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -121,6 +121,7 @@ module QA
module Wiki
autoload :ProjectPage, 'qa/resource/wiki/project_page'
+ autoload :GroupPage, 'qa/resource/wiki/group_page'
end
end
@@ -380,7 +381,6 @@ module QA
autoload :Edit, 'qa/page/project/wiki/edit'
autoload :Show, 'qa/page/project/wiki/show'
autoload :GitAccess, 'qa/page/project/wiki/git_access'
- autoload :Sidebar, 'qa/page/project/wiki/sidebar'
autoload :List, 'qa/page/project/wiki/list'
end
@@ -496,6 +496,9 @@ module QA
autoload :Snippet, 'qa/page/component/snippet'
autoload :NewSnippet, 'qa/page/component/new_snippet'
autoload :InviteMembersModal, 'qa/page/component/invite_members_modal'
+ autoload :Wiki, 'qa/page/component/wiki'
+ autoload :WikiSidebar, 'qa/page/component/wiki_sidebar'
+ autoload :WikiPageForm, 'qa/page/component/wiki_page_form'
module Issuable
autoload :Common, 'qa/page/component/issuable/common'
diff --git a/qa/qa/page/component/wiki.rb b/qa/qa/page/component/wiki.rb
new file mode 100644
index 00000000000..92eb25af247
--- /dev/null
+++ b/qa/qa/page/component/wiki.rb
@@ -0,0 +1,74 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module Wiki
+ extend QA::Page::PageConcern
+
+ def self.included(base)
+ super
+
+ base.view 'app/views/shared/wikis/show.html.haml' do
+ element :wiki_page_title
+ element :wiki_page_content
+ element :edit_page_button
+ end
+
+ base.view 'app/views/shared/wikis/_main_links.html.haml' do
+ element :new_page_button
+ element :page_history_button
+ end
+
+ base.view 'app/views/shared/empty_states/_wikis.html.haml' do
+ element :create_first_page_link
+ end
+
+ base.view 'app/views/shared/empty_states/_wikis_layout.html.haml' do
+ element :svg_content
+ end
+ end
+
+ def click_create_your_first_page
+ # The svg takes a fraction of a second to load after which the
+ # "Create your first page" button shifts up a bit. This can cause
+ # webdriver to miss the hit so we wait for the svg to load before
+ # clicking the button.
+ within_element(:svg_content) do
+ has_element?(:js_lazy_loaded)
+ end
+
+ click_element(:create_first_page_link)
+ end
+
+ def click_new_page
+ click_element(:new_page_button)
+ end
+
+ def click_page_history
+ click_element(:page_history_button)
+ end
+
+ def click_edit
+ click_element(:edit_page_button)
+ end
+
+ def has_title?(title)
+ has_element?(:wiki_page_title, title)
+ end
+
+ def has_content?(content)
+ has_element?(:wiki_page_content, content)
+ end
+
+ def has_no_content?(content)
+ has_no_element?(:wiki_page_content, content)
+ end
+
+ def has_no_page?
+ has_element?(:create_first_page_link)
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/component/wiki_page_form.rb b/qa/qa/page/component/wiki_page_form.rb
new file mode 100644
index 00000000000..e24b1b67af1
--- /dev/null
+++ b/qa/qa/page/component/wiki_page_form.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module WikiPageForm
+ extend QA::Page::PageConcern
+
+ def self.included(base)
+ super
+
+ base.view 'app/views/shared/wikis/_form.html.haml' do
+ element :wiki_title_textbox
+ element :wiki_content_textarea
+ element :wiki_message_textbox
+ element :save_changes_button
+ element :create_page_button
+ end
+
+ base.view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do
+ element :delete_button
+ end
+ end
+
+ def set_title(title)
+ fill_element(:wiki_title_textbox, title)
+ end
+
+ def set_content(content)
+ fill_element(:wiki_content_textarea, content)
+ end
+
+ def set_message(message)
+ fill_element(:wiki_message_textbox, message)
+ end
+
+ def click_save_changes
+ click_element(:save_changes_button)
+ end
+
+ def click_create_page
+ click_element(:create_page_button)
+ end
+
+ def delete_page
+ click_element(:delete_button, Page::Modal::DeleteWiki)
+ Page::Modal::DeleteWiki.perform(&:confirm_deletion)
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/component/wiki_sidebar.rb b/qa/qa/page/component/wiki_sidebar.rb
new file mode 100644
index 00000000000..dfb912a1d0b
--- /dev/null
+++ b/qa/qa/page/component/wiki_sidebar.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module WikiSidebar
+ extend QA::Page::PageConcern
+
+ def self.included(base)
+ super
+
+ base.view 'app/views/shared/wikis/_sidebar.html.haml' do
+ element :clone_repository_link
+ element :view_all_pages_button
+ end
+
+ base.view 'app/views/shared/wikis/_sidebar_wiki_page.html.haml' do
+ element :wiki_page_link
+ end
+
+ base.view 'app/views/shared/wikis/_wiki_directory.html.haml' do
+ element :wiki_directory_content
+ end
+ end
+
+ def click_clone_repository
+ click_element(:clone_repository_link)
+ end
+
+ def click_view_all_pages
+ click_element(:view_all_pages_button)
+ end
+
+ def click_page_link(page_title)
+ click_element(:wiki_page_link, page_name: page_title)
+ end
+
+ def has_page_listed?(page_title)
+ has_element?(:wiki_page_link, page_name: page_title)
+ end
+
+ def has_directory?(directory)
+ has_element?(:wiki_directory_content, text: directory)
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/wiki/edit.rb b/qa/qa/page/project/wiki/edit.rb
index 6f3be904eb3..70aa10cc43e 100644
--- a/qa/qa/page/project/wiki/edit.rb
+++ b/qa/qa/page/project/wiki/edit.rb
@@ -5,44 +5,8 @@ module QA
module Project
module Wiki
class Edit < Base
- include Wiki::Sidebar
-
- view 'app/views/shared/wikis/_form.html.haml' do
- element :wiki_title_textbox
- element :wiki_content_textarea
- element :wiki_message_textbox
- element :save_changes_button
- element :create_page_button
- end
-
- view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do
- element :delete_button
- end
-
- def set_title(title)
- fill_element :wiki_title_textbox, title
- end
-
- def set_content(content)
- fill_element :wiki_content_textarea, content
- end
-
- def set_message(message)
- fill_element :wiki_message_textbox, message
- end
-
- def click_save_changes
- click_element :save_changes_button
- end
-
- def click_create_page
- click_element :create_page_button
- end
-
- def delete_page
- click_element :delete_button, Page::Modal::DeleteWiki
- Page::Modal::DeleteWiki.perform(&:confirm_deletion)
- end
+ include Page::Component::WikiPageForm
+ include Page::Component::WikiSidebar
end
end
end
diff --git a/qa/qa/page/project/wiki/show.rb b/qa/qa/page/project/wiki/show.rb
index d9e0783a581..f3573e3cdd3 100644
--- a/qa/qa/page/project/wiki/show.rb
+++ b/qa/qa/page/project/wiki/show.rb
@@ -5,67 +5,9 @@ module QA
module Project
module Wiki
class Show < Base
- include Wiki::Sidebar
- include Component::LazyLoader
-
- view 'app/views/shared/wikis/show.html.haml' do
- element :wiki_page_title
- element :wiki_page_content
- element :edit_page_button
- end
-
- view 'app/views/shared/wikis/_main_links.html.haml' do
- element :new_page_button
- element :page_history_button
- end
-
- view 'app/views/shared/empty_states/_wikis.html.haml' do
- element :create_first_page_link
- end
-
- view 'app/views/shared/empty_states/_wikis_layout.html.haml' do
- element :svg_content
- end
-
- def click_create_your_first_page
- # The svg takes a fraction of a second to load after which the
- # "Create your first page" button shifts up a bit. This can cause
- # webdriver to miss the hit so we wait for the svg to load before
- # clicking the button.
- within_element(:svg_content) do
- has_element? :js_lazy_loaded
- end
-
- click_element :create_first_page_link
- end
-
- def click_new_page
- click_element(:new_page_button)
- end
-
- def click_page_history
- click_element(:page_history_button)
- end
-
- def click_edit
- click_element(:edit_page_button)
- end
-
- def has_title?(title)
- has_element?(:wiki_page_title, title)
- end
-
- def has_content?(content)
- has_element?(:wiki_page_content, content)
- end
-
- def has_no_content?(content)
- has_no_element?(:wiki_page_content, content)
- end
-
- def has_no_page?
- has_element? :create_first_page_link
- end
+ include Page::Component::Wiki
+ include Page::Component::WikiSidebar
+ include Page::Component::LazyLoader
end
end
end
diff --git a/qa/qa/page/project/wiki/sidebar.rb b/qa/qa/page/project/wiki/sidebar.rb
deleted file mode 100644
index 3e1edcbbefb..00000000000
--- a/qa/qa/page/project/wiki/sidebar.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- module Page
- module Project
- module Wiki
- module Sidebar
- extend QA::Page::PageConcern
-
- def self.included(base)
- super
-
- base.view 'app/views/shared/wikis/_sidebar.html.haml' do
- element :clone_repository_link
- element :view_all_pages_button
- end
-
- base.view 'app/views/shared/wikis/_sidebar_wiki_page.html.haml' do
- element :wiki_page_link
- end
-
- base.view 'app/views/shared/wikis/_wiki_directory.html.haml' do
- element :wiki_directory_content
- end
- end
-
- def click_clone_repository
- click_element(:clone_repository_link)
- end
-
- def click_view_all_pages
- click_element(:view_all_pages_button)
- end
-
- def click_page_link(page_title)
- click_element :wiki_page_link, page_name: page_title
- end
-
- def has_page_listed?(page_title)
- has_element? :wiki_page_link, page_name: page_title
- end
-
- def has_directory?(directory)
- has_element? :wiki_directory_content, text: directory
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/resource/wiki/group_page.rb b/qa/qa/resource/wiki/group_page.rb
new file mode 100644
index 00000000000..27150ecf6c7
--- /dev/null
+++ b/qa/qa/resource/wiki/group_page.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+
+require 'securerandom'
+
+module QA
+ module Resource
+ module Wiki
+ class GroupPage < Base
+ attribute :title
+ attribute :content
+ attribute :slug
+
+ attribute :group do
+ Group.fabricate_via_api! do |group|
+ group.path = "group-with-wiki-#{SecureRandom.hex(8)}"
+ end
+ end
+
+ def initialize
+ @title = 'Home'
+ @content = 'This wiki page is created via API'
+ end
+
+ def resource_web_url(resource)
+ super
+ rescue ResourceURLMissingError
+ "#{group.web_url}/-/wikis/#{slug}"
+ end
+
+ def api_get_path
+ "/groups/#{group.id}/wikis/#{slug}"
+ end
+
+ def api_post_path
+ "/groups/#{group.id}/wikis"
+ end
+
+ def api_post_body
+ {
+ id: group.id,
+ content: content,
+ title: title
+ }
+ end
+ end
+ end
+ end
+end