diff options
-rw-r--r-- | app/assets/javascripts/monitoring/components/charts/time_series.vue | 5 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/dashboard.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/panel_type.vue | 7 | ||||
-rw-r--r-- | app/assets/javascripts/pipelines/components/pipelines_table_row.vue | 1 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_project.html.haml | 2 | ||||
-rw-r--r-- | changelogs/unreleased/35552-improve-logging-of-sync-services-alt.yml | 5 | ||||
-rw-r--r-- | doc/ci/yaml/README.md | 2 | ||||
-rw-r--r-- | doc/development/background_migrations.md | 7 | ||||
-rw-r--r-- | doc/development/ee_features.md | 49 | ||||
-rw-r--r-- | doc/development/i18n/externalization.md | 25 | ||||
-rw-r--r-- | doc/development/scalability.md | 32 | ||||
-rw-r--r-- | doc/raketasks/backup_restore.md | 4 | ||||
-rw-r--r-- | locale/gitlab.pot | 10 | ||||
-rw-r--r-- | qa/qa.rb | 2 | ||||
-rw-r--r-- | qa/qa/fixtures/monitored_auto_devops/.gitlab-ci.yml | 337 | ||||
-rw-r--r-- | qa/qa/page/project/operations/metrics.rb | 87 | ||||
-rw-r--r-- | qa/qa/page/project/pipeline/index.rb | 22 | ||||
-rw-r--r-- | qa/qa/page/project/sub_menus/operations.rb | 9 |
18 files changed, 119 insertions, 489 deletions
diff --git a/app/assets/javascripts/monitoring/components/charts/time_series.vue b/app/assets/javascripts/monitoring/components/charts/time_series.vue index 8b1a9f6f770..0d442f14aea 100644 --- a/app/assets/javascripts/monitoring/components/charts/time_series.vue +++ b/app/assets/javascripts/monitoring/components/charts/time_series.vue @@ -311,10 +311,7 @@ export default { <gl-tooltip :target="() => $refs.graphTitle" :disabled="!showTitleTooltip"> {{ graphData.title }} </gl-tooltip> - <div - class="prometheus-graph-widgets js-graph-widgets flex-fill" - data-qa-selector="prometheus_graph_widgets" - > + <div class="prometheus-graph-widgets js-graph-widgets flex-fill"> <slot></slot> </div> </div> diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index 8c33e13e2f0..2c51252be39 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -342,7 +342,7 @@ export default { </script> <template> - <div class="prometheus-graphs" data-qa-selector="prometheus_graphs"> + <div class="prometheus-graphs"> <div class="prometheus-graphs-header gl-p-3 pb-0 border-bottom bg-gray-light"> <div class="row"> <template v-if="environmentsEndpoint"> diff --git a/app/assets/javascripts/monitoring/components/panel_type.vue b/app/assets/javascripts/monitoring/components/panel_type.vue index 5d4f3425ad0..ec6a41d0540 100644 --- a/app/assets/javascripts/monitoring/components/panel_type.vue +++ b/app/assets/javascripts/monitoring/components/panel_type.vue @@ -138,7 +138,6 @@ export default { v-gl-tooltip class="ml-auto mx-3" toggle-class="btn btn-transparent border-0" - data-qa-selector="prometheus_widgets_dropdown" :right="true" :no-caret="true" :title="__('More actions')" @@ -162,11 +161,7 @@ export default { > {{ __('Generate link to chart') }} </gl-dropdown-item> - <gl-dropdown-item - v-if="alertWidgetAvailable" - v-gl-modal="`alert-modal-${index}`" - data-qa-selector="alert_widget_menu_item" - > + <gl-dropdown-item v-if="alertWidgetAvailable" v-gl-modal="`alert-modal-${index}`"> {{ __('Alerts') }} </gl-dropdown-item> </gl-dropdown> diff --git a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue index 33f5199aabe..afb8439511f 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue @@ -331,7 +331,6 @@ export default { :loading="isRetrying" :disabled="isRetrying" container-class="js-pipelines-retry-button btn btn-default btn-retry" - data-qa-selector="pipeline_retry_button" @click="handleRetryClick" > <icon name="repeat" /> diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml index d79568d9047..3464cc1ea07 100644 --- a/app/views/layouts/nav/sidebar/_project.html.haml +++ b/app/views/layouts/nav/sidebar/_project.html.haml @@ -232,7 +232,7 @@ - if project_nav_tab? :environments = nav_link(controller: :environments, action: [:metrics, :metrics_redirect]) do - = link_to metrics_project_environments_path(@project), title: _('Metrics'), class: 'shortcuts-metrics', data: { qa_selector: 'operations_metrics_link' } do + = link_to metrics_project_environments_path(@project), title: _('Metrics'), class: 'shortcuts-metrics' do %span = _('Metrics') diff --git a/changelogs/unreleased/35552-improve-logging-of-sync-services-alt.yml b/changelogs/unreleased/35552-improve-logging-of-sync-services-alt.yml new file mode 100644 index 00000000000..aaad407676d --- /dev/null +++ b/changelogs/unreleased/35552-improve-logging-of-sync-services-alt.yml @@ -0,0 +1,5 @@ +--- +title: 'Geo: Include host when logging' +merge_request: 22203 +author: +type: other diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 6f2ad341ce2..4a79fc33da3 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -651,7 +651,7 @@ With `only`, individual keys are logically joined by an AND: > NOT((any of refs) AND (any of variables) AND (any of changes) AND (if Kubernetes is active)) -This, more intuitively, means the keys join by an OR. A functionally equivalent expression: +This means the keys are treated as if joined by an OR. This relationship could be described as: > (any of refs) OR (any of variables) OR (any of changes) OR (if Kubernetes is active) diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md index 8a1db615022..746618be50f 100644 --- a/doc/development/background_migrations.md +++ b/doc/development/background_migrations.md @@ -56,6 +56,13 @@ for more details. Make sure that in case that your migration job is going to be retried data integrity is guaranteed. +## Background migrations for EE-only features + +All the background migration classes for EE-only features should be present in GitLab CE. +For this purpose, an empty class can be created for GitLab CE and for GitLab EE it can be extended +For this purpose, an empty class can be created for GitLab CE, and it can be extended for GitLab EE +as explained in the [guidelines for implementing Enterprise Edition features](ee_features.md#code-in-libgitlabbackground_migration). + ## How It Works Background migrations are simple classes that define a `perform` method. A diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md index 672ae5e7b27..7fdda7fab27 100644 --- a/doc/development/ee_features.md +++ b/doc/development/ee_features.md @@ -350,6 +350,55 @@ resolve when you add the indentation to the equation. EE-specific views should be placed in `ee/app/views/`, using extra sub-directories if appropriate. +### Code in `lib/gitlab/background_migration/` + +When you create EE-only background migrations, you have to plan for users that +downgrade GitLab EE to CE. In other words, every EE-only migration has to be present in +CE code but with no implementation, instead you need to extend it on EE side. + +GitLab CE: + +```ruby +# lib/gitlab/background_migration/prune_orphaned_geo_events.rb + +module Gitlab + module BackgroundMigration + class PruneOrphanedGeoEvents + def perform(table_name) + end + end + end +end + +Gitlab::BackgroundMigration::PruneOrphanedGeoEvents.prepend_if_ee('EE::Gitlab::BackgroundMigration::PruneOrphanedGeoEvents') +``` + +GitLab EE: + +```ruby +# ee/lib/ee/gitlab/background_migration/prune_orphaned_geo_events.rb + +module EE + module Gitlab + module BackgroundMigration + module PruneOrphanedGeoEvents + extend ::Gitlab::Utils::Override + + override :perform + def perform(table_name = EVENT_TABLES.first) + return if ::Gitlab::Database.read_only? + + deleted_rows = prune_orphaned_rows(table_name) + table_name = next_table(table_name) if deleted_rows.zero? + + ::BackgroundMigrationWorker.perform_in(RESCHEDULE_DELAY, self.class.name.demodulize, table_name) if table_name + end + end + end + end +end +``` + #### Using `render_if_exists` Instead of using regular `render`, we should use `render_if_exists`, which diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md index 903ca6ada4a..386baf825b8 100644 --- a/doc/development/i18n/externalization.md +++ b/doc/development/i18n/externalization.md @@ -195,6 +195,31 @@ For example use `%{created_at}` in Ruby but `%{createdAt}` in JavaScript. Make s // => When x == 2: 'Last 2 days' ``` +The `n_` method should only be used to fetch pluralized translations of the same +string, not to control the logic of showing different strings for different +quantities. Some languages have different quantities of target plural forms - +Chinese (simplified), for example, has only one target plural form in our +translation tool. This means the translator would have to choose to translate +only one of the strings and the translation would not behave as intended in the +other case. + +For example, prefer to use: + +```ruby +if selected_projects.one? + selected_projects.first.name +else + n__("Project selected", "%d projects selected", selected_projects.count) +end +``` + +rather than: + +```ruby +# incorrect usage example +n_("%{project_name}", "%d projects selected", count) % { project_name: 'GitLab' } +``` + ### Namespaces Sometimes you need to add some context to the text that you want to translate diff --git a/doc/development/scalability.md b/doc/development/scalability.md index 70a4cab39e2..cc86a4b91a0 100644 --- a/doc/development/scalability.md +++ b/doc/development/scalability.md @@ -104,10 +104,10 @@ GitLab.com](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7356). There are several strategies to provide high-availability and redundancy: -1. Write-ahead logs (WAL) streamed to object storage (e.g. S3, Google Cloud - Storage). -1. Read-replicas (hot backups) -1. Delayed replicas +- Write-ahead logs (WAL) streamed to object storage (e.g. S3, Google Cloud + Storage). +- Read-replicas (hot backups). +- Delayed replicas. To restore a database from a point in time, a base backup needs to have been taken prior to that incident. Once a database has restored from @@ -145,9 +145,9 @@ saturate a single core, which can result in slower response times for background job and/or Web requests. There are two ways to address this limitation: -1. Run multiple PgBouncer instances -1. Use a multi-threaded connection pooler (e.g. - [Odyssey](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7776). +- Run multiple PgBouncer instances. +- Use a multi-threaded connection pooler (e.g. + [Odyssey](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7776). On some Linux systems, it's possible to run [multiple PgBouncer instances on the same port](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4796). @@ -158,9 +158,9 @@ avoid saturating a single core. In addition, the PgBouncer instances that communicate with the primary and secondaries are set up a bit differently: -1. Multiple PgBouncer instances in different availability zones talk to the - PostgreSQL primary -1. Multiple PgBouncer processes are colocated with PostgreSQL read replicas +- Multiple PgBouncer instances in different availability zones talk to the + PostgreSQL primary. +- Multiple PgBouncer processes are colocated with PostgreSQL read replicas. For replicas, colocating is advantageous because it reduces network hops and hence latency. However, for the primary, colocating is @@ -211,10 +211,10 @@ Redis process. #### High availability/Risks -1. Single-core: Like PgBouncer, a single Redis process can only use one +Single-core: Like PgBouncer, a single Redis process can only use one core. It does not support multi-threading. -1. Dumb secondaries: Redis secondaries (aka slaves) don't actually +Dumb secondaries: Redis secondaries (aka slaves) don't actually handle any load. Unlike PostgreSQL secondaries, they don't even serve read queries. They simply replicate data from the primary and take over only when the primary fails. @@ -240,10 +240,10 @@ Sidekiq is a multi-threaded, background job processing system used in Ruby on Rails applications. In GitLab, Sidekiq performs the heavy lifting of many activities, including: -1. Updating merge requests after a push -1. Sending e-mails -1. Updating user authorizations -1. Processing CI builds and pipelines +- Updating merge requests after a push. +- Sending e-mails. +- Updating user authorizations. +- Processing CI builds and pipelines. The full list of jobs can be found in the [app/workers](https://gitlab.com/gitlab-org/gitlab/tree/master/app/workers) diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index 1a689674db9..2d2f5409c15 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -634,6 +634,10 @@ before attempting to perform it in a production environment. You can only restore a backup to **exactly the same version and type (CE/EE)** of GitLab that you created it on, for example CE 9.1.0. +If your backup is a different version than the current installation, you will +need to [downgrade your GitLab installation](https://docs.gitlab.com/omnibus/update/README.html#downgrading) +before restoring the backup. + ### Restore prerequisites You need to have a working GitLab installation before you can perform diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 14891309a1b..1d3a7e2a958 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -5742,11 +5742,6 @@ msgstr "" msgid "CycleAnalyticsStage|should be under a group" msgstr "" -msgid "CycleAnalytics|%{projectName}" -msgid_plural "CycleAnalytics|%d projects selected" -msgstr[0] "" -msgstr[1] "" - msgid "CycleAnalytics|%{stageCount} stages selected" msgstr "" @@ -5768,6 +5763,11 @@ msgstr "" msgid "CycleAnalytics|Number of tasks" msgstr "" +msgid "CycleAnalytics|Project selected" +msgid_plural "CycleAnalytics|%d projects selected" +msgstr[0] "" +msgstr[1] "" + msgid "CycleAnalytics|Select labels" msgstr "" @@ -289,8 +289,6 @@ module QA autoload :AddExisting, 'qa/page/project/operations/kubernetes/add_existing' autoload :Show, 'qa/page/project/operations/kubernetes/show' end - - autoload :Metrics, 'qa/page/project/operations/metrics' end module Wiki diff --git a/qa/qa/fixtures/monitored_auto_devops/.gitlab-ci.yml b/qa/qa/fixtures/monitored_auto_devops/.gitlab-ci.yml deleted file mode 100644 index a65ae5aa1d9..00000000000 --- a/qa/qa/fixtures/monitored_auto_devops/.gitlab-ci.yml +++ /dev/null @@ -1,337 +0,0 @@ -# This is stripped down version of the .gitlab-ci.yml found -# here: https://gitlab.com/joshlambert/autodevops-deploy. -# -# It performs only the deploy stage. - -image: alpine:latest - -variables: - # AUTO_DEVOPS_DOMAIN is the application deployment domain and should be set as a variable at the group or project level. - AUTO_DEVOPS_DOMAIN: my-fake-domain.com - - POSTGRES_USER: user - POSTGRES_PASSWORD: testing-password - POSTGRES_ENABLED: 'false' - POSTGRES_DB: $CI_ENVIRONMENT_SLUG - - KUBERNETES_VERSION: 1.11.6 - HELM_VERSION: 2.12.2 - - DOCKER_DRIVER: overlay2 - -stages: - - production - -# This job continuously deploys to production on every push to `master`. - -production: - stage: production - script: - - check_kube_domain - - install_dependencies - - download_chart - - ensure_namespace - - initialize_tiller - - create_secret - - deploy - - persist_environment_url - environment: - name: production - url: http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN - artifacts: - paths: [environment_url.txt] - only: - refs: - - master - kubernetes: active - -# --------------------------------------------------------------------------- - -.auto_devops: &auto_devops | - # Auto DevOps variables and functions - [[ "$TRACE" ]] && set -x - auto_database_url=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${CI_ENVIRONMENT_SLUG}-postgres:5432/${POSTGRES_DB} - export DATABASE_URL=${DATABASE_URL-$auto_database_url} - export CI_APPLICATION_REPOSITORY=$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG - export CI_APPLICATION_TAG=$CI_COMMIT_SHA - export CI_CONTAINER_NAME=ci_job_build_${CI_JOB_ID} - export TILLER_NAMESPACE=$KUBE_NAMESPACE - # Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable" for Security Products - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - - - function get_replicas() { - track="${1:-stable}" - percentage="${2:-100}" - - env_track=$( echo $track | tr -s '[:lower:]' '[:upper:]' ) - env_slug=$( echo ${CI_ENVIRONMENT_SLUG//-/_} | tr -s '[:lower:]' '[:upper:]' ) - - if [[ "$track" == "stable" ]] || [[ "$track" == "rollout" ]]; then - # for stable track get number of replicas from `PRODUCTION_REPLICAS` - eval new_replicas=\$${env_slug}_REPLICAS - if [[ -z "$new_replicas" ]]; then - new_replicas=$REPLICAS - fi - else - # for all tracks get number of replicas from `CANARY_PRODUCTION_REPLICAS` - eval new_replicas=\$${env_track}_${env_slug}_REPLICAS - if [[ -z "$new_replicas" ]]; then - eval new_replicas=\${env_track}_REPLICAS - fi - fi - - replicas="${new_replicas:-1}" - replicas="$(($replicas * $percentage / 100))" - - # always return at least one replicas - if [[ $replicas -gt 0 ]]; then - echo "$replicas" - else - echo 1 - fi - } - - - # Extracts variables prefixed with K8S_SECRET_ - # and creates a Kubernetes secret. - # - # e.g. If we have the following environment variables: - # K8S_SECRET_A=value1 - # K8S_SECRET_B=multi\ word\ value - # - # Then we will create a secret with the following key-value pairs: - # data: - # A: dmFsdWUxCg== - # B: bXVsdGkgd29yZCB2YWx1ZQo= - function create_application_secret() { - track="${1-stable}" - export APPLICATION_SECRET_NAME=$(application_secret_name "$track") - - env | sed -n "s/^K8S_SECRET_\(.*\)$/\1/p" > k8s_prefixed_variables - - kubectl create secret \ - -n "$KUBE_NAMESPACE" generic "$APPLICATION_SECRET_NAME" \ - --from-env-file k8s_prefixed_variables -o yaml --dry-run | - kubectl replace -n "$KUBE_NAMESPACE" --force -f - - - export APPLICATION_SECRET_CHECKSUM=$(cat k8s_prefixed_variables | sha256sum | cut -d ' ' -f 1) - - rm k8s_prefixed_variables - } - - function deploy_name() { - name="$CI_ENVIRONMENT_SLUG" - track="${1-stable}" - - if [[ "$track" != "stable" ]]; then - name="$name-$track" - fi - - echo $name - } - - function application_secret_name() { - track="${1-stable}" - name=$(deploy_name "$track") - - echo "${name}-secret" - } - - - function deploy() { - track="${1-stable}" - percentage="${2:-100}" - name=$(deploy_name "$track") - - replicas="1" - service_enabled="true" - postgres_enabled="$POSTGRES_ENABLED" - - # if track is different than stable, - # re-use all attached resources - if [[ "$track" != "stable" ]]; then - service_enabled="false" - postgres_enabled="false" - fi - - replicas=$(get_replicas "$track" "$percentage") - - if [[ "$CI_PROJECT_VISIBILITY" != "public" ]]; then - secret_name='gitlab-registry' - else - secret_name='' - fi - - create_application_secret "$track" - - env_slug=$(echo ${CI_ENVIRONMENT_SLUG//-/_} | tr -s '[:lower:]' '[:upper:]') - eval env_ADDITIONAL_HOSTS=\$${env_slug}_ADDITIONAL_HOSTS - if [ -n "$env_ADDITIONAL_HOSTS" ]; then - additional_hosts="{$env_ADDITIONAL_HOSTS}" - elif [ -n "$ADDITIONAL_HOSTS" ]; then - additional_hosts="{$ADDITIONAL_HOSTS}" - fi - - if [[ -n "$DB_INITIALIZE" && -z "$(helm ls -q "^$name$")" ]]; then - echo "Deploying first release with database initialization..." - helm upgrade --install \ - --wait \ - --set service.enabled="$service_enabled" \ - --set releaseOverride="$CI_ENVIRONMENT_SLUG" \ - --set image.repository="registry.gitlab.com/joshlambert/ruby-gke/master" \ - --set image.tag="63492726c2264a0277141d6a6573c3d22ecd7de3" \ - --set image.pullPolicy=IfNotPresent \ - --set image.secrets[0].name="$secret_name" \ - --set application.track="$track" \ - --set application.database_url="$DATABASE_URL" \ - --set application.secretName="$APPLICATION_SECRET_NAME" \ - --set application.secretChecksum="$APPLICATION_SECRET_CHECKSUM" \ - --set service.url="$CI_ENVIRONMENT_URL" \ - --set service.additionalHosts="$additional_hosts" \ - --set replicaCount="$replicas" \ - --set postgresql.enabled="$postgres_enabled" \ - --set postgresql.nameOverride="postgres" \ - --set postgresql.postgresUser="$POSTGRES_USER" \ - --set postgresql.postgresPassword="$POSTGRES_PASSWORD" \ - --set postgresql.postgresDatabase="$POSTGRES_DB" \ - --set application.initializeCommand="$DB_INITIALIZE" \ - --set gitlab.app="$CI_PROJECT_PATH_SLUG" \ - --set gitlab.env="$CI_ENVIRONMENT_SLUG" \ - --namespace="$KUBE_NAMESPACE" \ - "$name" \ - chart/ - - echo "Deploying second release..." - helm upgrade --reuse-values \ - --wait \ - --set application.initializeCommand="" \ - --set application.migrateCommand="$DB_MIGRATE" \ - --namespace="$KUBE_NAMESPACE" \ - "$name" \ - chart/ - else - echo "Deploying new release..." - helm upgrade --install \ - --wait \ - --set service.enabled="$service_enabled" \ - --set releaseOverride="$CI_ENVIRONMENT_SLUG" \ - --set image.repository="registry.gitlab.com/joshlambert/ruby-gke/master" \ - --set image.tag="63492726c2264a0277141d6a6573c3d22ecd7de3" \ - --set image.pullPolicy=IfNotPresent \ - --set image.secrets[0].name="$secret_name" \ - --set application.track="$track" \ - --set application.database_url="$DATABASE_URL" \ - --set application.secretName="$APPLICATION_SECRET_NAME" \ - --set application.secretChecksum="$APPLICATION_SECRET_CHECKSUM" \ - --set service.url="$CI_ENVIRONMENT_URL" \ - --set service.additionalHosts="$additional_hosts" \ - --set replicaCount="$replicas" \ - --set postgresql.enabled="$postgres_enabled" \ - --set postgresql.nameOverride="postgres" \ - --set postgresql.postgresUser="$POSTGRES_USER" \ - --set postgresql.postgresPassword="$POSTGRES_PASSWORD" \ - --set postgresql.postgresDatabase="$POSTGRES_DB" \ - --set application.migrateCommand="$DB_MIGRATE" \ - --set gitlab.app="$CI_PROJECT_PATH_SLUG" \ - --set gitlab.env="$CI_ENVIRONMENT_SLUG" \ - --namespace="$KUBE_NAMESPACE" \ - "$name" \ - chart/ - fi - - kubectl rollout status -n "$KUBE_NAMESPACE" -w "deployment/$name" - } - - - function install_dependencies() { - apk add -U openssl curl tar gzip bash ca-certificates git - wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-2.23-r3.apk - apk add glibc-2.23-r3.apk - rm glibc-2.23-r3.apk - - curl "https://kubernetes-helm.storage.googleapis.com/helm-v${HELM_VERSION}-linux-amd64.tar.gz" | tar zx - mv linux-amd64/helm /usr/bin/ - mv linux-amd64/tiller /usr/bin/ - helm version --client - tiller -version - - curl -L -o /usr/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl" - chmod +x /usr/bin/kubectl - kubectl version --client - } - - function download_chart() { - if [[ ! -d chart ]]; then - auto_chart=${AUTO_DEVOPS_CHART:-gitlab/auto-deploy-app} - auto_chart_name=$(basename $auto_chart) - auto_chart_name=${auto_chart_name%.tgz} - else - auto_chart="chart" - auto_chart_name="chart" - fi - - helm init --client-only - helm repo add gitlab https://charts.gitlab.io - if [[ ! -d "$auto_chart" ]]; then - helm fetch ${auto_chart} --untar - fi - if [ "$auto_chart_name" != "chart" ]; then - mv ${auto_chart_name} chart - fi - - helm dependency update chart/ - helm dependency build chart/ - } - - function ensure_namespace() { - kubectl describe namespace "$KUBE_NAMESPACE" || kubectl create namespace "$KUBE_NAMESPACE" - } - - function check_kube_domain() { - if [ -z ${AUTO_DEVOPS_DOMAIN+x} ]; then - echo "In order to deploy or use Review Apps, AUTO_DEVOPS_DOMAIN variable must be set" - echo "You can do it in Auto DevOps project settings or defining a secret variable at group or project level" - echo "You can also manually add it in .gitlab-ci.yml" - false - else - true - fi - } - - function initialize_tiller() { - echo "Checking Tiller..." - - export HELM_HOST="localhost:44134" - tiller -listen ${HELM_HOST} -alsologtostderr > /dev/null 2>&1 & - echo "Tiller is listening on ${HELM_HOST}" - - if ! helm version --debug; then - echo "Failed to init Tiller." - return 1 - fi - echo "" - } - - function create_secret() { - echo "Create secret..." - if [[ "$CI_PROJECT_VISIBILITY" == "public" ]]; then - return - fi - - kubectl create secret -n "$KUBE_NAMESPACE" \ - docker-registry gitlab-registry \ - --docker-server="$CI_REGISTRY" \ - --docker-username="$CI_REGISTRY_USER" \ - --docker-password="$CI_REGISTRY_PASSWORD" \ - --docker-email="$GITLAB_USER_EMAIL" \ - -o yaml --dry-run | kubectl replace -n "$KUBE_NAMESPACE" --force -f - - } - - function persist_environment_url() { - echo $CI_ENVIRONMENT_URL > environment_url.txt - } - -before_script: - - *auto_devops diff --git a/qa/qa/page/project/operations/metrics.rb b/qa/qa/page/project/operations/metrics.rb deleted file mode 100644 index cf5578ef26b..00000000000 --- a/qa/qa/page/project/operations/metrics.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -module QA - module Page - module Project - module Operations - class Metrics < Page::Base - EXPECTED_TITLE = 'Memory Usage (Total)' - EXPECTED_LABEL = 'Total (GB)' - LOADING_MESSAGE = 'Waiting for performance data' - - view 'app/assets/javascripts/monitoring/components/dashboard.vue' do - element :prometheus_graphs - end - - view 'app/assets/javascripts/monitoring/components/charts/time_series.vue' do - element :prometheus_graph_widgets - end - - view 'app/assets/javascripts/monitoring/components/panel_type.vue' do - element :prometheus_widgets_dropdown - element :alert_widget_menu_item - end - - view 'ee/app/assets/javascripts/monitoring/components/alert_widget_form.vue' do - element :alert_query_dropdown - element :alert_query_option - element :alert_threshold_field - end - - def wait_for_metrics - wait_for_data - return if has_metrics? - - wait_until(max_duration: 180) do - wait_for_data - has_metrics? - end - end - - def wait_for_data - wait_until(reload: false) { !has_text?(LOADING_MESSAGE) } if has_text?(LOADING_MESSAGE) - end - - def has_metrics? - within_element :prometheus_graphs do - has_text?(EXPECTED_TITLE) - end - end - - def wait_for_alert(operator = '>', threshold = 0) - wait_until(reload: false) { has_alert?(operator, threshold) } - end - - def has_alert?(operator = '>', threshold = 0) - within_element :prometheus_graphs do - has_text?([EXPECTED_LABEL, operator, threshold].join(' ')) - end - end - - def write_first_alert(operator = '>', threshold = 0) - open_first_alert_modal - click_on operator - fill_element :alert_threshold_field, threshold - - within('.modal-content') { click_button(class: 'btn-success') } - end - - def delete_first_alert - open_first_alert_modal - - within('.modal-content') { click_button(class: 'btn-danger') } - wait_for_requests - end - - def open_first_alert_modal - all_elements(:prometheus_widgets_dropdown, minimum: 1).first.click - click_element :alert_widget_menu_item - - click_element :alert_query_dropdown unless has_element?(:alert_query_option, wait: 3) - all_elements(:alert_query_option, minimum: 1).first.click - end - end - end - end - end -end diff --git a/qa/qa/page/project/pipeline/index.rb b/qa/qa/page/project/pipeline/index.rb index f018e4bf018..684ad4a59d5 100644 --- a/qa/qa/page/project/pipeline/index.rb +++ b/qa/qa/page/project/pipeline/index.rb @@ -9,7 +9,6 @@ module QA::Page view 'app/assets/javascripts/pipelines/components/pipelines_table_row.vue' do element :pipeline_commit_status - element :pipeline_retry_button end def click_on_latest_pipeline @@ -19,25 +18,10 @@ module QA::Page end def wait_for_latest_pipeline_success - wait_for_latest_pipeline_status { has_text?('passed') } - end - - def wait_for_latest_pipeline_completion - wait_for_latest_pipeline_status { has_text?('passed') || has_text?('failed') } - end - - def wait_for_latest_pipeline_status wait_until(reload: false, max_duration: 300) do - within_element_by_index(:pipeline_commit_status, 0) { yield } - end - end - - def wait_for_latest_pipeline_success_or_retry - wait_for_latest_pipeline_completion - - if has_text?('failed') - click_element :pipeline_retry_button - wait_for_latest_pipeline_success + within_element_by_index(:pipeline_commit_status, 0) do + has_text?('passed') + end end end end diff --git a/qa/qa/page/project/sub_menus/operations.rb b/qa/qa/page/project/sub_menus/operations.rb index bcbc1dc16d3..d266cb21417 100644 --- a/qa/qa/page/project/sub_menus/operations.rb +++ b/qa/qa/page/project/sub_menus/operations.rb @@ -12,7 +12,6 @@ module QA view 'app/views/layouts/nav/sidebar/_project.html.haml' do element :link_operations element :operations_environments_link - element :operations_metrics_link end end end @@ -25,14 +24,6 @@ module QA end end - def go_to_operations_metrics - hover_operations do - within_submenu do - click_element(:operations_metrics_link) - end - end - end - def go_to_operations_kubernetes hover_operations do within_submenu do |