Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-18 03:09:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-18 03:09:34 +0300
commitccefff8087799bc076737ad080f18cf98e6fe114 (patch)
tree452ebc93942fd48d58e57ea57f8bdaaa93ab5b90
parent1d84a028b42a1a3aed36a0f3a6cae970c8df8e69 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/blob/pipeline_tour_success_modal.vue24
-rw-r--r--app/assets/javascripts/pages/projects/blob/show/index.js6
-rw-r--r--app/models/ci/job_artifact.rb16
-rw-r--r--app/views/projects/_activity.html.haml9
-rw-r--r--changelogs/unreleased/223003-show-clone-for-activity.yml5
-rw-r--r--changelogs/unreleased/eb-document-artifact-size-plan-limits.yml5
-rw-r--r--doc/.vale/gitlab/spelling-exceptions.txt1
-rw-r--r--doc/administration/instance_limits.md51
-rw-r--r--doc/operations/metrics/embed.md52
-rw-r--r--doc/operations/metrics/embed_grafana.md58
-rw-r--r--doc/security/ssh_keys_restrictions.md3
-rw-r--r--doc/security/two_factor_authentication.md3
-rw-r--r--doc/security/user_email_confirmation.md3
-rw-r--r--doc/security/user_file_uploads.md3
-rw-r--r--doc/user/incident_management/index.md2
-rw-r--r--lib/api/helpers.rb4
-rw-r--r--lib/api/helpers/merge_requests_helpers.rb17
-rw-r--r--lib/api/merge_requests.rb32
-rw-r--r--locale/gitlab.pot10
-rw-r--r--spec/frontend/blob/pipeline_tour_success_modal_spec.js7
-rw-r--r--spec/lib/api/helpers/merge_requests_helpers_spec.rb63
-rw-r--r--spec/models/ci/job_artifact_spec.rb64
-rw-r--r--spec/requests/api/ci/runner_spec.rb20
-rw-r--r--spec/requests/api/merge_requests_spec.rb10
24 files changed, 312 insertions, 156 deletions
diff --git a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue b/app/assets/javascripts/blob/pipeline_tour_success_modal.vue
index 3ccd84037a7..ca4750f73d2 100644
--- a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue
+++ b/app/assets/javascripts/blob/pipeline_tour_success_modal.vue
@@ -11,8 +11,12 @@ export default {
beginnerLink:
'https://about.gitlab.com/blog/2018/01/22/a-beginners-guide-to-continuous-integration/',
exampleLink: 'https://docs.gitlab.com/ee/ci/examples/',
+ codeQualityLink: 'https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html',
bodyMessage: s__(
- 'MR widget|The pipeline will now run automatically every time you commit code. Pipelines are useful for deploying static web pages, detecting vulnerabilities in dependencies, static or dynamic application security testing (SAST and DAST), and so much more!',
+ `MR widget|The pipeline will test your code on every commit. A %{codeQualityLinkStart}code quality report%{codeQualityLinkEnd} will appear in your merge requests to warn you about potential code degradations.`,
+ ),
+ helpMessage: s__(
+ `MR widget|Take a look at our %{beginnerLinkStart}Beginner's Guide to Continuous Integration%{beginnerLinkEnd} and our %{exampleLinkStart}examples of GitLab CI/CD%{exampleLinkEnd} to learn more.`,
),
modalTitle: sprintf(
__("That's it, well done!%{celebrate}"),
@@ -75,15 +79,15 @@ export default {
modal-id="success-pipeline-modal-id-not-used"
>
<p>
- {{ $options.bodyMessage }}
+ <gl-sprintf :message="$options.bodyMessage">
+ <template #codeQualityLink="{content}">
+ <gl-link :href="$options.codeQualityLink" target="_blank" class="font-size-inherit">{{
+ content
+ }}</gl-link>
+ </template>
+ </gl-sprintf>
</p>
- <gl-sprintf
- :message="
- s__(`MR widget|Take a look at our %{beginnerLinkStart}Beginner's Guide to Continuous Integration%{beginnerLinkEnd}
- and our %{exampleLinkStart}examples of GitLab CI/CD%{exampleLinkEnd}
- to see all the cool stuff you can do with it.`)
- "
- >
+ <gl-sprintf :message="$options.helpMessage">
<template #beginnerLink="{content}">
<gl-link :href="$options.beginnerLink" target="_blank">
{{ content }}
@@ -105,7 +109,7 @@ export default {
:data-track-event="$options.trackEvent"
:data-track-label="trackLabel"
>
- {{ __('Go to Pipelines') }}
+ {{ __('See your pipeline in action') }}
</a>
</template>
</gl-modal>
diff --git a/app/assets/javascripts/pages/projects/blob/show/index.js b/app/assets/javascripts/pages/projects/blob/show/index.js
index e5e4670a5d7..cb7198e9789 100644
--- a/app/assets/javascripts/pages/projects/blob/show/index.js
+++ b/app/assets/javascripts/pages/projects/blob/show/index.js
@@ -54,13 +54,9 @@ document.addEventListener('DOMContentLoaded', () => {
new Vue({
el: successPipelineEl,
render(createElement) {
- const { commitCookie, goToPipelinesPath, humanAccess } = this.$el.dataset;
-
return createElement(PipelineTourSuccessModal, {
props: {
- goToPipelinesPath,
- commitCookie,
- humanAccess,
+ ...successPipelineEl.dataset,
},
});
},
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb
index dbeba1ece31..47ac19635ab 100644
--- a/app/models/ci/job_artifact.rb
+++ b/app/models/ci/job_artifact.rb
@@ -303,16 +303,12 @@ module Ci
end
def self.max_artifact_size(type:, project:)
- max_size = if Feature.enabled?(:ci_max_artifact_size_per_type, project, default_enabled: false)
- limit_name = "#{PLAN_LIMIT_PREFIX}#{type}"
-
- project.actual_limits.limit_for(
- limit_name,
- alternate_limit: -> { project.closest_setting(:max_artifacts_size) }
- )
- else
- project.closest_setting(:max_artifacts_size)
- end
+ limit_name = "#{PLAN_LIMIT_PREFIX}#{type}"
+
+ max_size = project.actual_limits.limit_for(
+ limit_name,
+ alternate_limit: -> { project.closest_setting(:max_artifacts_size) }
+ )
max_size&.megabytes.to_i
end
diff --git a/app/views/projects/_activity.html.haml b/app/views/projects/_activity.html.haml
index 07faf5a66da..af24ce84a35 100644
--- a/app/views/projects/_activity.html.haml
+++ b/app/views/projects/_activity.html.haml
@@ -1,9 +1,14 @@
+- is_project_overview = local_assigns.fetch(:is_project_overview, false)
+
%div{ class: container_class }
- .nav-block.d-none.d-sm-flex.activities
+ .nav-block.d-none.d-sm-flex.activities.gl-static
= render 'shared/event_filter'
- .controls
+ .controls.gl-display-flex
= link_to project_path(@project, rss_url_options), title: s_("ProjectActivityRSS|Subscribe"), class: 'btn d-none d-sm-inline-block has-tooltip' do
= icon('rss')
+ - if is_project_overview && can?(current_user, :download_code, @project)
+ .project-clone-holder.d-none.d-md-inline-flex.gl-ml-2
+ = render "projects/buttons/clone", dropdown_class: 'dropdown-menu-right'
.content_list.project-activity{ :"data-href" => activity_project_path(@project) }
.loading
diff --git a/changelogs/unreleased/223003-show-clone-for-activity.yml b/changelogs/unreleased/223003-show-clone-for-activity.yml
new file mode 100644
index 00000000000..86152ca8d39
--- /dev/null
+++ b/changelogs/unreleased/223003-show-clone-for-activity.yml
@@ -0,0 +1,5 @@
+---
+title: Show clone button for activity on project page
+merge_request: 36147
+author:
+type: changed
diff --git a/changelogs/unreleased/eb-document-artifact-size-plan-limits.yml b/changelogs/unreleased/eb-document-artifact-size-plan-limits.yml
new file mode 100644
index 00000000000..1be4fef6af7
--- /dev/null
+++ b/changelogs/unreleased/eb-document-artifact-size-plan-limits.yml
@@ -0,0 +1,5 @@
+---
+title: Remove flag and document max artifact size plan limits
+merge_request: 37226
+author:
+type: changed
diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt
index 28da80557ec..78b5865fdbf 100644
--- a/doc/.vale/gitlab/spelling-exceptions.txt
+++ b/doc/.vale/gitlab/spelling-exceptions.txt
@@ -330,6 +330,7 @@ profiler
Prometheus
proxied
proxies
+proxyable
proxying
pseudonymized
pseudonymizer
diff --git a/doc/administration/instance_limits.md b/doc/administration/instance_limits.md
index b8915f8a4a3..bc1858a233b 100644
--- a/doc/administration/instance_limits.md
+++ b/doc/administration/instance_limits.md
@@ -314,6 +314,57 @@ To update this limit to a new value on a self-managed installation, run the foll
Plan.default.actual_limits.update!(ci_instance_level_variables: 30)
```
+### Maximum file size per type of artifact
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216097) in GitLab 13.3.
+
+Artifacts that are uploaded by the Runner will be rejected if the file size exceeds the
+maximum file size limit. The limit is determined by picking the smaller value between the project's
+[maximum artifact size setting](../user/admin_area/settings/continuous_integration.md#maximum-artifacts-size-core-only)
+and the plan limit for the given artifact type.
+
+Values are interpreted as megabytes thus the smallest possible value that can be defined is `1 MB`.
+
+Each type of artifact has its corresponding maximum size limit. For now, only the `lsif` type's plan limit
+is enabled and has a default value defined. The rest of the values and defaults are going to be determined and updated
+in future releases.
+
+| Limit Name | Default Value |
+| ----------------------------------------- | ------------- |
+| ci_max_artifact_size_lsif | 20 |
+| ci_max_artifact_size_archive | 0 |
+| ci_max_artifact_size_metadata | 0 |
+| ci_max_artifact_size_trace | 0 |
+| ci_max_artifact_size_junit | 0 |
+| ci_max_artifact_size_sast | 0 |
+| ci_max_artifact_size_dependency_scanning | 0 |
+| ci_max_artifact_size_container_scanning | 0 |
+| ci_max_artifact_size_dast | 0 |
+| ci_max_artifact_size_codequality | 0 |
+| ci_max_artifact_size_license_management | 0 |
+| ci_max_artifact_size_license_scanning | 0 |
+| ci_max_artifact_size_performance | 0 |
+| ci_max_artifact_size_metrics | 0 |
+| ci_max_artifact_size_metrics_referee | 0 |
+| ci_max_artifact_size_network_referee | 0 |
+| ci_max_artifact_size_dotenv | 0 |
+| ci_max_artifact_size_cobertura | 0 |
+| ci_max_artifact_size_terraform | 0 |
+| ci_max_artifact_size_accessibility | 0 |
+| ci_max_artifact_size_cluster_applications | 0 |
+| ci_max_artifact_size_secret_detection | 0 |
+| ci_max_artifact_size_requirements | 0 |
+| ci_max_artifact_size_coverage_fuzzing | 0 |
+| ci_max_artifact_size_browser_performance | 0 |
+| ci_max_artifact_size_load_performance | 0 |
+
+To update the limit on a self-managed installation, run the following in the
+[GitLab Rails console](troubleshooting/debug.md#starting-a-rails-console-session):
+
+```ruby
+Plan.default.actual_limits.update!(ci_max_artifact_size_junit: 10)
+```
+
## Instance monitoring and metrics
### Incident Management inbound alert limits
diff --git a/doc/operations/metrics/embed.md b/doc/operations/metrics/embed.md
index 5ee9b0859b9..3d089d4fcc9 100644
--- a/doc/operations/metrics/embed.md
+++ b/doc/operations/metrics/embed.md
@@ -4,21 +4,25 @@ group: APM
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
-# Embedding metric charts within GitLab Flavored Markdown
+# Embedding metric charts within GitLab-flavored Markdown
+
+You can display metrics charts within
+[GitLab Flavored Markdown](../../user/markdown.md#gitlab-flavored-markdown-gfm)
+fields such as issue or merge request descriptions. The maximum number of embedded
+charts allowed in a GitLab Flavored Markdown field is 100.
+Embedding charts is useful when sharing an application incident or performance
+metrics to others, and you want to have relevant information directly available.
## Embedding GitLab-managed Kubernetes metrics
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29691) in GitLab 12.2.
-It is possible to display metrics charts within [GitLab Flavored Markdown](../../user/markdown.md#gitlab-flavored-markdown-gfm) fields such as issue or merge request descriptions. The maximum number of embedded charts allowed in a GitLab Flavored Markdown field is 100.
-
-This can be useful if you are sharing an application incident or performance
-metrics to others and want to have relevant information directly available.
-
NOTE: **Note:**
Requires [Kubernetes](../../user/project/integrations/prometheus_library/kubernetes.md) metrics.
-To display metric charts, include a link of the form `https://<root_url>/<project>/-/environments/<environment_id>/metrics`:
+To display metric charts, include a link of the form
+`https://<root_url>/<project>/-/environments/<environment_id>/metrics` in a field
+that supports GitLab-flavored Markdown:
![Embedded Metrics Markdown](../../user/project/integrations/img/embedded_metrics_markdown_v12_8.png)
@@ -40,7 +44,7 @@ The following requirements must be met for the metric to unfurl:
- The user must be allowed access to the monitoring dashboard for the environment ([Reporter or higher](../../user/permissions.md)).
- The dashboard must have data within the last 8 hours.
- If all of the above are true, then the metric will unfurl as seen below:
+ If all of the above are true, then the metric unfurls as seen below:
![Embedded Metrics](../../user/project/integrations/img/view_embedded_metrics_v12_10.png)
@@ -48,19 +52,25 @@ Metric charts may also be hidden:
![Show Hide](../../user/project/integrations/img/hide_embedded_metrics_v12_10.png)
-You can open the link directly into your browser for a [detailed view of the data](dashboards/index.md#expand-panel).
+You can open the link directly into your browser for a
+[detailed view of the data](dashboards/index.md#expand-panel).
## Embedding metrics in issue templates
-It is also possible to embed either the default dashboard metrics or individual metrics in issue templates. For charts to render side-by-side, links to the entire metrics dashboard or individual metrics should be separated by either a comma or a space.
+You can also embed either the default dashboard metrics or individual metrics in
+issue templates. For charts to render side-by-side, separate links to the entire metrics
+dashboard or individual metrics by either a comma or a space.
![Embedded Metrics in issue templates](../../user/project/integrations/img/embed_metrics_issue_template.png)
## Embedding metrics based on alerts in incident issues
-For [GitLab-managed alerting rules](alerts.md), the issue will include an embedded chart for the query corresponding to the alert. The chart displays an hour of data surrounding the starting point of the incident, 30 minutes before and after.
+For [GitLab-managed alerting rules](alerts.md), the issue includes an embedded
+chart for the query corresponding to the alert. The chart displays an hour of data
+surrounding the starting point of the incident, 30 minutes before and after.
-For [manually configured Prometheus instances](../../user/project/integrations/prometheus.md#manual-configuration-of-prometheus), a chart corresponding to the query can be included if these requirements are met:
+For [manually configured Prometheus instances](../../user/project/integrations/prometheus.md#manual-configuration-of-prometheus),
+a chart corresponding to the query can be included if these requirements are met:
- The alert corresponds to an environment managed through GitLab.
- The alert corresponds to a [range query](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries).
@@ -69,25 +79,31 @@ For [manually configured Prometheus instances](../../user/project/integrations/p
| Attributes | Required | Description |
| ---------- | -------- | ----------- |
| `annotations/gitlab_environment_name` | Yes | Name of the GitLab-managed environment corresponding to the alert |
-| One of `annotations/title`, `annotations/summary`, `labels/alertname` | Yes | Will be used as the chart title |
-| `annotations/gitlab_y_label` | No | Will be used as the chart's y-axis label |
+| One of `annotations/title`, `annotations/summary`, `labels/alertname` | Yes | Used as the chart title |
+| `annotations/gitlab_y_label` | No | Used as the chart's y-axis label |
## Embedding cluster health charts
> - [Introduced](<https://gitlab.com/gitlab-org/gitlab/-/issues/40997>) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.9.
> - [Moved](<https://gitlab.com/gitlab-org/gitlab/-/issues/208224>) to GitLab core in 13.2.
-[Cluster Health Metrics](../../user/project/clusters/index.md#visualizing-cluster-health) can also be embedded in [GitLab-flavored Markdown](../../user/markdown.md).
+[Cluster Health Metrics](../../user/project/clusters/index.md#visualizing-cluster-health)
+can also be embedded in [GitLab-flavored Markdown](../../user/markdown.md).
-To embed a metric chart, include a link to that chart in the form `https://<root_url>/<project>/-/cluster/<cluster_id>?<query_params>` anywhere that GitLab-flavored Markdown is supported. To generate and copy a link to the chart, follow the instructions in the [Cluster Health Metric documentation](../../user/project/clusters/index.md#visualizing-cluster-health).
+To embed a metric chart, include a link to that chart in the form
+`https://<root_url>/<project>/-/cluster/<cluster_id>?<query_params>` anywhere that
+GitLab-flavored Markdown is supported. To generate and copy a link to the chart,
+follow the instructions in the
+[Cluster Health Metric documentation](../../user/project/clusters/index.md#visualizing-cluster-health).
The following requirements must be met for the metric to unfurl:
- The `<cluster_id>` must correspond to a real cluster.
- Prometheus must be monitoring the cluster.
- The user must be allowed access to the project cluster metrics.
-- The dashboards must be reporting data on the [Cluster Health Page](../../user/project/clusters/index.md#visualizing-cluster-health)
+- The dashboards must be reporting data on the
+ [Cluster Health Page](../../user/project/clusters/index.md#visualizing-cluster-health)
- If the above requirements are met, then the metric will unfurl as seen below.
+ If the above requirements are met, then the metric unfurls as seen below.
![Embedded Cluster Metric in issue descriptions](../../user/project/integrations/img/prometheus_cluster_health_embed_v12_9.png)
diff --git a/doc/operations/metrics/embed_grafana.md b/doc/operations/metrics/embed_grafana.md
index 427ad866442..6a5c3de4d4a 100644
--- a/doc/operations/metrics/embed_grafana.md
+++ b/doc/operations/metrics/embed_grafana.md
@@ -8,24 +8,29 @@ info: To determine the technical writer assigned to the Stage/Group associated w
Grafana metrics can be embedded in [GitLab Flavored Markdown](../../user/markdown.md).
-## Embedding charts via Grafana Rendered Images
+## Embedding charts via Grafana rendered images
-It is possible to embed live [Grafana](https://docs.gitlab.com/omnibus/settings/grafana.html) charts in issues, as a [direct linked rendered image](https://grafana.com/docs/grafana/latest/reference/share_panel/#direct-link-rendered-image).
-
-The sharing dialog within Grafana provides the link, as highlighted below.
+You can embed live [Grafana](https://docs.gitlab.com/omnibus/settings/grafana.html)
+charts in issues as a
+[direct linked rendered image](https://grafana.com/docs/grafana/latest/reference/share_panel/#direct-link-rendered-image).
+The **Direct link rendered image** sharing dialog within Grafana provides the link:
![Grafana Direct Linked Rendered Image](../../user/project/integrations/img/grafana_live_embed.png)
NOTE: **Note:**
-For this embed to display correctly, the Grafana instance must be available to the target user, either as a public dashboard, or on the same network.
+For this embed to display correctly, the Grafana instance must be available to the
+target user, either as a public dashboard or on the same network.
-Copy the link and add an image tag as [inline HTML](../../user/markdown.md#inline-html) in your Markdown. You may tweak the query parameters as required. For instance, removing the `&from=` and `&to=` parameters will give you a live chart. Here is example markup for a live chart from GitLab's public dashboard:
+Copy the link and add an image tag as [inline HTML](../../user/markdown.md#inline-html)
+in your Markdown. You can tweak the query parameters to meet your needs, such as
+removing the `&from=` and `&to=` parameters to display a live chart. Here is example
+markup for a live chart from GitLab's public dashboard:
```html
<img src="https://dashboards.gitlab.com/d/RZmbBr7mk/gitlab-triage?orgId=1&refresh=30s&var-env=gprd&var-environment=gprd&var-prometheus=prometheus-01-inf-gprd&var-prometheus_app=prometheus-app-01-inf-gprd&var-backend=All&var-type=All&var-stage=main&from=1580444107655&to=1580465707655"/>
```
-This will render like so:
+This markup renders a graph of `5xx` errors, like this:
![Grafana dashboard embedded preview](../../user/project/integrations/img/grafana_embedded.png)
@@ -33,33 +38,42 @@ This will render like so:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/31376) in GitLab 12.5.
-Each project can support integration with one Grafana instance. This configuration allows a user to copy a link to a panel in Grafana, then paste it into a GitLab Markdown field. The chart will be rendered in the GitLab chart format.
-
-Prerequisites for embedding from a Grafana instance:
+Each project can support integration with one Grafana instance. This configuration
+enables you to copy a link to a panel in Grafana, then paste it into a GitLab Markdown
+field. The chart renders in the GitLab chart format. To embed charts
+from a Grafana instance, the data source must:
-1. The datasource must be a Prometheus instance.
-1. The datasource must be proxyable, so the HTTP Access setting should be set to `Server`.
+1. Be a Prometheus instance.
+1. Be proxyable, so the HTTP Access setting should be set to `Server`:
-![HTTP Proxy Access](../../user/project/integrations/img/http_proxy_access_v12_5.png)
+ ![HTTP Proxy Access](../../user/project/integrations/img/http_proxy_access_v12_5.png)
## Setting up the Grafana integration
-1. [Generate an Admin-level API Token in Grafana.](https://grafana.com/docs/grafana/latest/http_api/auth/#create-api-token)
-1. In your GitLab project, navigate to **Settings > Operations > Grafana Authentication**.
-1. To enable the integration, check the "Active" checkbox.
-1. For "Grafana URL", enter the base URL of the Grafana instance.
-1. For "API Token", enter the Admin API Token you just generated.
+1. In Grafana, [generate an Admin-level API Token](https://grafana.com/docs/grafana/latest/http_api/auth/#create-api-token).
+1. In your GitLab project, navigate to **{settings}** **Settings > Operations > Grafana Authentication**.
+1. To enable the integration, check the **Active** checkbox.
+1. For **Grafana URL**, enter the base URL of the Grafana instance.
+1. For **API Token**, enter the Admin API Token you just generated.
1. Click **Save Changes**.
## Generating a link to a chart
1. In Grafana, navigate to the dashboard you wish to embed a panel from.
![Grafana Metric Panel](../../user/project/integrations/img/grafana_panel_v12_5.png)
-1. In the upper-left corner of the page, select a specific value for each variable required for the queries in the chart.
+1. In the upper-left corner of the page, select a specific value for each variable
+ required for the queries in the chart.
![Select Query Variables](../../user/project/integrations/img/select_query_variables_v12_5.png)
-1. In Grafana, click on a panel's title, then click **Share** to open the panel's sharing dialog to the **Link** tab. If you click the _dashboard's_ share panel instead, GitLab will attempt to embed the first supported panel on the dashboard (if available).
-1. If your Prometheus queries use Grafana's custom template variables, ensure that the "Template variables" option is toggled to **On**. Of Grafana global template variables, only `$__interval`, `$__from`, and `$__to` are currently supported. Toggle **On** the "Current time range" option to specify the time range of the chart. Otherwise, the default range will be the last 8 hours.
+1. In Grafana, click on a panel's title, then click **Share** to open the panel's
+ sharing dialog to the **Link** tab. If you click the _dashboard's_ share panel
+ instead, GitLab attempts to embed the first supported panel on the dashboard (if available).
+1. If your Prometheus queries use Grafana's custom template variables, ensure the
+ **Template variables** option is toggled to **On**. Of Grafana global template
+ variables, only `$__interval`, `$__from`, and `$__to` are supported.
+1. Toggle **On** the **Current time range** option to specify the time range of
+ the chart. Otherwise, the default range is the last 8 hours.
![Grafana Sharing Dialog](../../user/project/integrations/img/grafana_sharing_dialog_v12_5.png)
1. Click **Copy** to copy the URL to the clipboard.
-1. In GitLab, paste the URL into a Markdown field and save. The chart will take a few moments to render.
+1. In GitLab, paste the URL into a Markdown field and save. The chart takes a few
+ moments to render.
![GitLab Rendered Grafana Panel](../../user/project/integrations/img/rendered_grafana_embed_v12_5.png)
diff --git a/doc/security/ssh_keys_restrictions.md b/doc/security/ssh_keys_restrictions.md
index 47eccf665d3..903a28136ad 100644
--- a/doc/security/ssh_keys_restrictions.md
+++ b/doc/security/ssh_keys_restrictions.md
@@ -1,5 +1,8 @@
---
type: reference, howto
+stage: Manage
+group: Access
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Restrict allowed SSH key technologies and minimum length
diff --git a/doc/security/two_factor_authentication.md b/doc/security/two_factor_authentication.md
index 886154aac6d..4b8611fdd72 100644
--- a/doc/security/two_factor_authentication.md
+++ b/doc/security/two_factor_authentication.md
@@ -1,5 +1,8 @@
---
type: howto
+stage: Manage
+group: Access
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Enforce Two-factor Authentication (2FA)
diff --git a/doc/security/user_email_confirmation.md b/doc/security/user_email_confirmation.md
index a493b374d66..6260c76bff9 100644
--- a/doc/security/user_email_confirmation.md
+++ b/doc/security/user_email_confirmation.md
@@ -1,5 +1,8 @@
---
type: howto
+stage: Manage
+group: Access
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# User email confirmation at sign-up
diff --git a/doc/security/user_file_uploads.md b/doc/security/user_file_uploads.md
index 9fc8f7ec985..7abd03d091c 100644
--- a/doc/security/user_file_uploads.md
+++ b/doc/security/user_file_uploads.md
@@ -1,5 +1,8 @@
---
type: reference
+stage: Manage
+group: Access
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# User File Uploads
diff --git a/doc/user/incident_management/index.md b/doc/user/incident_management/index.md
index 996f423e770..2efe5a8f790 100644
--- a/doc/user/incident_management/index.md
+++ b/doc/user/incident_management/index.md
@@ -64,7 +64,7 @@ in both PagerDuty and GitLab:
![PagerDuty incidents integration](img/pagerduty_incidents_integration_13_2.png)
1. Activate the integration, and save the changes in GitLab.
-1. Copy the value of **Webhook URL**, as you'll need it in a later step.
+1. Copy the value of **Webhook URL** for use in a later step.
1. Follow the steps described in the
[PagerDuty documentation](https://support.pagerduty.com/docs/webhooks)
to add the webhook URL to a PagerDuty webhook integration.
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 01b89959c14..4554391d610 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -404,6 +404,10 @@ module API
render_api_error!(message || '409 Conflict', 409)
end
+ def unprocessable_entity!(message = nil)
+ render_api_error!(message || '422 Unprocessable Entity', :unprocessable_entity)
+ end
+
def file_too_large!
render_api_error!('413 Request Entity Too Large', 413)
end
diff --git a/lib/api/helpers/merge_requests_helpers.rb b/lib/api/helpers/merge_requests_helpers.rb
index 4d5350498a7..e4163c63575 100644
--- a/lib/api/helpers/merge_requests_helpers.rb
+++ b/lib/api/helpers/merge_requests_helpers.rb
@@ -4,6 +4,9 @@ module API
module Helpers
module MergeRequestsHelpers
extend Grape::API::Helpers
+ extend ActiveSupport::Concern
+
+ UNPROCESSABLE_ERROR_KEYS = [:project_access, :branch_conflict, :validate_fork, :base].freeze
params :merge_requests_negatable_params do
optional :author_id, type: Integer, desc: 'Return merge requests which are authored by the user with the given ID'
@@ -79,6 +82,20 @@ module API
default: 'created_by_me',
desc: 'Return merge requests for the given scope: `created_by_me`, `assigned_to_me` or `all`'
end
+
+ def handle_merge_request_errors!(merge_request)
+ return if merge_request.valid?
+
+ errors = merge_request.errors
+
+ UNPROCESSABLE_ERROR_KEYS.each do |error|
+ unprocessable_entity!(errors[error]) if errors.has_key?(error)
+ end
+
+ conflict!(errors[:validate_branches]) if errors.has_key?(:validate_branches)
+
+ render_validation_error!(merge_request)
+ end
end
end
end
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 2e6ac40a593..8e513a6b04d 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -153,22 +153,6 @@ module API
include TimeTrackingEndpoints
helpers do
- def handle_merge_request_errors!(errors)
- if errors[:project_access].any?
- error!(errors[:project_access], 422)
- elsif errors[:branch_conflict].any?
- error!(errors[:branch_conflict], 422)
- elsif errors[:validate_fork].any?
- error!(errors[:validate_fork], 422)
- elsif errors[:validate_branches].any?
- conflict!(errors[:validate_branches])
- elsif errors[:base].any?
- error!(errors[:base], 422)
- end
-
- render_api_error!(errors, 400)
- end
-
params :optional_params do
optional :description, type: String, desc: 'The description of the merge request'
optional :assignee_id, type: Integer, desc: 'The ID of a user to assign the merge request'
@@ -226,11 +210,9 @@ module API
merge_request = ::MergeRequests::CreateService.new(user_project, current_user, mr_params).execute
- if merge_request.valid?
- present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
- else
- handle_merge_request_errors! merge_request.errors
- end
+ handle_merge_request_errors!(merge_request)
+
+ present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
end
desc 'Delete a merge request'
@@ -420,11 +402,9 @@ module API
merge_request = ::MergeRequests::UpdateService.new(user_project, current_user, mr_params).execute(merge_request)
- if merge_request.valid?
- present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
- else
- handle_merge_request_errors! merge_request.errors
- end
+ handle_merge_request_errors!(merge_request)
+
+ present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
end
desc 'Merge a merge request' do
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index f4a29553e87..a74e9a7ff00 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -11368,9 +11368,6 @@ msgstr ""
msgid "Go to <strong>Issues</strong> > <strong>Boards</strong> to access your personalized learning issue board."
msgstr ""
-msgid "Go to Pipelines"
-msgstr ""
-
msgid "Go to Webhooks"
msgstr ""
@@ -14183,10 +14180,10 @@ msgstr ""
msgid "MERGED"
msgstr ""
-msgid "MR widget|Take a look at our %{beginnerLinkStart}Beginner's Guide to Continuous Integration%{beginnerLinkEnd} and our %{exampleLinkStart}examples of GitLab CI/CD%{exampleLinkEnd} to see all the cool stuff you can do with it."
+msgid "MR widget|Take a look at our %{beginnerLinkStart}Beginner's Guide to Continuous Integration%{beginnerLinkEnd} and our %{exampleLinkStart}examples of GitLab CI/CD%{exampleLinkEnd} to learn more."
msgstr ""
-msgid "MR widget|The pipeline will now run automatically every time you commit code. Pipelines are useful for deploying static web pages, detecting vulnerabilities in dependencies, static or dynamic application security testing (SAST and DAST), and so much more!"
+msgid "MR widget|The pipeline will test your code on every commit. A %{codeQualityLinkStart}code quality report%{codeQualityLinkEnd} will appear in your merge requests to warn you about potential code degradations."
msgstr ""
msgid "MRApprovals|Approvals"
@@ -21072,6 +21069,9 @@ msgstr ""
msgid "See what's new at GitLab"
msgstr ""
+msgid "See your pipeline in action"
+msgstr ""
+
msgid "Select"
msgstr ""
diff --git a/spec/frontend/blob/pipeline_tour_success_modal_spec.js b/spec/frontend/blob/pipeline_tour_success_modal_spec.js
index 6d4e5e46cb8..41c64f76e61 100644
--- a/spec/frontend/blob/pipeline_tour_success_modal_spec.js
+++ b/spec/frontend/blob/pipeline_tour_success_modal_spec.js
@@ -1,7 +1,7 @@
import pipelineTourSuccess from '~/blob/pipeline_tour_success_modal.vue';
import { shallowMount } from '@vue/test-utils';
import Cookies from 'js-cookie';
-import { GlSprintf, GlModal } from '@gitlab/ui';
+import { GlSprintf, GlModal, GlLink } from '@gitlab/ui';
import { mockTracking, triggerEvent, unmockTracking } from 'helpers/tracking_helper';
import modalProps from './pipeline_tour_success_mock_data';
@@ -18,6 +18,7 @@ describe('PipelineTourSuccessModal', () => {
propsData: modalProps,
stubs: {
GlModal,
+ GlSprintf,
},
});
@@ -37,6 +38,10 @@ describe('PipelineTourSuccessModal', () => {
expect(sprintf.exists()).toBe(true);
});
+ it('renders the link for codeQualityLink', () => {
+ expect(wrapper.find(GlLink).attributes('href')).toBe(wrapper.vm.$options.codeQualityLink);
+ });
+
it('calls to remove cookie', () => {
wrapper.vm.disableModalFromRenderingAgain();
diff --git a/spec/lib/api/helpers/merge_requests_helpers_spec.rb b/spec/lib/api/helpers/merge_requests_helpers_spec.rb
new file mode 100644
index 00000000000..1d68b7985f1
--- /dev/null
+++ b/spec/lib/api/helpers/merge_requests_helpers_spec.rb
@@ -0,0 +1,63 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe API::Helpers::MergeRequestsHelpers do
+ describe '#handle_merge_request_errors!' do
+ let(:helper) do
+ Class.new do
+ include API::Helpers::MergeRequestsHelpers
+ end.new
+ end
+
+ let(:merge_request) { double }
+
+ context 'when merge request is valid' do
+ it 'returns nil' do
+ allow(merge_request).to receive(:valid?).and_return(true)
+
+ expect(merge_request).not_to receive(:errors)
+
+ helper.handle_merge_request_errors!(merge_request)
+ end
+ end
+
+ context 'when merge request is invalid' do
+ before do
+ allow(merge_request).to receive(:valid?).and_return(false)
+ allow(helper).to receive_messages([
+ :unprocessable_entity!, :conflict!, :render_validation_error!
+ ])
+ end
+
+ API::Helpers::MergeRequestsHelpers::UNPROCESSABLE_ERROR_KEYS.each do |error_key|
+ it "responds to a #{error_key} error with unprocessable_entity" do
+ error = double
+ allow(merge_request).to receive(:errors).and_return({ error_key => error })
+
+ expect(helper).to receive(:unprocessable_entity!).with(error)
+
+ helper.handle_merge_request_errors!(merge_request)
+ end
+ end
+
+ it 'responds to a validate_branches error with conflict' do
+ error = double
+ allow(merge_request).to receive(:errors).and_return({ validate_branches: error })
+
+ expect(helper).to receive(:conflict!).with(error)
+
+ helper.handle_merge_request_errors!(merge_request)
+ end
+
+ it 'responds with bad request' do
+ error = double
+ allow(merge_request).to receive(:errors).and_return({ other_error: error })
+
+ expect(helper).to receive(:render_validation_error!).with(merge_request)
+
+ helper.handle_merge_request_errors!(merge_request)
+ end
+ end
+ end
+end
diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb
index b5f9128b7c5..9445ddfcd9d 100644
--- a/spec/models/ci/job_artifact_spec.rb
+++ b/spec/models/ci/job_artifact_spec.rb
@@ -529,11 +529,9 @@ RSpec.describe Ci::JobArtifact do
context 'when file type is supported' do
let(:project_closest_setting) { 1024 }
let(:artifact_type) { 'junit' }
+ let(:limit_name) { "#{described_class::PLAN_LIMIT_PREFIX}#{artifact_type}" }
- before do
- stub_feature_flags(ci_max_artifact_size_per_type: flag_enabled)
- allow(build.project).to receive(:closest_setting).with(:max_artifacts_size).and_return(project_closest_setting)
- end
+ let!(:plan_limits) { create(:plan_limits, :default_plan) }
shared_examples_for 'basing off the project closest setting' do
it { is_expected.to eq(project_closest_setting.megabytes.to_i) }
@@ -543,49 +541,40 @@ RSpec.describe Ci::JobArtifact do
it { is_expected.to eq(max_size_for_type.megabytes.to_i) }
end
- context 'and feature flag for custom max size per type is enabled' do
- let(:flag_enabled) { true }
- let(:limit_name) { "#{described_class::PLAN_LIMIT_PREFIX}#{artifact_type}" }
-
- let!(:plan_limits) { create(:plan_limits, :default_plan) }
+ before do
+ allow(build.project).to receive(:closest_setting).with(:max_artifacts_size).and_return(project_closest_setting)
+ end
- context 'and plan limit is disabled for the given artifact type' do
- before do
- plan_limits.update!(limit_name => 0)
- end
+ context 'and plan limit is disabled for the given artifact type' do
+ before do
+ plan_limits.update!(limit_name => 0)
+ end
- it_behaves_like 'basing off the project closest setting'
+ it_behaves_like 'basing off the project closest setting'
- context 'and project closest setting results to zero' do
- let(:project_closest_setting) { 0 }
+ context 'and project closest setting results to zero' do
+ let(:project_closest_setting) { 0 }
- it { is_expected.to eq(0) }
- end
+ it { is_expected.to eq(0) }
end
+ end
- context 'and plan limit is enabled for the given artifact type' do
- before do
- plan_limits.update!(limit_name => max_size_for_type)
- end
-
- context 'and plan limit is smaller than project setting' do
- let(:max_size_for_type) { project_closest_setting - 1 }
-
- it_behaves_like 'basing off the plan limit'
- end
+ context 'and plan limit is enabled for the given artifact type' do
+ before do
+ plan_limits.update!(limit_name => max_size_for_type)
+ end
- context 'and plan limit is smaller than project setting' do
- let(:max_size_for_type) { project_closest_setting + 1 }
+ context 'and plan limit is smaller than project setting' do
+ let(:max_size_for_type) { project_closest_setting - 1 }
- it_behaves_like 'basing off the project closest setting'
- end
+ it_behaves_like 'basing off the plan limit'
end
- end
- context 'and feature flag for custom max size per type is disabled' do
- let(:flag_enabled) { false }
+ context 'and plan limit is larger than project setting' do
+ let(:max_size_for_type) { project_closest_setting + 1 }
- it_behaves_like 'basing off the project closest setting'
+ it_behaves_like 'basing off the project closest setting'
+ end
end
end
end
@@ -597,7 +586,8 @@ RSpec.describe Ci::JobArtifact do
Please refer to https://docs.gitlab.com/ee/development/application_limits.html on how to add new plan limit columns.
Take note that while existing max size plan limits default to 0, succeeding new limits are recommended to have
- non-zero default values.
+ non-zero default values. Also, remember to update the plan limits documentation (doc/administration/instance_limits.md)
+ when changes or new entries are made.
MSG
end
end
diff --git a/spec/requests/api/ci/runner_spec.rb b/spec/requests/api/ci/runner_spec.rb
index c8718309bf2..41c30ce383a 100644
--- a/spec/requests/api/ci/runner_spec.rb
+++ b/spec/requests/api/ci/runner_spec.rb
@@ -1632,25 +1632,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
stub_application_setting(max_artifacts_size: application_max_size)
end
- context 'and feature flag ci_max_artifact_size_per_type is enabled' do
- before do
- stub_feature_flags(ci_max_artifact_size_per_type: true)
- end
-
- it_behaves_like 'failed request'
- end
-
- context 'and feature flag ci_max_artifact_size_per_type is disabled' do
- before do
- stub_feature_flags(ci_max_artifact_size_per_type: false)
- end
-
- it 'bases of project closest setting' do
- send_request
-
- expect(response).to have_gitlab_http_status(success_code)
- end
- end
+ it_behaves_like 'failed request'
end
context 'based on application setting' do
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 68f1a0f1ba1..d4c05b4b198 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -1551,25 +1551,33 @@ RSpec.describe API::MergeRequests do
it "returns 422 when source_branch equals target_branch" do
post api("/projects/#{project.id}/merge_requests", user),
params: { title: "Test merge_request", source_branch: "master", target_branch: "master", author: user }
+
expect(response).to have_gitlab_http_status(:unprocessable_entity)
+ expect(json_response['message']).to eq(["You can't use same project/branch for source and target"])
end
it "returns 400 when source_branch is missing" do
post api("/projects/#{project.id}/merge_requests", user),
params: { title: "Test merge_request", target_branch: "master", author: user }
+
expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['error']).to eq('source_branch is missing')
end
it "returns 400 when target_branch is missing" do
post api("/projects/#{project.id}/merge_requests", user),
params: { title: "Test merge_request", source_branch: "markdown", author: user }
+
expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['error']).to eq('target_branch is missing')
end
it "returns 400 when title is missing" do
post api("/projects/#{project.id}/merge_requests", user),
params: { target_branch: 'master', source_branch: 'markdown' }
+
expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['error']).to eq('title is missing')
end
context 'with existing MR' do
@@ -1594,7 +1602,9 @@ RSpec.describe API::MergeRequests do
author: user
}
end.to change { MergeRequest.count }.by(0)
+
expect(response).to have_gitlab_http_status(:conflict)
+ expect(json_response['message']).to eq(["Another open merge request already exists for this source branch: !5"])
end
end