diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-24 12:06:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-24 12:06:18 +0300 |
commit | dc0622dbe3cd552abca4107557c6c09edb23625c (patch) | |
tree | 224dc625a2fe70a37ea7af11b1ad539b9bee2212 /doc | |
parent | 12287a65b735d784cda3555d1b261e50b461b29e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/api_resources.md | 5 | ||||
-rw-r--r-- | doc/api/visual_review_discussions.md | 40 | ||||
-rw-r--r-- | doc/user/application_security/index.md | 38 |
3 files changed, 72 insertions, 11 deletions
diff --git a/doc/api/api_resources.md b/doc/api/api_resources.md index 232a9825691..eeb4bf6c5f2 100644 --- a/doc/api/api_resources.md +++ b/doc/api/api_resources.md @@ -24,7 +24,7 @@ The following API resources are available in the project context: | [Commits](commits.md) | `/projects/:id/repository/commits`, `/projects/:id/statuses` | | [Container Registry](container_registry.md) | `/projects/:id/registry/repositories` | | [Custom attributes](custom_attributes.md) | `/projects/:id/custom_attributes` (also available for groups and users) | -| [Dependencies](dependencies.md) **(ULTIMATE)** | `/projects/:id/dependencies` +| [Dependencies](dependencies.md) **(ULTIMATE)** | `/projects/:id/dependencies` | | [Deploy keys](deploy_keys.md) | `/projects/:id/deploy_keys` (also available standalone) | | [Deployments](deployments.md) | `/projects/:id/deployments` | | [Discussions](discussions.md) (threaded comments) | `/projects/:id/issues/.../discussions`, `/projects/:id/snippets/.../discussions`, `/projects/:id/merge_requests/.../discussions`, `/projects/:id/commits/.../discussions` (also available for groups) | @@ -67,7 +67,8 @@ The following API resources are available in the project context: | [Search](search.md) | `/projects/:id/search` (also available for groups and standalone) | | [Services](services.md) | `/projects/:id/services` | | [Tags](tags.md) | `/projects/:id/repository/tags` | -| [Vulnerabilities](vulnerabilities.md) **(ULTIMATE)** | `/projects/:id/vulnerabilities` +| [Vulnerabilities](vulnerabilities.md) **(ULTIMATE)** | `/projects/:id/vulnerabilities` | +| [Visual Review discussions](visual_review_discussions.md) **(STARTER**) | `/projects/:id/merge_requests/:merge_request_id/visual_review_discussions` | | [Wikis](wikis.md) | `/projects/:id/wikis` | ## Group resources diff --git a/doc/api/visual_review_discussions.md b/doc/api/visual_review_discussions.md new file mode 100644 index 00000000000..59dbd6cb006 --- /dev/null +++ b/doc/api/visual_review_discussions.md @@ -0,0 +1,40 @@ +# Visual Review discussions API **(STARTER**) + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/merge_requests/18710) in [GitLab Starter](https://about.gitlab.com/pricing/) 12.5. + +Visual Review discussions are notes on Merge Requests sent as +feedback from [Visual Reviews](../ci/review_apps/index.md#visual-reviews-starter). + +## Create new merge request thread + +Creates a new thread to a single project merge request. This is similar to creating +a note but other comments (replies) can be added to it later. + +``` +POST /projects/:id/merge_requests/:merge_request_iid/visual_review_discussions +``` + +Parameters: + +| Attribute | Type | Required | Description | +| ------------------------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) | +| `merge_request_iid` | integer | yes | The IID of a merge request | +| `body` | string | yes | The content of the thread | +| `position` | hash | no | Position when creating a diff note | +| `position[base_sha]` | string | yes | Base commit SHA in the source branch | +| `position[start_sha]` | string | yes | SHA referencing commit in target branch | +| `position[head_sha]` | string | yes | SHA referencing HEAD of this merge request | +| `position[position_type]` | string | yes | Type of the position reference. Either `text` or `image`. | +| `position[new_path]` | string | no | File path after change | +| `position[new_line]` | integer | no | Line number after change (Only stored for `text` diff notes) | +| `position[old_path]` | string | no | File path before change | +| `position[old_line]` | integer | no | Line number before change (Only stored for `text` diff notes) | +| `position[width]` | integer | no | Width of the image (Only stored for `image` diff notes) | +| `position[height]` | integer | no | Height of the image (Only stored for `image` diff notes) | +| `position[x]` | integer | no | X coordinate (Only stored for `image` diff notes) | +| `position[y]` | integer | no | Y coordinate (Only stored for `image` diff notes) | + +```bash +curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/5/merge_requests/11/visual_review_discussions?body=comment +``` diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md index e9f5898950e..dbbcb606ac7 100644 --- a/doc/user/application_security/index.md +++ b/doc/user/application_security/index.md @@ -203,14 +203,34 @@ An approval will be optional when a license report: - Contains no software license violations. - Contains only new licenses that are `approved` or unknown. -<!-- ## Troubleshooting +## Troubleshooting -Include any troubleshooting steps that you can foresee. If you know beforehand what issues -one might have when setting this up, or when something is changed, or on upgrading, it's -important to describe those, too. Think of things that may go wrong and include them here. -This is important to minimize requests for support, and to avoid doc comments with -questions that you know someone might ask. +### Getting error message `sast job: stage parameter should be [some stage name here]` -Each scenario can be a third-level heading, e.g. `### Getting error message X`. -If you have none to add when creating a doc, leave this section in place -but commented out to help encourage others to add to it in the future. --> +When including a security job template like [`SAST`](sast/index.md#configuration), +the following error can be raised, depending on your GitLab CI/CD configuration: + +``` +Found errors in your .gitlab-ci.yml: + +* sast job: stage parameter should be unit-tests +``` + +This error appears when the stage (nammed `test`) of the included job isn't declared +in `.gitlab-ci.yml`. +To fix this issue, you can either: + +- Add a `test` stage in your `.gitlab-ci.yml`. +- Change the default stage of the included security jobs. For example, with `SAST`: + + ```yaml + include: + template: SAST.gitlab-ci.yml + + sast: + stage: unit-tests + ``` + +[Learn more on overriding the SAST template](sast/index.md#overriding-the-sast-template). +All the security scanning tools define their stage, so this error can occur with +all of them. |