提交 423e5c97 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 72580406
......@@ -104,7 +104,7 @@ module Projects
project_params = {
incident_management_setting_attributes: ::Gitlab::Tracking::IncidentManagement.tracking_keys.keys,
metrics_setting_attributes: [:external_dashboard_url],
metrics_setting_attributes: [:external_dashboard_url, :dashboard_timezone],
error_tracking_setting_attributes: [
:enabled,
......
......@@ -367,6 +367,10 @@ module ProjectsHelper
@project.metrics_setting_external_dashboard_url
end
def metrics_dashboard_timezone
@project.metrics_setting_dashboard_timezone
end
def grafana_integration_url
@project.grafana_integration&.grafana_url
end
......
......@@ -372,6 +372,7 @@ class Project < ApplicationRecord
delegate :root_ancestor, to: :namespace, allow_nil: true
delegate :last_pipeline, to: :commit, allow_nil: true
delegate :external_dashboard_url, to: :metrics_setting, allow_nil: true, prefix: true
delegate :dashboard_timezone, to: :metrics_setting, allow_nil: true, prefix: true
delegate :default_git_depth, :default_git_depth=, to: :ci_cd_settings, prefix: :ci
delegate :forward_deployment_enabled, :forward_deployment_enabled=, :forward_deployment_enabled?, to: :ci_cd_settings
delegate :actual_limits, :actual_plan_name, to: :namespace, allow_nil: true
......
......@@ -6,4 +6,6 @@ class ProjectMetricsSetting < ApplicationRecord
validates :external_dashboard_url,
length: { maximum: 255 },
addressable_url: { enforce_sanitization: true, ascii_only: true }
enum dashboard_timezone: { local: 0, utc: 1 }
end
---
title: Add column dashboard_timezone to project_metrics_setting
merge_request: 33120
author:
type: added
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class RemoveNotNullFromExternalDashboardUrl < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
change_column_null :project_metrics_settings, :external_dashboard_url, true
end
end
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddDashboardTimezoneToProjectMetricsSetting < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
add_column :project_metrics_settings, :dashboard_timezone, :integer, limit: 2, null: false, default: 0
end
end
......@@ -5220,7 +5220,8 @@ ALTER SEQUENCE public.project_incident_management_settings_project_id_seq OWNED
CREATE TABLE public.project_metrics_settings (
project_id integer NOT NULL,
external_dashboard_url character varying NOT NULL
external_dashboard_url character varying,
dashboard_timezone smallint DEFAULT 0 NOT NULL
);
CREATE TABLE public.project_mirror_data (
......@@ -13798,6 +13799,8 @@ COPY "schema_migrations" (version) FROM STDIN;
20200528054112
20200528123703
20200528125905
20200528171933
20200601210148
20200602143020
20200603073101
\.
......
......@@ -114,3 +114,26 @@ timed rollout 30%:
A [deployable application](https://gitlab.com/gl-release/timed-rollout-example) is
available, [demonstrating configuration of timed rollouts](https://gitlab.com/gl-release/timed-rollout-example/blob/master/.gitlab-ci.yml#L86-95).
## Blue-Green Deployment
Also sometimes known as canary or red-black deployment, this technique is used to reduce
downtime and risk during a deployment. When combined with incremental rollouts, you can
minimize the impact of a deployment causing an issue.
With this technique there are two deployments ("blue" and "green", but any naming can be used).
Only one of these deployments is live at any given time, except during an incremental rollout.
For example, your blue deployment can be currently active on production, while the
green deployment is "live" for testing, but not deployed to production. If issues
are found, the green deployment can be updated without affecting the production
deployment (currently blue). If testing finds no issues, you switch production to the green
deployment, and blue is now available to test the next release.
This process reduces downtime as there is no need to take down the production deployment
to switch to a different deployment. Both deployments are running in parallel, and
can be switched to at any time.
An [example deployable application](https://gitlab.com/gl-release/blue-green-example)
is available, with a [`gitlab-ci.yml` CI/CD configuration file](https://gitlab.com/gl-release/blue-green-example/blob/master/.gitlab-ci.yml)
that demonstrates blue-green deployments.
......@@ -192,6 +192,20 @@ cpp:
junit: report.xml
```
#### CUnit
[CUnit](https://cunity.gitlab.io/cunit/) can be made to produce [JUnit XML reports](https://cunity.gitlab.io/cunit/group__CI.html) automatically when run using its `CUnitCI.h` macros:
```yaml
cunit:
stage: test
script:
- ./my-cunit-test
artifacts:
reports:
junit: ./my-cunit-test.xml
```
### .Net example
The [JunitXML.TestLogger](https://www.nuget.org/packages/JunitXml.TestLogger/) NuGet
......
......@@ -356,7 +356,8 @@ Widgets should now be replicated by Geo!
end
```
1. Add fields `widget_count`, `widget_checksummed_count`, and `widget_checksum_failed_count`
1. Add fields `widget_count`, `widget_checksummed_count`, `widget_checksum_failed_count`,
`widget_synced_count` and `widget_failed_count`
to `GeoNodeStatus#RESOURCE_STATUS_FIELDS` array in `ee/app/models/geo_node_status.rb`.
1. Add the same fields to `GeoNodeStatus#PROMETHEUS_METRICS` hash in
`ee/app/models/geo_node_status.rb`.
......@@ -370,6 +371,8 @@ Widgets should now be replicated by Geo!
self.widget_count = Geo::WidgetReplicator.model.count
self.widget_checksummed_count = Geo::WidgetReplicator.checksummed.count
self.widget_checksum_failed_count = Geo::WidgetReplicator.checksum_failed.count
self.widget_synced_count = Geo::WidgetReplicator.synced_count
self.widget_failed_count = Geo::WidgetReplicator.failed_count
```
1. Make sure `Widget` model has `checksummed` and `checksum_failed` scopes.
......@@ -450,7 +453,7 @@ Widgets should now be verified by Geo!
end
```
1. Create `ee/app/graphql/types/geo/package_file_registry_type.rb`:
1. Create `ee/app/graphql/types/geo/widget_registry_type.rb`:
```ruby
# frozen_string_literal: true
......
......@@ -235,6 +235,10 @@ are available:
- `master` branch is directly deployed to staging.
- Manual actions are provided for incremental rollout to production.
TIP: **Tip:**
Use the [blue-green deployment](../../ci/environments/incremental_rollouts.md#blue-green-deployment) technique
to minimize downtime and risk.
## Using multiple Kubernetes clusters **(PREMIUM)**
When using Auto DevOps, you can deploy different environments to
......
......@@ -751,6 +751,7 @@ ProjectMetricsSetting:
- external_dashboard_url
- created_at
- updated_at
- dashboard_timezone
Board:
- id
- project_id
......
......@@ -96,7 +96,8 @@ describe Projects::Operations::UpdateService do
let(:params) do
{
metrics_setting_attributes: {
external_dashboard_url: 'http://gitlab.com'
external_dashboard_url: 'http://gitlab.com',
dashboard_timezone: 'utc'
}
}
end
......@@ -108,6 +109,7 @@ describe Projects::Operations::UpdateService do
expect(project.reload.metrics_setting.external_dashboard_url).to eq(
'http://gitlab.com'
)
expect(project.metrics_setting.dashboard_timezone).to eq('utc')
end
end
......@@ -122,6 +124,7 @@ describe Projects::Operations::UpdateService do
expect(project.reload.metrics_setting.external_dashboard_url).to eq(
'http://gitlab.com'
)
expect(project.metrics_setting.dashboard_timezone).to eq('utc')
end
context 'with blank external_dashboard_url in params' do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册