From 587e30d0497bb38f237483eeaa43c6d05cdf7d18 Mon Sep 17 00:00:00 2001 From: Aris Lacdao Date: Thu, 7 Mar 2019 11:07:42 +0000 Subject: Update index.md Bug on cloning repository: Getting error "fatal: Could not parse object {COMMIT_HASH}" Fix: cd into $new_release_dir instead of $releases_dir. --- doc/ci/examples/laravel_with_gitlab_and_envoy/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md b/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md index d3b6650b0f4..ad5d968d5d8 100644 --- a/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md +++ b/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md @@ -268,7 +268,7 @@ The `releases` directory will hold all our deployments: echo 'Cloning repository' [ -d {{ $releases_dir }} ] || mkdir {{ $releases_dir }} git clone --depth 1 {{ $repository }} {{ $new_release_dir }} - cd {{ $releases_dir }} + cd {{ $new_release_dir }} git reset --hard {{ $commit }} @endtask @@ -346,7 +346,7 @@ At the end, our `Envoy.blade.php` file will look like this: echo 'Cloning repository' [ -d {{ $releases_dir }} ] || mkdir {{ $releases_dir }} git clone --depth 1 {{ $repository }} {{ $new_release_dir }} - cd {{ $releases_dir }} + cd {{ $new_release_dir }} git reset --hard {{ $commit }} @endtask -- cgit v1.2.1 From 0f6a61f1ad33ff23eb20bf1c2c9381b00f054706 Mon Sep 17 00:00:00 2001 From: Harald Reingruber Date: Mon, 11 Mar 2019 14:16:27 +0000 Subject: Git push-option documentation anchor seems to have changed. --- doc/ci/yaml/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index f170323059a..2e1a88a8464 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -2552,4 +2552,4 @@ git push -o ci.skip [environment]: ../environments.md "CI/CD environments" [schedules]: ../../user/project/pipelines/schedules.md "Pipelines schedules" [variables]: ../variables/README.md "CI/CD variables" -[push-option]: https://git-scm.com/docs/git-push#git-push--oltoptiongt +[push-option]: https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt -- cgit v1.2.1 From e285fb50498912c7fbabf5edfe64a9bedd85fc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C5=82gorzata=20Ksionek?= Date: Tue, 12 Mar 2019 12:33:45 +0100 Subject: Fix false positive specs --- spec/features/security/group/private_access_spec.rb | 6 +++++- spec/policies/group_policy_spec.rb | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/spec/features/security/group/private_access_spec.rb b/spec/features/security/group/private_access_spec.rb index 3238e07fe15..8944124bd72 100644 --- a/spec/features/security/group/private_access_spec.rb +++ b/spec/features/security/group/private_access_spec.rb @@ -96,16 +96,20 @@ describe 'Private Group access' do describe 'GET /groups/:path for shared projects' do let(:project) { create(:project, :public) } + let(:linking_user) { create(:user) } before do + group.add_guest(linking_user) + Projects::GroupLinks::CreateService.new( project, - create(:user), + linking_user, link_group_access: ProjectGroupLink::DEVELOPER ).execute(group) end subject { group_path(group) } + it { expect(group.shared_projects).not_to be_empty } it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:owner).of(group) } it { is_expected.to be_allowed_for(:maintainer).of(group) } diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index 0ad50c6f91f..28fc7e0ddf5 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -80,6 +80,8 @@ describe GroupPolicy do let(:current_user) { nil } before do + group.add_developer(user) + Projects::GroupLinks::CreateService.new( project, user, @@ -87,7 +89,10 @@ describe GroupPolicy do ).execute(group) end - it { expect_disallowed(:read_group) } + it do + expect(group.shared_projects).not_to be_empty + expect_disallowed(:read_group) + end end context 'with foreign user and public project' do @@ -96,6 +101,8 @@ describe GroupPolicy do let(:current_user) { create(:user) } before do + group.add_developer(user) + Projects::GroupLinks::CreateService.new( project, user, @@ -103,7 +110,10 @@ describe GroupPolicy do ).execute(group) end - it { expect_disallowed(:read_group) } + it do + expect(group.shared_projects).not_to be_empty + expect_disallowed(:read_group) + end end context 'has projects' do -- cgit v1.2.1 From b1318cd18873971041a8fa0ec52cfbdc420a007f Mon Sep 17 00:00:00 2001 From: Martin Wortschack Date: Tue, 12 Mar 2019 15:20:52 +0100 Subject: Clean up empty repository state UI - Remove irrelevante information - Remove horizontal scrolling on smaller viewports - Hide auto devops flash message for empty projects --- app/assets/stylesheets/framework/common.scss | 4 + app/assets/stylesheets/pages/projects.scss | 4 - app/presenters/project_presenter.rb | 10 +- app/views/projects/_flash_messages.html.haml | 3 +- app/views/projects/_home_panel.html.haml | 5 +- app/views/projects/empty.html.haml | 133 +++++++++------------ ...roject-improve-empty-repository-state-ui-fe.yml | 5 + locale/gitlab.pot | 42 ++----- .../show/user_sees_git_instructions_spec.rb | 2 +- .../show/user_sees_setup_shortcut_buttons_spec.rb | 58 ++------- 10 files changed, 93 insertions(+), 173 deletions(-) create mode 100644 changelogs/unreleased/56833-project-improve-empty-repository-state-ui-fe.yml diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss index aad5150c0b5..d47931a49e4 100644 --- a/app/assets/stylesheets/framework/common.scss +++ b/app/assets/stylesheets/framework/common.scss @@ -376,18 +376,21 @@ img.emoji { .prepend-top-default { margin-top: $gl-padding !important; } .prepend-top-16 { margin-top: 16px; } .prepend-top-20 { margin-top: 20px; } +.prepend-top-32 { margin-top: 32px; } .prepend-left-4 { margin-left: 4px; } .prepend-left-5 { margin-left: 5px; } .prepend-left-8 { margin-left: 8px; } .prepend-left-10 { margin-left: 10px; } .prepend-left-default { margin-left: $gl-padding; } .prepend-left-20 { margin-left: 20px; } +.prepend-left-32 { margin-left: 32px; } .append-right-4 { margin-right: 4px; } .append-right-5 { margin-right: 5px; } .append-right-8 { margin-right: 8px; } .append-right-10 { margin-right: 10px; } .append-right-default { margin-right: $gl-padding; } .append-right-20 { margin-right: 20px; } +.prepend-right-32 { margin-right: 32px; } .append-bottom-0 { margin-bottom: 0; } .append-bottom-4 { margin-bottom: $gl-padding-4; } .append-bottom-5 { margin-bottom: 5px; } @@ -396,6 +399,7 @@ img.emoji { .append-bottom-15 { margin-bottom: 15px; } .append-bottom-20 { margin-bottom: 20px; } .append-bottom-default { margin-bottom: $gl-padding; } +.prepend-bottom-32 { margin-bottom: 32px; } .inline { display: inline-block; } .center { text-align: center; } .vertical-align-middle { vertical-align: middle; } diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 1349845f300..8e53876eb4f 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -693,10 +693,6 @@ } } -.project-empty-note-panel { - border-bottom: 1px solid $border-color; -} - .project-stats, .project-buttons { .scrolling-tabs-container { diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb index 000b7c433a2..161eebcfb3f 100644 --- a/app/presenters/project_presenter.rb +++ b/app/presenters/project_presenter.rb @@ -42,11 +42,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated def empty_repo_statistics_anchors [ - license_anchor_data, - commits_anchor_data, - branches_anchor_data, - tags_anchor_data, - files_anchor_data + license_anchor_data ].compact.select { |item| item.is_link } end @@ -55,9 +51,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated new_file_anchor_data, readme_anchor_data, changelog_anchor_data, - contribution_guide_anchor_data, - autodevops_anchor_data, - kubernetes_cluster_anchor_data + contribution_guide_anchor_data ].compact.reject { |item| item.is_link } end diff --git a/app/views/projects/_flash_messages.html.haml b/app/views/projects/_flash_messages.html.haml index 7a5fff96676..b72f0e39b23 100644 --- a/app/views/projects/_flash_messages.html.haml +++ b/app/views/projects/_flash_messages.html.haml @@ -5,4 +5,5 @@ - if current_user && can?(current_user, :download_code, project) = render 'shared/no_ssh' = render 'shared/no_password' - = render 'shared/auto_devops_implicitly_enabled_banner', project: project + - unless project.empty_repo? + = render 'shared/auto_devops_implicitly_enabled_banner', project: project diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 1d7287410ea..4ac5a74c85c 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -57,7 +57,10 @@ - if can?(current_user, :download_code, @project) %nav.project-stats .nav-links.quick-links - = render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout) + - if @project.empty_repo? + = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors + - else + = render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout) .home-panel-home-desc.mt-1 - if @project.description.present? diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 081990ac9b7..9fa31c147eb 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -7,89 +7,64 @@ %div{ class: [container_class, ("limit-container-width" unless fluid_layout)] } = render "home_panel" - .project-empty-note-panel - %h4.append-bottom-20 - = _('The repository for this project is empty') + %h4.prepend-top-0.append-bottom-8 + = _('The repository for this project is empty') - - if @project.can_current_user_push_code? - %p - - link_to_cli = link_to _('command line instructions'), '#repo-command-line-instructions' - = _('If you already have files you can push them using the %{link_to_cli} below.').html_safe % { link_to_cli: link_to_cli } - %p - %em - - link_to_protected_branches = link_to _('Learn more about protected branches'), help_page_path('user/project/protected_branches') - = _('Note that the master branch is automatically protected. %{link_to_protected_branches}').html_safe % { link_to_protected_branches: link_to_protected_branches } - - %hr - %p - - link_to_auto_devops_settings = link_to(s_('AutoDevOps|enable Auto DevOps'), project_settings_ci_cd_path(@project, anchor: 'autodevops-settings')) - - link_to_add_kubernetes_cluster = link_to(s_('AutoDevOps|add a Kubernetes cluster'), new_project_cluster_path(@project)) - = s_('AutoDevOps|You can automatically build and test your application if you %{link_to_auto_devops_settings} for this project. You can automatically deploy it as well, if you %{link_to_add_kubernetes_cluster}.').html_safe % { link_to_auto_devops_settings: link_to_auto_devops_settings, link_to_add_kubernetes_cluster: link_to_add_kubernetes_cluster } + - if @project.can_current_user_push_code? + %p.append-bottom-0 + = _('You can create files directly in GitLab using one of the following options.') - %hr - %p - = _('Otherwise it is recommended you start with one of the options below.') - .prepend-top-20 - - %nav.project-buttons - .scrolling-tabs-container.inner-page-scroll-tabs.is-smaller.qa-quick-actions - .fade-left= icon('angle-left') - .fade-right= icon('angle-right') - .nav-links.scrolling-tabs.quick-links - = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons + .project-buttons.qa-quick-actions + = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons - if can?(current_user, :push_code, @project) - %div - .prepend-top-20 - .empty_wrapper - %h3#repo-command-line-instructions.page-title-empty - = _('Command line instructions') - .git-empty.js-git-empty - %fieldset - %h5= _('Git global setup') - %pre.bg-light - :preserve - git config --global user.name "#{h git_user_name}" - git config --global user.email "#{h git_user_email}" - - %fieldset - %h5= _('Create a new repository') - %pre.bg-light - :preserve - git clone #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} - cd #{h @project.path} - touch README.md - git add README.md - git commit -m "add README" - - if @project.can_current_user_push_to_default_branch? - %span>< - git push -u origin master + .empty-wrapper.prepend-top-32 + %h3#repo-command-line-instructions.page-title-empty + = _('Command line instructions') + %p + = _('You can also upload existing files from your computer using the instructions below.') + .git-empty.js-git-empty + %fieldset + %h5= _('Git global setup') + %pre.bg-light + :preserve + git config --global user.name "#{h git_user_name}" + git config --global user.email "#{h git_user_email}" - %fieldset - %h5= _('Existing folder') - %pre.bg-light - :preserve - cd existing_folder - git init - git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} - git add . - git commit -m "Initial commit" - - if @project.can_current_user_push_to_default_branch? - %span>< - git push -u origin master + %fieldset + %h5= _('Create a new repository') + %pre.bg-light + :preserve + git clone #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + cd #{h @project.path} + touch README.md + git add README.md + git commit -m "add README" + - if @project.can_current_user_push_to_default_branch? + %span>< + git push -u origin master - %fieldset - %h5= _('Existing Git repository') - %pre.bg-light - :preserve - cd existing_repo - git remote rename origin old-origin - git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} - - if @project.can_current_user_push_to_default_branch? - %span>< - git push -u origin --all - git push -u origin --tags + %fieldset + %h5= _('Push an existing folder') + %pre.bg-light + :preserve + cd existing_folder + git init + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + git add . + git commit -m "Initial commit" + - if @project.can_current_user_push_to_default_branch? + %span>< + git push -u origin master - - if can? current_user, :remove_project, @project - .prepend-top-20 - = link_to _('Remove project'), [@project.namespace.becomes(Namespace), @project], data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-inverted btn-remove float-right" + %fieldset + %h5= _('Push an existing Git repository') + %pre.bg-light + :preserve + cd existing_repo + git remote rename origin old-origin + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + - if @project.can_current_user_push_to_default_branch? + %span>< + git push -u origin --all + git push -u origin --tags diff --git a/changelogs/unreleased/56833-project-improve-empty-repository-state-ui-fe.yml b/changelogs/unreleased/56833-project-improve-empty-repository-state-ui-fe.yml new file mode 100644 index 00000000000..19cf3d69db1 --- /dev/null +++ b/changelogs/unreleased/56833-project-improve-empty-repository-state-ui-fe.yml @@ -0,0 +1,5 @@ +--- +title: 'Project: Improve empty repository state UI' +merge_request: 26024 +author: +type: other diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 90dab37a33b..25ac8e35db3 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -966,15 +966,6 @@ msgstr "" msgid "AutoDevOps|The Auto DevOps pipeline has been enabled and will be used if no alternative CI configuration file is found. %{more_information_link}" msgstr "" -msgid "AutoDevOps|You can automatically build and test your application if you %{link_to_auto_devops_settings} for this project. You can automatically deploy it as well, if you %{link_to_add_kubernetes_cluster}." -msgstr "" - -msgid "AutoDevOps|add a Kubernetes cluster" -msgstr "" - -msgid "AutoDevOps|enable Auto DevOps" -msgstr "" - msgid "Automatically marked as default internal user" msgstr "" @@ -3373,12 +3364,6 @@ msgstr "" msgid "Except policy:" msgstr "" -msgid "Existing Git repository" -msgstr "" - -msgid "Existing folder" -msgstr "" - msgid "Existing members and groups" msgstr "" @@ -4073,9 +4058,6 @@ msgstr "" msgid "If enabled" msgstr "" -msgid "If you already have files you can push them using the %{link_to_cli} below." -msgstr "" - msgid "If your HTTP repository is not publicly accessible, add authentication information to the URL: https://username:password@gitlab.company.com/group/project.git." msgstr "" @@ -4540,9 +4522,6 @@ msgstr "" msgid "Learn more about Kubernetes" msgstr "" -msgid "Learn more about protected branches" -msgstr "" - msgid "Learn more about signing commits" msgstr "" @@ -5207,9 +5186,6 @@ msgstr "" msgid "Not started" msgstr "" -msgid "Note that the master branch is automatically protected. %{link_to_protected_branches}" -msgstr "" - msgid "Note that this invitation was sent to %{mail_to_invite_email}, but you are signed in as %{link_to_current_user} with email %{mail_to_current_user}." msgstr "" @@ -5401,9 +5377,6 @@ msgstr "" msgid "Other Labels" msgstr "" -msgid "Otherwise it is recommended you start with one of the options below." -msgstr "" - msgid "Outbound requests" msgstr "" @@ -6262,6 +6235,12 @@ msgstr "" msgid "Push" msgstr "" +msgid "Push an existing Git repository" +msgstr "" + +msgid "Push an existing folder" +msgstr "" + msgid "Push events" msgstr "" @@ -8765,6 +8744,12 @@ msgstr "" msgid "You can also star a label to make it a priority label." msgstr "" +msgid "You can also upload existing files from your computer using the instructions below." +msgstr "" + +msgid "You can create files directly in GitLab using one of the following options." +msgstr "" + msgid "You can easily contribute to them by requesting to join these groups." msgstr "" @@ -8969,9 +8954,6 @@ msgstr "" msgid "branch name" msgstr "" -msgid "command line instructions" -msgstr "" - msgid "commented on %{link_to_project}" msgstr "" diff --git a/spec/features/projects/show/user_sees_git_instructions_spec.rb b/spec/features/projects/show/user_sees_git_instructions_spec.rb index ffa80235083..0d59ef4a727 100644 --- a/spec/features/projects/show/user_sees_git_instructions_spec.rb +++ b/spec/features/projects/show/user_sees_git_instructions_spec.rb @@ -13,7 +13,7 @@ describe 'Projects > Show > User sees Git instructions' do it 'shows Git command line instructions' do click_link 'Create empty repository' - page.within '.empty_wrapper' do + page.within '.empty-wrapper' do expect(page).to have_content('Command line instructions') end end diff --git a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb index dcca1d388c7..58bd20d7551 100644 --- a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb +++ b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb @@ -20,18 +20,18 @@ describe 'Projects > Show > User sees setup shortcut buttons' do visit project_path(project) end - it 'no Auto DevOps button if can not manage pipelines' do - page.within('.project-buttons') do - expect(page).not_to have_link('Enable Auto DevOps') - expect(page).not_to have_link('Auto DevOps enabled') - end - end - - it '"Auto DevOps enabled" button not linked' do + it 'Project buttons are not visible' do visit project_path(project) page.within('.project-buttons') do - expect(page).to have_text('Auto DevOps enabled') + expect(page).not_to have_link('New file') + expect(page).not_to have_link('Add README') + expect(page).not_to have_link('Add CHANGELOG') + expect(page).not_to have_link('Add CONTRIBUTING') + expect(page).not_to have_link('Enable Auto DevOps') + expect(page).not_to have_link('Auto DevOps enabled') + expect(page).not_to have_link('Add Kubernetes cluster') + expect(page).not_to have_link('Kubernetes configured') end end end @@ -61,46 +61,6 @@ describe 'Projects > Show > User sees setup shortcut buttons' do expect(page).to have_link('Add license', href: presenter.add_license_path) end end - - describe 'Auto DevOps button' do - context 'when Auto DevOps is enabled' do - it '"Auto DevOps enabled" anchor linked to settings page' do - visit project_path(project) - - page.within('.project-buttons') do - expect(page).to have_link('Auto DevOps enabled', href: project_settings_ci_cd_path(project, anchor: 'autodevops-settings')) - end - end - end - - context 'when Auto DevOps is not enabled' do - let(:project) { create(:project, :public, :empty_repo, auto_devops_attributes: { enabled: false }) } - - it '"Enable Auto DevOps" button linked to settings page' do - page.within('.project-buttons') do - expect(page).to have_link('Enable Auto DevOps', href: project_settings_ci_cd_path(project, anchor: 'autodevops-settings')) - end - end - end - end - - describe 'Kubernetes cluster button' do - it '"Add Kubernetes cluster" button linked to clusters page' do - page.within('.project-buttons') do - expect(page).to have_link('Add Kubernetes cluster', href: new_project_cluster_path(project)) - end - end - - it '"Kubernetes cluster" anchor linked to cluster page' do - cluster = create(:cluster, :provided_by_gcp, projects: [project]) - - visit project_path(project) - - page.within('.project-buttons') do - expect(page).to have_link('Kubernetes configured', href: project_cluster_path(project, cluster)) - end - end - end end end -- cgit v1.2.1 From 8343cb02bd6fd302f577d9194a1b1b84b943660d Mon Sep 17 00:00:00 2001 From: Daniel Gruesso Date: Tue, 12 Mar 2019 14:40:01 +0000 Subject: Add license_management to env variables --- doc/topics/autodevops/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md index 24fd4d70b9f..1c6a14e053b 100644 --- a/doc/topics/autodevops/index.md +++ b/doc/topics/autodevops/index.md @@ -704,6 +704,7 @@ also be customized, and you can easily use a [custom buildpack](#custom-buildpac | `INCREMENTAL_ROLLOUT_MODE`| From GitLab 11.4, this variable, if present, can be used to enable an [incremental rollout](#incremental-rollout-to-production-premium) of your application for the production environment.
Set to:
  • `manual`, for manual deployment jobs.
  • `timed`, for automatic rollout deployments with a 5 minute delay each one.
| | `TEST_DISABLED` | From GitLab 11.0, this variable can be used to disable the `test` job. If the variable is present, the job will not be created. | | `CODE_QUALITY_DISABLED` | From GitLab 11.0, this variable can be used to disable the `codequality` job. If the variable is present, the job will not be created. | +| `LICENSE_MANAGEMENT_DISABLED` | From GitLab 11.0, this variable can be used to disable the `license_management` job. If the variable is present, the job will not be created. | | `SAST_DISABLED` | From GitLab 11.0, this variable can be used to disable the `sast` job. If the variable is present, the job will not be created. | | `DEPENDENCY_SCANNING_DISABLED` | From GitLab 11.0, this variable can be used to disable the `dependency_scanning` job. If the variable is present, the job will not be created. | | `CONTAINER_SCANNING_DISABLED` | From GitLab 11.0, this variable can be used to disable the `sast:container` job. If the variable is present, the job will not be created. | -- cgit v1.2.1 From 4a5eedb1757aed21e815323356ef67ae614526d2 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Wed, 13 Mar 2019 00:29:08 +0100 Subject: Hide 404 errors in Karma locally --- config/karma.config.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/config/karma.config.js b/config/karma.config.js index e1d7c30b1c2..746c11ebd64 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -115,6 +115,15 @@ module.exports = function(config) { reporters: ['progress'], webpack: webpackConfig, webpackMiddleware: { stats: 'errors-only' }, + plugins: [ + 'karma-chrome-launcher', + 'karma-coverage-istanbul-reporter', + 'karma-jasmine', + 'karma-junit-reporter', + 'karma-mocha-reporter', + 'karma-sourcemap-loader', + 'karma-webpack', + ], }; if (process.env.CI) { @@ -123,6 +132,19 @@ module.exports = function(config) { outputFile: 'junit_karma.xml', useBrowserName: false, }; + } else { + // ignore 404s in local environment because we are not fixing them and they bloat the log + function ignore404() { + return (request, response /* next */) => { + response.writeHead(404); + return response.end('NOT FOUND'); + }; + } + + karmaConfig.middleware = ['ignore-404']; + karmaConfig.plugins.push({ + 'middleware:ignore-404': ['factory', ignore404], + }); } if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') { -- cgit v1.2.1 From 428ee4bc6017c2df2a1fa02a358c33b7b67480a8 Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Tue, 12 Mar 2019 22:38:18 +1300 Subject: Explicitly set master_auth for new GKE clusters From 1.12, GKE will disable basic auth and client certificate by default. Explicitly enable those now (currently we use 1.10/1.11 clusters) so that GKE cluster configuration will continue to work. --- changelogs/unreleased/58208-explicitly-set-masterauth.yml | 6 ++++++ lib/google_api/cloud_platform/client.rb | 7 +++++++ spec/lib/google_api/cloud_platform/client_spec.rb | 12 ++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 changelogs/unreleased/58208-explicitly-set-masterauth.yml diff --git a/changelogs/unreleased/58208-explicitly-set-masterauth.yml b/changelogs/unreleased/58208-explicitly-set-masterauth.yml new file mode 100644 index 00000000000..e3512d11113 --- /dev/null +++ b/changelogs/unreleased/58208-explicitly-set-masterauth.yml @@ -0,0 +1,6 @@ +--- +title: Explicitly set master_auth setting to enable basic auth and client certificate + for new GKE clusters +merge_request: 26018 +author: +type: other diff --git a/lib/google_api/cloud_platform/client.rb b/lib/google_api/cloud_platform/client.rb index e74ff6a9129..b5f99ea012b 100644 --- a/lib/google_api/cloud_platform/client.rb +++ b/lib/google_api/cloud_platform/client.rb @@ -10,6 +10,7 @@ module GoogleApi class Client < GoogleApi::Auth SCOPE = 'https://www.googleapis.com/auth/cloud-platform'.freeze LEAST_TOKEN_LIFE_TIME = 10.minutes + CLUSTER_MASTER_AUTH_USERNAME = 'admin'.freeze class << self def session_key_for_token @@ -64,6 +65,12 @@ module GoogleApi "node_config": { "machine_type": machine_type }, + "master_auth": { + "username": CLUSTER_MASTER_AUTH_USERNAME, + "client_certificate_config": { + issue_client_certificate: true + } + }, "legacy_abac": { "enabled": legacy_abac } diff --git a/spec/lib/google_api/cloud_platform/client_spec.rb b/spec/lib/google_api/cloud_platform/client_spec.rb index e2134dc279c..1fefc947636 100644 --- a/spec/lib/google_api/cloud_platform/client_spec.rb +++ b/spec/lib/google_api/cloud_platform/client_spec.rb @@ -97,6 +97,12 @@ describe GoogleApi::CloudPlatform::Client do "node_config": { "machine_type": machine_type }, + "master_auth": { + "username": "admin", + "client_certificate_config": { + issue_client_certificate: true + } + }, "legacy_abac": { "enabled": true } @@ -122,6 +128,12 @@ describe GoogleApi::CloudPlatform::Client do "node_config": { "machine_type": machine_type }, + "master_auth": { + "username": "admin", + "client_certificate_config": { + issue_client_certificate: true + } + }, "legacy_abac": { "enabled": false } -- cgit v1.2.1 From 86abef88b4a65f8da18d6f20b0089772c52586c8 Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Wed, 13 Mar 2019 09:59:39 +1300 Subject: Add docs about requirement for basic auth and cert Document that GitLab need the cluster to be created with basic auth and cert and why. Also note we have started explicitly enabling this so that we are ready when these settings are disabled by default in GKE 1.12 --- doc/user/project/clusters/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/user/project/clusters/index.md b/doc/user/project/clusters/index.md index e84c3ca4bef..d1206b0c80a 100644 --- a/doc/user/project/clusters/index.md +++ b/doc/user/project/clusters/index.md @@ -75,6 +75,14 @@ new Kubernetes cluster to your project: After a couple of minutes, your cluster will be ready to go. You can now proceed to install some [pre-defined applications](#installing-applications). +NOTE: **Note:** +GitLab requires basic authentication enabled and a client certificate issued for +the cluster in order to setup an [initial service +account](#access-controls). Starting from [GitLab +11.10](https://gitlab.com/gitlab-org/gitlab-ce/issues/58208), the cluster +creation process will explicitly request that basic authentication and +client certificate is enabled. + ## Adding an existing Kubernetes cluster To add an existing Kubernetes cluster to your project: -- cgit v1.2.1 From c829c1c4a9dc6bc327c08eed90e20c4fb6c2410d Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 12 Mar 2019 17:44:47 +0000 Subject: Removes EE differences for folder_view --- .../folder/environments_folder_view.vue | 11 ++++++-- .../mixins/environments_folder_view_mixin.js | 29 ++++++++++++++++++++++ .../folder/environments_folder_view_spec.js | 14 ++++++++--- 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 app/assets/javascripts/environments/mixins/environments_folder_view_mixin.js diff --git a/app/assets/javascripts/environments/folder/environments_folder_view.vue b/app/assets/javascripts/environments/folder/environments_folder_view.vue index 80f0e00400b..6fd0561f682 100644 --- a/app/assets/javascripts/environments/folder/environments_folder_view.vue +++ b/app/assets/javascripts/environments/folder/environments_folder_view.vue @@ -1,4 +1,5 @@