diff options
author | John Jarvis <jarv@gitlab.com> | 2019-06-10 09:44:01 +0000 |
---|---|---|
committer | John Jarvis <jarv@gitlab.com> | 2019-06-10 09:44:01 +0000 |
commit | b74aa02fa30b9fb3b4d5a5245843ad2022f07eea (patch) | |
tree | fa82fca5fcd9de7031a14c8011be82edc6c27212 | |
parent | 0da38977aca7df3071a936115a7336081b86e4c7 (diff) | |
parent | 9c3713a968e3cd3b086267d05d35a86c60cc7dc7 (diff) | |
download | gitlab-ce-b74aa02fa30b9fb3b4d5a5245843ad2022f07eea.tar.gz |
Merge branch '11-11-stable-patch-3' into '11-11-stable'
Prepare 11.11.3 release
See merge request gitlab-org/gitlab-ce!29405
34 files changed, 313 insertions, 61 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 975492089e6..6f7c8cdabe5 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -1.42.3 +1.42.4 @@ -333,7 +333,7 @@ group :development, :test do gem 'database_cleaner', '~> 1.7.0' gem 'factory_bot_rails', '~> 4.8.2' gem 'rspec-rails', '~> 3.7.0' - gem 'rspec-retry', '~> 0.4.5' + gem 'rspec-retry', '~> 0.6.1' gem 'rspec_profiling', '~> 0.0.5' gem 'rspec-set', '~> 0.1.3' gem 'rspec-parameterized', require: false diff --git a/Gemfile.lock b/Gemfile.lock index ddff7e56968..3cd8ea5f708 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -780,8 +780,8 @@ GEM rspec-expectations (~> 3.7.0) rspec-mocks (~> 3.7.0) rspec-support (~> 3.7.0) - rspec-retry (0.4.5) - rspec-core + rspec-retry (0.6.1) + rspec-core (> 3.3) rspec-set (0.1.3) rspec-support (3.7.1) rspec_junit_formatter (0.4.1) @@ -1175,7 +1175,7 @@ DEPENDENCIES rqrcode-rails3 (~> 0.1.7) rspec-parameterized rspec-rails (~> 3.7.0) - rspec-retry (~> 0.4.5) + rspec-retry (~> 0.6.1) rspec-set (~> 0.1.3) rspec_junit_formatter rspec_profiling (~> 0.0.5) diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js index 1c6b18c0e03..e52bc8583c6 100644 --- a/app/assets/javascripts/gl_dropdown.js +++ b/app/assets/javascripts/gl_dropdown.js @@ -561,6 +561,11 @@ GitLabDropdown = (function() { !$target.data('isLink') ) { e.stopPropagation(); + + // This prevents automatic scrolling to the top + if ($target.is('a')) { + return false; + } } return true; diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index d2f5ff13408..5a2ead41578 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -352,7 +352,7 @@ module Ci end def retryable? - !archived? && (success? || failed?) + !archived? && (success? || failed? || canceled?) end def retries_count diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb index ed3daf6585b..6d46e0bf18a 100644 --- a/app/presenters/ci/build_runner_presenter.rb +++ b/app/presenters/ci/build_runner_presenter.rb @@ -4,7 +4,6 @@ module Ci class BuildRunnerPresenter < SimpleDelegator include Gitlab::Utils::StrongMemoize - DEFAULT_GIT_DEPTH_MERGE_REQUEST = 10 RUNNER_REMOTE_TAG_PREFIX = 'refs/tags/'.freeze RUNNER_REMOTE_BRANCH_PREFIX = 'refs/remotes/origin/'.freeze @@ -28,7 +27,6 @@ module Ci def git_depth strong_memoize(:git_depth) do git_depth = variables&.find { |variable| variable[:key] == 'GIT_DEPTH' }&.dig(:value) - git_depth ||= DEFAULT_GIT_DEPTH_MERGE_REQUEST if merge_request_ref? git_depth.to_i end end @@ -39,12 +37,13 @@ module Ci if git_depth > 0 specs << refspec_for_branch(ref) if branch? || legacy_detached_merge_request_pipeline? specs << refspec_for_tag(ref) if tag? - specs << refspec_for_merge_request_ref if merge_request_ref? else specs << refspec_for_branch specs << refspec_for_tag end + specs << refspec_for_merge_request_ref if merge_request_ref? + specs end diff --git a/changelogs/unreleased/61246-fix-label-click-scroll-to-top.yml b/changelogs/unreleased/61246-fix-label-click-scroll-to-top.yml new file mode 100644 index 00000000000..7fa15e1c0fd --- /dev/null +++ b/changelogs/unreleased/61246-fix-label-click-scroll-to-top.yml @@ -0,0 +1,5 @@ +--- +title: Fix label click scrolling to top +merge_request: 29202 +author: +type: fixed diff --git a/changelogs/unreleased/62713-fix-uninstalling-cluster-apps.yml b/changelogs/unreleased/62713-fix-uninstalling-cluster-apps.yml new file mode 100644 index 00000000000..45fa668ae85 --- /dev/null +++ b/changelogs/unreleased/62713-fix-uninstalling-cluster-apps.yml @@ -0,0 +1,5 @@ +--- +title: Fix connection to Tiller error while uninstalling +merge_request: 29131 +author: +type: fixed diff --git a/changelogs/unreleased/revert-git-depth-for-merge-request.yml b/changelogs/unreleased/revert-git-depth-for-merge-request.yml new file mode 100644 index 00000000000..3a258dff358 --- /dev/null +++ b/changelogs/unreleased/revert-git-depth-for-merge-request.yml @@ -0,0 +1,5 @@ +--- +title: Remove a default git depth in Pipelines for merge requests +merge_request: 28926 +author: +type: fixed diff --git a/changelogs/unreleased/sh-fix-openid-connect-defaults.yml b/changelogs/unreleased/sh-fix-openid-connect-defaults.yml new file mode 100644 index 00000000000..1ed977c9be6 --- /dev/null +++ b/changelogs/unreleased/sh-fix-openid-connect-defaults.yml @@ -0,0 +1,5 @@ +--- +title: Make OpenID Connect work without requiring a name +merge_request: 29312 +author: +type: fixed diff --git a/changelogs/unreleased/sh-project-import-visibility-error.yml b/changelogs/unreleased/sh-project-import-visibility-error.yml new file mode 100644 index 00000000000..eb7e001c6aa --- /dev/null +++ b/changelogs/unreleased/sh-project-import-visibility-error.yml @@ -0,0 +1,5 @@ +--- +title: Fix invalid visibility string comparison in project import +merge_request: 28612 +author: +type: fixed diff --git a/doc/administration/auth/oidc.md b/doc/administration/auth/oidc.md index e55f7dbb4df..df4f22aa3e7 100644 --- a/doc/administration/auth/oidc.md +++ b/doc/administration/auth/oidc.md @@ -31,6 +31,7 @@ The OpenID Connect will provide you with a client details and secret for you to { 'name' => 'openid_connect', 'label' => '<your_oidc_label>', 'args' => { + "name' => 'openid_connect', 'scope' => ['openid','profile'], 'response_type' => 'code', 'issuer' => '<your_oidc_url>', @@ -53,6 +54,7 @@ The OpenID Connect will provide you with a client details and secret for you to - { name: 'openid_connect', label: '<your_oidc_label>', args: { + name: 'openid_connect', scope: ['openid','profile'], response_type: 'code', issuer: '<your_oidc_url>', @@ -103,3 +105,36 @@ On the sign in page, there should now be an OpenID Connect icon below the regula Click the icon to begin the authentication process. The OpenID Connect provider will ask the user to sign in and authorize the GitLab application (if confirmation required by the client). If everything goes well, the user will be redirected to GitLab and will be signed in. + +## Example configurations + +The following configurations illustrate how to set up OpenID with +different providers with Omnibus GitLab. + +### Google + +See the [Google +documentation](https://developers.google.com/identity/protocols/OpenIDConnect) +for more details: + +```ruby + gitlab_rails['omniauth_providers'] = [ + { + 'name' => 'openid_connect', + 'label' => 'Google OpenID', + 'args' => { + 'name' => 'openid_connect', + 'scope' => ['openid', 'profile', 'email'], + 'response_type' => 'code', + 'issuer' => 'https://accounts.google.com', + 'client_auth_method' => 'query', + 'discovery' => true, + 'uid_field' => 'preferred_username', + 'client_options' => { + 'identifier' => '<YOUR PROJECT CLIENT ID>', + 'secret' => '<YOUR PROJECT CLIENT SECRET>', + 'redirect_uri' => 'https://example.com/users/auth/openid_connect/callback', + } + } + } +``` diff --git a/doc/ci/pipelines.md b/doc/ci/pipelines.md index 4dbe1a85588..b1437b70fe0 100644 --- a/doc/ci/pipelines.md +++ b/doc/ci/pipelines.md @@ -266,9 +266,6 @@ Clicking on an individual job will show you its job trace, and allow you to: - Retry the job. - Erase the job trace. -NOTE: **Note:** -To prevent jobs from being bypassed or run out of order, canceled jobs can only be retried when the whole pipeline they belong to is retried. - ### Seeing the failure reason for jobs > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17782) in GitLab 10.7. diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 1ba22070abe..67e1d316f02 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -58,8 +58,29 @@ the need to specify the value itself. There are two types of variables supported by GitLab: -- `env_var`: the runner will create environment variable named same as the variable key and set its value to the variable value. -- `file`: the runner will write the variable value to a temporary file and set the path to this file as the value of an environment variable named same as the variable key. +- "Variable": the Runner will create an environment variable named same as the variable key and set its value to the variable value. +- "File": the Runner will write the variable value to a temporary file and set the path to this file as the value of an environment variable named same as the variable key. + +Many tools (like [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html) and [kubectl](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable)) provide the ability to customise configuration using files by either providing the file path as a command line argument or an environment variable. Prior to the introduction of variable types, the common pattern was to use the value of a CI variable, save it in a file, and then use the newly created file in your script: + +```bash +# Save the content of variable in a file +echo "$KUBE_CA_PEM" > "$(pwd)/kube.ca.pem" + # Use the newly created file +kubectl config set-cluster e2e --server="$KUBE_URL" --certificate-authority="$(pwd)/kube.ca.pem" +``` + +This can be simplified by creating a variable of type "File" and using it directly. For example, let's say we have the following variables. + +![CI/CD settings - variable types usage example](img/variable_types_usage_example.png) + +We can then call them from `.gitlab-ci.yml` like this: + +```bash +kubectl config set-cluster e2e --server="$KUBE_URL" --certificate-authority="$KUBE_CA_PEM" +``` + +Variable types can be set via the [UI](#via-the-ui) or the [API](../../api/project_level_variables.md#create-variable), but not in `.gitlab-ci.yml`. #### Masked variables diff --git a/doc/ci/variables/img/new_custom_variables_example.png b/doc/ci/variables/img/new_custom_variables_example.png Binary files differindex 4b78e0ff587..efe104efe4c 100644 --- a/doc/ci/variables/img/new_custom_variables_example.png +++ b/doc/ci/variables/img/new_custom_variables_example.png diff --git a/doc/ci/variables/img/variable_types_usage_example.png b/doc/ci/variables/img/variable_types_usage_example.png Binary files differnew file mode 100644 index 00000000000..0e8bde891fe --- /dev/null +++ b/doc/ci/variables/img/variable_types_usage_example.png diff --git a/doc/development/architecture.md b/doc/development/architecture.md index ddfbd449c20..1f4d40fedfd 100644 --- a/doc/development/architecture.md +++ b/doc/development/architecture.md @@ -462,3 +462,95 @@ Note: It is recommended to log into the `git` user using `sudo -i -u git` or `su ## GitLab.com We've also detailed [our architecture of GitLab.com](https://about.gitlab.com/handbook/engineering/infrastructure/production-architecture/) but this is probably over the top unless you have millions of users. + +[alertmanager-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template +[alertmanager-charts]: https://github.com/helm/charts/tree/master/stable/prometheus +[nginx-omnibus]: https://docs.gitlab.com/omnibus/settings/ +[nginx-charts]: https://docs.gitlab.com/charts/charts/nginx/ +[nginx-source]: ../install/installation.md#9-nginx +[unicorn-omnibus]: https://docs.gitlab.com/omnibus/settings/unicorn.html +[unicorn-charts]: https://docs.gitlab.com/charts/charts/gitlab/unicorn/ +[unicorn-source]: ../install/installation.md#configure-it +[gitlab-yml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example +[sidekiq-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template +[sidekiq-charts]: https://docs.gitlab.com/charts/charts/gitlab/sidekiq/ +[gitaly-omnibus]: ../administration/gitaly/index.md +[gitaly-charts]: https://docs.gitlab.com/charts/charts/gitlab/gitaly/ +[gitaly-source]: ../install/installation.md#install-gitaly +[workhorse-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template +[workhorse-charts]: https://docs.gitlab.com/charts/charts/gitlab/unicorn/ +[workhorse-source]: ../install/installation.md#install-gitlab-workhorse +[shell-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template +[shell-charts]: https://docs.gitlab.com/charts/charts/gitlab/gitlab-shell/ +[shell-source]: ../install/installation.md#install-gitlab-shell +[pages-omnibus]: ../administration/pages/index.md +[pages-charts]: https://gitlab.com/charts/gitlab/issues/37 +[pages-source]: ../install/installation.md#install-gitlab-pages +[pages-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/pages.md +[registry-omnibus]: ../administration/container_registry.md#container-registry-domain-configuration +[registry-charts]: https://docs.gitlab.com/charts/charts/registry/ +[registry-source]: ../administration/container_registry.md#enable-the-container-registry +[registry-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/registry.md +[redis-omnibus]: https://docs.gitlab.com/omnibus/settings/redis.html +[redis-charts]: https://docs.gitlab.com/charts/charts/redis/ +[redis-source]: ../install/installation.md#7-redis +[postgres-omnibus]: https://docs.gitlab.com/omnibus/settings/database.html +[postgres-charts]: https://github.com/helm/charts/tree/master/stable/postgresql +[postgres-source]: ../install/installation.md#6-database +[pgbouncer-omnibus]: ../administration/high_availability/pgbouncer.md +[pgbouncer-charts]: https://docs.gitlab.com/charts/installation/deployment.html#postgresql +[consul-omnibus]: ../administration/high_availability/consul.md +[consul-charts]: https://docs.gitlab.com/charts/installation/deployment.html#postgresql +[prometheus-omnibus]: ../administration/monitoring/prometheus/index.md +[prometheus-charts]: https://github.com/helm/charts/tree/master/stable/prometheus +[grafana-omnibus]: ../administration/monitoring/performance/grafana_configuration.md +[grafana-charts]: https://github.com/helm/charts/tree/master/stable/grafana +[sentry-omnibus]: https://docs.gitlab.com/omnibus/settings/configuration.html#error-reporting-and-logging-with-sentry +[sentry-charts]: https://gitlab.com/charts/gitlab/issues/1319 +[jaeger-omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4104 +[jaeger-charts]: https://gitlab.com/charts/gitlab/issues/1320 +[jaeger-source]: ../development/distributed_tracing.md#enabling-distributed-tracing +[jaeger-gdk]: ../development/distributed_tracing.html#using-jaeger-in-the-gitlab-development-kit +[redis-exporter-omnibus]: ../administration/monitoring/prometheus/redis_exporter.md +[redis-exporter-charts]: https://docs.gitlab.com/charts/charts/redis/ +[postgres-exporter-omnibus]: ../administration/monitoring/prometheus/postgres_exporter.md +[postgres-exporter-charts]: https://github.com/helm/charts/tree/master/stable/postgresql +[pgbouncer-exporter-omnibus]: ../administration/monitoring/prometheus/pgbouncer_exporter.md +[pgbouncer-exporter-charts]: https://docs.gitlab.com/charts/installation/deployment.html#postgresql +[gitlab-monitor-omnibus]: ../administration/monitoring/prometheus/gitlab_monitor_exporter.md +[gitab-monitor-charts]: https://gitlab.com/charts/gitlab/issues/319 +[node-exporter-omnibus]: ../administration/monitoring/prometheus/node_exporter.md +[node-exporter-charts]: https://gitlab.com/charts/gitlab/issues/1332 +[mattermost-omnibus]: https://docs.gitlab.com/omnibus/gitlab-mattermost/ +[mattermost-charts]: https://docs.mattermost.com/install/install-mmte-helm-gitlab-helm.html +[minio-omnibus]: https://min.io/download +[minio-charts]: https://docs.gitlab.com/charts/charts/minio/ +[minio-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/object_storage.md +[runner-omnibus]: https://docs.gitlab.com/runner/ +[runner-charts]: https://docs.gitlab.com/runner/install/kubernetes.html +[runner-source]: https://docs.gitlab.com/runner/ +[runner-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/runner.md +[database-migrations-omnibus]: https://docs.gitlab.com/omnibus/settings/database.html#disabling-automatic-database-migration +[database-migrations-charts]: https://docs.gitlab.com/charts/charts/gitlab/migrations/ +[database-migrations-source]: ../update/upgrading_from_source.md#14-install-libs-migrations-etc +[certificate-management-omnibus]: https://docs.gitlab.com/omnibus/settings/ssl.html +[certificate-management-charts]: https://docs.gitlab.com/charts/installation/tls.html +[certificate-management-source]: ../install/installation.md#using-https +[certificate-management-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/https.md +[geo-omnibus]: ../administration/geo/replication/index.md#setup-instructions +[geo-charts]: https://gitlab.com/charts/gitlab/issues/8 +[geo-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/geo.md +[ldap-omnibus]: ../administration/auth/ldap.md +[ldap-charts]: https://docs.gitlab.com/charts/charts/globals.html#ldap +[ldap-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/ldap.md +[outbound-email-omnibus]: https://docs.gitlab.com/omnibus/settings/smtp.html +[outbound-email-charts]: https://docs.gitlab.com/charts/installation/command-line-options.html#outgoing-email-configuration +[inbound-email-omnibus]: ../administration/incoming_email.md +[inbound-email-charts]: https://docs.gitlab.com/charts/installation/command-line-options.html#incoming-email-configuration +[elasticsearch-omnibus]: ../integration/elasticsearch.md +[elasticsearch-charts]: ../integration/elasticsearch.md +[elasticsearch-source]: ../integration/elasticsearch.md +[elasticsearch-gdk]: https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/elasticsearch.md +[sentry-integration]: ../user/project/operations/error_tracking.md +[jaeger-integration]: ../user/project/operations/tracing.md +[managed-k8s-apps]: ../user/project/clusters/index.md#installing-applications diff --git a/doc/integration/github.md b/doc/integration/github.md index e145afbdd5e..5b01dd9feb7 100644 --- a/doc/integration/github.md +++ b/doc/integration/github.md @@ -21,10 +21,10 @@ To get the credentials (a pair of Client ID and Client Secret), you must registe - 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 of your GitLab installation. For example, `https://gitlab.example.com`. - Application description: Fill this in if you wish. - - Authorization callback URL: `http(s)://${YOUR_DOMAIN}/users/auth/github/callback`. Please make sure the port is included if your GitLab instance is not configured on default port. + - Authorization callback URL: `http(s)://${YOUR_DOMAIN}/users/auth`. 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) - NOTE: Be sure to append `/users/auth/github/callback` to the end of the callback URL + NOTE: Be sure to append `/users/auth` to the end of the callback URL to prevent a [OAuth2 convert redirect](http://tetraph.com/covert_redirect/) vulnerability. diff --git a/doc/update/upgrading_from_source.md b/doc/update/upgrading_from_source.md index fea89669831..199fbe92f4c 100644 --- a/doc/update/upgrading_from_source.md +++ b/doc/update/upgrading_from_source.md @@ -114,7 +114,47 @@ sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ rm go1.10.5.linux-amd64.tar.gz ``` -### 6. Get latest code +### 6. Update git + +NOTE: **Note:** +GitLab 11.11 and higher only supports Git 2.21.x and newer, and +[dropped support for older versions](https://gitlab.com/gitlab-org/gitlab-ce/issues/54255). +Be sure to upgrade your installation if necessary. + +```bash +# Make sure Git is version 2.21.0 or higher +git --version + +# Remove packaged Git +sudo apt-get remove git-core + +# Install dependencies +sudo apt-get install -y libcurl4-openssl-dev libexpat1-dev gettext libz-dev libssl-dev build-essential + +# Download and compile pcre2 from source +curl --silent --show-error --location https://ftp.pcre.org/pub/pcre/pcre2-10.33.tar.gz --output pcre2.tar.gz +tar -xzf pcre2.tar.gz +cd pcre2-10.33 +chmod +x configure +./configure --prefix=/usr --enable-jit +make +make install + +# Download and compile from source +cd /tmp +curl --remote-name --location --progress https://www.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz +echo '85eca51c7404da75e353eba587f87fea9481ba41e162206a6f70ad8118147bee git-2.21.0.tar.gz' | shasum -a256 -c - && tar -xzf git-2.21.0.tar.gz +cd git-2.21.0/ +./configure --with-libpcre +make prefix=/usr/local all + +# Install into /usr/local/bin +sudo make prefix=/usr/local install + +# You should edit config/gitlab.yml, change the git -> bin_path to /usr/local/bin/git +``` + +### 7. Get latest code ```bash cd /home/git/gitlab @@ -142,7 +182,7 @@ cd /home/git/gitlab sudo -u git -H git checkout BRANCH-ee ``` -### 7. Update gitlab-shell +### 8. Update gitlab-shell ```bash cd /home/git/gitlab-shell @@ -152,7 +192,7 @@ sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) sudo -u git -H bin/compile ``` -### 8. Update gitlab-workhorse +### 9. Update gitlab-workhorse Install and compile gitlab-workhorse. GitLab-Workhorse uses [GNU Make](https://www.gnu.org/software/make/). @@ -167,7 +207,7 @@ sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) sudo -u git -H make ``` -### 9. Update Gitaly +### 10. Update Gitaly #### Compile Gitaly @@ -178,7 +218,7 @@ sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) sudo -u git -H make ``` -### 10. Update gitlab-pages +### 11. Update gitlab-pages #### Only needed if you use GitLab Pages @@ -195,7 +235,7 @@ sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) sudo -u git -H make ``` -### 11. Update MySQL permissions +### 12. Update MySQL permissions If you are using MySQL you need to grant the GitLab user the necessary permissions on the database: @@ -217,7 +257,7 @@ You can make this setting permanent by adding it to your `my.cnf`: log_bin_trust_function_creators=1 ``` -### 12. Update configuration files +### 13. Update configuration files #### New configuration options for `gitlab.yml` @@ -291,7 +331,7 @@ For Ubuntu 16.04.1 LTS: sudo systemctl daemon-reload ``` -### 13. Install libs, migrations, etc. +### 14. Install libs, migrations, etc. ```bash cd /home/git/gitlab @@ -323,14 +363,14 @@ sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production **MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). -### 14. Start application +### 15. Start application ```bash sudo service gitlab start sudo service nginx restart ``` -### 15. Check application status +### 16. Check application status Check if GitLab and its environment are configured correctly: diff --git a/doc/user/project/integrations/img/mattermost_configuration.png b/doc/user/project/integrations/img/mattermost_configuration.png Binary files differindex e0b55b23520..75ef0310f2d 100644 --- a/doc/user/project/integrations/img/mattermost_configuration.png +++ b/doc/user/project/integrations/img/mattermost_configuration.png diff --git a/doc/user/project/integrations/img/slack_configuration.png b/doc/user/project/integrations/img/slack_configuration.png Binary files differindex 53b30e0e8cd..a14d2969488 100644 --- a/doc/user/project/integrations/img/slack_configuration.png +++ b/doc/user/project/integrations/img/slack_configuration.png diff --git a/doc/user/project/integrations/mattermost.md b/doc/user/project/integrations/mattermost.md index 8c5461de42f..d7fd75fd728 100644 --- a/doc/user/project/integrations/mattermost.md +++ b/doc/user/project/integrations/mattermost.md @@ -27,9 +27,11 @@ There, you will see a checkbox with the following events that can be triggered: - Confidential issue - Merge request - Note +- Confidential note - Tag push - Pipeline - Wiki page +- Deployment Below each of these event checkboxes, you have an input field to enter which Mattermost channel you want to send that event message. Enter your preferred channel handle (the hash sign `#` is optional). diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb index 51001750a6c..20caadb89c0 100644 --- a/lib/gitlab/import_export/project_tree_restorer.rb +++ b/lib/gitlab/import_export/project_tree_restorer.rb @@ -129,7 +129,7 @@ module Gitlab def visibility_level level = override_params['visibility_level'] || json_params['visibility_level'] || @project.visibility_level - level = @project.group.visibility_level if @project.group && level > @project.group.visibility_level + level = @project.group.visibility_level if @project.group && level.to_i > @project.group.visibility_level { 'visibility_level' => level } end diff --git a/lib/gitlab/kubernetes/helm/api.rb b/lib/gitlab/kubernetes/helm/api.rb index ff1dadf9247..978cafae9ac 100644 --- a/lib/gitlab/kubernetes/helm/api.rb +++ b/lib/gitlab/kubernetes/helm/api.rb @@ -24,6 +24,7 @@ module Gitlab def uninstall(command) namespace.ensure_exists! + create_config_map(command) delete_pod!(command.pod_name) kubeclient.create_pod(command.pod_resource) diff --git a/lib/gitlab/omniauth_initializer.rb b/lib/gitlab/omniauth_initializer.rb index 2a2083ebae0..83204fa5d18 100644 --- a/lib/gitlab/omniauth_initializer.rb +++ b/lib/gitlab/omniauth_initializer.rb @@ -63,6 +63,12 @@ module Gitlab { remote_sign_out_handler: authentiq_signout_handler } when 'shibboleth' { fail_with_empty_uid: true } + when 'openid_connect' + # If a name argument is omitted, OmniAuth will expect that the + # matching route is /auth/users/openidconnect instead of + # /auth/users/openid_connect because of + # https://gitlab.com/gitlab-org/gitlab-ce/issues/62208#note_178780341. + { name: 'openid_connect' } else {} end diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index 9cf04fe13b4..224375daf71 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -936,8 +936,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do find('.js-cancel-job').click end - it 'loads the page and shows no controls' do - expect(page).not_to have_content 'Retry' + it 'loads the page and shows all needed controls' do + expect(page).to have_content 'Retry' end end end @@ -946,7 +946,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do context "Job from project", :js do before do job.run! - job.drop!(:script_failure) + job.cancel! visit project_job_path(project, job) wait_for_requests diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index a1115b514d3..4cd19e64ec7 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -115,11 +115,11 @@ describe 'Pipeline', :js do end end - it 'cancels the running build and does not show retry button' do + it 'cancels the running build and shows retry button' do find('#ci-badge-deploy .ci-action-icon-container').click page.within('#ci-badge-deploy') do - expect(page).not_to have_css('.js-icon-retry') + expect(page).to have_css('.js-icon-retry') end end end @@ -133,11 +133,11 @@ describe 'Pipeline', :js do end end - it 'cancels the preparing build and does not show retry button' do + it 'cancels the preparing build and shows retry button' do find('#ci-badge-deploy .ci-action-icon-container').click page.within('#ci-badge-deploy') do - expect(page).not_to have_css('.js-icon-retry') + expect(page).to have_css('.js-icon-retry') end end end diff --git a/spec/lib/gitlab/ci/status/build/factory_spec.rb b/spec/lib/gitlab/ci/status/build/factory_spec.rb index 025439f1b6e..b6231510b91 100644 --- a/spec/lib/gitlab/ci/status/build/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/build/factory_spec.rb @@ -163,11 +163,11 @@ describe Gitlab::Ci::Status::Build::Factory do it 'matches correct extended statuses' do expect(factory.extended_statuses) - .to eq [Gitlab::Ci::Status::Build::Canceled] + .to eq [Gitlab::Ci::Status::Build::Canceled, Gitlab::Ci::Status::Build::Retryable] end - it 'does not fabricate a retryable build status' do - expect(status).not_to be_a Gitlab::Ci::Status::Build::Retryable + it 'fabricates a retryable build status' do + expect(status).to be_a Gitlab::Ci::Status::Build::Retryable end it 'fabricates status with correct details' do @@ -177,7 +177,7 @@ describe Gitlab::Ci::Status::Build::Factory do expect(status.illustration).to include(:image, :size, :title) expect(status.label).to eq 'canceled' expect(status).to have_details - expect(status).not_to have_action + expect(status).to have_action end end diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index 9d2b69ea798..ca46006ea58 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -348,6 +348,19 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do end context 'when the project has overridden params in import data' do + it 'handles string versions of visibility_level' do + # Project needs to be in a group for visibility level comparison + # to happen + group = create(:group) + project.group = group + + project.create_import_data(data: { override_params: { visibility_level: Gitlab::VisibilityLevel::INTERNAL.to_s } }) + + restored_project_json + + expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::INTERNAL) + end + it 'overwrites the params stored in the JSON' do project.create_import_data(data: { override_params: { description: "Overridden" } }) diff --git a/spec/lib/gitlab/kubernetes/helm/api_spec.rb b/spec/lib/gitlab/kubernetes/helm/api_spec.rb index 24ce397ec3d..0de809833e6 100644 --- a/spec/lib/gitlab/kubernetes/helm/api_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/api_spec.rb @@ -36,6 +36,8 @@ describe Gitlab::Kubernetes::Helm::Api do describe '#uninstall' do before do allow(client).to receive(:create_pod).and_return(nil) + allow(client).to receive(:get_config_map).and_return(nil) + allow(client).to receive(:create_config_map).and_return(nil) allow(client).to receive(:delete_pod).and_return(nil) allow(namespace).to receive(:ensure_exists!).once end @@ -53,6 +55,28 @@ describe Gitlab::Kubernetes::Helm::Api do subject.uninstall(command) end + + context 'with a ConfigMap' do + let(:resource) { Gitlab::Kubernetes::ConfigMap.new(application_name, files).generate } + + it 'creates a ConfigMap on kubeclient' do + expect(client).to receive(:create_config_map).with(resource).once + + subject.install(command) + end + + context 'config map already exists' do + before do + expect(client).to receive(:get_config_map).with("values-content-configuration-#{application_name}", gitlab_namespace).and_return(resource) + end + + it 'updates the config map' do + expect(client).to receive(:update_config_map).with(resource).once + + subject.install(command) + end + end + end end describe '#install' do diff --git a/spec/lib/gitlab/omniauth_initializer_spec.rb b/spec/lib/gitlab/omniauth_initializer_spec.rb index f9c0daf1ef1..32296caf819 100644 --- a/spec/lib/gitlab/omniauth_initializer_spec.rb +++ b/spec/lib/gitlab/omniauth_initializer_spec.rb @@ -83,5 +83,13 @@ describe Gitlab::OmniauthInitializer do subject.execute([cas3_config]) end + + it 'configures name for openid_connect' do + openid_connect_config = { 'name' => 'openid_connect', 'args' => {} } + + expect(devise_config).to receive(:omniauth).with(:openid_connect, name: 'openid_connect') + + subject.execute([openid_connect_config]) + end end end diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 9b489baf163..771166e39f7 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1434,7 +1434,7 @@ describe Ci::Build do build.cancel! end - it { is_expected.not_to be_retryable } + it { is_expected.to be_retryable } end end @@ -1964,7 +1964,7 @@ describe Ci::Build do context 'when build has been canceled' do subject { build_stubbed(:ci_build, :manual, status: :canceled) } - it { is_expected.not_to be_playable } + it { is_expected.to be_playable } end context 'when build is successful' do diff --git a/spec/presenters/ci/build_runner_presenter_spec.rb b/spec/presenters/ci/build_runner_presenter_spec.rb index ad6cb012d0b..3430111ca9e 100644 --- a/spec/presenters/ci/build_runner_presenter_spec.rb +++ b/spec/presenters/ci/build_runner_presenter_spec.rb @@ -136,24 +136,6 @@ describe Ci::BuildRunnerPresenter do is_expected.to eq(1) end end - - context 'when pipeline is detached merge request pipeline' do - let(:merge_request) { create(:merge_request, :with_detached_merge_request_pipeline) } - let(:pipeline) { merge_request.all_pipelines.first } - let(:build) { create(:ci_build, ref: pipeline.ref, pipeline: pipeline) } - - it 'returns the default git depth for pipelines for merge requests' do - is_expected.to eq(described_class::DEFAULT_GIT_DEPTH_MERGE_REQUEST) - end - - context 'when pipeline is legacy detached merge request pipeline' do - let(:merge_request) { create(:merge_request, :with_legacy_detached_merge_request_pipeline) } - - it 'behaves as branch pipeline' do - is_expected.to eq(0) - end - end - end end describe '#refspecs' do @@ -191,7 +173,9 @@ describe Ci::BuildRunnerPresenter do it 'returns the correct refspecs' do is_expected - .to contain_exactly('+refs/merge-requests/1/head:refs/merge-requests/1/head') + .to contain_exactly('+refs/heads/*:refs/remotes/origin/*', + '+refs/tags/*:refs/tags/*', + '+refs/merge-requests/1/head:refs/merge-requests/1/head') end context 'when pipeline is legacy detached merge request pipeline' do diff --git a/spec/requests/api/jobs_spec.rb b/spec/requests/api/jobs_spec.rb index c14507de186..ed2ef4c730b 100644 --- a/spec/requests/api/jobs_spec.rb +++ b/spec/requests/api/jobs_spec.rb @@ -863,7 +863,7 @@ describe API::Jobs do end describe 'POST /projects/:id/jobs/:job_id/retry' do - let(:job) { create(:ci_build, :failed, pipeline: pipeline) } + let(:job) { create(:ci_build, :canceled, pipeline: pipeline) } before do post api("/projects/#{project.id}/jobs/#{job.id}/retry", api_user) @@ -873,7 +873,7 @@ describe API::Jobs do context 'user with :update_build permission' do it 'retries non-running job' do expect(response).to have_gitlab_http_status(201) - expect(project.builds.first.status).to eq('failed') + expect(project.builds.first.status).to eq('canceled') expect(json_response['status']).to eq('pending') end end |