Commit e7b36a1f authored by Evan Read's avatar Evan Read Committed by Achilleas Pipinellis

Clarify limits for needs keyword

parent 8326e84e
...@@ -1801,7 +1801,8 @@ and bring back the old behavior. ...@@ -1801,7 +1801,8 @@ and bring back the old behavior.
### `needs` ### `needs`
> Introduced in GitLab 12.2. > - Introduced in GitLab 12.2.
> - In GitLab 12.3, maximum number of jobs in `needs` array raised from five to 50.
The `needs:` keyword enables executing jobs out-of-order, allowing you to implement The `needs:` keyword enables executing jobs out-of-order, allowing you to implement
a [directed acyclic graph](../directed_acyclic_graph/index.md) in your `.gitlab-ci.yml`. a [directed acyclic graph](../directed_acyclic_graph/index.md) in your `.gitlab-ci.yml`.
...@@ -1852,30 +1853,26 @@ This example creates three paths of execution: ...@@ -1852,30 +1853,26 @@ This example creates three paths of execution:
#### Requirements and limitations #### Requirements and limitations
1. If `needs:` is set to point to a job that is not instantiated - If `needs:` is set to point to a job that is not instantiated
because of `only/except` rules or otherwise does not exist, the because of `only/except` rules or otherwise does not exist, the
job will fail. pipeline will be created with YAML error.
1. Note that on day one of the launch, we are temporarily limiting the - We are temporarily limiting the maximum number of jobs that a single job can
maximum number of jobs that a single job can need in the `needs:` array. Track need in the `needs:` array:
our [infrastructure issue](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7541) - For GitLab.com, the limit is five. For more information, see our
for details on the current limit. [infrastructure issue](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7541).
1. If you use `dependencies:` with `needs:`, it's important that you - For self-managed instances, the limit is:
do not mark a job as having a dependency on something that won't - Five by default (`ci_dag_limit_needs` feature flag is enabled).
have been run at the time it needs it. It's better to use both - 50 if the `ci_dag_limit_needs` feature flag is disabled.
keywords in this case so that GitLab handles the ordering appropriately. - It is impossible for now to have `needs: []` (empty needs),
1. It is impossible for now to have `needs: []` (empty needs), the job always needs to depend on something, unless this is the job
the job always needs to depend on something, unless this is the job in the first stage (see [gitlab-ce#65504](https://gitlab.com/gitlab-org/gitlab-ce/issues/65504)).
in the first stage (see [gitlab-ce#65504](https://gitlab.com/gitlab-org/gitlab-ce/issues/65504)). - If `needs:` refers to a job that is marked as `parallel:`.
1. If `needs:` refers to a job that is marked as `parallel:`. the current job will depend on all parallel jobs created.
the current job will depend on all parallel jobs created. - `needs:` is similar to `dependencies:` in that it needs to use jobs from
1. `needs:` is similar to `dependencies:` in that it needs to use jobs from prior stages, meaning it is impossible to create circular
prior stages, meaning it is impossible to create circular dependencies or depend on jobs in the current stage (see [gitlab-ce#65505](https://gitlab.com/gitlab-org/gitlab-ce/issues/65505)).
dependencies or depend on jobs in the current stage (see [gitlab-ce#65505](https://gitlab.com/gitlab-org/gitlab-ce/issues/65505)). - Related to the above, stages must be explicitly defined for all jobs
1. Related to the above, stages must be explicitly defined for all jobs that have the keyword `needs:` or are referred to by one.
that have the keyword `needs:` or are referred to by one.
1. For self-managed users, the feature must be turned on using the `ci_dag_support`
feature flag. The `ci_dag_limit_needs` option, if set, will limit the number of
jobs that a single job can need to `50`. If unset, the limit is `5`.
### `coverage` ### `coverage`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment