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

Add latest changes from gitlab-org/gitlab@master

parent 24fe7aa2
No related branches found
No related tags found
No related merge requests found
Showing
with 190 additions and 6 deletions
Loading
Loading
@@ -292,7 +292,9 @@ module ApplicationSettingsHelper
:snowplow_site_id,
:push_event_hooks_limit,
:push_event_activities_limit,
:custom_http_clone_url_root
:custom_http_clone_url_root,
:pendo_enabled,
:pendo_url
]
end
 
Loading
Loading
Loading
Loading
@@ -104,6 +104,11 @@ class ApplicationSetting < ApplicationRecord
hostname: true,
if: :snowplow_enabled
 
validates :pendo_url,
presence: true,
public_url: true,
if: :pendo_enabled
validates :max_attachment_size,
presence: true,
numericality: { only_integer: true, greater_than: 0 }
Loading
Loading
Loading
Loading
@@ -129,7 +129,9 @@ module ApplicationSettingImplementation
snowplow_cookie_domain: nil,
snowplow_enabled: false,
snowplow_site_id: nil,
custom_http_clone_url_root: nil
custom_http_clone_url_root: nil,
pendo_enabled: false,
pendo_url: nil
}
end
 
Loading
Loading
- expanded = true if !@application_setting.valid? && @application_setting.errors.any? { |k| k.to_s.start_with?('pendo_') }
%section.settings.as-pendo.no-animate#js-pendo-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Pendo')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
= _('Configure the %{link} integration.').html_safe % { link: link_to('Pendo', 'https://www.pendo.io/', target: '_blank') }
.settings-content
= form_for @application_setting, url: integrations_admin_application_settings_path(anchor: 'js-pendo-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) if expanded
%fieldset
.form-group
.form-check
= f.check_box :pendo_enabled, class: 'form-check-input'
= f.label :pendo_enabled, _('Enable pendo tracking'), class: 'form-check-label'
.form-group
= f.label :pendo_url, _('Pendo endpoint'), class: 'label-light'
= f.text_field :pendo_url, class: 'form-control', placeholder: 'https://cdn.pendo.io/agent/static/your-api-key/pendo.js'
= f.submit _('Save changes'), class: 'btn btn-success'
Loading
Loading
@@ -28,4 +28,5 @@
.settings-content
= render 'third_party_offers', application_setting: @application_setting
 
= render_if_exists 'admin/application_settings/snowplow', expanded: expanded_by_default?
= render 'admin/application_settings/snowplow', expanded: expanded_by_default?
= render 'admin/application_settings/pendo'
Loading
Loading
@@ -89,4 +89,5 @@
 
= render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id')
= render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id')
= render_if_exists 'layouts/snowplow'
= render 'layouts/snowplow'
= render 'layouts/pendo'
- return unless Gitlab::CurrentSettings.pendo_enabled?
= javascript_tag nonce: true do
:plain
;var trackable = !['1', 'yes'].includes(window.doNotTrack || navigator.doNotTrack || navigator.msDoNotTrack);
if (trackable){
(function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=[];
v=['initialize','identify','updateOptions','pageLoad'];for(w=0,x=v.length;w<x;++w)(function(m){
o[m]=o[m]||function(){o._q[m===v[0]?'unshift':'push']([m].concat([].slice.call(arguments,0)));};})(v[w]);
y=e.createElement(n);y.async=!0;y.src='#{Gitlab::CurrentSettings.pendo_url}';
z=e.getElementsByTagName(n)[0];z.parentNode.insertBefore(y,z);})(window,document,'script','pendo');
pendo.initialize({
visitor: {
id: '#{current_user&.id}',
}
});};
---
title: The Security Dashboard displays DAST vulnerabilities for all the scanned sites, not just the first
merge_request: 17779
author:
type: added
---
title: Fix error when viewing group billing page
merge_request: 18740
author:
type: fixed
---
title: Adds Application Settings and ui settings in the integration admin area for Pendo
merge_request: 15086
author:
type: added
---
title: Minor UX improvements to Environments Dashboard page
merge_request: 18280
author:
type: changed
class AddPendoEnabledToApplicationSettings < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default :application_settings, :pendo_enabled, :boolean, default: false, allow_null: false
end
def down
remove_column :application_settings, :pendo_enabled
end
end
class AddPendoUrlToApplicationSettings < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
add_column :application_settings, :pendo_url, :string, limit: 255
end
end
Loading
Loading
@@ -341,6 +341,8 @@ ActiveRecord::Schema.define(version: 2019_10_17_045817) do
t.integer "push_event_hooks_limit", default: 3, null: false
t.integer "push_event_activities_limit", default: 3, null: false
t.string "custom_http_clone_url_root", limit: 511
t.boolean "pendo_enabled", default: false, null: false
t.string "pendo_url", limit: 255
t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id"
t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id"
t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id"
Loading
Loading
Loading
Loading
@@ -257,7 +257,6 @@ are listed in the descriptions of the relevant settings.
| `housekeeping_incremental_repack_period` | integer | required by: `housekeeping_enabled` | Number of Git pushes after which an incremental `git repack` is run. |
| `html_emails_enabled` | boolean | no | Enable HTML emails. |
| `import_sources` | array of strings | no | Sources to allow project import from, possible values: `github`, `bitbucket`, `bitbucket_server`, `gitlab`, `google_code`, `fogbugz`, `git`, `gitlab_project`, `gitea`, `manifest`, and `phabricator`. |
| `instance_statistics_visibility_private` | boolean | no | When set to `true` Instance statistics will only be available to admins. |
| `local_markdown_version` | integer | no | Increase this value when any cached markdown should be invalidated. |
| `max_artifacts_size` | integer | no | Maximum artifacts size in MB |
Loading
Loading
@@ -317,6 +316,8 @@ are listed in the descriptions of the relevant settings.
| `snowplow_cookie_domain` | string | no | The Snowplow cookie domain. (e.g. `.gitlab.com`) |
| `snowplow_enabled` | boolean | no | Enable snowplow tracking. |
| `snowplow_site_id` | string | no | The Snowplow site name / application id. (e.g. `gitlab`) |
| `pendo_url` | string | required by: `pendo_enabled` | The Pendo endpoint url with js snippet. (e.g. `https://cdn.pendo.io/agent/static/your-api-key/pendo.js`) |
| `pendo_enabled` | boolean | no | Enable pendo tracking. |
| `terminal_max_session_time` | integer | no | Maximum time for web terminal websocket connection (in seconds). Set to `0` for unlimited time. |
| `terms` | text | required by: `enforce_terms` | (**Required by:** `enforce_terms`) Markdown content for the ToS. |
| `throttle_authenticated_api_enabled` | boolean | no | (**If enabled, requires:** `throttle_authenticated_api_period_in_seconds` and `throttle_authenticated_api_requests_per_period`) Enable authenticated API request rate limit. Helps reduce request volume (e.g. from crawlers or abusive bots). |
Loading
Loading
Loading
Loading
@@ -106,7 +106,7 @@ The following table lists available parameters for jobs:
| [`when`](#when) | When to run job. Also available: `when:manual` and `when:delayed`. |
| [`environment`](#environment) | Name of an environment to which the job deploys. Also available: `environment:name`, `environment:url`, `environment:on_stop`, and `environment:action`. |
| [`cache`](#cache) | List of files that should be cached between subsequent runs. Also available: `cache:paths`, `cache:key`, `cache:untracked`, and `cache:policy`. |
| [`artifacts`](#artifacts) | List of files and directories to attach to a job on success. Also available: `artifacts:paths`, `artifacts:name`, `artifacts:untracked`, `artifacts:when`, `artifacts:expire_in`, `artifacts:reports`, and `artifacts:reports:junit`.<br><br>In GitLab [Enterprise Edition](https://about.gitlab.com/pricing/), these are available: `artifacts:reports:codequality`, `artifacts:reports:sast`, `artifacts:reports:dependency_scanning`, `artifacts:reports:container_scanning`, `artifacts:reports:dast`, `artifacts:reports:license_management`, `artifacts:reports:performance` and `artifacts:reports:metrics`. |
| [`artifacts`](#artifacts) | List of files and directories to attach to a job on success. Also available: `artifacts:paths`, `artifacts:expose_as`, `artifacts:name`, `artifacts:untracked`, `artifacts:when`, `artifacts:expire_in`, `artifacts:reports`, and `artifacts:reports:junit`.<br><br>In GitLab [Enterprise Edition](https://about.gitlab.com/pricing/), these are available: `artifacts:reports:codequality`, `artifacts:reports:sast`, `artifacts:reports:dependency_scanning`, `artifacts:reports:container_scanning`, `artifacts:reports:dast`, `artifacts:reports:license_management`, `artifacts:reports:performance` and `artifacts:reports:metrics`. |
| [`dependencies`](#dependencies) | Restrict which artifacts are passed to a specific job by providing a list of jobs to fetch artifacts from. |
| [`coverage`](#coverage) | Code coverage settings for a given job. |
| [`retry`](#retry) | When and how many times a job can be auto-retried in case of a failure. |
Loading
Loading
@@ -1627,6 +1627,47 @@ release-job:
- tags
```
 
#### `artifacts:expose_as`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/15018) in GitLab 12.5.
The `expose_as` keyword can be used to expose [job artifacts](../../user/project/pipelines/job_artifacts.md)
in the [merge request](../../user/project/merge_requests/index.md) UI.
For example, to match a single file:
```yml
test:
script: [ 'echo 1' ]
artifacts:
expose_as: 'artifact 1'
paths: ['path/to/file.txt']
```
With this configuration, GitLab will add a link **artifact 1** to the relevant merge request
that points to `file1.txt`.
An example that will match an entire directory:
```yml
test:
script: [ 'echo 1' ]
artifacts:
expose_as: 'artifact 1'
paths: ['path/to/directory/']
```
Note the following:
- A maximum of 10 job artifacts per merge request can be exposed.
- Glob patterns are unsupported.
- If a directory is specified, the link will be to the job [artifacts browser](../../user/project/pipelines/job_artifacts.md#browsing-artifacts) if there is more than
one file in the directory.
- For exposed single file artifacts with `.html`, `.htm`, `.txt`, `.json`, `.xml`,
and `.log` extensions, if [GitLab Pages](../../administration/pages/index.md) is:
- Enabled, GitLab will automatically render the artifact.
- Not enabled, you will see the file in the artifacts browser.
#### `artifacts:name`
 
> Introduced in GitLab 8.6 and GitLab Runner v1.1.0.
Loading
Loading
Loading
Loading
@@ -493,6 +493,11 @@ For more information, [read about pipelines](../../../ci/pipelines.md).
 
Find out about [bulk editing merge requests](../../project/bulk_editing.md).
 
## Display arbitrary job artifacts
To configure pipelines to job [artifacts](../pipelines/job_artifacts.md) that can be displayed in
merge requests, see [`artifacts:expose_as`](../../../ci/yaml/README.md#artifactsexpose_as).
## Troubleshooting
 
Sometimes things don't go as expected in a merge request, here are some
Loading
Loading
Loading
Loading
@@ -85,3 +85,8 @@ questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->
## Use it from the command line
You can use [Push Options](../push_options.md) to trigger this feature when
pushing.
Loading
Loading
@@ -75,3 +75,33 @@ merge request, and target a branch named `my-target-branch`:
```shell
git push -o merge_request.create -o merge_request.target=my-target-branch
```
Additionally if you want the merge request to merge as soon as the pipeline succeeds you can do:
```shell
git push -o merge_request.create -o merge_request.target=my-target-branch -o merge_request.merge_when_pipeline_succeeds
```
## Useful Git aliases
As shown above, Git push options can cause Git commands to grow very long. If
you use the same push options frequently, it's useful to create [Git
aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases). Git aliases
are command line shortcuts for Git which can significantly simplify the use of
long Git commands.
### Merge when pipeline succeeds alias
To set up a Git alias for the [merge when pipeline succeeds Git push
option](#push-options-for-merge-requests):
```shell
git config --global alias.mwps "push -o merge_request.create -o merge_request.target=master -o merge_request.merge_when_pipeline_succeeds"
```
Then to quickly push a local branch that will target master and merge when the
pipeline succeeds:
```shell
git mwps origin <local-branch-name>
```
Loading
Loading
@@ -140,6 +140,10 @@ module API
optional :snowplow_cookie_domain, type: String, desc: 'The Snowplow cookie domain'
optional :snowplow_site_id, type: String, desc: 'The Snowplow site name / application ic'
end
optional :pendo_enabled, type: Grape::API::Boolean, desc: 'Enable Pendo tracking'
given pendo_enabled: ->(val) { val } do
requires :pendo_url, type: String, desc: 'The Pendo url endpoint'
end
 
ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type|
optional :"#{type}_key_restriction",
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