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>2023-11-16 00:07:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-16 00:07:25 +0300
commita7d47330045c163760517a49f5fd35854e089c6e (patch)
tree57b7695720db8c461c2ef82841ae9571c1e2b9dc
parenta46bff51d5262a5c05c460f0c7c43a5f2405cd5d (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/search/index.js9
-rw-r--r--app/assets/javascripts/search/store/state.js3
-rw-r--r--app/assets/javascripts/search/topbar/components/app.vue83
-rw-r--r--app/assets/javascripts/search/topbar/components/search_type_indicator.vue115
-rw-r--r--app/assets/javascripts/search/topbar/constants.js6
-rw-r--r--app/assets/javascripts/search/topbar/index.js3
-rw-r--r--app/models/integrations/irker.rb8
-rw-r--r--app/views/search/show.html.haml3
-rw-r--r--doc/api/packages.md2
-rw-r--r--doc/ci/yaml/index.md45
-rw-r--r--doc/ci/yaml/inputs.md94
-rw-r--r--locale/gitlab.pot44
-rw-r--r--package.json2
-rw-r--r--spec/frontend/search/topbar/components/app_spec.js13
-rw-r--r--spec/frontend/search/topbar/components/search_type_indicator_spec.js120
-rw-r--r--spec/models/integrations/irker_spec.rb9
-rw-r--r--yarn.lock78
17 files changed, 502 insertions, 135 deletions
diff --git a/app/assets/javascripts/search/index.js b/app/assets/javascripts/search/index.js
index dfb2c519c28..5879735d0f6 100644
--- a/app/assets/javascripts/search/index.js
+++ b/app/assets/javascripts/search/index.js
@@ -7,15 +7,24 @@ import createStore from './store';
import { initTopbar } from './topbar';
import { initBlobRefSwitcher } from './under_topbar';
+const topbarInitState = () => {
+ const el = document.getElementById('js-search-topbar');
+ if (!el) return {};
+ const { defaultBranchName } = el.dataset;
+ return { defaultBranchName };
+};
+
export const initSearchApp = () => {
syntaxHighlight(document.querySelectorAll('.js-search-results'));
const query = queryToObject(window.location.search, { gatherArrays: true });
const { navigationJsonParsed: navigation, searchType } = sidebarInitState() || {};
+ const { defaultBranchName } = topbarInitState() || {};
const store = createStore({
query,
navigation,
searchType,
+ defaultBranchName,
});
initTopbar(store);
diff --git a/app/assets/javascripts/search/store/state.js b/app/assets/javascripts/search/store/state.js
index 9c38a230343..a0e4d8c5596 100644
--- a/app/assets/javascripts/search/store/state.js
+++ b/app/assets/javascripts/search/store/state.js
@@ -1,7 +1,7 @@
import { cloneDeep } from 'lodash';
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from './constants';
-const createState = ({ query, navigation, searchType }) => ({
+const createState = ({ query, navigation, defaultBranchName, searchType }) => ({
urlQuery: cloneDeep(query),
query,
groups: [],
@@ -21,6 +21,7 @@ const createState = ({ query, navigation, searchType }) => ({
},
searchLabelString: '',
searchType,
+ defaultBranchName,
});
export default createState;
diff --git a/app/assets/javascripts/search/topbar/components/app.vue b/app/assets/javascripts/search/topbar/components/app.vue
index 49e66492519..d9f824b6e18 100644
--- a/app/assets/javascripts/search/topbar/components/app.vue
+++ b/app/assets/javascripts/search/topbar/components/app.vue
@@ -7,6 +7,7 @@ import { parseBoolean } from '~/lib/utils/common_utils';
import MarkdownDrawer from '~/vue_shared/components/markdown_drawer/markdown_drawer.vue';
import { ZOEKT_SEARCH_TYPE, ADVANCED_SEARCH_TYPE } from '~/search/store/constants';
import { SYNTAX_OPTIONS_ADVANCED_DOCUMENT, SYNTAX_OPTIONS_ZOEKT_DOCUMENT } from '../constants';
+import SearchTypeIndicator from './search_type_indicator.vue';
import GroupFilter from './group_filter.vue';
import ProjectFilter from './project_filter.vue';
@@ -31,6 +32,7 @@ export default {
GroupFilter,
ProjectFilter,
MarkdownDrawer,
+ SearchTypeIndicator,
},
props: {
groupInitialJson: {
@@ -90,45 +92,50 @@ export default {
</script>
<template>
- <section class="gl-p-5 gl-bg-gray-10 gl-border-b gl-border-t">
- <div class="search-page-form gl-lg-display-flex gl-flex-direction-column">
- <div class="gl-lg-display-flex gl-flex-direction-row gl-align-items-flex-end">
- <div class="gl-flex-grow-1 gl-mb-4 gl-lg-mb-0 gl-lg-mr-2">
- <div
- class="gl-display-flex gl-flex-direction-row gl-justify-content-space-between gl-mb-0 gl-md-mb-4"
- >
- <label class="gl-mb-1 gl-md-pb-2">{{ $options.i18n.searchLabel }}</label>
- <template v-if="showSyntaxOptions">
- <gl-button
- category="tertiary"
- variant="link"
- size="small"
- button-text-classes="gl-font-sm!"
- @click="onToggleDrawer"
- >{{ $options.i18n.syntaxOptionsLabel }}
- </gl-button>
- <markdown-drawer ref="markdownDrawer" :document-path="documentBasedOnSearchType" />
- </template>
+ <section>
+ <div class="gl-display-flex gl-flex-wrap gl-justify-content-end gl-pt-6 gl-pb-5">
+ <search-type-indicator />
+ </div>
+ <div class="gl-p-5 gl-bg-gray-10 gl-border-b gl-border-t">
+ <div class="search-page-form gl-lg-display-flex gl-flex-direction-column">
+ <div class="gl-lg-display-flex gl-flex-direction-row gl-align-items-flex-end">
+ <div class="gl-flex-grow-1 gl-mb-4 gl-lg-mb-0 gl-lg-mr-2">
+ <div
+ class="gl-display-flex gl-flex-direction-row gl-justify-content-space-between gl-mb-0 gl-md-mb-4"
+ >
+ <label class="gl-mb-1 gl-md-pb-2">{{ $options.i18n.searchLabel }}</label>
+ <template v-if="showSyntaxOptions">
+ <gl-button
+ category="tertiary"
+ variant="link"
+ size="small"
+ button-text-classes="gl-font-sm!"
+ @click="onToggleDrawer"
+ >{{ $options.i18n.syntaxOptionsLabel }}
+ </gl-button>
+ <markdown-drawer ref="markdownDrawer" :document-path="documentBasedOnSearchType" />
+ </template>
+ </div>
+ <gl-search-box-by-click
+ id="dashboard_search"
+ v-model="search"
+ name="search"
+ :placeholder="$options.i18n.searchPlaceholder"
+ @submit="applyQuery"
+ />
+ </div>
+ <div v-if="showFilters" class="gl-mb-4 gl-lg-mb-0 gl-lg-mx-3">
+ <label class="gl-display-block gl-mb-1 gl-md-pb-2">{{
+ $options.i18n.groupFieldLabel
+ }}</label>
+ <group-filter :initial-data="groupInitialJson" />
+ </div>
+ <div v-if="showFilters" class="gl-mb-4 gl-lg-mb-0 gl-lg-ml-3">
+ <label class="gl-display-block gl-mb-1 gl-md-pb-2">{{
+ $options.i18n.projectFieldLabel
+ }}</label>
+ <project-filter :initial-data="projectInitialJson" />
</div>
- <gl-search-box-by-click
- id="dashboard_search"
- v-model="search"
- name="search"
- :placeholder="$options.i18n.searchPlaceholder"
- @submit="applyQuery"
- />
- </div>
- <div v-if="showFilters" class="gl-mb-4 gl-lg-mb-0 gl-lg-mx-3">
- <label class="gl-display-block gl-mb-1 gl-md-pb-2">{{
- $options.i18n.groupFieldLabel
- }}</label>
- <group-filter :initial-data="groupInitialJson" />
- </div>
- <div v-if="showFilters" class="gl-mb-4 gl-lg-mb-0 gl-lg-ml-3">
- <label class="gl-display-block gl-mb-1 gl-md-pb-2">{{
- $options.i18n.projectFieldLabel
- }}</label>
- <project-filter :initial-data="projectInitialJson" />
</div>
</div>
</div>
diff --git a/app/assets/javascripts/search/topbar/components/search_type_indicator.vue b/app/assets/javascripts/search/topbar/components/search_type_indicator.vue
new file mode 100644
index 00000000000..7520a878452
--- /dev/null
+++ b/app/assets/javascripts/search/topbar/components/search_type_indicator.vue
@@ -0,0 +1,115 @@
+<script>
+// eslint-disable-next-line no-restricted-imports
+import { mapState } from 'vuex';
+import { GlSprintf, GlLink, GlTooltipDirective } from '@gitlab/ui';
+import { s__, __ } from '~/locale';
+import { helpPagePath } from '~/helpers/help_page_helper';
+import {
+ ZOEKT_SEARCH_TYPE,
+ ADVANCED_SEARCH_TYPE,
+ BASIC_SEARCH_TYPE,
+} from '~/search/store/constants';
+import {
+ ZOEKT_HELP_PAGE,
+ ADVANCED_SEARCH_HELP_PAGE,
+ ADVANCED_SEARCH_SYNTAX_HELP_ANCHOR,
+ ZOEKT_HELP_PAGE_SYNTAX_ANCHOR,
+} from '../constants';
+
+export default {
+ name: 'SearchTypeIndicator',
+ directives: {
+ GlTooltip: GlTooltipDirective,
+ },
+ i18n: {
+ zoekt_enabled: s__(
+ 'GlobalSearch|%{linkStart}Exact code search (powered by Zoekt)%{linkEnd} is enabled',
+ ),
+ zoekt_disabled: s__(
+ 'GlobalSearch|%{linkStart}Exact code search (powered by Zoekt)%{linkEnd} is disabled since %{ref_elem} is not the default branch. %{docs_link}',
+ ),
+ advanced_enabled: __('%{linkStart}Advanced search%{linkEnd} is enabled.'),
+ advanced_disabled: __(
+ '%{linkStart}Exact code search (powered by Zoekt)%{linkEnd} is disabled since %{ref_elem} is not the default branch. %{docs_link}',
+ ),
+ more: __('Learn more.'),
+ },
+ components: {
+ GlSprintf,
+ GlLink,
+ },
+ computed: {
+ ...mapState(['searchType', 'defaultBranchName', 'query']),
+ zoektHelpUrl() {
+ return helpPagePath(ZOEKT_HELP_PAGE);
+ },
+ zoektSyntaxHelpUrl() {
+ return helpPagePath(ZOEKT_HELP_PAGE, {
+ anchor: ZOEKT_HELP_PAGE_SYNTAX_ANCHOR,
+ });
+ },
+ advancedSearchHelpUrl() {
+ return helpPagePath(ADVANCED_SEARCH_HELP_PAGE);
+ },
+ advancedSearchSyntaxHelpUrl() {
+ return helpPagePath(ADVANCED_SEARCH_HELP_PAGE, {
+ anchor: ADVANCED_SEARCH_SYNTAX_HELP_ANCHOR,
+ });
+ },
+ isZoekt() {
+ return this.searchType === ZOEKT_SEARCH_TYPE;
+ },
+ isAdvancedSearch() {
+ return this.searchType === ADVANCED_SEARCH_TYPE;
+ },
+ isEnabled() {
+ return !this.query.repository_ref || this.query.repository_ref === this.defaultBranchName;
+ },
+ isBasicSearch() {
+ return this.searchType === BASIC_SEARCH_TYPE;
+ },
+ disabledMessage() {
+ return this.isZoekt
+ ? this.$options.i18n.zoekt_disabled
+ : this.$options.i18n.advanced_disabled;
+ },
+ helpUrl() {
+ return this.isZoekt ? this.zoektHelpUrl : this.advancedSearchHelpUrl;
+ },
+ enabledMessage() {
+ return this.isZoekt ? this.$options.i18n.zoekt_enabled : this.$options.i18n.advanced_enabled;
+ },
+ syntaxHelpUrl() {
+ return this.isZoekt ? this.zoektSyntaxHelpUrl : this.advancedSearchSyntaxHelpUrl;
+ },
+ },
+};
+</script>
+
+<template>
+ <div class="gl-text-gray-600">
+ <div v-if="isBasicSearch" data-testid="basic">&nbsp;</div>
+ <div v-else-if="isEnabled" :data-testid="`${searchType}-enabled`">
+ <gl-sprintf :message="enabledMessage">
+ <template #link="{ content }">
+ <gl-link :href="helpUrl" target="_blank" data-testid="docs-link">{{ content }} </gl-link>
+ </template>
+ </gl-sprintf>
+ </div>
+ <div v-else :data-testid="`${searchType}-disabled`">
+ <gl-sprintf :message="disabledMessage">
+ <template #link="{ content }">
+ <gl-link :href="helpUrl" target="_blank" data-testid="docs-link">{{ content }} </gl-link>
+ </template>
+ <template #ref_elem>
+ <code v-gl-tooltip :title="query.repository_ref">{{ query.repository_ref }}</code>
+ </template>
+ <template #docs_link>
+ <gl-link :href="syntaxHelpUrl" target="_blank" data-testid="syntax-docs-link"
+ >{{ $options.i18n.more }}
+ </gl-link>
+ </template>
+ </gl-sprintf>
+ </div>
+ </div>
+</template>
diff --git a/app/assets/javascripts/search/topbar/constants.js b/app/assets/javascripts/search/topbar/constants.js
index 1ad40fbe3db..279f315f89f 100644
--- a/app/assets/javascripts/search/topbar/constants.js
+++ b/app/assets/javascripts/search/topbar/constants.js
@@ -22,3 +22,9 @@ export const PROJECT_DATA = {
export const SYNTAX_OPTIONS_ADVANCED_DOCUMENT = 'drawers/drawers/advanced_search_syntax.md';
export const SYNTAX_OPTIONS_ZOEKT_DOCUMENT = 'drawers/drawers/exact_code_search_syntax.md';
+
+export const ZOEKT_HELP_PAGE = 'user/search/exact_code_search';
+export const ADVANCED_SEARCH_HELP_PAGE = 'user/search/advanced_search';
+
+export const ADVANCED_SEARCH_SYNTAX_HELP_ANCHOR = 'use-the-advanced-search-syntax';
+export const ZOEKT_HELP_PAGE_SYNTAX_ANCHOR = 'syntax';
diff --git a/app/assets/javascripts/search/topbar/index.js b/app/assets/javascripts/search/topbar/index.js
index aad7445ebdc..95e15afd597 100644
--- a/app/assets/javascripts/search/topbar/index.js
+++ b/app/assets/javascripts/search/topbar/index.js
@@ -11,7 +11,7 @@ export const initTopbar = (store) => {
return false;
}
- const { groupInitialJson, projectInitialJson, defaultBranchName } = el.dataset;
+ const { groupInitialJson, projectInitialJson } = el.dataset;
const groupInitialJsonParsed = JSON.parse(groupInitialJson);
const projectInitialJsonParsed = JSON.parse(projectInitialJson);
@@ -24,7 +24,6 @@ export const initTopbar = (store) => {
props: {
groupInitialJson: groupInitialJsonParsed,
projectInitialJson: projectInitialJsonParsed,
- defaultBranchName,
},
});
},
diff --git a/app/models/integrations/irker.rb b/app/models/integrations/irker.rb
index a1ce0877957..f441ef25015 100644
--- a/app/models/integrations/irker.rb
+++ b/app/models/integrations/irker.rb
@@ -89,16 +89,18 @@ module Integrations
def execute(data)
return unless supported_events.include?(data[:object_kind])
+ serialized_data = data.deep_stringify_keys
+
Integrations::IrkerWorker.perform_async(
project_id, channels,
- colorize_messages, data, settings
+ colorize_messages, serialized_data, settings
)
end
def settings
{
- server_host: server_host.presence || 'localhost',
- server_port: server_port.presence || 6659
+ 'server_host' => server_host.presence || 'localhost',
+ 'server_port' => server_port.presence || 6659
}
end
diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml
index 55d7a4ed041..4ddeca64c7d 100644
--- a/app/views/search/show.html.haml
+++ b/app/views/search/show.html.haml
@@ -16,9 +16,6 @@
- page_description(_("%{count} %{scope} for term '%{term}'") % { count: @search_results.formatted_count(@scope), scope: @scope, term: @search_term })
- page_card_attributes("Namespace" => @group&.full_path, "Project" => @project&.full_path)
-.gl-display-flex.gl-flex-wrap.gl-justify-content-end.gl-pt-6.gl-pb-5
- = render_if_exists 'search/form_elasticsearch'
-
#js-search-topbar{ data: { "group-initial-json": group_attributes.to_json, "project-initial-json": project_attributes.to_json, "default-branch-name": @project&.default_branch } }
.results.gl-lg-display-flex.gl-mt-0
#js-search-sidebar{ data: { navigation_json: search_navigation_json, search_type: search_service.search_type } }
diff --git a/doc/api/packages.md b/doc/api/packages.md
index 7c8dfeb8710..80ba5480c6e 100644
--- a/doc/api/packages.md
+++ b/doc/api/packages.md
@@ -263,7 +263,7 @@ GET /projects/:id/packages/:package_id/package_files
| `package_id` | integer | yes | ID of a package. |
```shell
-curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages/4/package_files"
+curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages/:package_id/package_files"
```
Example response:
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index 9abf6ed88ee..d6b2aeb207c 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -725,8 +725,11 @@ In this example:
**Additional details**:
-- If an input uses both `default` and [`options`](#specinputsoptions), the default value
- must be one of the listed options. If not, the pipeline fails with a validation error.
+- The pipeline fails with a validation error when the input:
+ - Uses both `default` and [`options`](#specinputsoptions), but the default value
+ is not one of the listed options.
+ - Uses both `default` and `regex`, but the default value does not match the regular expression.
+ - Value does not match the [`type`](#specinputstype).
##### `spec:inputs:description`
@@ -786,8 +789,42 @@ In this example:
**Additional details**:
-- If an input uses both [`default`](#specinputsdefault) and `options`, the default value
- must be one of the listed options. If not, the pipeline fails with a validation error.
+- The pipeline fails with a validation error when:
+ - The input uses both `options` and [`default`](#specinputsdefault), but the default value
+ is not one of the listed options.
+ - Any of the input options do not match the [`type`](#specinputstype), which can
+ be either `string` or `number`, but not `boolean` when using `options`.
+
+##### `spec:inputs:regex`
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/410836) in GitLab 16.5.
+
+Use `spec:inputs:regex` to specify a regular expression that the input must match.
+
+**Keyword type**: Header keyword. `specs` must be declared at the top of the configuration file,
+in a header section.
+
+**Possible inputs**: Must be a regular expression that starts and ends with the `/` character.
+
+**Example of `spec:inputs:regex`**:
+
+```yaml
+spec:
+ inputs:
+ version:
+ regex: /^v\d\.\d+(\.\d+)$/
+---
+
+# The pipeline configuration would follow...
+```
+
+In this example, inputs of `v1.0` or `v1.2.3` match the regular expression and pass validation.
+An input of `v1.A.B` does not match the regular expression and fails validation.
+
+**Additional details**:
+
+- `inputs:regex` can only be used with a [`type`](#specinputstype) of `string`,
+ not `number` or `boolean`.
##### `spec:inputs:type`
diff --git a/doc/ci/yaml/inputs.md b/doc/ci/yaml/inputs.md
index 089d6bc5b62..d32b949495c 100644
--- a/doc/ci/yaml/inputs.md
+++ b/doc/ci/yaml/inputs.md
@@ -11,17 +11,14 @@ info: To determine the technical writer assigned to the Stage/Group associated w
## Define input parameters with `spec:inputs`
-> - `description` keyword [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/415637) in GitLab 16.5.
-> - `options` keyword [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/393401) in GitLab 16.6.
-
Use `spec:inputs` to define input parameters for CI/CD configuration intended to be added
to a pipeline with `include`. Use [`include:inputs`](#set-input-values-when-using-include)
-to define the values to use when the pipeline runs.
+to pass input values when building the configuration for a pipeline.
The specs must be declared at the top of the configuration file, in a header section.
Separate the header from the rest of the configuration with `---`.
-Use the interpolation format `$[[ input.input-id ]]` to reference the values outside of the header section.
+Use the interpolation format `$[[ inputs.input-id ]]` outside the header section to replace the values.
The inputs are evaluated and interpolated when the configuration is fetched during pipeline creation, but before the
configuration is merged with the contents of the `.gitlab-ci.yml` file.
@@ -42,9 +39,9 @@ scan-website:
When using `spec:inputs`:
- Inputs are mandatory by default.
-- Inputs must be strings by default.
-- A string containing an interpolation block must not exceed 1 MB.
-- The string inside an interpolation block must not exceed 1 KB.
+- Validation errors are returned if:
+ - A string containing an interpolation block exceeds 1 MB.
+ - The string inside an interpolation block exceeds 1 KB.
Additionally, use:
@@ -55,8 +52,53 @@ Additionally, use:
understand the input details or expected values.
- [`spec:inputs:options`](index.md#specinputsoptions) to specify a list of allowed values
for an input.
+- [`spec:inputs:regex`](index.md#specinputsoptions) to specify a regular expression
+ that the input must match.
- [`spec:inputs:type`](index.md#specinputstype) to force a specific input type, which
- can be `string` (the default type), `number`, or `boolean`.
+ can be `string` (default when not specified), `number`, or `boolean`.
+
+### Define inputs with multiple parameters
+
+You can define multiple inputs per CI/CD configuration file, and each input can have
+multiple configuration parameters.
+
+For example, in a file named `scan-website-job.yml`:
+
+```yaml
+spec:
+ inputs:
+ job-prefix: # Mandatory string input
+ description: "Define a prefix for the job name"
+ job-stage: # Optional string input with a default value when not provided
+ default: test
+ environment: # Mandatory input that must match one of the options
+ options: ['test', 'staging', 'production']
+ concurrency:
+ type: number # Optional numeric input with a default value when not provided
+ default: 1
+ version: # Mandatory string input that must match the regular expression
+ type: string
+ regex: /^v\d\.\d+(\.\d+)$/
+ export_results: # Optional boolean input with a default value when not provided
+ type: boolean
+ default: true
+---
+
+"$[[ job-prefix ]]-scan-website":
+ stage: $[[ inputs.job-stage ]]
+ script:
+ - echo "scanning website -e $[[ inputs.environment ]] -c $[[ inputs.concurrency ]] -v $[[ inputs.version ]]"
+ - if [ $[[ inputs.export_results ]] ]; then echo "export results"; fi
+```
+
+In this example:
+
+- `job-prefix` is a mandatory string input and must be defined.
+- `job-stage` is optional. If not defined, the value is `test`.
+- `environment` is a mandatory string input that must match one of the defined options.
+- `concurrency` is an optional numeric input. When not specified, it defaults to `1`.
+- `version` is a mandatory string input that must match the specified regular expression.
+- `export_results` is an optional boolean input. When not specified, it defaults to `true`.
## Set input values when using `include`
@@ -65,29 +107,29 @@ Additionally, use:
Use [`include:inputs`](index.md#includeinputs) to set the values for the parameters
when the included configuration is added to the pipeline.
-For example, to include a `custom_website_scan.yml` that has the same specs
-as the [example above](#define-input-parameters-with-specinputs):
+For example, to include the `scan-website-job.yml` in the [example above](#define-inputs-with-multiple-parameters):
```yaml
include:
- - local: 'custom_website_scan.yml'
+ - local: 'scan-website-job.yml'
inputs:
- job-stage: post-deploy
- environment: production
-
-stages:
- - build
- - test
- - deploy
- - post-deploy
-
-# The pipeline configuration would follow...
+ job-prefix: 'some-service-'
+ environment: 'staging'
+ concurrency: 2
+ version: 'v1.3.2'
+ export_results: false
```
-In this example, the included configuration is added with:
+In this example, the inputs for the included configuration are:
-- `job-stage` set to `post-deploy`, so the included job runs in the custom `post-deploy` stage.
-- `environment` set to `production`, so the included job runs for the production environment.
+| Input | Value | Details |
+|------------------|-----------------|---------|
+| `job-prefix` | `some-service-` | Must be explicitly defined. |
+| `job-stage` | `test` | Not defined in `include:inputs`, so the value comes from `spec:inputs:default` in the included configuration. |
+| `environment` | `staging` | Must be explicitly defined, and must match one of the values in `spec:inputs:options` in the included configuration. |
+| `concurrency` | `2` | Must be a numeric value to match the `spec:inputs:type` set to `number` in the included configuration. Overrides the default value. |
+| `version` | `v1.3.2` | Must be explicitly defined, and must match the regular expression in the `spec:inputs:regex` in the included configuration. |
+| `export_results` | `false` | Must be either `true` or `false` to match the `spec:inputs:type` set to `boolean` in the included configuration. Overrides the default value. |
### Use `include:inputs` with multiple files
@@ -96,7 +138,7 @@ For example:
```yaml
include:
- - component: gitlab.com/org/my-component@1.0
+ - component: gitlab.com/the-namespace/the-project/the-component@1.0
inputs:
stage: my-stage
- local: path/to/file.yml
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 8a22c3c3280..670aee863a2 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -707,12 +707,6 @@ msgstr ""
msgid "%{description}- Sentry event: %{errorUrl}- First seen: %{firstSeen}- Last seen: %{lastSeen} %{countLabel}: %{count}%{userCountLabel}: %{userCount}"
msgstr ""
-msgid "%{doc_link_start}Advanced search%{doc_link_end} is disabled since %{ref_elem} is not the default branch. %{docs_link}"
-msgstr ""
-
-msgid "%{doc_link_start}Advanced search%{doc_link_end} is enabled."
-msgstr ""
-
msgid "%{docs_link_start}Learn about visibility levels.%{docs_link_end}"
msgstr ""
@@ -923,6 +917,12 @@ msgstr ""
msgid "%{linkStart}%{linkEnd} review summary"
msgstr ""
+msgid "%{linkStart}Advanced search%{linkEnd} is enabled."
+msgstr ""
+
+msgid "%{linkStart}Exact code search (powered by Zoekt)%{linkEnd} is disabled since %{ref_elem} is not the default branch. %{docs_link}"
+msgstr ""
+
msgid "%{listToShow}, and %{awardsListLength} more"
msgstr ""
@@ -22303,7 +22303,10 @@ msgstr ""
msgid "GlobalSearch|%{count} default results provided. Use the up and down arrow keys to navigate search results list."
msgstr ""
-msgid "GlobalSearch|%{link_start}Exact code search (powered by Zoekt)%{link_end} is enabled"
+msgid "GlobalSearch|%{linkStart}Exact code search (powered by Zoekt)%{linkEnd} is disabled since %{ref_elem} is not the default branch. %{docs_link}"
+msgstr ""
+
+msgid "GlobalSearch|%{linkStart}Exact code search (powered by Zoekt)%{linkEnd} is enabled"
msgstr ""
msgid "GlobalSearch|Aggregations load error."
@@ -42070,6 +42073,9 @@ msgstr ""
msgid "Saving project."
msgstr ""
+msgid "ScanExecutionPolicy|%{boldStart}Run%{boldEnd} %{typeSelector} %{tooltip}"
+msgstr ""
+
msgid "ScanExecutionPolicy|%{hostname}'s timezone"
msgstr ""
@@ -42091,6 +42097,9 @@ msgstr ""
msgid "ScanExecutionPolicy|Add new CI variable"
msgstr ""
+msgid "ScanExecutionPolicy|Choose a method to execute code"
+msgstr ""
+
msgid "ScanExecutionPolicy|Conditions"
msgstr ""
@@ -42112,12 +42121,24 @@ msgstr ""
msgid "ScanExecutionPolicy|DAST site profiles"
msgstr ""
+msgid "ScanExecutionPolicy|Execute a YAML code block"
+msgstr ""
+
+msgid "ScanExecutionPolicy|If there are any conflicting variables with the local pipeline configuration (Ex, gitlab-ci.yml) then variables defined here will take precedence. %{linkStart}Learn more%{linkEnd}."
+msgstr ""
+
+msgid "ScanExecutionPolicy|Inserted CI code block"
+msgstr ""
+
msgid "ScanExecutionPolicy|Key"
msgstr ""
msgid "ScanExecutionPolicy|Kubernetes agent's timezone"
msgstr ""
+msgid "ScanExecutionPolicy|Linked existing CI file"
+msgstr ""
+
msgid "ScanExecutionPolicy|Maximum number of CI-criteria is one"
msgstr ""
@@ -42127,6 +42148,9 @@ msgstr ""
msgid "ScanExecutionPolicy|Run a %{scan} scan with the following options:"
msgstr ""
+msgid "ScanExecutionPolicy|Run a scan"
+msgstr ""
+
msgid "ScanExecutionPolicy|Runner tags:"
msgstr ""
@@ -43001,6 +43025,9 @@ msgstr ""
msgid "SecurityOrchestration|Add action"
msgstr ""
+msgid "SecurityOrchestration|Add new action"
+msgstr ""
+
msgid "SecurityOrchestration|Add new approver"
msgstr ""
@@ -43058,6 +43085,9 @@ msgstr ""
msgid "SecurityOrchestration|Choose a project"
msgstr ""
+msgid "SecurityOrchestration|Choose an action"
+msgstr ""
+
msgid "SecurityOrchestration|Choose approver type"
msgstr ""
diff --git a/package.json b/package.json
index ed6b7b715e9..cc843c20de7 100644
--- a/package.json
+++ b/package.json
@@ -190,7 +190,7 @@
"remark-rehype": "^10.1.0",
"scrollparent": "^2.0.1",
"semver": "^7.3.4",
- "sentrybrowser": "npm:@sentry/browser@7.80.0",
+ "sentrybrowser": "npm:@sentry/browser@7.80.1",
"sentrybrowser5": "npm:@sentry/browser@5.30.0",
"sortablejs": "^1.10.2",
"string-hash": "1.1.3",
diff --git a/spec/frontend/search/topbar/components/app_spec.js b/spec/frontend/search/topbar/components/app_spec.js
index 9704277c86b..33287892c3d 100644
--- a/spec/frontend/search/topbar/components/app_spec.js
+++ b/spec/frontend/search/topbar/components/app_spec.js
@@ -9,6 +9,8 @@ import GlobalSearchTopbar from '~/search/topbar/components/app.vue';
import GroupFilter from '~/search/topbar/components/group_filter.vue';
import ProjectFilter from '~/search/topbar/components/project_filter.vue';
import MarkdownDrawer from '~/vue_shared/components/markdown_drawer/markdown_drawer.vue';
+import SearchTypeIndicator from '~/search/topbar/components/search_type_indicator.vue';
+
import {
SYNTAX_OPTIONS_ADVANCED_DOCUMENT,
SYNTAX_OPTIONS_ZOEKT_DOCUMENT,
@@ -46,16 +48,19 @@ describe('GlobalSearchTopbar', () => {
const findProjectFilter = () => wrapper.findComponent(ProjectFilter);
const findSyntaxOptionButton = () => wrapper.findComponent(GlButton);
const findSyntaxOptionDrawer = () => wrapper.findComponent(MarkdownDrawer);
+ const findSearchTypeIndicator = () => wrapper.findComponent(SearchTypeIndicator);
describe('template', () => {
beforeEach(() => {
createComponent();
});
- describe('Search box', () => {
- it('renders always', () => {
- expect(findGlSearchBox().exists()).toBe(true);
- });
+ it('always renders Search box', () => {
+ expect(findGlSearchBox().exists()).toBe(true);
+ });
+
+ it('always renders Search indicator', () => {
+ expect(findSearchTypeIndicator().exists()).toBe(true);
});
describe.each`
diff --git a/spec/frontend/search/topbar/components/search_type_indicator_spec.js b/spec/frontend/search/topbar/components/search_type_indicator_spec.js
new file mode 100644
index 00000000000..91af062aa97
--- /dev/null
+++ b/spec/frontend/search/topbar/components/search_type_indicator_spec.js
@@ -0,0 +1,120 @@
+import Vue from 'vue';
+// eslint-disable-next-line no-restricted-imports
+import Vuex from 'vuex';
+import { GlSprintf } from '@gitlab/ui';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
+import { MOCK_QUERY } from 'jest/search/mock_data';
+import SearchTypeIndicator from '~/search/topbar/components/search_type_indicator.vue';
+
+Vue.use(Vuex);
+
+describe('SearchTypeIndicator', () => {
+ let wrapper;
+
+ const actionSpies = {
+ applyQuery: jest.fn(),
+ setQuery: jest.fn(),
+ preloadStoredFrequentItems: jest.fn(),
+ };
+
+ const createComponent = (initialState = {}, defaultBranchName = '') => {
+ const store = new Vuex.Store({
+ state: {
+ query: MOCK_QUERY,
+ ...initialState,
+ },
+ actions: actionSpies,
+ });
+
+ wrapper = shallowMountExtended(SearchTypeIndicator, {
+ store,
+ propsData: { defaultBranchName },
+ stubs: {
+ GlSprintf,
+ },
+ });
+ };
+
+ const findIndicator = (id) => wrapper.findAllByTestId(id);
+ const findDocsLink = () => wrapper.findComponentByTestId('docs-link');
+ const findSyntaxDocsLink = () => wrapper.findComponentByTestId('syntax-docs-link');
+
+ describe.each`
+ searchType | repository | showSearchTypeIndicator
+ ${'advanced'} | ${'master'} | ${'advanced-enabled'}
+ ${'advanced'} | ${'v0.1'} | ${'advanced-disabled'}
+ ${'zoekt'} | ${'master'} | ${'zoekt-enabled'}
+ ${'zoekt'} | ${'v0.1'} | ${'zoekt-disabled'}
+ `(
+ 'search type indicator for $searchType',
+ ({ searchType, repository, showSearchTypeIndicator }) => {
+ beforeEach(() => {
+ createComponent({
+ query: { repository_ref: repository },
+ searchType,
+ defaultBranchName: 'master',
+ });
+ });
+ it('renders correctly', () => {
+ expect(findIndicator(showSearchTypeIndicator).exists()).toBe(true);
+ });
+ },
+ );
+
+ describe.each`
+ searchType | repository | showSearchTypeIndicator
+ ${'basic'} | ${'master'} | ${true}
+ ${'basic'} | ${'v0.1'} | ${true}
+ `(
+ 'search type indicator for $searchType and $repository',
+ ({ searchType, repository, showSearchTypeIndicator }) => {
+ beforeEach(() => {
+ createComponent({
+ query: { repository_ref: repository },
+ searchType,
+ defaultBranchName: 'master',
+ });
+ });
+ it.each(['zoekt-enabled', 'zoekt-disabled', 'advanced-enabled', 'advanced-disabled'])(
+ 'renders correct indicator %s',
+ () => {
+ expect(findIndicator(searchType).exists()).toBe(showSearchTypeIndicator);
+ },
+ );
+ },
+ );
+
+ describe.each`
+ searchType | docsLink
+ ${'advanced'} | ${'/help/user/search/advanced_search'}
+ ${'zoekt'} | ${'/help/user/search/exact_code_search'}
+ `('documentation link for $searchType', ({ searchType, docsLink }) => {
+ beforeEach(() => {
+ createComponent({
+ query: { repository_ref: 'master' },
+ searchType,
+ defaultBranchName: 'master',
+ });
+ });
+ it('has correct link', () => {
+ expect(findDocsLink().attributes('href')).toBe(docsLink);
+ });
+ });
+
+ describe.each`
+ searchType | syntaxdocsLink
+ ${'advanced'} | ${'/help/user/search/advanced_search#use-the-advanced-search-syntax'}
+ ${'zoekt'} | ${'/help/user/search/exact_code_search#syntax'}
+ `('Syntax documentation $searchType', ({ searchType, syntaxdocsLink }) => {
+ beforeEach(() => {
+ createComponent({
+ query: { repository_ref: '000' },
+ searchType,
+ defaultBranchName: 'master',
+ });
+ });
+ it('has correct link', () => {
+ expect(findSyntaxDocsLink().attributes('href')).toBe(syntaxdocsLink);
+ });
+ });
+});
diff --git a/spec/models/integrations/irker_spec.rb b/spec/models/integrations/irker_spec.rb
index e98b8b54e03..2a733e67a3c 100644
--- a/spec/models/integrations/irker_spec.rb
+++ b/spec/models/integrations/irker_spec.rb
@@ -5,7 +5,7 @@ require 'socket'
require 'timeout'
require 'json'
-RSpec.describe Integrations::Irker do
+RSpec.describe Integrations::Irker, feature_category: :integrations do
describe 'Validations' do
context 'when integration is active' do
before do
@@ -30,10 +30,7 @@ RSpec.describe Integrations::Irker do
let(:irker) { described_class.new }
let(:irker_server) { TCPServer.new('localhost', 0) }
- let(:sample_data) do
- Gitlab::DataBuilder::Push.build_sample(project, user)
- end
-
+ let(:sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) }
let(:recipients) { '#commits irc://test.net/#test ftp://bad' }
let(:colorize_messages) { '1' }
@@ -58,7 +55,7 @@ RSpec.describe Integrations::Irker do
it 'sends valid JSON messages to an Irker listener', :sidekiq_might_not_need_inline do
expect(Integrations::IrkerWorker).to receive(:perform_async)
- .with(project.id, irker.channels, colorize_messages, sample_data, irker.settings)
+ .with(project.id, irker.channels, colorize_messages, sample_data.deep_stringify_keys, irker.settings)
.and_call_original
irker.execute(sample_data)
diff --git a/yarn.lock b/yarn.lock
index f799dd15a07..304985f52e6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1913,14 +1913,14 @@
estree-walker "^2.0.2"
picomatch "^2.3.1"
-"@sentry-internal/tracing@7.80.0":
- version "7.80.0"
- resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.80.0.tgz#f9a6c0456b3cbf4a53c986a0b9208572d80e0756"
- integrity sha512-P1Ab9gamHLsbH9D82i1HY8xfq9dP8runvc4g50AAd6OXRKaJ45f2KGRZUmnMEVqBQ7YoPYp2LFMkrhNYbcZEoQ==
+"@sentry-internal/tracing@7.80.1":
+ version "7.80.1"
+ resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.80.1.tgz#b0e993265aa75743787d84e6c0655ed17e4bac0f"
+ integrity sha512-5gZ4LPIj2vpQl2/dHBM4uXMi9OI5E0VlOhJQt0foiuN6JJeiOjdpJFcfVqJk69wrc0deVENTtgKKktxqMwVeWQ==
dependencies:
- "@sentry/core" "7.80.0"
- "@sentry/types" "7.80.0"
- "@sentry/utils" "7.80.0"
+ "@sentry/core" "7.80.1"
+ "@sentry/types" "7.80.1"
+ "@sentry/utils" "7.80.1"
"@sentry/core@5.30.0":
version "5.30.0"
@@ -1933,13 +1933,13 @@
"@sentry/utils" "5.30.0"
tslib "^1.9.3"
-"@sentry/core@7.80.0":
- version "7.80.0"
- resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.80.0.tgz#7b8a460c19160b81ade20080333189f1a80c1410"
- integrity sha512-nJiiymdTSEyI035/rdD3VOq6FlOZ2wWLR5bit9LK8a3rzHU3UXkwScvEo6zYgs0Xp1sC0yu1S9+0BEiYkmi29A==
+"@sentry/core@7.80.1":
+ version "7.80.1"
+ resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.80.1.tgz#ccb85e15495bf0c8b142ca1713408c64e38c9f4c"
+ integrity sha512-3Yh+O9Q86MxwIuJFYtuSSoUCpdx99P1xDAqL0FIPTJ+ekaVMiUJq9NmyaNh9uN2myPSmxvEXW6q3z37zta9ZHg==
dependencies:
- "@sentry/types" "7.80.0"
- "@sentry/utils" "7.80.0"
+ "@sentry/types" "7.80.1"
+ "@sentry/utils" "7.80.1"
"@sentry/hub@5.30.0":
version "5.30.0"
@@ -1959,25 +1959,25 @@
"@sentry/types" "5.30.0"
tslib "^1.9.3"
-"@sentry/replay@7.80.0":
- version "7.80.0"
- resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.80.0.tgz#0626d85af1d8573038d52ae9e244e3e95fa47385"
- integrity sha512-wWnpuJq3OaDLp1LutE4oxWXnau04fvwuzBjuaFvOXOV+pB/kn+pDPuVOC5+FH/RMRZ5ftwX5+dF6fojfcLVGCg==
+"@sentry/replay@7.80.1":
+ version "7.80.1"
+ resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.80.1.tgz#1f47d3e52bfd0ad531f3032ae1eda8528c947c44"
+ integrity sha512-yjpftIyybQeWD2i0Nd7C96tZwjNbSMRW515EL9jwlNxYbQtGtMs0HavP9Y7uQvQrzwSHY0Wp+ooe9PMuvzqbHw==
dependencies:
- "@sentry-internal/tracing" "7.80.0"
- "@sentry/core" "7.80.0"
- "@sentry/types" "7.80.0"
- "@sentry/utils" "7.80.0"
+ "@sentry-internal/tracing" "7.80.1"
+ "@sentry/core" "7.80.1"
+ "@sentry/types" "7.80.1"
+ "@sentry/utils" "7.80.1"
"@sentry/types@5.30.0":
version "5.30.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402"
integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==
-"@sentry/types@7.80.0":
- version "7.80.0"
- resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.80.0.tgz#f6896de2d231a7f8d814cf1c981c474240e96d8a"
- integrity sha512-4bpMO+2jWiWLDa8zbTASWWNLWe6yhjfPsa7/6VH5y9x1NGtL8oRbqUsTgsvjF3nmeHEMkHQsC8NHPaQ/ibFmZQ==
+"@sentry/types@7.80.1":
+ version "7.80.1"
+ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.80.1.tgz#dc720d6f2da0b510d586814451a04a2cdd2f4a9d"
+ integrity sha512-CVu4uPVTOI3U9kYiOdA085R7jX5H1oVODbs9y+A8opJ0dtJTMueCXgZyE8oXQ0NjGVs6HEeaLkOuiV0mj8X3yw==
"@sentry/utils@5.30.0":
version "5.30.0"
@@ -1987,12 +1987,12 @@
"@sentry/types" "5.30.0"
tslib "^1.9.3"
-"@sentry/utils@7.80.0":
- version "7.80.0"
- resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.80.0.tgz#5bd682fa9a382eea952d4fa3628f0f33e4240ff3"
- integrity sha512-XbBCEl6uLvE50ftKwrEo6XWdDaZXHXu+kkHXTPWQEcnbvfZKLuG9V0Hxtxxq3xQgyWmuF05OH1GcqYqiO+v5Yg==
+"@sentry/utils@7.80.1":
+ version "7.80.1"
+ resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.80.1.tgz#1c719f41b4d2c818363551fc40776a274b71efff"
+ integrity sha512-bfFm2e/nEn+b9++QwjNEYCbS7EqmteT8uf0XUs7PljusSimIqqxDtK1pfD9zjynPgC8kW/fVBKv0pe2LufomeA==
dependencies:
- "@sentry/types" "7.80.0"
+ "@sentry/types" "7.80.1"
"@sinclair/typebox@^0.24.1":
version "0.24.40"
@@ -11775,16 +11775,16 @@ send@0.17.2:
"@sentry/utils" "5.30.0"
tslib "^1.9.3"
-"sentrybrowser@npm:@sentry/browser@7.80.0":
- version "7.80.0"
- resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.80.0.tgz#385fb59ac1d52b67919087f3d7044575ae0abbdd"
- integrity sha512-Ngwjc+yyf/aH5q7iQM1LeDNlhM1Ilt4ZLUogTghZR/guwNWmCtk3OHcjOLz7fxBBj9wGFUc2pHPyeYM6bQhrEw==
+"sentrybrowser@npm:@sentry/browser@7.80.1":
+ version "7.80.1"
+ resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.80.1.tgz#3e63a122846a4d5dec04237b97ae064b80546da4"
+ integrity sha512-1dPR6vPJ9vOTzgXff9HGheb178XeEv5hyjBNhCO1f6rjCgnVj99XGNZIgO1Ee1ALJbqlfPWaeV+uSWbbcmgJMA==
dependencies:
- "@sentry-internal/tracing" "7.80.0"
- "@sentry/core" "7.80.0"
- "@sentry/replay" "7.80.0"
- "@sentry/types" "7.80.0"
- "@sentry/utils" "7.80.0"
+ "@sentry-internal/tracing" "7.80.1"
+ "@sentry/core" "7.80.1"
+ "@sentry/replay" "7.80.1"
+ "@sentry/types" "7.80.1"
+ "@sentry/utils" "7.80.1"
serialize-javascript@^2.1.2:
version "2.1.2"