diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-15 18:08:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-15 18:08:32 +0300 |
commit | 9044365a91112d426fbbfba07eca595652bbe2df (patch) | |
tree | a46df8721ca37ef4336375c201f783b4392f385a | |
parent | 0820b29dca14bd22c2cee6d9ee2900b64385bfa6 (diff) |
Add latest changes from gitlab-org/gitlab@master
22 files changed, 190 insertions, 33 deletions
diff --git a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue index 62fd379aa4c..4e63e167260 100644 --- a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue +++ b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue @@ -1,4 +1,5 @@ <script> +import _ from 'underscore'; import { GlTooltip } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; @@ -56,17 +57,36 @@ export default { collapseIcon() { return this.isExpanded ? 'chevron-down' : 'chevron-right'; }, - noCodeFn() { - return this.errorFn ? sprintf(__('in %{errorFn} '), { errorFn: this.errorFn }) : ''; + errorFnText() { + return this.errorFn + ? sprintf( + __(`%{spanStart}in%{spanEnd} %{errorFn}`), + { + errorFn: `<strong>${_.escape(this.errorFn)}</strong>`, + spanStart: `<span class="text-tertiary">`, + spanEnd: `</span>`, + }, + false, + ) + : ''; }, - noCodeLine() { + errorPositionText() { return this.errorLine - ? sprintf(__('at line %{errorLine}%{errorColumn}'), { - errorLine: this.errorLine, - errorColumn: this.errorColumn ? `:${this.errorColumn}` : '', - }) + ? sprintf( + __(`%{spanStart}at line%{spanEnd} %{errorLine}%{errorColumn}`), + { + errorLine: `<strong>${this.errorLine}</strong>`, + errorColumn: this.errorColumn ? `:<strong>${this.errorColumn}</strong>` : ``, + spanStart: `<span class="text-tertiary">`, + spanEnd: `</span>`, + }, + false, + ) : ''; }, + errorInfo() { + return `${this.errorFnText} ${this.errorPositionText}`; + }, }, methods: { isHighlighted(lineNum) { @@ -102,8 +122,7 @@ export default { <strong v-gl-tooltip :title="filePath" - class="file-title-name d-inline-block overflow-hidden text-truncate" - :class="{ 'limited-width': !hasCode }" + class="file-title-name d-inline-block overflow-hidden text-truncate limited-width" data-container="body" > {{ filePath }} @@ -113,7 +132,7 @@ export default { :text="filePath" css-class="btn-default btn-transparent btn-clipboard position-static" /> - <span v-if="!hasCode" class="text-tertiary">{{ noCodeFn }}{{ noCodeLine }}</span> + <span v-html="errorInfo"></span> </div> </div> diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index da263949b98..d755e7e8cdb 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -222,7 +222,7 @@ document.addEventListener('DOMContentLoaded', () => { // Disable form buttons while a form is submitting $body.on('ajax:complete, ajax:beforeSend, submit', 'form', function ajaxCompleteCallback(e) { - const $buttons = $('[type="submit"], .js-disable-on-submit', this); + const $buttons = $('[type="submit"], .js-disable-on-submit', this).not('.js-no-auto-disable'); switch (e.type) { case 'ajax:beforeSend': case 'submit': diff --git a/app/assets/javascripts/repository/components/tree_content.vue b/app/assets/javascripts/repository/components/tree_content.vue index c30d6f05c6a..92e33b013c3 100644 --- a/app/assets/javascripts/repository/components/tree_content.vue +++ b/app/assets/javascripts/repository/components/tree_content.vue @@ -5,6 +5,7 @@ import FileTable from './table/index.vue'; import getRefMixin from '../mixins/get_ref'; import getFiles from '../queries/getFiles.query.graphql'; import getProjectPath from '../queries/getProjectPath.query.graphql'; +import getVueFileListLfsBadge from '../queries/getVueFileListLfsBadge.query.graphql'; import FilePreview from './preview/index.vue'; import { readmeFile } from '../utils/readme'; @@ -20,6 +21,9 @@ export default { projectPath: { query: getProjectPath, }, + vueFileListLfsBadge: { + query: getVueFileListLfsBadge, + }, }, props: { path: { @@ -43,6 +47,7 @@ export default { blobs: [], }, isLoadingFiles: false, + vueFileListLfsBadge: false, }; }, computed: { @@ -77,6 +82,7 @@ export default { path: this.path || '/', nextPageCursor: this.nextPageCursor, pageSize: PAGE_SIZE, + vueLfsEnabled: this.vueFileListLfsBadge, }, }) .then(({ data }) => { diff --git a/app/assets/javascripts/repository/index.js b/app/assets/javascripts/repository/index.js index ae6409a0ac9..2ef0c078f13 100644 --- a/app/assets/javascripts/repository/index.js +++ b/app/assets/javascripts/repository/index.js @@ -23,6 +23,7 @@ export default function setupVueRepositoryList() { projectPath, projectShortPath, ref, + vueFileListLfsBadge: gon?.features?.vueFileListLfsBadge, commits: [], }, }); diff --git a/app/assets/javascripts/repository/queries/getFiles.query.graphql b/app/assets/javascripts/repository/queries/getFiles.query.graphql index 2aaf5066b4a..01ad72ef752 100644 --- a/app/assets/javascripts/repository/queries/getFiles.query.graphql +++ b/app/assets/javascripts/repository/queries/getFiles.query.graphql @@ -14,6 +14,7 @@ query getFiles( $ref: String! $pageSize: Int! $nextPageCursor: String + $vueLfsEnabled: Boolean = false ) { project(fullPath: $projectPath) { repository { @@ -46,7 +47,7 @@ query getFiles( node { ...TreeEntry webUrl - lfsOid + lfsOid @include(if: $vueLfsEnabled) } } pageInfo { diff --git a/app/assets/javascripts/repository/queries/getVueFileListLfsBadge.query.graphql b/app/assets/javascripts/repository/queries/getVueFileListLfsBadge.query.graphql new file mode 100644 index 00000000000..3c3d14881da --- /dev/null +++ b/app/assets/javascripts/repository/queries/getVueFileListLfsBadge.query.graphql @@ -0,0 +1,3 @@ +query getProjectShortPath { + vueFileListLfsBadge @client +} diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index c2f6fbdc265..aba28e5c835 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -15,6 +15,10 @@ class Projects::TreeController < Projects::ApplicationController before_action :authorize_download_code! before_action :authorize_edit_tree!, only: [:create_dir] + before_action only: [:show] do + push_frontend_feature_flag(:vue_file_list_lfs_badge) + end + def show return render_404 unless @repository.commit(@ref) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 2df41bc2a07..bb3762c26f6 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -266,7 +266,7 @@ module Ci end before_transition on: :enqueue_preparing do |build| - build.any_unmet_prerequisites? # If false is returned, it stops the transition + !build.any_unmet_prerequisites? # If false is returned, it stops the transition end after_transition created: :scheduled do |build| diff --git a/app/services/clusters/applications/check_installation_progress_service.rb b/app/services/clusters/applications/check_installation_progress_service.rb index 1ce6e0c1cb0..7d064abfaa3 100644 --- a/app/services/clusters/applications/check_installation_progress_service.rb +++ b/app/services/clusters/applications/check_installation_progress_service.rb @@ -11,6 +11,8 @@ module Clusters def on_success app.make_installed! + + Gitlab::Tracking.event('cluster:applications', "cluster_application_#{app.name}_installed") ensure remove_installation_pod end diff --git a/changelogs/unreleased/195998-fix-build-prerequisite-transition.yml b/changelogs/unreleased/195998-fix-build-prerequisite-transition.yml new file mode 100644 index 00000000000..6c306cc1556 --- /dev/null +++ b/changelogs/unreleased/195998-fix-build-prerequisite-transition.yml @@ -0,0 +1,5 @@ +--- +title: Prevent builds from halting unnecessarily when completing prerequisites +merge_request: 22938 +author: +type: fixed diff --git a/changelogs/unreleased/38130-update-header-for-all-stacktrace-entries.yml b/changelogs/unreleased/38130-update-header-for-all-stacktrace-entries.yml new file mode 100644 index 00000000000..bdc7b6c02f5 --- /dev/null +++ b/changelogs/unreleased/38130-update-header-for-all-stacktrace-entries.yml @@ -0,0 +1,5 @@ +--- +title: Display fn, line num and column in stacktrace entry caption +merge_request: 22905 +author: +type: added diff --git a/changelogs/unreleased/sh-fix-mark-for-deletion-service.yml b/changelogs/unreleased/sh-fix-mark-for-deletion-service.yml new file mode 100644 index 00000000000..2c8a45e8e92 --- /dev/null +++ b/changelogs/unreleased/sh-fix-mark-for-deletion-service.yml @@ -0,0 +1,5 @@ +--- +title: Gracefully handle marking a project deletion multiple times +merge_request: 22949 +author: +type: fixed diff --git a/config/feature_categories.yml b/config/feature_categories.yml index 50776d92a30..1cae9875eac 100644 --- a/config/feature_categories.yml +++ b/config/feature_categories.yml @@ -21,7 +21,6 @@ - cloud_native_installation - cluster_cost_optimization - cluster_monitoring -- code_analytics - code_quality - code_review - collection diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index dc66b2adb70..5f078459bc2 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -35,7 +35,7 @@ production: &base https: false # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details # The maximum time unicorn/puma can spend on the request. This needs to be smaller than the worker timeout. # Default is 95% of the worker timeout - max_request_duration: 57 + max_request_duration_seconds: 57 # Uncomment this line below if your ssh host is different from HTTP/HTTPS one # (you'd obviously need to replace ssh.host_example.com with your own host). diff --git a/doc/administration/geo/replication/high_availability.md b/doc/administration/geo/replication/high_availability.md index faa9d051107..19266a6b358 100644 --- a/doc/administration/geo/replication/high_availability.md +++ b/doc/administration/geo/replication/high_availability.md @@ -123,6 +123,20 @@ a single node only, rather than as a PostgreSQL cluster. Configure the [**secondary** database](database.md) as a read-only replica of the **primary** database. Use the following as a guide. +1. Generate an MD5 hash of the desired password for the database user that the + GitLab application will use to access the read-replica database: + + Note that the username (`gitlab` by default) is incorporated into the hash. + + ```sh + gitlab-ctl pg-password-md5 gitlab + # Enter password: <your_password_here> + # Confirm password: <your_password_here> + # fca0b89a972d69f00eb3ec98a5838484 + ``` + + Use this hash to fill in `<md5_hash_of_your_password>` in the next step. + 1. Edit `/etc/gitlab/gitlab.rb` in the replica database machine, and add the following: @@ -167,6 +181,22 @@ only a single machine, rather than as a PostgreSQL cluster. Configure the tracking database. +1. Generate an MD5 hash of the desired password for the database user that the + GitLab application will use to access the tracking database: + + Note that the username (`gitlab_geo` by default) is incorporated into the + hash. + + ```sh + gitlab-ctl pg-password-md5 gitlab_geo + # Enter password: <your_password_here> + # Confirm password: <your_password_here> + # fca0b89a972d69f00eb3ec98a5838484 + ``` + + Use this hash to fill in `<tracking_database_password_md5_hash>` in the next + step. + 1. Edit `/etc/gitlab/gitlab.rb` in the tracking database machine, and add the following: diff --git a/doc/administration/geo/replication/troubleshooting.md b/doc/administration/geo/replication/troubleshooting.md index 771efc2c8c6..7c36d55027a 100644 --- a/doc/administration/geo/replication/troubleshooting.md +++ b/doc/administration/geo/replication/troubleshooting.md @@ -494,16 +494,55 @@ The following steps are for Omnibus installs only. Using Geo with source-based i To check the configuration: +1. SSH into an app node in the **secondary**: + + ```sh + sudo -i + ``` + + Note: An app node is any machine running at least one of the following services: + + - `puma` + - `unicorn` + - `sidekiq` + - `geo-logcursor` + 1. Enter the database console: + If the tracking database is running on the same node: + ```sh gitlab-geo-psql ``` -1. Check whether any tables are present. If everything is working, you - should see something like this: + Or, if the tracking database is running on a different node, you must specify + the user and host when entering the database console: + + ```sh + gitlab-geo-psql -U gitlab_geo -h <IP of tracking database> + ``` + + You will be prompted for the password of the `gitlab_geo` user. You can find + it in plaintext in `/etc/gitlab/gitlab.rb` at: + + ```ruby + geo_secondary['db_password'] = '<geo_tracking_db_password>' + ``` + + This password is normally set on the tracking database during + [Step 3: Configure the tracking database on the secondary node](high_availability.md#step-3-configure-the-tracking-database-on-the-secondary-node), + and it is set on the app nodes during + [Step 4: Configure the frontend application servers on the secondary node](high_availability.md#step-4-configure-the-frontend-application-servers-on-the-secondary-node). + +1. Check whether any tables are present with the following statement: ```sql + SELECT * from information_schema.foreign_tables; + ``` + + If everything is working, you should see something like this: + + ``` gitlabhq_geo_production=# SELECT * from information_schema.foreign_tables; foreign_table_catalog | foreign_table_schema | foreign_table_name | foreign_server_catalog | foreign_server_name -------------------------+----------------------+-------------------------------------------------+-------------------------+--------------------- @@ -519,7 +558,7 @@ To check the configuration: 1. Check that the foreign server mapping is correct via `\des+`. The results should look something like this: - ```sql + ``` gitlabhq_geo_production=# \des+ List of foreign servers -[ RECORD 1 ]--------+------------------------------------------------------------ @@ -555,7 +594,7 @@ To check the configuration: 1. Check that the user mapping is configured properly via `\deu+`: - ```sql + ``` gitlabhq_geo_production=# \deu+ List of user mappings Server | User name | FDW Options diff --git a/doc/development/contributing/issue_workflow.md b/doc/development/contributing/issue_workflow.md index 1439c56983b..eba650ea22f 100644 --- a/doc/development/contributing/issue_workflow.md +++ b/doc/development/contributing/issue_workflow.md @@ -185,9 +185,9 @@ their color is `#428BCA`. `<Category Name>` is the category name as it is in the single source of truth for categories at <https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/categories.yml>. -For instance, the "Code Analytics" category is represented by the -~"Category:Code Analytics" label in the `gitlab-org` group since its -`code_analytics.name` value is "Code Analytics". +For instance, the "DevOps Score" category is represented by the +~"Category:DevOps Score" label in the `gitlab-org` group since its +`devops_score.name` value is "DevOps Score". If a category's label doesn't respect this naming convention, it should be specified with [the `label` attribute](https://about.gitlab.com/handbook/marketing/website/#category-attributes) diff --git a/doc/development/fe_guide/frontend_faq.md b/doc/development/fe_guide/frontend_faq.md index cbe0a78370d..b8101a99ff6 100644 --- a/doc/development/fe_guide/frontend_faq.md +++ b/doc/development/fe_guide/frontend_faq.md @@ -73,3 +73,8 @@ Ensure a [Product Designer](https://about.gitlab.com/company/team/?department=ux reviews the use of the non-conforming component as part of the MR review. Make a follow up issue and attach it to the component implementation epic found within the [Components of Pajamas Design System epic](https://gitlab.com/groups/gitlab-org/-/epics/973). + +### 4. My submit form button becomes disabled after submitting + +If you are using a submit button inside a form and you attach an `onSubmit` event listener on the form element, [this piece of code](https://gitlab.com/gitlab-org/gitlab/blob/794c247a910e2759ce9b401356432a38a4535d49/app/assets/javascripts/main.js#L225) will add a `disabled` class selector to the submit button when the form is submitted. +To avoid this behavior, add the class `js-no-auto-disable` to the button. diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 890e925c238..9b51ad51a31 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -373,6 +373,12 @@ msgstr "" msgid "%{spammable_titlecase} was submitted to Akismet successfully." msgstr "" +msgid "%{spanStart}at line%{spanEnd} %{errorLine}%{errorColumn}" +msgstr "" + +msgid "%{spanStart}in%{spanEnd} %{errorFn}" +msgstr "" + msgid "%{start} to %{end}" msgstr "" @@ -4544,9 +4550,6 @@ msgstr "" msgid "Code" msgstr "" -msgid "Code Analytics" -msgstr "" - msgid "Code Owners" msgstr "" @@ -21522,9 +21525,6 @@ msgstr "" msgid "assign yourself" msgstr "" -msgid "at line %{errorLine}%{errorColumn}" -msgstr "" - msgid "attach a new file" msgstr "" @@ -21997,9 +21997,6 @@ msgstr "" msgid "importing" msgstr "" -msgid "in %{errorFn} " -msgstr "" - msgid "in group %{link_to_group}" msgstr "" diff --git a/spec/frontend/error_tracking/components/stacktrace_entry_spec.js b/spec/frontend/error_tracking/components/stacktrace_entry_spec.js index 942585d5370..2a4e826b4ab 100644 --- a/spec/frontend/error_tracking/components/stacktrace_entry_spec.js +++ b/spec/frontend/error_tracking/components/stacktrace_entry_spec.js @@ -46,8 +46,8 @@ describe('Stacktrace Entry', () => { expect(wrapper.findAll('.line_content.old').length).toBe(1); }); - describe('no code block', () => { - const findFileHeaderContent = () => wrapper.find('.file-header-content').html(); + describe('entry caption', () => { + const findFileHeaderContent = () => wrapper.find('.file-header-content').text(); it('should hide collapse icon and render error fn name and error line when there is no code block', () => { const extraInfo = { errorLine: 34, errorFn: 'errorFn', errorColumn: 77 }; diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 21644ea5dec..38e15fc4582 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -341,6 +341,36 @@ describe Ci::Build do end end + describe '#enqueue_preparing' do + let(:build) { create(:ci_build, :preparing) } + + subject { build.enqueue_preparing } + + before do + allow(build).to receive(:any_unmet_prerequisites?).and_return(has_unmet_prerequisites) + end + + context 'build completed prerequisites' do + let(:has_unmet_prerequisites) { false } + + it 'transitions to pending' do + subject + + expect(build).to be_pending + end + end + + context 'build did not complete prerequisites' do + let(:has_unmet_prerequisites) { true } + + it 'remains in preparing' do + subject + + expect(build).to be_preparing + end + end + end + describe '#actionize' do context 'when build is a created' do before do diff --git a/spec/services/clusters/applications/check_installation_progress_service_spec.rb b/spec/services/clusters/applications/check_installation_progress_service_spec.rb index 7b37eb97800..2f224d40920 100644 --- a/spec/services/clusters/applications/check_installation_progress_service_spec.rb +++ b/spec/services/clusters/applications/check_installation_progress_service_spec.rb @@ -160,6 +160,12 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do expect(application).to be_installed expect(application.status_reason).to be_nil end + + it 'tracks application install' do + expect(Gitlab::Tracking).to receive(:event).with('cluster:applications', "cluster_application_helm_installed") + + service.execute + end end context 'when installation POD failed' do |