From 8917726bb5e6746750129c0d9322c2daa7f88172 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Sun, 3 Sep 2017 23:45:44 +0900 Subject: Add changelog. Fix doc --- doc/ci/yaml/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index f40d2c5e347..ef32e7658ee 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -1106,7 +1106,8 @@ Note that `artifacts` from all previous [stages](#stages) are passed by default. To use this feature, define `dependencies` in context of the job and pass a list of all previous jobs from which the artifacts should be downloaded. You can only define jobs from stages that are executed before the current one. -An error will be shown if you define jobs from the current stage or next ones. +An error will be shown if you define jobs from the current stage or next ones, +or there are no depended jobs in previous stages. Defining an empty array will skip downloading any artifacts for that job. The status of the previous job is not considered when using `dependencies`, so if it failed or it is a manual job that was not run, no error occurs. -- cgit v1.2.1 From c3e0731d2efc777018b668d9e0b7f8aa2377d9fc Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Tue, 5 Sep 2017 22:37:28 +0900 Subject: Add case when artifacts have not existed on dependencies --- doc/ci/yaml/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index ef32e7658ee..f5391ff0768 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -1107,7 +1107,7 @@ To use this feature, define `dependencies` in context of the job and pass a list of all previous jobs from which the artifacts should be downloaded. You can only define jobs from stages that are executed before the current one. An error will be shown if you define jobs from the current stage or next ones, -or there are no depended jobs in previous stages. +or there are no depended jobs with artifacts in previous stages. Defining an empty array will skip downloading any artifacts for that job. The status of the previous job is not considered when using `dependencies`, so if it failed or it is a manual job that was not run, no error occurs. -- cgit v1.2.1 From fba38b51b761cdc5edb964dc90eea051a33aab3e Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Mon, 27 Nov 2017 18:59:03 +0900 Subject: Add feature flag --- doc/ci/yaml/README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index f5391ff0768..ea151853f50 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -1106,8 +1106,7 @@ Note that `artifacts` from all previous [stages](#stages) are passed by default. To use this feature, define `dependencies` in context of the job and pass a list of all previous jobs from which the artifacts should be downloaded. You can only define jobs from stages that are executed before the current one. -An error will be shown if you define jobs from the current stage or next ones, -or there are no depended jobs with artifacts in previous stages. +An error will be shown if you define jobs from the current stage or next ones. Defining an empty array will skip downloading any artifacts for that job. The status of the previous job is not considered when using `dependencies`, so if it failed or it is a manual job that was not run, no error occurs. @@ -1154,6 +1153,22 @@ deploy: script: make deploy ``` +### Validations for `dependencies` keyword + +> Introduced in GitLab 10.3 + +`dependencies` keyword doesn't check the depended `artifacts` strictly. Therefore +they do not fail even though it falls into the following conditions. + +1. A depended `artifacts` has been [erased](https://docs.gitlab.com/ee/api/jobs.html#erase-a-job). +1. A depended `artifacts` has been [expired](https://docs.gitlab.com/ee/ci/yaml/#artifacts-expire_in). + +To validate those conditions, you can flip the feature flag from a rails console: + +``` +Feature.enable('ci_validates_dependencies') +``` + ### before_script and after_script It's possible to overwrite the globally defined `before_script` and `after_script`: -- cgit v1.2.1 From c2f68b7ae319cb732eeaf53ddd020702644dc70d Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Thu, 7 Dec 2017 23:16:57 +0900 Subject: Update document to use ci_validates_dependencies --- doc/ci/yaml/README.md | 14 ++++---------- doc/user/project/pipelines/job_artifacts.md | 8 ++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index ea151853f50..ac5d99c71fc 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -1153,22 +1153,16 @@ deploy: script: make deploy ``` -### Validations for `dependencies` keyword - +>**Note:** > Introduced in GitLab 10.3 +> This is the user documentation. For the administration guide see + [administration/job_artifacts](../../../administration/job_artifacts.md#validation_for_dependency). -`dependencies` keyword doesn't check the depended `artifacts` strictly. Therefore -they do not fail even though it falls into the following conditions. +If a depended job doesn't have artifacts by the following reason, the depending job will fail. 1. A depended `artifacts` has been [erased](https://docs.gitlab.com/ee/api/jobs.html#erase-a-job). 1. A depended `artifacts` has been [expired](https://docs.gitlab.com/ee/ci/yaml/#artifacts-expire_in). -To validate those conditions, you can flip the feature flag from a rails console: - -``` -Feature.enable('ci_validates_dependencies') -``` - ### before_script and after_script It's possible to overwrite the globally defined `before_script` and `after_script`: diff --git a/doc/user/project/pipelines/job_artifacts.md b/doc/user/project/pipelines/job_artifacts.md index f9a268fb789..f8675f77856 100644 --- a/doc/user/project/pipelines/job_artifacts.md +++ b/doc/user/project/pipelines/job_artifacts.md @@ -163,6 +163,14 @@ information in the UI. ![Latest artifacts button](img/job_latest_artifacts_browser.png) +## Validation for `dependency` keyword + +To disable [the validation for dependency], you can flip the feature flag from a rails console: + +``` +Feature.enable('ci_disable_validates_dependencies') +``` [expiry date]: ../../../ci/yaml/README.md#artifacts-expire_in +[the validation for dependency]: ../../../ci/yaml/README.md#dependencies [ce-14399]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14399 -- cgit v1.2.1 From 2ac6d806900f3aea708b3fcdc32463235f83eb73 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 7 Dec 2017 19:46:27 +0100 Subject: Clean up docs for dependencies validation --- doc/administration/job_artifacts.md | 39 +++++++++++++++++++++++++++++ doc/ci/yaml/README.md | 18 +++++++------ doc/user/project/pipelines/job_artifacts.md | 22 +++++++++------- 3 files changed, 63 insertions(+), 16 deletions(-) (limited to 'doc') diff --git a/doc/administration/job_artifacts.md b/doc/administration/job_artifacts.md index 86b436d89dd..33f8a69c249 100644 --- a/doc/administration/job_artifacts.md +++ b/doc/administration/job_artifacts.md @@ -128,6 +128,45 @@ steps below. 1. Save the file and [restart GitLab][] for the changes to take effect. +## Validation for dependencies + +> Introduced in GitLab 10.3. + +To disable [the dependencies validation](../ci/yaml/README.md#when-a-dependent-job-will-fail), +you can flip the feature flag from a Rails console. + +--- + +**In Omnibus installations:** + +1. Enter the Rails console: + + ```sh + sudo gitlab-rails console + ``` + +1. Flip the switch and disable it: + + ```ruby + Feature.enable('ci_disable_validates_dependencies') + ``` +--- + +**In installations from source:** + +1. Enter the Rails console: + + ```sh + cd /home/git/gitlab + RAILS_ENV=production sudo -u git -H bundle exec rails console + ``` + +1. Flip the switch and disable it: + + ```ruby + Feature.enable('ci_disable_validates_dependencies') + ``` + ## Set the maximum file size of the artifacts Provided the artifacts are enabled, you can change the maximum file size of the diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index ac5d99c71fc..32464cbb259 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -1153,15 +1153,19 @@ deploy: script: make deploy ``` ->**Note:** -> Introduced in GitLab 10.3 -> This is the user documentation. For the administration guide see - [administration/job_artifacts](../../../administration/job_artifacts.md#validation_for_dependency). +#### When a dependent job will fail + +> Introduced in GitLab 10.3. -If a depended job doesn't have artifacts by the following reason, the depending job will fail. +If the artifacts of the job that is set as a dependency have been +[expired](#artifacts-expire_in) or +[erased](../../user/project/pipelines/job_artifacts.md#erasing-artifacts), then +the dependent job will fail. -1. A depended `artifacts` has been [erased](https://docs.gitlab.com/ee/api/jobs.html#erase-a-job). -1. A depended `artifacts` has been [expired](https://docs.gitlab.com/ee/ci/yaml/#artifacts-expire_in). +NOTE: **Note:** +You can ask your administrator to +[flip this switch](../../administration/job_artifacts.md#validation-for-dependencies) +and bring back the old behavior. ### before_script and after_script diff --git a/doc/user/project/pipelines/job_artifacts.md b/doc/user/project/pipelines/job_artifacts.md index f8675f77856..402989f4508 100644 --- a/doc/user/project/pipelines/job_artifacts.md +++ b/doc/user/project/pipelines/job_artifacts.md @@ -44,7 +44,7 @@ the artifacts will be kept forever. For more examples on artifacts, follow the [artifacts reference in `.gitlab-ci.yml`](../../../ci/yaml/README.md#artifacts). -## Browsing job artifacts +## Browsing artifacts >**Note:** With GitLab 9.2, PDFs, images, videos and other formats can be previewed @@ -77,7 +77,7 @@ one HTML file that you can view directly online when --- -## Downloading job artifacts +## Downloading artifacts If you need to download the whole archive, there are buttons in various places inside GitLab that make that possible. @@ -102,7 +102,7 @@ inside GitLab that make that possible. ![Job artifacts browser](img/job_artifacts_browser.png) -## Downloading the latest job artifacts +## Downloading the latest artifacts It is possible to download the latest artifacts of a job via a well known URL so you can use it for scripting purposes. @@ -163,14 +163,18 @@ information in the UI. ![Latest artifacts button](img/job_latest_artifacts_browser.png) -## Validation for `dependency` keyword +## Erasing artifacts -To disable [the validation for dependency], you can flip the feature flag from a rails console: +DANGER: **Warning:** +This is a destructive action that leads to data loss. Use with caution. -``` -Feature.enable('ci_disable_validates_dependencies') -``` +If you have at least Developer [permissions](../../permissions.md#gitlab-ci-cd-permissions) +on the project, you can erase a single job via the UI which will also remove the +artifacts and the job's trace. + +1. Navigate to a job's page. +1. Click the trash icon at the top right of the job's trace. +1. Confirm the deletion. [expiry date]: ../../../ci/yaml/README.md#artifacts-expire_in -[the validation for dependency]: ../../../ci/yaml/README.md#dependencies [ce-14399]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14399 -- cgit v1.2.1