diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-13 15:10:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-13 15:10:27 +0300 |
commit | 39c1496527de559d5d3a5c3b53d11575f435a4dc (patch) | |
tree | 51ed818b49752bb27d8bc7a13e9efcb3e5192c1f /doc | |
parent | ab9c1dbb2dc0e591a6ce4466e15766d99f4abf4b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/graphql/reference/gitlab_schema.graphql | 65 | ||||
-rw-r--r-- | doc/api/graphql/reference/gitlab_schema.json | 211 | ||||
-rw-r--r-- | doc/api/graphql/reference/index.md | 23 | ||||
-rw-r--r-- | doc/ci/pipelines/job_artifacts.md | 17 | ||||
-rw-r--r-- | doc/ci/variables/predefined_variables.md | 2 | ||||
-rw-r--r-- | doc/ci/yaml/README.md | 2 | ||||
-rw-r--r-- | doc/development/pipelines.md | 23 | ||||
-rw-r--r-- | doc/development/profiling.md | 56 | ||||
-rw-r--r-- | doc/user/project/merge_requests/revert_changes.md | 4 |
9 files changed, 376 insertions, 27 deletions
diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql index 584f2061666..213d963bf16 100644 --- a/doc/api/graphql/reference/gitlab_schema.graphql +++ b/doc/api/graphql/reference/gitlab_schema.graphql @@ -2496,17 +2496,42 @@ type CiConfigGroupEdge { type CiConfigJob { """ - Name of the job group + Override a set of commands that are executed after the job. + """ + afterScript: [String!] + + """ + Allow job to fail. + """ + allowFailure: Boolean + + """ + Override a set of commands that are executed before the job. + """ + beforeScript: [String!] + + """ + Name of an environment to which the job deploys. + """ + environment: String + + """ + Limit when jobs are not created. + """ + except: CiConfigJobRestriction + + """ + Name of the job group. """ groupName: String """ - Name of the job + Name of the job. """ name: String """ - Builds that must complete before the jobs run + Builds that must complete before the jobs run. """ needs( """ @@ -2531,9 +2556,29 @@ type CiConfigJob { ): CiConfigNeedConnection """ - Name of the job stage + Jobs are created when these conditions do not apply. + """ + only: CiConfigJobRestriction + + """ + Shell script that is executed by a runner. + """ + script: [String!] + + """ + Name of the job stage. """ stage: String + + """ + List of tags that are used to select a runner. + """ + tags: [String!] + + """ + When to run the job. + """ + when: String } """ @@ -2571,6 +2616,13 @@ type CiConfigJobEdge { node: CiConfigJob } +type CiConfigJobRestriction { + """ + The Git refs the job restriction applies to. + """ + refs: [String!] +} + type CiConfigNeed { """ Name of the need @@ -19640,6 +19692,11 @@ type Query { content: String! """ + Run pipeline creation simulation, or only do static check. + """ + dryRun: Boolean + + """ The project of the CI config. """ projectPath: ID! diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json index ea5cbb888a3..23b4ebd9553 100644 --- a/doc/api/graphql/reference/gitlab_schema.json +++ b/doc/api/graphql/reference/gitlab_schema.json @@ -6712,8 +6712,94 @@ "description": null, "fields": [ { + "name": "afterScript", + "description": "Override a set of commands that are executed after the job.", + "args": [ + + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allowFailure", + "description": "Allow job to fail.", + "args": [ + + ], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "beforeScript", + "description": "Override a set of commands that are executed before the job.", + "args": [ + + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "environment", + "description": "Name of an environment to which the job deploys.", + "args": [ + + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "except", + "description": "Limit when jobs are not created.", + "args": [ + + ], + "type": { + "kind": "OBJECT", + "name": "CiConfigJobRestriction", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "groupName", - "description": "Name of the job group", + "description": "Name of the job group.", "args": [ ], @@ -6727,7 +6813,7 @@ }, { "name": "name", - "description": "Name of the job", + "description": "Name of the job.", "args": [ ], @@ -6741,7 +6827,7 @@ }, { "name": "needs", - "description": "Builds that must complete before the jobs run", + "description": "Builds that must complete before the jobs run.", "args": [ { "name": "after", @@ -6793,8 +6879,80 @@ "deprecationReason": null }, { + "name": "only", + "description": "Jobs are created when these conditions do not apply.", + "args": [ + + ], + "type": { + "kind": "OBJECT", + "name": "CiConfigJobRestriction", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "script", + "description": "Shell script that is executed by a runner.", + "args": [ + + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "stage", - "description": "Name of the job stage", + "description": "Name of the job stage.", + "args": [ + + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tags", + "description": "List of tags that are used to select a runner.", + "args": [ + + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "when", + "description": "When to run the job.", "args": [ ], @@ -6928,6 +7086,41 @@ }, { "kind": "OBJECT", + "name": "CiConfigJobRestriction", + "description": null, + "fields": [ + { + "name": "refs", + "description": "The Git refs the job restriction applies to.", + "args": [ + + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", "name": "CiConfigNeed", "description": null, "fields": [ @@ -57308,6 +57501,16 @@ } }, "defaultValue": null + }, + { + "name": "dryRun", + "description": "Run pipeline creation simulation, or only do static check.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null } ], "type": { diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 9a6a515b764..4930b136894 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -413,10 +413,25 @@ Autogenerated return type of CiCdSettingsUpdate. | Field | Type | Description | | ----- | ---- | ----------- | -| `groupName` | String | Name of the job group | -| `name` | String | Name of the job | -| `needs` | CiConfigNeedConnection | Builds that must complete before the jobs run | -| `stage` | String | Name of the job stage | +| `afterScript` | String! => Array | Override a set of commands that are executed after the job. | +| `allowFailure` | Boolean | Allow job to fail. | +| `beforeScript` | String! => Array | Override a set of commands that are executed before the job. | +| `environment` | String | Name of an environment to which the job deploys. | +| `except` | CiConfigJobRestriction | Limit when jobs are not created. | +| `groupName` | String | Name of the job group. | +| `name` | String | Name of the job. | +| `needs` | CiConfigNeedConnection | Builds that must complete before the jobs run. | +| `only` | CiConfigJobRestriction | Jobs are created when these conditions do not apply. | +| `script` | String! => Array | Shell script that is executed by a runner. | +| `stage` | String | Name of the job stage. | +| `tags` | String! => Array | List of tags that are used to select a runner. | +| `when` | String | When to run the job. | + +### CiConfigJobRestriction + +| Field | Type | Description | +| ----- | ---- | ----------- | +| `refs` | String! => Array | The Git refs the job restriction applies to. | ### CiConfigNeed diff --git a/doc/ci/pipelines/job_artifacts.md b/doc/ci/pipelines/job_artifacts.md index 8ea94ad72bb..27cbde9285f 100644 --- a/doc/ci/pipelines/job_artifacts.md +++ b/doc/ci/pipelines/job_artifacts.md @@ -464,6 +464,23 @@ To retrieve a job artifact from a different project, you might need to use a private token to [authenticate and download](../../api/job_artifacts.md#get-job-artifacts) the artifact. +## Keep artifacts from most recent successful jobs + +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16267) in GitLab 13.0. +> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/229936) in GitLab 13.4. +> - [Made optional with a CI/CD setting](https://gitlab.com/gitlab-org/gitlab/-/issues/241026) in GitLab 13.8. + +By default, the latest artifacts from the most recent successful jobs are never deleted. +If a job is configured with [`expire_in`](../yaml/README.md#artifactsexpire_in), +its artifacts only expire if a more recent artifact exists. + +Keeping the latest artifacts can use a large amount of storage space in projects +with a lot of jobs or large artifacts. If the latest artifacts are not needed in +a project, you can disable this behavior to save space: + +1. Navigate to **Settings > CI/CD > Artifacts**. +1. Uncheck **Keep artifacts from most recent successful jobs**. + ## Troubleshooting ### Error message `No files to upload` diff --git a/doc/ci/variables/predefined_variables.md b/doc/ci/variables/predefined_variables.md index 6453ffda28c..779b0c4732c 100644 --- a/doc/ci/variables/predefined_variables.md +++ b/doc/ci/variables/predefined_variables.md @@ -66,7 +66,7 @@ Kubernetes-specific environment variables are detailed in the | `CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME` | 12.3 | all | The target branch name of the pull request if [the pipelines are for external pull requests](../ci_cd_for_external_repos/index.md#pipelines-for-external-pull-requests). Available only if `only: [external_pull_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the pull request is open. | | `CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_SHA` | 12.3 | all | The HEAD SHA of the target branch of the pull request if [the pipelines are for external pull requests](../ci_cd_for_external_repos/index.md#pipelines-for-external-pull-requests). Available only if `only: [external_pull_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the pull request is open. | | `CI_HAS_OPEN_REQUIREMENTS` | 13.1 | all | Included with the value `true` only if the pipeline's project has any open [requirements](../../user/project/requirements/index.md). Not included if there are no open requirements for the pipeline's project. | -| `CI_OPEN_MERGE_REQUESTS` | 13.7 | all | Contains a comma-delimited list of up to 4 Merge Requests from the current source project and branch in the form `gitlab-org/gitlab!333,gitlab-org/gitlab-foss!11`. | +| `CI_OPEN_MERGE_REQUESTS` | 13.8 | all | Available in branch and merge request pipelines. Contains a comma-separated list of up to four merge requests that use the current branch and project as the merge request source. For example `gitlab-org/gitlab!333,gitlab-org/gitlab-foss!11`. | | `CI_JOB_ID` | 9.0 | all | The unique ID of the current job that GitLab CI/CD uses internally. | | `CI_JOB_IMAGE` | 12.9 | 12.9 | The name of the image running the CI job. | | `CI_JOB_MANUAL` | 8.12 | all | The flag to indicate that job was manually started. | diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 8c881460606..cfc69d473de 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -3363,7 +3363,7 @@ job: The latest artifacts for refs are locked against deletion, and kept regardless of the expiry time. [Introduced in](https://gitlab.com/gitlab-org/gitlab/-/issues/16267) GitLab 13.0 behind a disabled feature flag, and [made the default behavior](https://gitlab.com/gitlab-org/gitlab/-/issues/229936) -in GitLab 13.4. +in GitLab 13.4. In [GitLab 13.8 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/241026), you can [disable this behavior in the CI/CD settings](../pipelines/job_artifacts.md#keep-artifacts-from-most-recent-successful-jobs). #### `artifacts:reports` diff --git a/doc/development/pipelines.md b/doc/development/pipelines.md index fb8b83465fd..0354e703357 100644 --- a/doc/development/pipelines.md +++ b/doc/development/pipelines.md @@ -422,24 +422,29 @@ We are using a custom mapping between source file to test files, maintained in t ### PostgreSQL versions testing +Even though [Omnibus defaults to PG12 for new installs and upgrades](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.md), +our test suite is currently running against PG11, since GitLab.com still runs on PG11. + +We do run our test suite against PG12 on nightly scheduled pipelines as well as upon specific +database library changes in MRs and `master` pipelines (with the `rspec db-library-code pg12` job). + #### Current versions testing | Where? | PostgreSQL version | -| ------ | ------ | -| MRs | 11 | -| `master` (non-scheduled pipelines) | 11 | -| 2-hourly scheduled pipelines | 11 | +| ------ | ------------------ | +| MRs | 11, 12 for DB library changes | +| `master` (non-scheduled pipelines) | 11, 12 for DB library changes | +| 2-hourly scheduled pipelines | 11, 12 for DB library changes | | `nightly` scheduled pipelines | 11, 12 | #### Long-term plan We follow the [PostgreSQL versions shipped with Omnibus GitLab](https://docs.gitlab.com/omnibus/package-information/postgresql_versions.html): -| PostgreSQL version | 13.0 (May 2020) | 13.1 (June 2020) | 13.2 (July 2020) | 13.3 (August 2020) | 13.4, 13.5 | [13.7 (December 2020)](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5722) | 14.0 (May 2021?) | -| ------ | --------------- | ---------------- | ---------------- | ------------------ | ------------ | -------------------- | ---------------- | -| PG11 | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | MRs/`master`/`2-hour`/`nightly` | `nightly` | - | -| PG12 | - | - | `nightly` | `2-hour`/`nightly` | `2-hour`/`nightly` | MRs/`2-hour`/`nightly` | `2-hour`/`nightly` | -| PG13 | - | - | - | - | - | - | MRs/`2-hour`/`nightly` | +| PostgreSQL version | 13.7 (December 2020) | 13.8 (January 2021) | 13.9 (February 2021) | 13.10 (March 2021) | 13.11 (April 2021) | 14.0 (May 2021?) | +| -------------------| -------------------- | ------------------- | -------------------- | ------------------ | ------------------ | ---------------- | +| PG11 | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | +| PG12 | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` | ### Test jobs diff --git a/doc/development/profiling.md b/doc/development/profiling.md index f6c7f493b21..ce9c1191648 100644 --- a/doc/development/profiling.md +++ b/doc/development/profiling.md @@ -128,6 +128,62 @@ console. As a follow up to finding `N+1` queries with Bullet, consider writing a [QueryRecoder test](query_recorder.md) to prevent a regression. +## System stats + +During or after profiling, you may want to get detailed information about the Ruby virtual machine process, +such as memory consumption, time spent on CPU, or garbage collector statistics. These are easy to produce individually +through various tools, but for convenience, a summary endpoint has been added that exports this data as a JSON payload: + +```shell +curl localhost:3000/-/metrics/system | jq +``` + +Example output: + +```json +{ + "version": "ruby 2.7.2p137 (2020-10-01 revision a8323b79eb) [x86_64-linux-gnu]", + "gc_stat": { + "count": 118, + "heap_allocated_pages": 11503, + "heap_sorted_length": 11503, + "heap_allocatable_pages": 0, + "heap_available_slots": 4688580, + "heap_live_slots": 3451712, + "heap_free_slots": 1236868, + "heap_final_slots": 0, + "heap_marked_slots": 3451450, + "heap_eden_pages": 11503, + "heap_tomb_pages": 0, + "total_allocated_pages": 11503, + "total_freed_pages": 0, + "total_allocated_objects": 32679478, + "total_freed_objects": 29227766, + "malloc_increase_bytes": 84760, + "malloc_increase_bytes_limit": 32883343, + "minor_gc_count": 88, + "major_gc_count": 30, + "compact_count": 0, + "remembered_wb_unprotected_objects": 114228, + "remembered_wb_unprotected_objects_limit": 228456, + "old_objects": 3185330, + "old_objects_limit": 6370660, + "oldmalloc_increase_bytes": 21838024, + "oldmalloc_increase_bytes_limit": 119181499 + }, + "memory_rss": 1326501888, + "memory_uss": 1048563712, + "memory_pss": 1139554304, + "time_cputime": 82.885264633, + "time_realtime": 1610459445.5579069, + "time_monotonic": 24001.23145713, + "worker_id": "puma_0" +} +``` + +NOTE: +This endpoint is only available for Rails web workers. Sidekiq workers can not be inspected this way. + ## Settings that impact performance ### Application settings diff --git a/doc/user/project/merge_requests/revert_changes.md b/doc/user/project/merge_requests/revert_changes.md index 23ad881087e..40a4631694b 100644 --- a/doc/user/project/merge_requests/revert_changes.md +++ b/doc/user/project/merge_requests/revert_changes.md @@ -59,10 +59,6 @@ mainline: git revert -m 2 7a39eb0 ``` -From [GitLab 13.8 onwards](https://gitlab.com/gitlab-org/gitlab/-/issues/35824), merge requests -reverted by another merge request through one of the methods described in this document -will display a link to the reverted merge request at the top-left corner within the **Merged** badge. - <!-- ## Troubleshooting Include any troubleshooting steps that you can foresee. If you know beforehand what issues |