diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-08 18:09:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-08 18:09:52 +0000 |
commit | f18d1ffec0ecaae592a0ccd708ce77146f5f37e3 (patch) | |
tree | 5abbec71d01d6f561089878e7569d3a5b62a917a /app | |
parent | 05db4ead6d5c73cf62ad95d80ccac415bc3bf3cd (diff) | |
download | gitlab-ce-f18d1ffec0ecaae592a0ccd708ce77146f5f37e3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
9 files changed, 59 insertions, 9 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue b/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue index fc17669a737..492e68b636f 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/added_commit_message.vue @@ -40,9 +40,9 @@ export default { }, message() { return this.isFastForwardEnabled - ? s__('mrWidgetCommitsAdded|%{commitCount} will be added to %{targetBranch}.') + ? s__('mrWidgetCommitsAdded|Adds %{commitCount} to %{targetBranch}.') : s__( - 'mrWidgetCommitsAdded|%{commitCount} and %{mergeCommitCount} will be added to %{targetBranch}%{squashedCommits}.', + 'mrWidgetCommitsAdded|Adds %{commitCount} and %{mergeCommitCount} to %{targetBranch}%{squashedCommits}.', ); }, textDecorativeComponent() { @@ -69,7 +69,7 @@ export default { </template> <template #squashedCommits> <template v-if="glFeatures.restructuredMrWidget && isSquashEnabled"> - {{ __('(commits will be squashed)') }}</template + {{ n__('(squashes %d commit)', '(squashes %d commits)', commitsCount) }}</template ></template > </gl-sprintf> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/source_branch_removal_status.vue b/app/assets/javascripts/vue_merge_request_widget/components/source_branch_removal_status.vue index 9268e426954..caafd6b995e 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/source_branch_removal_status.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/source_branch_removal_status.vue @@ -4,7 +4,7 @@ import { __ } from '../../locale'; export default { i18n: { - removesBranchText: __('The source branch will be deleted'), + removesBranchText: __('Deletes the source branch'), tooltipTitle: __('A user with write access to the source branch selected this option'), }, components: { diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue index 0eb173edbcb..a44caf886a4 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue @@ -177,10 +177,10 @@ export default { </h4> <section class="mr-info-list"> <p v-if="shouldRemoveSourceBranch"> - {{ s__('mrWidget|The source branch will be deleted') }} + {{ s__('mrWidget|Deletes the source branch') }} </p> <p v-else class="gl-display-flex"> - <span class="gl-mr-3">{{ s__('mrWidget|The source branch will not be deleted') }}</span> + <span class="gl-mr-3">{{ s__('mrWidget|Does not delete the source branch') }}</span> <gl-button v-if="canRemoveSourceBranch" :loading="isRemovingSourceBranch" diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merging.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merging.vue index 1c245b584ea..247877a8235 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merging.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merging.vue @@ -32,7 +32,7 @@ export default { </h4> <section class="mr-info-list"> <p> - {{ s__('mrWidget|The changes will be merged into') }} + {{ s__('mrWidget|Merges changes into') }} <span class="label-branch"> <a :href="mr.targetBranchPath">{{ mr.targetBranch }}</a> </span> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue index 3ca0c387478..aca838ce099 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue @@ -710,10 +710,10 @@ export default { </li> <li class="gl-line-height-normal"> <template v-if="removeSourceBranch"> - {{ __('Source branch will be deleted.') }} + {{ __('Deletes the source branch.') }} </template> <template v-else> - {{ __('Source branch will not be deleted.') }} + {{ __('Does not delete the source branch.') }} </template> </li> <li v-if="mr.relatedLinks" class="gl-line-height-normal"> diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 2103a37180f..b8ee71daeee 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -404,6 +404,10 @@ module ApplicationSettingsHelper :keep_latest_artifact, :whats_new_variant, :user_deactivation_emails_enabled, + :sentry_enabled, + :sentry_dsn, + :sentry_clientside_dsn, + :sentry_environment, :sidekiq_job_limiter_mode, :sidekiq_job_limiter_compression_threshold_bytes, :sidekiq_job_limiter_limit_bytes, diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 5a8cbd8d71c..af5796d682f 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -536,6 +536,18 @@ class ApplicationSetting < ApplicationRecord validates :sidekiq_job_limiter_limit_bytes, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :sentry_enabled, + inclusion: { in: [true, false], message: _('must be a boolean value') } + validates :sentry_dsn, + addressable_url: true, presence: true, length: { maximum: 255 }, + if: :sentry_enabled? + validates :sentry_clientside_dsn, + addressable_url: true, allow_blank: true, length: { maximum: 255 }, + if: :sentry_enabled? + validates :sentry_environment, + presence: true, length: { maximum: 255 }, + if: :sentry_enabled? + attr_encrypted :asset_proxy_secret_key, mode: :per_attribute_iv, key: Settings.attr_encrypted_db_key_base_truncated, diff --git a/app/views/admin/application_settings/_sentry.html.haml b/app/views/admin/application_settings/_sentry.html.haml new file mode 100644 index 00000000000..5fd373d59e9 --- /dev/null +++ b/app/views/admin/application_settings/_sentry.html.haml @@ -0,0 +1,22 @@ += form_for @application_setting, url: metrics_and_profiling_admin_application_settings_path(anchor: 'js-sentry-settings'), html: { class: 'fieldset-form', id: 'sentry-settings' } do |f| + = form_errors(@application_setting) + + %span.text-muted + = _('Changing any setting here requires an application restart') + + %fieldset + .form-group + .form-check + = f.check_box :sentry_enabled, class: 'form-check-input' + = f.label :sentry_enabled, _('Enable Sentry error tracking'), class: 'form-check-label' + .form-group + = f.label :sentry_dsn, _('DSN'), class: 'label-light' + = f.text_field :sentry_dsn, class: 'form-control gl-form-input', placeholder: 'https://public@sentry.example.com/1' + .form-group + = f.label :sentry_clientside_dsn, _('Clientside DSN'), class: 'label-light' + = f.text_field :sentry_clientside_dsn, class: 'form-control gl-form-input', placeholder: 'https://public@sentry.example.com/2' + .form-group + = f.label :sentry_environment, _('Environment'), class: 'label-light' + = f.text_field :sentry_environment, class: 'form-control gl-form-input', placeholder: Rails.env + + = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' diff --git a/app/views/admin/application_settings/metrics_and_profiling.html.haml b/app/views/admin/application_settings/metrics_and_profiling.html.haml index 6087551d7c7..eba50b93bfe 100644 --- a/app/views/admin/application_settings/metrics_and_profiling.html.haml +++ b/app/views/admin/application_settings/metrics_and_profiling.html.haml @@ -54,3 +54,15 @@ = render 'usage' = render_if_exists 'admin/application_settings/pseudonymizer_settings', expanded: expanded_by_default? + +- if Feature.enabled?(:configure_sentry_in_application_settings, default_enabled: :yaml) + %section.settings.as-sentry.no-animate#js-sentry-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'sentry_settings_content' } } + .settings-header + %h4 + = _('Sentry') + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure Sentry integration for error tracking') + .settings-content + = render 'sentry' |