diff --git a/app/assets/javascripts/projects/compare/components/revision_dropdown_legacy.vue b/app/assets/javascripts/projects/compare/components/revision_dropdown_legacy.vue deleted file mode 100644 index 034bae3066d19a1659ccc367811b0e7c9b9c2b89..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/projects/compare/components/revision_dropdown_legacy.vue +++ /dev/null @@ -1,156 +0,0 @@ -<script> -import { GlDropdown, GlDropdownItem, GlSearchBoxByType, GlDropdownSectionHeader } from '@gitlab/ui'; -import { createAlert } from '~/alert'; -import axios from '~/lib/utils/axios_utils'; -import { s__ } from '~/locale'; - -export default { - components: { - GlDropdown, - GlDropdownItem, - GlDropdownSectionHeader, - GlSearchBoxByType, - }, - props: { - refsProjectPath: { - type: String, - required: true, - }, - revisionText: { - type: String, - required: true, - }, - paramsName: { - type: String, - required: true, - }, - paramsBranch: { - type: String, - required: false, - default: null, - }, - }, - data() { - return { - branches: [], - tags: [], - loading: true, - searchTerm: '', - selectedRevision: this.getDefaultBranch(), - }; - }, - computed: { - filteredBranches() { - return this.branches.filter((branch) => - branch.toLowerCase().includes(this.searchTerm.toLowerCase()), - ); - }, - hasFilteredBranches() { - return this.filteredBranches.length; - }, - filteredTags() { - return this.tags.filter((tag) => tag.toLowerCase().includes(this.searchTerm.toLowerCase())); - }, - hasFilteredTags() { - return this.filteredTags.length; - }, - }, - watch: { - paramsBranch(newBranch) { - this.setSelectedRevision(newBranch); - }, - }, - mounted() { - this.fetchBranchesAndTags(); - }, - methods: { - fetchBranchesAndTags() { - const endpoint = this.refsProjectPath; - - return axios - .get(endpoint) - .then(({ data }) => { - this.branches = data.Branches || []; - this.tags = data.Tags || []; - }) - .catch(() => { - createAlert({ - message: `${s__( - 'CompareRevisions|There was an error while updating the branch/tag list. Please try again.', - )}`, - }); - }) - .finally(() => { - this.loading = false; - }); - }, - getDefaultBranch() { - return this.paramsBranch || s__('CompareRevisions|Select branch/tag'); - }, - onClick(revision) { - this.setSelectedRevision(revision); - }, - onSearchEnter() { - this.setSelectedRevision(this.searchTerm); - }, - setSelectedRevision(revision) { - this.selectedRevision = revision || s__('CompareRevisions|Select branch/tag'); - this.$emit('selectRevision', { direction: this.paramsName, revision }); - }, - }, -}; -</script> - -<template> - <div class="form-group compare-form-group" :class="`js-compare-${paramsName}-dropdown`"> - <div class="input-group inline-input-group"> - <span class="input-group-prepend"> - <div class="input-group-text"> - {{ revisionText }} - </div> - </span> - <input type="hidden" :name="paramsName" :value="selectedRevision" /> - <gl-dropdown - class="gl-flex-grow-1 gl-flex-basis-0 gl-min-w-0 gl-font-monospace" - toggle-class="form-control compare-dropdown-toggle gl-min-w-0 gl-rounded-top-left-none! gl-rounded-bottom-left-none!" - :text="selectedRevision" - header-text="Select Git revision" - :loading="loading" - > - <template #header> - <gl-search-box-by-type - v-model.trim="searchTerm" - :placeholder="s__('CompareRevisions|Filter by Git revision')" - @keyup.enter="onSearchEnter" - /> - </template> - <gl-dropdown-section-header v-if="hasFilteredBranches"> - {{ s__('CompareRevisions|Branches') }} - </gl-dropdown-section-header> - <gl-dropdown-item - v-for="(branch, index) in filteredBranches" - :key="`branch${index}`" - is-check-item - :is-checked="selectedRevision === branch" - data-testid="branches-dropdown-item" - @click="onClick(branch)" - > - {{ branch }} - </gl-dropdown-item> - <gl-dropdown-section-header v-if="hasFilteredTags"> - {{ s__('CompareRevisions|Tags') }} - </gl-dropdown-section-header> - <gl-dropdown-item - v-for="(tag, index) in filteredTags" - :key="`tag${index}`" - is-check-item - :is-checked="selectedRevision === tag" - data-testid="tags-dropdown-item" - @click="onClick(tag)" - > - {{ tag }} - </gl-dropdown-item> - </gl-dropdown> - </div> - </div> -</template> diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index ef2233307eda456de62dd4af1c6684f27526f6e3..a564c9c30717da72989971a3dbcb4517ef36188b 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -479,6 +479,7 @@ def visible_attributes :sentry_dsn, :sentry_clientside_dsn, :sentry_environment, + :sentry_clientside_traces_sample_rate, :sidekiq_job_limiter_mode, :sidekiq_job_limiter_compression_threshold_bytes, :sidekiq_job_limiter_limit_bytes, diff --git a/app/views/admin/application_settings/_sentry.html.haml b/app/views/admin/application_settings/_sentry.html.haml index 20164cfe88d6d69fa04375258242b5ef8c18585a..9f2a40e4e5432316d45e49bb585126dc201a7841 100644 --- a/app/views/admin/application_settings/_sentry.html.haml +++ b/app/views/admin/application_settings/_sentry.html.haml @@ -17,4 +17,12 @@ = f.label :sentry_environment, _('Environment'), class: 'label-light' = f.text_field :sentry_environment, class: 'form-control gl-form-input', placeholder: Rails.env + %p.text-muted + = _("Changing any setting bellow doesn't require an application restart") + + %fieldset + .form-group + = f.label :sentry_clientside_traces_sample_rate, _('Clientside traces sample rate'), class: 'label-light' + = f.number_field :sentry_clientside_traces_sample_rate, class: 'form-control gl-form-input', placeholder: '0.5', min: 0, max: 1, step: 0.001 + = f.submit _('Save changes'), pajamas_button: true diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 74b89b079d9cc3ce1390c9a4875414094ddf6b0e..408503f47caf33bcca40214d7d93f449e49f8ab1 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -164,19 +164,16 @@ and gives you the option to return to the search results page. > - [Support for partial matches in issue search](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71913) removed in GitLab 14.9 [with a flag](../../administration/feature_flags.md) named `issues_full_text_search`. Disabled by default. > - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124703) in GitLab 16.2. Feature flag `issues_full_text_search` removed. -You can filter issues and merge requests by specific terms included in titles or descriptions. - -- Syntax - - Searches look for all the words in a query, in any order. For example: searching - issues for `display bug` returns all issues matching both those words, in any order. - - To find the exact term, use double quotes: `"display bug"`. -- Limitation - - For performance reasons, terms shorter than three characters are ignored. For example: searching - issues for `included in titles` is same as `included titles` - - Search is limited to 4096 characters and 64 terms per query. - - When searching issues, partial matches are not allowed. For example: searching for `play` will - not return issues that have the word `display`. But variations of words match, so searching - for `displays` also returns issues that have the word `display`. +You can search issues and merge requests for specific terms. +For example, when you search issues for `display bug`, the query returns +all issues that contain both `display` and `bug` in any order. +To search for the exact string, use `"display bug"` instead. + +Partial matches are not supported in issue search. +For example, when you search issues for `play`, the query does not return issues that contain `display`. +However, the query matches all possible variations of the string (for example, `plays`). + +For more information about query validation, see [Global search validation](#global-search-validation). ## Run a search from history diff --git a/locale/gitlab.pot b/locale/gitlab.pot index fa4b80f667263583e1cb99563ac26b8dbb1d000a..7a6750e71f1fd7da42c3f23fe30edca44cb6aa1e 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -9557,6 +9557,9 @@ msgstr "" msgid "Changes:" msgstr "" +msgid "Changing any setting bellow doesn't require an application restart" +msgstr "" + msgid "Changing any setting here requires an application restart" msgstr "" @@ -10424,6 +10427,9 @@ msgstr "" msgid "Clientside DSN" msgstr "" +msgid "Clientside traces sample rate" +msgstr "" + msgid "Clone" msgstr "" @@ -11975,9 +11981,6 @@ msgstr "" msgid "CompareRevisions|There was an error while searching the branch/tag list. Please try again." msgstr "" -msgid "CompareRevisions|There was an error while updating the branch/tag list. Please try again." -msgstr "" - msgid "CompareRevisions|View open merge request" msgstr "" diff --git a/qa/Gemfile b/qa/Gemfile index 4698f3a0db0ca46ec19dc31300a0c99dcd8f9f1e..2d0d73aa71127dc01be55e5f998b47de6f0d9a7a 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -gem 'gitlab-qa', '~> 12', '>= 12.3.0', require: 'gitlab/qa' +gem 'gitlab-qa', '~> 12', '>= 12.4.0', require: 'gitlab/qa' gem 'gitlab_quality-test_tooling', '~> 0.9.3', require: false gem 'gitlab-utils', path: '../gems/gitlab-utils' gem 'activesupport', '~> 7.0.5.1' # This should stay in sync with the root's Gemfile @@ -20,7 +20,7 @@ gem 'rspec_junit_formatter', '~> 0.6.0' gem 'faker', '~> 3.2' gem 'knapsack', '~> 4.0' gem 'parallel_tests', '~> 4.2', '>= 4.2.1' -gem 'rotp', '~> 6.2.2' +gem 'rotp', '~> 6.3.0' gem 'parallel', '~> 1.23' gem 'rainbow', '~> 3.1.1' gem 'rspec-parameterized', '~> 1.0.0' diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index 8a8bff904996f72d610423cc1decbf2f5b60cc23..9c68f6dee54623fa8f6016db4e5ccf57d7345cf2 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -121,7 +121,7 @@ GEM gitlab (4.19.0) httparty (~> 0.20) terminal-table (>= 1.5.1) - gitlab-qa (12.3.0) + gitlab-qa (12.4.0) activesupport (>= 6.1, < 7.1) gitlab (~> 4.19) http (~> 5.0) @@ -260,7 +260,7 @@ GEM netrc (~> 0.8) retriable (3.1.2) rexml (3.2.5) - rotp (6.2.2) + rotp (6.3.0) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -351,7 +351,7 @@ DEPENDENCIES faraday-retry (~> 2.2) fog-core (= 2.1.0) fog-google (~> 1.19) - gitlab-qa (~> 12, >= 12.3.0) + gitlab-qa (~> 12, >= 12.4.0) gitlab-utils! gitlab_quality-test_tooling (~> 0.9.3) influxdb-client (~> 2.9) @@ -364,7 +364,7 @@ DEPENDENCIES rainbow (~> 3.1.1) rake (~> 13, >= 13.0.6) rest-client (~> 2.1.0) - rotp (~> 6.2.2) + rotp (~> 6.3.0) rspec (~> 3.12) rspec-parameterized (~> 1.0.0) rspec-retry (~> 0.6.2) diff --git a/qa/qa/resource/api_fabricator.rb b/qa/qa/resource/api_fabricator.rb index 7c6c6cc02882c2efc519057249e334e10c0e46e7..499a9b278e9a8aa2d74b33f19d8f1645d6891d03 100644 --- a/qa/qa/resource/api_fabricator.rb +++ b/qa/qa/resource/api_fabricator.rb @@ -237,7 +237,7 @@ def wait_for_resource_availability(resource_web_url) Support::Retrier.retry_until(sleep_interval: 3, max_attempts: 5, raise_on_failure: false) do response_check = get(resource_web_url) - Runtime::Logger.debug("Resource availability check ... #{response_check.code}") + Runtime::Logger.debug("Resource availability check for #{resource_web_url} ... #{response_check.code}") response_check.code == HTTP_STATUS_OK end end diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index 76b07d903bc38a61cd77c216624cb279cddc5412..857cb1f39a2a014619ae2e14bddbf39fa58da3cd 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -16,7 +16,7 @@ sign_out(:user) end - it "redirects to signin then back to new issue after signin", :js, quarantine: 'https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1486' do + it "redirects to signin then back to new issue after signin", :js do create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/frontend/projects/compare/components/revision_dropdown_legacy_spec.js b/spec/frontend/projects/compare/components/revision_dropdown_legacy_spec.js deleted file mode 100644 index e289569f8cedf9b17bb31852af88487e2ca1965e..0000000000000000000000000000000000000000 --- a/spec/frontend/projects/compare/components/revision_dropdown_legacy_spec.js +++ /dev/null @@ -1,136 +0,0 @@ -import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import AxiosMockAdapter from 'axios-mock-adapter'; -import waitForPromises from 'helpers/wait_for_promises'; -import { createAlert } from '~/alert'; -import axios from '~/lib/utils/axios_utils'; -import { HTTP_STATUS_NOT_FOUND, HTTP_STATUS_OK } from '~/lib/utils/http_status'; -import RevisionDropdown from '~/projects/compare/components/revision_dropdown_legacy.vue'; - -const defaultProps = { - refsProjectPath: 'some/refs/path', - revisionText: 'Target', - paramsName: 'from', - paramsBranch: 'main', -}; - -jest.mock('~/alert'); - -describe('RevisionDropdown component', () => { - let wrapper; - let axiosMock; - - const createComponent = (props = {}) => { - wrapper = shallowMount(RevisionDropdown, { - propsData: { - ...defaultProps, - ...props, - }, - }); - }; - - beforeEach(() => { - axiosMock = new AxiosMockAdapter(axios); - createComponent(); - }); - - afterEach(() => { - axiosMock.restore(); - }); - - const findGlDropdown = () => wrapper.findComponent(GlDropdown); - const findBranchesDropdownItem = () => - wrapper.findAllComponents('[data-testid="branches-dropdown-item"]'); - const findTagsDropdownItem = () => - wrapper.findAllComponents('[data-testid="tags-dropdown-item"]'); - - it('sets hidden input', () => { - expect(wrapper.find('input[type="hidden"]').attributes('value')).toBe( - defaultProps.paramsBranch, - ); - }); - - it('update the branches on success', async () => { - const Branches = ['branch-1', 'branch-2']; - const Tags = ['tag-1', 'tag-2', 'tag-3']; - - axiosMock.onGet(defaultProps.refsProjectPath).replyOnce(HTTP_STATUS_OK, { - Branches, - Tags, - }); - - createComponent(); - - expect(findBranchesDropdownItem()).toHaveLength(0); - expect(findTagsDropdownItem()).toHaveLength(0); - - await waitForPromises(); - - Branches.forEach((branch, index) => { - expect(findBranchesDropdownItem().at(index).text()).toBe(branch); - }); - - Tags.forEach((tag, index) => { - expect(findTagsDropdownItem().at(index).text()).toBe(tag); - }); - - expect(findBranchesDropdownItem()).toHaveLength(Branches.length); - expect(findTagsDropdownItem()).toHaveLength(Tags.length); - }); - - it('sets branches and tags to be an empty array when no tags or branches are given', async () => { - axiosMock.onGet(defaultProps.refsProjectPath).replyOnce(HTTP_STATUS_OK, { - Branches: undefined, - Tags: undefined, - }); - - await waitForPromises(); - - expect(findBranchesDropdownItem()).toHaveLength(0); - expect(findTagsDropdownItem()).toHaveLength(0); - }); - - it('shows an alert on error', async () => { - axiosMock.onGet('some/invalid/path').replyOnce(HTTP_STATUS_NOT_FOUND); - - await waitForPromises(); - - expect(createAlert).toHaveBeenCalled(); - }); - - describe('GlDropdown component', () => { - it('renders props', () => { - expect(wrapper.props()).toEqual(expect.objectContaining(defaultProps)); - }); - - it('display default text', () => { - createComponent({ - paramsBranch: null, - }); - expect(findGlDropdown().props('text')).toBe('Select branch/tag'); - }); - - it('display params branch text', () => { - expect(findGlDropdown().props('text')).toBe(defaultProps.paramsBranch); - }); - - it('emits a "selectRevision" event when a revision is selected', async () => { - const findGlDropdownItems = () => wrapper.findAllComponents(GlDropdownItem); - const findFirstGlDropdownItem = () => findGlDropdownItems().at(0); - const branchName = 'some-branch'; - - axiosMock.onGet(defaultProps.refsProjectPath).replyOnce(HTTP_STATUS_OK, { - Branches: [branchName], - }); - - createComponent(); - await waitForPromises(); - - findFirstGlDropdownItem().vm.$emit('click'); - - expect(wrapper.emitted()).toEqual({ - selectRevision: [[{ direction: 'from', revision: branchName }]], - }); - }); - }); -}); diff --git a/spec/requests/api/settings_spec.rb b/spec/requests/api/settings_spec.rb index 7d630f1868155cc38e41c9062b73c5d4e626f6d9..ad52076523c8d84477ad67de319f544563777a85 100644 --- a/spec/requests/api/settings_spec.rb +++ b/spec/requests/api/settings_spec.rb @@ -854,7 +854,8 @@ sentry_enabled: true, sentry_dsn: 'http://sentry.example.com', sentry_clientside_dsn: 'http://sentry.example.com', - sentry_environment: 'production' + sentry_environment: 'production', + sentry_clientside_traces_sample_rate: 0.25 } end