Skip to content
Snippets Groups Projects
Commit 87231973 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 8f764d21
No related branches found
No related tags found
No related merge requests found
Showing
with 153 additions and 31 deletions
Loading
Loading
@@ -10,6 +10,7 @@ class Projects::ReleasesController < Projects::ApplicationController
push_frontend_feature_flag(:release_evidence_collection, project)
end
before_action :authorize_update_release!, only: %i[edit update]
before_action :authorize_download_code!, only: [:evidence]
 
def index
respond_to do |format|
Loading
Loading
Loading
Loading
@@ -662,9 +662,8 @@ module Ci
def execute_hooks
return unless project
 
build_data = Gitlab::DataBuilder::Build.build(self)
project.execute_hooks(build_data.dup, :job_hooks)
project.execute_services(build_data.dup, :job_hooks)
project.execute_hooks(build_data.dup, :job_hooks) if project.has_active_hooks?(:job_hooks)
project.execute_services(build_data.dup, :job_hooks) if project.has_active_services?(:job_hooks)
end
 
def browsable_artifacts?
Loading
Loading
@@ -873,6 +872,10 @@ module Ci
 
private
 
def build_data
@build_data ||= Gitlab::DataBuilder::Build.build(self)
end
def successful_deployment_status
if deployment&.last?
:last
Loading
Loading
Loading
Loading
@@ -38,7 +38,7 @@ class CohortsService
 
{
registration_month: registration_month,
activity_months: activity_months,
activity_months: activity_months[1..-1],
total: activity_months.first[:total],
inactive: inactive
}
Loading
Loading
- number_of_data_columns = @cohorts[:months_included] - 1
.bs-callout.clearfix
%p
User cohorts are shown for the last #{@cohorts[:months_included]}
months. Only users with activity are counted in the cohort total; inactive
users are counted separately.
= s_("Cohorts|User cohorts are shown for the last %{months_included} months. Only users with activity are counted in the 'New users' column; inactive users are counted separately.") % { months_included: @cohorts[:months_included] }
= link_to icon('question-circle'), help_page_path('user/instance_statistics/user_cohorts', anchor: 'cohorts'), title: 'About this feature', target: '_blank'
 
.table-holder
.table-holder.d-xl-table
%table.table
%thead
%tr
%th Registration month
%th Inactive users
%th Cohort total
- @cohorts[:months_included].times do |i|
%th Month #{i}
%th.border-right.pt-4{ colspan: 3 }
%th.font-weight-bold.pt-4{ colspan: number_of_data_columns }
= s_("Cohorts|Returning users")
%tr
%th.border-top-0
= s_("Cohorts|Registration month")
%th.border-top-0
= s_("Cohorts|Inactive users")
%th.border-top-0.border-right
= s_("Cohorts|New users")
- number_of_data_columns.times do |i|
%th.border-top-0
= s_("Cohorts|Month %{month_index}") % { month_index: i + 1 }
%tbody
- @cohorts[:cohorts].each do |cohort|
%tr
%td= cohort[:registration_month]
%td= cohort[:inactive]
%td= cohort[:total]
%td.border-right= cohort[:total]
- cohort[:activity_months].each do |activity_month|
%td
- next if cohort[:total] == '0'
Loading
Loading
#js-registry-settings{ data: { registry_settings_endpoint: '',
help_page_path: help_page_path('user/project/operations/linking_to_an_external_dashboard') } }
Loading
Loading
@@ -59,3 +59,14 @@
.settings-content
= render 'projects/triggers/index'
 
- if Feature.enabled?(:registry_retention_policies_settings, @project)
%section.settings.no-animate#js-registry-polcies{ class: ('expanded' if expanded) }
.settings-header
%h4
= _("Container Registry tag expiration policies")
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
= _("Expiration policies for the Container Registry are a perfect solution for keeping the Registry space down while still enjoying the full power of GitLab CI/CD.")
.settings-content
= render 'projects/registry/settings/index'
---
title: Clean up the cohorts table
merge_request: 20779
author:
type: changed
---
title: Update information and button text for deployment footer
merge_request: 18918
author:
type: changed
---
title: Evidence - Added restriction for guest on Release page
merge_request: 21102
author:
type: changed
---
title: Reduce Gitaly calls in BuildHooksWorker
merge_request: 20365
author:
type: performance
Loading
Loading
@@ -7,6 +7,17 @@ require 'gitlab/current_settings'
Gitlab.ee do
require 'elasticsearch/model'
 
### Monkey patches
Elasticsearch::Model::Response::Records.prepend GemExtensions::Elasticsearch::Model::Response::Records
Elasticsearch::Model::Adapter::Multiple::Records.prepend GemExtensions::Elasticsearch::Model::Adapter::Multiple::Records
Elasticsearch::Model::Indexing::InstanceMethods.prepend GemExtensions::Elasticsearch::Model::Indexing::InstanceMethods
Elasticsearch::Model::Adapter::ActiveRecord::Importing.prepend GemExtensions::Elasticsearch::Model::Adapter::ActiveRecord::Importing
Elasticsearch::Model::Client::InstanceMethods.prepend GemExtensions::Elasticsearch::Model::Client
Elasticsearch::Model::Client::ClassMethods.prepend GemExtensions::Elasticsearch::Model::Client
Elasticsearch::Model::ClassMethods.prepend GemExtensions::Elasticsearch::Model::Client
Elasticsearch::Model.singleton_class.prepend GemExtensions::Elasticsearch::Model::Client
### Modified from elasticsearch-model/lib/elasticsearch/model.rb
 
[
Loading
Loading
@@ -32,15 +43,4 @@ Gitlab.ee do
target.respond_to?(:as_indexed_json) ? target.__send__(:as_indexed_json, options) : super
end
CODE
### Monkey patches
Elasticsearch::Model::Response::Records.prepend GemExtensions::Elasticsearch::Model::Response::Records
Elasticsearch::Model::Adapter::Multiple::Records.prepend GemExtensions::Elasticsearch::Model::Adapter::Multiple::Records
Elasticsearch::Model::Indexing::InstanceMethods.prepend GemExtensions::Elasticsearch::Model::Indexing::InstanceMethods
Elasticsearch::Model::Adapter::ActiveRecord::Importing.prepend GemExtensions::Elasticsearch::Model::Adapter::ActiveRecord::Importing
Elasticsearch::Model::Client::InstanceMethods.prepend GemExtensions::Elasticsearch::Model::Client
Elasticsearch::Model::Client::ClassMethods.prepend GemExtensions::Elasticsearch::Model::Client
Elasticsearch::Model::ClassMethods.prepend GemExtensions::Elasticsearch::Model::Client
Elasticsearch::Model.singleton_class.prepend GemExtensions::Elasticsearch::Model::Client
end
Loading
Loading
@@ -88,8 +88,8 @@ def instrument_classes(instrumentation)
instrumentation.instrument_instance_methods(Gitlab::Highlight)
 
Gitlab.ee do
instrumentation.instrument_methods(Elasticsearch::Git::Repository)
instrumentation.instrument_instance_methods(Elasticsearch::Git::Repository)
instrumentation.instrument_instance_methods(Elastic::Latest::GitInstanceProxy)
instrumentation.instrument_instance_methods(Elastic::Latest::GitClassProxy)
 
instrumentation.instrument_instance_methods(Search::GlobalService)
instrumentation.instrument_instance_methods(Search::ProjectService)
Loading
Loading
# frozen_string_literal: true
class CreateGitlabSubscriptionHistories < ActiveRecord::Migration[5.2]
DOWNTIME = false
def up
create_table :gitlab_subscription_histories do |t|
t.datetime_with_timezone :gitlab_subscription_created_at
t.datetime_with_timezone :gitlab_subscription_updated_at
t.date :start_date
t.date :end_date
t.date :trial_ends_on
t.integer :namespace_id, null: true
t.integer :hosted_plan_id, null: true
t.integer :max_seats_used
t.integer :seats
t.boolean :trial
t.integer :change_type, limit: 2
t.bigint :gitlab_subscription_id, null: false
t.datetime_with_timezone :created_at
end
add_index :gitlab_subscription_histories, :gitlab_subscription_id
end
def down
drop_table :gitlab_subscription_histories
end
end
Loading
Loading
@@ -1828,6 +1828,23 @@ ActiveRecord::Schema.define(version: 2019_12_02_031812) do
t.index ["upload_id"], name: "index_geo_upload_deleted_events_on_upload_id"
end
 
create_table "gitlab_subscription_histories", force: :cascade do |t|
t.datetime_with_timezone "gitlab_subscription_created_at"
t.datetime_with_timezone "gitlab_subscription_updated_at"
t.date "start_date"
t.date "end_date"
t.date "trial_ends_on"
t.integer "namespace_id"
t.integer "hosted_plan_id"
t.integer "max_seats_used"
t.integer "seats"
t.boolean "trial"
t.integer "change_type", limit: 2
t.bigint "gitlab_subscription_id", null: false
t.datetime_with_timezone "created_at"
t.index ["gitlab_subscription_id"], name: "index_gitlab_subscription_histories_on_gitlab_subscription_id"
end
create_table "gitlab_subscriptions", force: :cascade do |t|
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
Loading
Loading
Loading
Loading
@@ -270,3 +270,15 @@ database: gitlabhq_production
--------------------------------------------------
up migration_id migration_name
```
## Import common metrics
Sometimes you may need to re-import the common metrics that power the Metrics dashboards.
This could be as a result of [updating existing metrics](../../development/prometheus_metrics.md#update-existing-metrics), or as a [troubleshooting measure](../../user/project/integrations/prometheus.md#troubleshooting).
To re-import the metrics you can run:
```sh
sudo gitlab-rake metrics:setup_common_metrics
```
Loading
Loading
@@ -75,6 +75,7 @@ cannot be used as job names**:
- `after_script`
- `variables`
- `cache`
- `include`
 
### Using reserved keywords
 
Loading
Loading
Loading
Loading
@@ -249,7 +249,7 @@ scss_lint` in the GitLab directory. SCSS Lint will also run in GitLab CI to
catch any warnings.
 
If the Rake task is throwing warnings you don't understand, SCSS Lint's
documentation includes [a full list of their linters][scss-lint-documentation](https://github.com/sds/scss-lint/blob/master/lib/scss_lint/linter/README.md).
documentation includes [a full list of their linters](https://github.com/sds/scss-lint/blob/master/lib/scss_lint/linter/README.md).
 
### Fixing issues
 
Loading
Loading
Loading
Loading
@@ -22,7 +22,9 @@ The requirement for adding a new metric is to make each query to have an unique
 
### Update existing metrics
 
After you add or change existing _common_ metric you have to create a new database migration that will query and update all existing metrics.
After you add or change an existing common metric, you must [re-run the import script](../administration/raketasks/maintenance.md#import-common-metrics) that will query and update all existing metrics.
Or, you can create a database migration:
 
NOTE: **Note:**
If a query metric (which is identified by `id:`) is removed it will not be removed from database by default.
Loading
Loading
Loading
Loading
@@ -348,7 +348,7 @@ project):
echo-js:
handler: echo-js
source: ./echo-js
runtime: https://gitlab.com/gitlab-org/serverless/runtimes/nodejs
runtime: gitlab/runtimes/nodejs
description: "node.js runtime function"
environment:
MY_FUNCTION: echo-js
Loading
Loading
@@ -379,10 +379,27 @@ subsequent lines contain the function attributes.
|-----------|-------------|
| `handler` | The function's name. |
| `source` | Directory with sources of a functions. |
| `runtime` (optional)| The runtime to be used to execute the function. When the runtime is not specified, we assume that `Dockerfile` is present in the function directory specified by `source`. |
| `runtime` (optional)| The runtime to be used to execute the function. This can be a runtime alias (see [Runtime aliases](#runtime-aliases)), or it can be a full URL to a custom runtime repository. When the runtime is not specified, we assume that `Dockerfile` is present in the function directory specified by `source`. |
| `description` | A short description of the function. |
| `environment` | Sets an environment variable for the specific function only. |
 
#### Runtime aliases
The optional `runtime` parameter can refer to one of the following runtime aliases (also see [Supported runtimes](#supported-runtimes)):
| Runtime alias | Maintained by |
|-------------|---------------|
| `gitlab/runtimes/go` | GitLab |
| `gitlab/runtimes/nodejs` | GitLab |
| `gitlab/runtimes/ruby` | GitLab |
| `openfaas/classic/csharp` | OpenFaaS |
| `openfaas/classic/go` | OpenFaaS |
| `openfaas/classic/node` | OpenFaaS |
| `openfaas/classic/php7` | OpenFaaS |
| `openfaas/classic/python` | OpenFaaS |
| `openfaas/classic/python3` | OpenFaaS |
| `openfaas/classic/ruby` | OpenFaaS |
After the `gitlab-ci.yml` template has been added and the `serverless.yml` file
has been created, pushing a commit to your project will result in a CI pipeline
being executed which will deploy each function as a Knative service. Once the
Loading
Loading
Loading
Loading
@@ -574,6 +574,7 @@ If the "No data found" screen continues to appear, it could be due to:
are not labeled correctly. To test this, connect to the Prometheus server and
[run a query](prometheus_library/kubernetes.html#metrics-supported), replacing `$CI_ENVIRONMENT_SLUG`
with the name of your environment.
- You may need to re-add the GitLab predefined common metrics. This can be done by running the [import common metrics rake task](../../../administration/raketasks/maintenance.md#import-common-metrics).
 
[autodeploy]: ../../../topics/autodevops/index.md#auto-deploy
[kubernetes]: https://kubernetes.io
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment