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

Add latest changes from gitlab-org/gitlab@master

parent 57e3d49f
No related branches found
No related tags found
No related merge requests found
Showing
with 253 additions and 86 deletions
<script>
import { mapActions, mapState } from 'vuex';
import { GlButton, GlFormInput } from '@gitlab/ui';
import { GlFormInput } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
 
export default {
components: { GlButton, GlFormInput, Icon },
components: { GlFormInput, Icon, LoadingButton },
computed: {
...mapState(['apiHost', 'connectError', 'connectSuccessful', 'token']),
...mapState(['apiHost', 'connectError', 'connectSuccessful', 'isLoadingProjects', 'token']),
tokenInputState() {
return this.connectError ? false : null;
},
Loading
Loading
@@ -27,6 +28,7 @@ export default {
<gl-form-input
id="error-tracking-api-host"
:value="apiHost"
:disabled="isLoadingProjects"
placeholder="https://mysentryserver.com"
@input="updateApiHost"
/>
Loading
Loading
@@ -47,13 +49,17 @@ export default {
id="error-tracking-token"
:value="token"
:state="tokenInputState"
:disabled="isLoadingProjects"
@input="updateToken"
/>
</div>
<div class="col-4 col-md-3 gl-pl-0">
<gl-button class="js-error-tracking-connect prepend-left-5" @click="fetchProjects">{{
__('Connect')
}}</gl-button>
<loading-button
class="js-error-tracking-connect prepend-left-5 d-inline-flex"
:label="isLoadingProjects ? __('Connecting') : __('Connect')"
:loading="isLoadingProjects"
@click="fetchProjects"
/>
<icon
v-show="connectSuccessful"
class="js-error-tracking-connect-success prepend-left-5 text-success align-middle"
Loading
Loading
Loading
Loading
@@ -6,17 +6,20 @@ import { transformFrontendSettings } from '../utils';
import * as types from './mutation_types';
 
export const requestProjects = ({ commit }) => {
commit(types.SET_PROJECTS_LOADING, true);
commit(types.RESET_CONNECT);
};
 
export const receiveProjectsSuccess = ({ commit }, projects) => {
commit(types.UPDATE_CONNECT_SUCCESS);
commit(types.RECEIVE_PROJECTS, projects);
commit(types.SET_PROJECTS_LOADING, false);
};
 
export const receiveProjectsError = ({ commit }) => {
commit(types.UPDATE_CONNECT_ERROR);
commit(types.CLEAR_PROJECTS);
commit(types.SET_PROJECTS_LOADING, false);
};
 
export const fetchProjects = ({ dispatch, state }) => {
Loading
Loading
Loading
Loading
@@ -9,3 +9,4 @@ export const UPDATE_ENABLED = 'UPDATE_ENABLED';
export const UPDATE_SELECTED_PROJECT = 'UPDATE_SELECTED_PROJECT';
export const UPDATE_SETTINGS_LOADING = 'UPDATE_SETTINGS_LOADING';
export const UPDATE_TOKEN = 'UPDATE_TOKEN';
export const SET_PROJECTS_LOADING = 'SET_PROJECTS_LOADING';
Loading
Loading
@@ -58,4 +58,7 @@ export default {
state.connectSuccessful = false;
state.connectError = true;
},
[types.SET_PROJECTS_LOADING](state, loading) {
state.isLoadingProjects = loading;
},
};
Loading
Loading
@@ -3,6 +3,7 @@ export default () => ({
enabled: false,
token: '',
projects: [],
isLoadingProjects: false,
selectedProject: null,
settingsLoading: false,
connectSuccessful: false,
Loading
Loading
/* eslint-disable no-restricted-properties, func-names, no-var, camelcase,
/* eslint-disable no-restricted-properties, no-var, camelcase,
no-unused-expressions, one-var, default-case,
consistent-return, no-alert, no-return-assign,
no-param-reassign, no-else-return, vars-on-top,
no-shadow, no-useless-escape, class-methods-use-this */
consistent-return, no-alert, no-param-reassign, no-else-return,
vars-on-top, no-shadow, no-useless-escape,
class-methods-use-this */
 
/* global ResolveService */
 
Loading
Loading
@@ -281,14 +281,7 @@ export default class Notes {
if (Notes.interval) {
clearInterval(Notes.interval);
}
return (Notes.interval = setInterval(
(function(_this) {
return function() {
return _this.refresh();
};
})(this),
this.pollingInterval,
));
Notes.interval = setInterval(() => this.refresh(), this.pollingInterval);
}
 
refresh() {
Loading
Loading
@@ -847,57 +840,52 @@ export default class Notes {
var noteElId, $note;
$note = $(e.currentTarget).closest('.note');
noteElId = $note.attr('id');
$(`.note[id="${noteElId}"]`).each(
(function() {
// A same note appears in the "Discussion" and in the "Changes" tab, we have
// to remove all. Using $('.note[id='noteId']') ensure we get all the notes,
// where $('#noteId') would return only one.
return function(i, el) {
var $note, $notes;
$note = $(el);
$notes = $note.closest('.discussion-notes');
const discussionId = $('.notes', $notes).data('discussionId');
if (typeof gl.diffNotesCompileComponents !== 'undefined') {
if (gl.diffNoteApps[noteElId]) {
gl.diffNoteApps[noteElId].$destroy();
}
}
$note.remove();
$(`.note[id="${noteElId}"]`).each((i, el) => {
// A same note appears in the "Discussion" and in the "Changes" tab, we have
// to remove all. Using $('.note[id='noteId']') ensure we get all the notes,
// where $('#noteId') would return only one.
const $note = $(el);
const $notes = $note.closest('.discussion-notes');
const discussionId = $('.notes', $notes).data('discussionId');
if (typeof gl.diffNotesCompileComponents !== 'undefined') {
if (gl.diffNoteApps[noteElId]) {
gl.diffNoteApps[noteElId].$destroy();
}
}
 
// check if this is the last note for this line
if ($notes.find('.note').length === 0) {
var notesTr = $notes.closest('tr');
$note.remove();
 
// "Discussions" tab
$notes.closest('.timeline-entry').remove();
// check if this is the last note for this line
if ($notes.find('.note').length === 0) {
const notesTr = $notes.closest('tr');
 
$(`.js-diff-avatars-${discussionId}`).trigger('remove.vue');
// "Discussions" tab
$notes.closest('.timeline-entry').remove();
 
// The notes tr can contain multiple lists of notes, like on the parallel diff
// notesTr does not exist for image diffs
if (notesTr.find('.discussion-notes').length > 1 || notesTr.length === 0) {
const $diffFile = $notes.closest('.diff-file');
if ($diffFile.length > 0) {
const removeBadgeEvent = new CustomEvent('removeBadge.imageDiff', {
detail: {
// badgeNumber's start with 1 and index starts with 0
badgeNumber: $notes.index() + 1,
},
});
$(`.js-diff-avatars-${discussionId}`).trigger('remove.vue');
 
$diffFile[0].dispatchEvent(removeBadgeEvent);
}
// The notes tr can contain multiple lists of notes, like on the parallel diff
// notesTr does not exist for image diffs
if (notesTr.find('.discussion-notes').length > 1 || notesTr.length === 0) {
const $diffFile = $notes.closest('.diff-file');
if ($diffFile.length > 0) {
const removeBadgeEvent = new CustomEvent('removeBadge.imageDiff', {
detail: {
// badgeNumber's start with 1 and index starts with 0
badgeNumber: $notes.index() + 1,
},
});
 
$notes.remove();
} else if (notesTr.length > 0) {
notesTr.remove();
}
$diffFile[0].dispatchEvent(removeBadgeEvent);
}
};
})(this),
);
$notes.remove();
} else if (notesTr.length > 0) {
notesTr.remove();
}
}
});
 
Notes.checkMergeRequestStatus();
return this.updateNotesCount(-1);
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action :release, only: %i[edit update]
before_action :authorize_read_release!
before_action do
push_frontend_feature_flag(:release_edit_page, project)
push_frontend_feature_flag(:release_edit_page, project, default_enabled: true)
push_frontend_feature_flag(:release_issue_summary, project)
end
before_action :authorize_update_release!, only: %i[edit update]
Loading
Loading
@@ -35,7 +35,7 @@ class Projects::ReleasesController < Projects::ApplicationController
private
 
def authorize_update_release!
access_denied! unless Feature.enabled?(:release_edit_page, project)
access_denied! unless Feature.enabled?(:release_edit_page, project, default_enabled: true)
access_denied! unless can?(current_user, :update_release, release)
end
 
Loading
Loading
Loading
Loading
@@ -329,7 +329,7 @@ module ApplicationHelper
if Rails.configuration.assets.compile
app.assets.find_asset(name).to_s
else
controller.view_context.render(file: File.join('public/assets', app.assets_manifest.assets[name]))
controller.view_context.render(file: Rails.root.join('public/assets', app.assets_manifest.assets[name]).to_s)
end
end
 
Loading
Loading
Loading
Loading
@@ -108,16 +108,6 @@ module TabHelper
current_controller?(c) && current_action?(a)
end
 
def project_tab_class
if controller.controller_path.start_with?('projects')
return 'active'
end
if %w(services hooks deploy_keys protected_branches).include? controller.controller_name
"active"
end
end
def branches_tab_class
if current_controller?(:protected_branches) ||
current_controller?(:branches) ||
Loading
Loading
@@ -125,14 +115,6 @@ module TabHelper
'active'
end
end
def profile_tab_class
if controller.controller_path.start_with?('profiles')
return 'active'
end
'active' if current_controller?('oauth/applications')
end
end
 
TabHelper.prepend_if_ee('EE::TabHelper')
Loading
Loading
@@ -52,6 +52,6 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
end
 
def release_edit_page_available?
::Feature.enabled?(:release_edit_page, project)
::Feature.enabled?(:release_edit_page, project, default_enabled: true)
end
end
---
title: Add loading icon to error tracking settings page
merge_request: 19539
author:
type: changed
---
title: Remove local qualifier from geo sync indicators
merge_request: 20034
author: Lee Tickett
type: fixed
---
title: Remove unused image/screenshot
merge_request: 20030
author: Lee Tickett
type: fixed
Loading
Loading
@@ -337,6 +337,7 @@ The following documentation relates to the DevOps **Monitor** stage:
| [Health check](user/admin_area/monitoring/health_check.md) | GitLab provides liveness and readiness probes to indicate service health and reachability to required services. |
| [Prometheus project integration](user/project/integrations/prometheus.md) | Configure the Prometheus integration per project and monitor your CI/CD environments. |
| [Prometheus metrics](user/project/integrations/prometheus_library/index.md) | Let Prometheus collect metrics from various services, like Kubernetes, NGINX, NGINX Ingress controller, HAProxy, and Amazon Cloud Watch. |
| [Incident management](user/incident_management/index.md) | Use GitLab to help you better respond to incidents that may occur in your systems. |
 
<div align="right">
<a type="button" class="btn btn-default" href="#overview">
Loading
Loading
Loading
Loading
@@ -78,6 +78,31 @@ To change the address/port that Prometheus listens on:
1. Save the file and [reconfigure GitLab][reconfigure] for the changes to
take effect
 
### Adding custom scrape configs
You can configure additional scrape targets for the GitLab Omnibus-bundled
Prometheus by editing `prometheus['scrape_configs']` in `/etc/gitlab/gitlab.rb`
using the [Prometheus scrape target configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Cscrape_config%3E)
syntax.
Here is an example configuration to scrape `http://1.1.1.1:8060/probe?param_a=test&param_b=additional_test`:
```ruby
prometheus['scrape_configs'] = [
{
'job_name': 'custom-scrape',
'metrics_path': '/probe',
'params' => {
'param_a' => ['test'],
'param_b' => ['additional_test']
},
'static_configs' => [
'targets' => ['1.1.1.1:8060'],
],
},
]
```
### Using an external Prometheus server
 
NOTE: **Note:**
Loading
Loading
Loading
Loading
@@ -141,6 +141,8 @@ have a [start or due date](#start-date-and-due-date), a
 
## Reordering issues and child epics
 
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9367) in GitLab 12.5.
New issues and child epics are added to the top of their respective lists in the **Epics and Issues** tab. You can reorder the list of issues and the list of child epics. Issues and child epics cannot be intermingled.
 
To reorder issues assigned to an epic:
Loading
Loading
doc/user/incident_management/img/incident_management_settings.png

44.5 KiB

---
description: "GitLab - Incident Management. GitLab offers solutions for handling incidents in your applications and services"
---
# Incident Management
GitLab offers solutions for handling incidents in your applications and services,
from setting up an alert with Prometheus, to receiving a notification via a
monitoring tool like Slack, and automatically setting up Zoom calls with your
support team.
## Configuring incidents **(ULTIMATE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/4925) in GitLab Ultimate 11.11.
The Incident Management features can be enabled and disabled via your project's
**Settings > Operations > Incidents**.
![Incident Management Settings](img/incident_management_settings.png)
### Automatically create issues from alerts
GitLab issues can automatically be created as a result of an alert notification.
An issue created this way will contain the error information to help you further
debug it.
### Issue templates
You can create your own [issue templates](../project/description_templates.md#creating-issue-templates)
that can be [used within Incident Management](../project/integrations/prometheus.md#taking-action-on-incidents-ultimate).
To select your issue template for use within Incident Management:
1. Visit your project's **Settings > Operations > Incidents**.
1. Select the template from the **Issue Template** dropdown.
## Alerting
GitLab can react to the alerts that your applications and services may be
triggering by automatically creating issues, and alerting developers via email.
### Prometheus alerts
Prometheus alerts can be set up in both:
- [GitLab-managed Prometheus](../project/integrations/prometheus.md#setting-up-alerts-for-prometheus-metrics-ultimate) and
- [Self-managed Prometheus](../project/integrations/prometheus.md#external-prometheus-instances) installations.
### Alert endpoint
GitLab can accept alerts from any source via a generic webhook receiver. When
you set up the generic alerts integration, a unique endpoint will
be created which can receive a payload in JSON format.
[Read more on setting this up, including how to customize the payload](../project/integrations/generic_alerts.md).
### Recovery alerts
GitLab can [automatically close issues](../project/integrations/prometheus.md#taking-action-on-incidents-ultimate)
that have been automatically created when you receive notification that the
alert is resolved.
## Embedded metrics
Metrics can be embedded anywhere where GitLab Markdown is used, for example,
descriptions and comments on issues and merge requests.
TIP: **Tip:**
Both GitLab-hosted and Grafana metrics can also be
[embedded in issue templates](../project/integrations/prometheus.md#embedding-metrics-in-issue-templates).
### GitLab-hosted metrics
Learn how to embed [GitLab hosted metric charts](../project/integrations/prometheus.md#embedding-metric-charts-within-gitlab-flavored-markdown).
### Grafana metrics
Learn how to embed [Grafana hosted metric charts](../project/integrations/prometheus.md#embedding-live-grafana-charts).
## Slack integration
Slack slash commands allow you to control GitLab and view content right inside
Slack, without having to leave it.
Learn how to [set up Slack slash commands](../project/integrations/slack_slash_commands.md)
and how to [use them](../../integration/slash_commands.md).
### Slash commands
Please refer to a list of [available slash commands](../../integration/slash_commands.md) and associated descriptions.
## Zoom in issues
In order to communicate synchronously for incidents management, GitLab allows to
associate a Zoom meeting with an issue. Once you start a Zoom call for a fire-fight,
you need a way to associate the conference call with an issue, so that your team
members can join swiftly without requesting a link.
Read more how to [add or remove a zoom meeting](../project/issues/associate_zoom_meeting.md).
### Alerting
You can let GitLab know of alerts that may be triggering in your applications and services. GitLab can react to these by automatically creating Issues, and alerting developers via Email.
#### Prometheus Alerts
Prometheus alerts can be setup in both GitLab-managed Prometheus installs and self-managed Prometheus installs.
Documentation for each method can be found here:
- [GitLab-managed Prometheus](../project/integrations/prometheus.md#setting-up-alerts-for-prometheus-metrics-ultimate)
- [Self-managed Prometheus](../project/integrations/prometheus.md#external-prometheus-instances)
#### Alert Endpoint
GitLab can accept alerts from any source via a generic webhook receiver. When you set up the generic alerts integration, a unique endpoint will
be created which can receive a payload in JSON format.
More information on setting this up, including how to customize the payload [can be found here](../project/integrations/generic_alerts.md).
#### Recovery Alerts
Coming soon: GitLab can automatically close Issues that have been automatically created when we receive notification that the alert is resolved.
### Configuring Incidents
Incident Management features can be easily enabled & disabled via the Project settings page. Head to Project -> Settings -> Operations -> Incidents.
#### Auto-creation
GitLab Issues can automatically be created as a result of an Alert notification. An Issue created this way will contain error information to help you further debug the error.
doc/user/project/integrations/img/embed_metrics_issue_template.png

143 KiB

Loading
Loading
@@ -403,9 +403,12 @@ receivers:
...
```
 
In order for GitLab to associate your alerts with an [environment](../../../ci/environments.md), you need to configure a `gitlab_environment_name` label on the alerts you set up in Prometheus. The value of this should match the name of your Environment in GitLab.
### Taking action on incidents **(ULTIMATE)**
 
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/4925) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.11.
>- [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/4925) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.11.
>- [From GitLab Ultimate 12.5](https://gitlab.com/gitlab-org/gitlab/issues/13401), when GitLab receives a recovery alert, it will automatically close the associated issue.
 
Alerts can be used to trigger actions, like open an issue automatically (enabled by default since `12.1`). To configure the actions:
 
Loading
Loading
@@ -426,7 +429,7 @@ Once enabled, an issue will be opened automatically when an alert is triggered w
- Optional list of attached annotations extracted from `annotations/*`
- Alert [GFM](../../markdown.md): GitLab Flavored Markdown from `annotations/gitlab_incident_markdown`
 
When GitLab recieves a **Recovery Alert**, it will automatically close the associated issue. This action will be recorded as a system message on the issue indicated that it was closed automatically by the GitLab Alert bot.
When GitLab receives a **Recovery Alert**, it will automatically close the associated issue. This action will be recorded as a system message on the issue indicated that it was closed automatically by the GitLab Alert bot.
 
To further customize the issue, you can add labels, mentions, or any other supported [quick action](../quick_actions.md) in the selected issue template, which will apply to all incidents. To limit quick actions or other information to only specific types of alerts, use the `annotations/gitlab_incident_markdown` field.
 
Loading
Loading
@@ -487,6 +490,12 @@ The following requirements must be met for the metric to unfurl:
 
![Embedded Metrics](img/embed_metrics.png)
 
### Embedding metrics in issue templates
It is also possible to embed either a dashboard or individual metrics in issue templates. The entire dashboard can be embedded as well as individual metrics, separated by either a comma or a space.
![Embedded Metrics in issue templates](img/embed_metrics_issue_template.png)
### Embedding live Grafana charts
 
It is also possible to embed live [Grafana](https://docs.gitlab.com/omnibus/settings/grafana.html) charts within issues, as a [Direct Linked Rendered Image](https://grafana.com/docs/reference/sharing/#direct-link-rendered-image).
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