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
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/administration/environment_variables.md7
-rw-r--r--doc/administration/external_pipeline_validation.md21
-rw-r--r--doc/api/graphql/reference/index.md1
-rw-r--r--doc/development/cicd/index.md14
-rw-r--r--doc/development/testing_guide/frontend_testing.md59
5 files changed, 70 insertions, 32 deletions
diff --git a/doc/administration/environment_variables.md b/doc/administration/environment_variables.md
index f886e19b13d..a168584e754 100644
--- a/doc/administration/environment_variables.md
+++ b/doc/administration/environment_variables.md
@@ -21,6 +21,9 @@ You can use the following environment variables to override certain values:
|--------------------------------------------|---------|---------------------------------------------------------------------------------------------------------|
| `DATABASE_URL` | string | The database URL; is of the form: `postgresql://localhost/blog_development`. |
| `ENABLE_BOOTSNAP` | string | Enables Bootsnap for speeding up initial Rails boot (`1` to enable). |
+| `EXTERNAL_VALIDATION_SERVICE_TIMEOUT` | integer | Timeout, in seconds, for an [external CI/CD pipeline validation service](external_pipeline_validation.md). Default is `5`. |
+| `EXTERNAL_VALIDATION_SERVICE_URL` | string | URL to an [external CI/CD pipeline validation service](external_pipeline_validation.md). |
+| `EXTERNAL_VALIDATION_SERVICE_TOKEN` | string | The `X-Gitlab-Token` for authentication with an [external CI/CD pipeline validation service](external_pipeline_validation.md). |
| `GITLAB_CDN_HOST` | string | Sets the base URL for a CDN to serve static assets (for example, `//mycdnsubdomain.fictional-cdn.com`). |
| `GITLAB_EMAIL_DISPLAY_NAME` | string | The name used in the **From** field in emails sent by GitLab. |
| `GITLAB_EMAIL_FROM` | string | The email address used in the **From** field in emails sent by GitLab. |
@@ -29,8 +32,8 @@ You can use the following environment variables to override certain values:
| `GITLAB_HOST` | string | The full URL of the GitLab server (including `http://` or `https://`). |
| `GITLAB_ROOT_PASSWORD` | string | Sets the password for the `root` user on installation. |
| `GITLAB_SHARED_RUNNERS_REGISTRATION_TOKEN` | string | Sets the initial registration token used for runners. |
-| `GITLAB_UNICORN_MEMORY_MAX` | integer | The maximum memory threshold (in bytes) for the [unicorn-worker-killer](operations/unicorn.md#unicorn-worker-killer). |
-| `GITLAB_UNICORN_MEMORY_MIN` | integer | The minimum memory threshold (in bytes) for the [unicorn-worker-killer](operations/unicorn.md#unicorn-worker-killer). |
+| `GITLAB_UNICORN_MEMORY_MAX` | integer | The maximum memory threshold (in bytes) for the [unicorn-worker-killer](operations/unicorn.md#unicorn-worker-killer). |
+| `GITLAB_UNICORN_MEMORY_MIN` | integer | The minimum memory threshold (in bytes) for the [unicorn-worker-killer](operations/unicorn.md#unicorn-worker-killer). |
| `RAILS_ENV` | string | The Rails environment; can be one of `production`, `development`, `staging`, or `test`. |
| `UNSTRUCTURED_RAILS_LOG` | string | Enables the unstructured log in addition to JSON logs (defaults to `true`). |
diff --git a/doc/administration/external_pipeline_validation.md b/doc/administration/external_pipeline_validation.md
index 482ca320736..f8329b24d6c 100644
--- a/doc/administration/external_pipeline_validation.md
+++ b/doc/administration/external_pipeline_validation.md
@@ -7,7 +7,7 @@ type: reference, howto
# External Pipeline Validation
-You can use an external service for validating a pipeline before it's created.
+You can use an external service to validate a pipeline before it's created.
WARNING:
This is an experimental feature and subject to change without notice.
@@ -19,19 +19,17 @@ data as payload. GitLab then invalidates the pipeline based on the response
code. If there's an error or the request times out, the pipeline is not
invalidated.
-Response Code Legend:
+Response codes:
-- `200` - Accepted
-- `406` - Not Accepted
-- Other Codes - Accepted and Logged
+- `200`: Accepted
+- `4XX`: Not accepted
+- All other codes: accepted and logged
## Configuration
-To configure external pipeline validation:
-
-1. Set the `EXTERNAL_VALIDATION_SERVICE_URL` environment variable to the external
- service URL.
-1. Enable the `ci_external_validation_service` feature flag.
+To configure external pipeline validation, add the
+[`EXTERNAL_VALIDATION_SERVICE_URL` environment variable](environment_variables.md)
+and set it to the external service URL.
By default, requests to the external service time out after five seconds. To override
the default, set the `EXTERNAL_VALIDATION_SERVICE_TIMEOUT` environment variable to the
@@ -131,3 +129,6 @@ required number of seconds.
}
}
```
+
+The `namespace` field is only available in [GitLab Premium](https://about.gitlab.com/pricing/)
+and higher.
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index fe85d43fd14..303b8c5b574 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -1235,6 +1235,7 @@ An edge in a connection.
| `stage` | [`CiStage`](#cistage) | Stage of the job. |
| `startedAt` | [`Time`](#time) | When the job was started. |
| `status` | [`CiJobStatus`](#cijobstatus) | Status of the job. |
+| `tags` | [`[String!]`](#string) | Tags for the current job. |
### `CiJobArtifact`
diff --git a/doc/development/cicd/index.md b/doc/development/cicd/index.md
index eb2224d710a..242446590bb 100644
--- a/doc/development/cicd/index.md
+++ b/doc/development/cicd/index.md
@@ -182,3 +182,17 @@ Watch a walkthrough of this feature in details in the video below.
<figure class="video-container">
<iframe src="https://www.youtube.com/embed/NmdWRGT8kZg" frameborder="0" allowfullscreen="true"> </iframe>
</figure>
+
+## External pipeline validation service
+
+The [external CI/CD pipeline validation service](../../administration/external_pipeline_validation.md)
+is available for use on self-managed GitLab instances, but is not in use on GitLab.com.
+It is configured with [environment variables](../../administration/environment_variables.md)
+on the instance.
+
+To enable the feature on GitLab.com, enable the `ci_external_validation_service`
+[feature flag](../feature_flags/index.md). The valid "Not accepted" response code
+for GitLab.com is `406` only.
+
+For more details, see the linked issues and MRs in the
+[feature flag rollout issue](https://gitlab.com/gitlab-org/gitlab/-/issues/325982).
diff --git a/doc/development/testing_guide/frontend_testing.md b/doc/development/testing_guide/frontend_testing.md
index 78f8e320269..1842bf5e7f8 100644
--- a/doc/development/testing_guide/frontend_testing.md
+++ b/doc/development/testing_guide/frontend_testing.md
@@ -212,8 +212,8 @@ When it comes to querying DOM elements in your tests, it is best to uniquely and
the element.
Preferentially, this is done by targeting what the user actually sees using [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro/).
-When selecting by text it is best to use [`getByRole` or `findByRole`](https://testing-library.com/docs/queries/byrole/)
-as these enforce accessibility best practices as well. The examples below demonstrate the order of preference.
+When selecting by text it is best to use the [`byRole`](https://testing-library.com/docs/queries/byrole) query
+as it helps enforce accessibility best practices. `findByRole` and the other [DOM Testing Library queries](https://testing-library.com/docs/queries/about) are available when using [`shallowMountExtended` or `mountExtended`](#shallowmountextended-and-mountextended).
When writing Vue component unit tests, it can be wise to query children by component, so that the unit test can focus on comprehensive value coverage
rather than dealing with the complexity of a child component's behavior.
@@ -223,25 +223,27 @@ possible selectors include:
- A semantic attribute like `name` (also verifies that `name` was setup properly)
- A `data-testid` attribute ([recommended by maintainers of `@vue/test-utils`](https://github.com/vuejs/vue-test-utils/issues/1498#issuecomment-610133465))
- optionally combined with [`findByTestId`](#extendedwrapper-and-findbytestid)
+ optionally combined with [`shallowMountExtended` or `mountExtended`](#shallowmountextended-and-mountextended)
- a Vue `ref` (if using `@vue/test-utils`)
```javascript
-import { getByRole, getByText } from '@testing-library/dom'
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper'
+
+const wrapper = shallowMountExtended(ExampleComponent);
// In this example, `wrapper` is a `@vue/test-utils` wrapper returned from `mount` or `shallowMount`.
it('exists', () => {
// Best (especially for integration tests)
- getByRole(wrapper.element, 'link', { name: /Click Me/i })
- getByRole(wrapper.element, 'link', { name: 'Click Me' })
- getByText(wrapper.element, 'Click Me')
- getByText(wrapper.element, /Click Me/i)
+ wrapper.findByRole('link', { name: /Click Me/i })
+ wrapper.findByRole('link', { name: 'Click Me' })
+ wrapper.findByText('Click Me')
+ wrapper.findByText(/Click Me/i)
// Good (especially for unit tests)
wrapper.find(FooComponent);
wrapper.find('input[name=foo]');
wrapper.find('[data-testid="my-foo-id"]');
- wrapper.findByTestId('my-foo-id'); // with the extendedWrapper utility – check below
+ wrapper.findByTestId('my-foo-id'); // with shallowMountExtended or mountExtended – check below
wrapper.find({ ref: 'foo'});
// Bad
@@ -1138,23 +1140,40 @@ These are very useful if you don't have a handle to the request's Promise, for e
Both functions run `callback` on the next tick after the requests finish (using `setImmediate()`), to allow any `.then()` or `.catch()` handlers to run.
-### `extendedWrapper` and `findByTestId`
+### `shallowMountExtended` and `mountExtended`
-Using `data-testid` is one of the [recommended ways to query DOM elements](#how-to-query-dom-elements).
-You can use the `extendedWrapper` utility on the `wrapper` returned by `shalowMount`/`mount`.
-By doing so, the `wrapper` provides you with the ability to perform a `findByTestId`,
-which is a shortcut to the more verbose `wrapper.find('[data-testid="my-test-id"]');`
+The `shallowMountExtended` and `mountExtended` utilities provide you with the ability to perform
+any of the available [DOM Testing Library queries](https://testing-library.com/docs/queries/about)
+by prefixing them with `find` or `findAll`.
```javascript
-import { extendedWrapper } from 'helpers/vue_test_utils_helper';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
describe('FooComponent', () => {
- const wrapper = extendedWrapper(shallowMount({
- template: `<div data-testid="my-test-id"></div>`,
- }));
+ const wrapper = shallowMountExtended({
+ template: `
+ <div data-testid="gitlab-frontend-stack">
+ <p>GitLab frontend stack</p>
+ <div role="tablist">
+ <button role="tab" aria-selected="true">Vue.js</button>
+ <button role="tab" aria-selected="false">GraphQL</button>
+ <button role="tab" aria-selected="false">SCSS</button>
+ </div>
+ </div>
+ `,
+ });
+
+ it('finds elements with `findByTestId`', () => {
+ expect(wrapper.findByTestId('gitlab-frontend-stack').exists()).toBe(true);
+ });
+
+ it('finds elements with `findByText`', () => {
+ expect(wrapper.findByText('GitLab frontend stack').exists()).toBe(true);
+ expect(wrapper.findByText('TypeScript').exists()).toBe(false);
+ });
- it('exists', () => {
- expect(wrapper.findByTestId('my-test-id').exists()).toBe(true);
+ it('finds elements with `findAllByRole`', () => {
+ expect(wrapper.findAllByRole('tab').length).toBe(3);
});
});
```