summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/framework/dropdowns.scss6
-rw-r--r--app/assets/stylesheets/framework/header.scss20
-rw-r--r--app/services/clusters/applications/base_helm_service.rb19
-rw-r--r--app/services/clusters/applications/check_installation_progress_service.rb3
-rw-r--r--app/services/clusters/applications/install_service.rb6
-rw-r--r--app/views/layouts/header/_default.html.haml2
-rw-r--r--changelogs/unreleased/53874-navbar-lowres.yml5
-rw-r--r--doc/administration/high_availability/gitlab.md2
-rw-r--r--doc/administration/high_availability/redis.md4
-rw-r--r--doc/administration/logs.md19
-rw-r--r--doc/development/db_dump.md2
-rw-r--r--doc/development/logging.md10
-rw-r--r--doc/integration/github.md34
-rw-r--r--doc/integration/img/github_app.pngbin29330 -> 128040 bytes
-rw-r--r--doc/integration/img/github_app_entry.pngbin0 -> 83603 bytes
-rw-r--r--doc/integration/img/github_register_app.pngbin0 -> 120981 bytes
-rw-r--r--doc/user/project/pages/introduction.md4
-rw-r--r--lib/gitlab/kubernetes/logger.rb11
-rw-r--r--spec/services/clusters/applications/check_installation_progress_service_spec.rb6
-rw-r--r--spec/services/clusters/applications/install_service_spec.rb70
20 files changed, 171 insertions, 52 deletions
diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss
index dca89981d81..ce5d36a340f 100644
--- a/app/assets/stylesheets/framework/dropdowns.scss
+++ b/app/assets/stylesheets/framework/dropdowns.scss
@@ -802,11 +802,7 @@
@include media-breakpoint-down(xs) {
.navbar-gitlab {
- li.header-projects,
- li.header-groups,
- li.header-more,
- li.header-new,
- li.header-user {
+ li.dropdown {
position: static;
}
}
diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss
index d1ce3a582bb..39410ac56af 100644
--- a/app/assets/stylesheets/framework/header.scss
+++ b/app/assets/stylesheets/framework/header.scss
@@ -110,6 +110,10 @@
}
}
+ .navbar-collapse > ul.nav > li:not(.d-none) {
+ margin: 0 2px;
+ }
+
&.menu-expanded {
@include media-breakpoint-down(xs) {
.title-container {
@@ -117,7 +121,7 @@
}
.navbar-collapse {
- display: block;
+ display: flex;
}
}
}
@@ -209,7 +213,7 @@
> a {
will-change: color;
- margin: 4px 2px;
+ margin: 4px 0;
padding: 6px 8px;
height: 32px;
@@ -455,14 +459,11 @@
color: $indigo-900;
font-weight: $gl-font-weight-bold;
line-height: 18px;
+ margin: 4px 0 4px 2px;
&:hover {
background-color: $white-light;
}
-
- @include media-breakpoint-down(xs) {
- margin-top: $gl-padding-4;
- }
}
.navbar-nav {
@@ -509,12 +510,7 @@
margin-right: -10px;
.nav > li:not(.d-none) {
- display: table-cell !important;
- width: 25%;
-
- a {
- margin-right: 8px;
- }
+ flex: 1;
}
}
}
diff --git a/app/services/clusters/applications/base_helm_service.rb b/app/services/clusters/applications/base_helm_service.rb
index 270a8eb24f4..e86ca8cf1d0 100644
--- a/app/services/clusters/applications/base_helm_service.rb
+++ b/app/services/clusters/applications/base_helm_service.rb
@@ -11,6 +11,25 @@ module Clusters
protected
+ def log_error(error)
+ meta = {
+ exception: error.class.name,
+ error_code: error.respond_to?(:error_code) ? error.error_code : nil,
+ service: self.class.name,
+ app_id: app.id,
+ project_ids: app.cluster.project_ids,
+ group_ids: app.cluster.group_ids,
+ message: error.message
+ }
+
+ logger.error(meta)
+ Gitlab::Sentry.track_acceptable_exception(error, extra: meta)
+ end
+
+ def logger
+ @logger ||= Gitlab::Kubernetes::Logger.build
+ end
+
def cluster
app.cluster
end
diff --git a/app/services/clusters/applications/check_installation_progress_service.rb b/app/services/clusters/applications/check_installation_progress_service.rb
index 6794580e1e8..21ec26ea233 100644
--- a/app/services/clusters/applications/check_installation_progress_service.rb
+++ b/app/services/clusters/applications/check_installation_progress_service.rb
@@ -15,8 +15,7 @@ module Clusters
check_timeout
end
rescue Kubeclient::HttpError => e
- Rails.logger.error("Kubernetes error: #{e.error_code} #{e.message}")
- Gitlab::Sentry.track_acceptable_exception(e, extra: { scope: 'kubernetes', app_id: app.id })
+ log_error(e)
app.make_errored!("Kubernetes error: #{e.error_code}") unless app.errored?
end
diff --git a/app/services/clusters/applications/install_service.rb b/app/services/clusters/applications/install_service.rb
index f4385748c43..5a65dc4ef59 100644
--- a/app/services/clusters/applications/install_service.rb
+++ b/app/services/clusters/applications/install_service.rb
@@ -13,12 +13,10 @@ module Clusters
ClusterWaitForAppInstallationWorker.perform_in(
ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id)
rescue Kubeclient::HttpError => e
- Rails.logger.error("Kubernetes error: #{e.error_code} #{e.message}")
- Gitlab::Sentry.track_acceptable_exception(e, extra: { scope: 'kubernetes', app_id: app.id })
+ log_error(e)
app.make_errored!("Kubernetes error: #{e.error_code}")
rescue StandardError => e
- Rails.logger.error "Can't start installation process: #{e.class.name} #{e.message}"
- Gitlab::Sentry.track_acceptable_exception(e, extra: { scope: 'kubernetes', app_id: app.id })
+ log_error(e)
app.make_errored!("Can't start installation process.")
end
end
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 474ef25cef7..b7d69539eb7 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -71,7 +71,7 @@
= link_to admin_impersonation_path, class: 'nav-link impersonation-btn', method: :delete, title: _('Stop impersonation'), aria: { label: _('Stop impersonation') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
= icon('user-secret')
- if header_link?(:sign_in)
- %li.nav-item.m-auto
+ %li.nav-item
%div
- sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in')
= link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in'
diff --git a/changelogs/unreleased/53874-navbar-lowres.yml b/changelogs/unreleased/53874-navbar-lowres.yml
new file mode 100644
index 00000000000..3b31b8f93fe
--- /dev/null
+++ b/changelogs/unreleased/53874-navbar-lowres.yml
@@ -0,0 +1,5 @@
+---
+title: "Fix overlapping navbar separator and overflowing navbar dropdown on small displays"
+merge_request: 23126
+author: Thomas Pathier
+type: fix
diff --git a/doc/administration/high_availability/gitlab.md b/doc/administration/high_availability/gitlab.md
index f16ae835ced..2ca860bd763 100644
--- a/doc/administration/high_availability/gitlab.md
+++ b/doc/administration/high_availability/gitlab.md
@@ -118,7 +118,7 @@ need some extra configuration.
gitlab_rails['db_key_base'] = 'bf2e47b68d6cafaef1d767e628b619365becf27571e10f196f98dc85e7771042b9203199d39aff91fcb6837c8ed83f2a912b278da50999bb11a2fbc0fba52964'
```
-1. Run `touch /etc/gitlab/skip-auto-migrations` to prevent database migrations
+1. Run `touch /etc/gitlab/skip-auto-reconfigure` to prevent database migrations
from running on upgrade. Only the primary GitLab application server should
handle migrations.
diff --git a/doc/administration/high_availability/redis.md b/doc/administration/high_availability/redis.md
index a9ba40c870c..833c1f367dd 100644
--- a/doc/administration/high_availability/redis.md
+++ b/doc/administration/high_availability/redis.md
@@ -336,7 +336,7 @@ The prerequisites for a HA Redis setup are the following:
1. To prevent database migrations from running on upgrade, run:
```
- sudo touch /etc/gitlab/skip-auto-migrations
+ sudo touch /etc/gitlab/skip-auto-reconfigure
```
Only the primary GitLab application server should handle migrations.
@@ -458,7 +458,7 @@ multiple machines with the Sentinel daemon.
1. To prevent database migrations from running on upgrade, run:
```
- sudo touch /etc/gitlab/skip-auto-migrations
+ sudo touch /etc/gitlab/skip-auto-reconfigure
```
Only the primary GitLab application server should handle migrations.
diff --git a/doc/administration/logs.md b/doc/administration/logs.md
index 7e5a3eb9ccd..698f4caab3a 100644
--- a/doc/administration/logs.md
+++ b/doc/administration/logs.md
@@ -126,6 +126,25 @@ It contains information about [integrations](../user/project/integrations/projec
{"severity":"INFO","time":"2018-09-06T17:15:16.365Z","service_class":"JiraService","project_id":3,"project_path":"namespace2/project2","message":"Successfully posted","client_url":"http://jira.example.net"}
```
+## `kubernetes.log`
+
+Introduced in GitLab 11.6. This file lives in
+`/var/log/gitlab/gitlab-rails/kubernetes.log` for Omnibus GitLab
+packages or in `/home/git/gitlab/log/kubernetes.log` for
+installations from source.
+
+It logs information related to the Kubernetes Integration including errors
+during installing cluster applications on your GitLab managed Kubernetes
+clusters.
+
+Each line contains a JSON line that can be ingested by Elasticsearch, Splunk,
+etc. For example:
+
+```json
+{"severity":"ERROR","time":"2018-11-23T15:14:54.652Z","exception":"Kubeclient::HttpError","error_code":401,"service":"Clusters::Applications::CheckInstallationProgressService","app_id":14,"project_ids":[1],"group_ids":[],"message":"Unauthorized"}
+{"severity":"ERROR","time":"2018-11-23T15:42:11.647Z","exception":"Kubeclient::HttpError","error_code":null,"service":"Clusters::Applications::InstallService","app_id":2,"project_ids":[19],"group_ids":[],"message":"SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)"}
+```
+
## `githost.log`
This file lives in `/var/log/gitlab/gitlab-rails/githost.log` for
diff --git a/doc/development/db_dump.md b/doc/development/db_dump.md
index e4ff72aa349..97762a62a80 100644
--- a/doc/development/db_dump.md
+++ b/doc/development/db_dump.md
@@ -13,7 +13,7 @@ large database imports.
```
# On STAGING
echo "postgresql['checkpoint_segments'] = 64" | sudo tee -a /etc/gitlab/gitlab.rb
-sudo touch /etc/gitlab/skip-auto-migrations
+sudo touch /etc/gitlab/skip-auto-reconfigure
sudo gitlab-ctl reconfigure
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
diff --git a/doc/development/logging.md b/doc/development/logging.md
index abd08c420da..5c1d96b9e0c 100644
--- a/doc/development/logging.md
+++ b/doc/development/logging.md
@@ -75,7 +75,7 @@ To create a new file:
module Import
class Logger < ::Gitlab::JsonLogger
def self.file_name_noext
- 'importer_json'
+ 'importer'
end
end
end
@@ -105,7 +105,7 @@ To create a new file:
```ruby
# GOOD
- logger.info("Unable to create project", project_id: project.id)
+ logger.info(message: "Unable to create project", project_id: project.id)
```
1. Be sure to create a common base structure of your log messages. For example,
@@ -118,13 +118,13 @@ To create a new file:
```ruby
# BAD
- logger.info("Import error", error: 1)
- logger.info("Import error", error: "I/O failure")
+ logger.info(message: "Import error", error: 1)
+ logger.info(message: "Import error", error: "I/O failure")
```
```ruby
# GOOD
- logger.info("Import error", error_code: 1, error: "I/O failure")
+ logger.info(message: "Import error", error_code: 1, error: "I/O failure")
```
## Additional steps with new log files
diff --git a/doc/integration/github.md b/doc/integration/github.md
index 7a83b8e4b35..b8156b2b593 100644
--- a/doc/integration/github.md
+++ b/doc/integration/github.md
@@ -1,28 +1,32 @@
-# Integrate your server with GitHub
+# Integrate your GitLab instance with GitHub
-Import projects from GitHub and login to your GitLab instance with your GitHub account.
+You can integrate your GitLab instance with GitHub.com as well as GitHub Enterprise to enable users to import projects from GitHub and/or to login to your GitLab instance with your GitHub account.
-To enable the GitHub OmniAuth provider you must register your application with GitHub.
-GitHub will generate an application ID and secret key for you to use.
+## Enabling GitHub OAuth
-1. Sign in to GitHub.
+To enable GitHub OmniAuth provider, you must use GitHub's credentials for your GitLab instance.
+To get the credentials (a pair of Client ID and Client Secret), you must register an application as an OAuth App on GitHub.
-1. Navigate to your individual user settings or an organization's settings, depending on how you want the application registered. It does not matter if the application is registered as an individual or an organization - that is entirely up to you.
+1. Sign in to GitHub.
-1. Select "OAuth applications" in the left menu.
+1. Navigate to your individual user or organization settings, depending on how you want the application registered. It does not matter if the application is registered as an individual or an organization - that is entirely up to you.
-1. If you already have applications listed, switch to the "Developer applications" tab.
+ - For individual accounts, select **Developer settings** from the left menu, then select **OAuth Apps**.
+ - For organization accounts, directly select **OAuth Apps** from the left menu.
-1. Select "Register new application".
+1. Select **Register an application** (if you don't have any OAuth App) or **New OAuth App** (if you already have OAuth Apps).
+ ![Register OAuth App](img/github_app_entry.png)
1. Provide the required details.
- Application name: This can be anything. Consider something like `<Organization>'s GitLab` or `<Your Name>'s GitLab` or something else descriptive.
- - Homepage URL: The URL to your GitLab installation. 'https://gitlab.company.com'
+ - Homepage URL: the URL to your GitLab installation. e.g., `https://gitlab.company.com`
- Application description: Fill this in if you wish.
- - Authorization callback URL is 'http(s)://${YOUR_DOMAIN}'. Please make sure the port is included if your GitLab instance is not configured on default port.
-1. Select "Register application".
+ - Authorization callback URL: `http(s)://${YOUR_DOMAIN}`. Please make sure the port is included if your GitLab instance is not configured on default port.
+ ![Register OAuth App](img/github_register_app.png)
+
+1. Select **Register application**.
-1. You should now see a Client ID and Client Secret near the top right of the page (see screenshot).
+1. You should now see a pair of **Client ID** and **Client Secret** near the top right of the page (see screenshot).
Keep this page open as you continue configuration.
![GitHub app](img/github_app.png)
@@ -97,9 +101,9 @@ GitHub will generate an application ID and secret key for you to use.
__Replace `https://github.example.com/` with your GitHub URL.__
-1. Change 'YOUR_APP_ID' to the client ID from the GitHub application page from step 7.
+1. Change `YOUR_APP_ID` to the Client ID from the GitHub application page from step 6.
-1. Change 'YOUR_APP_SECRET' to the client secret from the GitHub application page from step 7.
+1. Change `YOUR_APP_SECRET` to the Client Secret from the GitHub application page from step 6.
1. Save the configuration file.
diff --git a/doc/integration/img/github_app.png b/doc/integration/img/github_app.png
index d6c289a1de1..4a1523d41ac 100644
--- a/doc/integration/img/github_app.png
+++ b/doc/integration/img/github_app.png
Binary files differ
diff --git a/doc/integration/img/github_app_entry.png b/doc/integration/img/github_app_entry.png
new file mode 100644
index 00000000000..9e151f8cdff
--- /dev/null
+++ b/doc/integration/img/github_app_entry.png
Binary files differ
diff --git a/doc/integration/img/github_register_app.png b/doc/integration/img/github_register_app.png
new file mode 100644
index 00000000000..edd3f660f4e
--- /dev/null
+++ b/doc/integration/img/github_register_app.png
Binary files differ
diff --git a/doc/user/project/pages/introduction.md b/doc/user/project/pages/introduction.md
index 9f9b64ec20d..ed049e2e648 100644
--- a/doc/user/project/pages/introduction.md
+++ b/doc/user/project/pages/introduction.md
@@ -446,7 +446,9 @@ See also: [GitLab Pages from A to Z: Part 1 - Static sites and GitLab Pages doma
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/33422) in GitLab 11.5.
NOTE: **Note:**
-GitLab Pages access control is not activated on GitLab.com.
+GitLab Pages access control is not activated on GitLab.com. You can check its
+progress on the
+[infrastructure issue tracker](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5576).
You can enable Pages access control on your project, so that only
[members of your project](../../permissions.md#project-members-permissions)
diff --git a/lib/gitlab/kubernetes/logger.rb b/lib/gitlab/kubernetes/logger.rb
new file mode 100644
index 00000000000..5e59482419b
--- /dev/null
+++ b/lib/gitlab/kubernetes/logger.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Kubernetes
+ class Logger < ::Gitlab::JsonLogger
+ def self.file_name_noext
+ 'kubernetes'
+ end
+ end
+ end
+end
diff --git a/spec/services/clusters/applications/check_installation_progress_service_spec.rb b/spec/services/clusters/applications/check_installation_progress_service_spec.rb
index 9452a9e38fb..45b8ce94815 100644
--- a/spec/services/clusters/applications/check_installation_progress_service_spec.rb
+++ b/spec/services/clusters/applications/check_installation_progress_service_spec.rb
@@ -105,6 +105,12 @@ describe Clusters::Applications::CheckInstallationProgressService do
expect(application).to be_errored
expect(application.status_reason).to eq('Kubernetes error: 401')
end
+
+ it 'should log error' do
+ expect(service.send(:logger)).to receive(:error)
+
+ service.execute
+ end
end
end
end
diff --git a/spec/services/clusters/applications/install_service_spec.rb b/spec/services/clusters/applications/install_service_spec.rb
index 2f801d019fe..018d9822d3e 100644
--- a/spec/services/clusters/applications/install_service_spec.rb
+++ b/spec/services/clusters/applications/install_service_spec.rb
@@ -33,8 +33,9 @@ describe Clusters::Applications::InstallService do
end
context 'when k8s cluster communication fails' do
+ let(:error) { Kubeclient::HttpError.new(500, 'system failure', nil) }
+
before do
- error = Kubeclient::HttpError.new(500, 'system failure', nil)
expect(helm_client).to receive(:install).with(install_command).and_raise(error)
end
@@ -44,18 +45,81 @@ describe Clusters::Applications::InstallService do
expect(application).to be_errored
expect(application.status_reason).to match('Kubernetes error: 500')
end
+
+ it 'logs errors' do
+ expect(service.send(:logger)).to receive(:error).with(
+ {
+ exception: 'Kubeclient::HttpError',
+ message: 'system failure',
+ service: 'Clusters::Applications::InstallService',
+ app_id: application.id,
+ project_ids: application.cluster.project_ids,
+ group_ids: [],
+ error_code: 500
+ }
+ )
+
+ expect(Gitlab::Sentry).to receive(:track_acceptable_exception).with(
+ error,
+ extra: {
+ exception: 'Kubeclient::HttpError',
+ message: 'system failure',
+ service: 'Clusters::Applications::InstallService',
+ app_id: application.id,
+ project_ids: application.cluster.project_ids,
+ group_ids: [],
+ error_code: 500
+ }
+ )
+
+ service.execute
+ end
end
- context 'when application cannot be persisted' do
+ context 'a non kubernetes error happens' do
let(:application) { create(:clusters_applications_helm, :scheduled) }
+ let(:error) { StandardError.new("something bad happened") }
+
+ before do
+ expect(application).to receive(:make_installing!).once.and_raise(error)
+ end
it 'make the application errored' do
- expect(application).to receive(:make_installing!).once.and_raise(ActiveRecord::RecordInvalid)
expect(helm_client).not_to receive(:install)
service.execute
expect(application).to be_errored
+ expect(application.status_reason).to eq("Can't start installation process.")
+ end
+
+ it 'logs errors' do
+ expect(service.send(:logger)).to receive(:error).with(
+ {
+ exception: 'StandardError',
+ error_code: nil,
+ message: 'something bad happened',
+ service: 'Clusters::Applications::InstallService',
+ app_id: application.id,
+ project_ids: application.cluster.projects.pluck(:id),
+ group_ids: []
+ }
+ )
+
+ expect(Gitlab::Sentry).to receive(:track_acceptable_exception).with(
+ error,
+ extra: {
+ exception: 'StandardError',
+ error_code: nil,
+ message: 'something bad happened',
+ service: 'Clusters::Applications::InstallService',
+ app_id: application.id,
+ project_ids: application.cluster.projects.pluck(:id),
+ group_ids: []
+ }
+ )
+
+ service.execute
end
end
end