From f1f9ab9eecc11643801182cf57a3dd2c10918011 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Sat, 16 Apr 2022 03:09:57 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../issuable/form/_contribution.html.haml | 2 +- doc/ci/secure_files/index.md | 98 +++++++++++++++++++ .../group/value_stream_analytics/index.md | 3 + locale/gitlab.pot | 9 ++ .../helpers/cycle_analytics_helpers.rb | 12 +++ 5 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 doc/ci/secure_files/index.md diff --git a/app/views/shared/issuable/form/_contribution.html.haml b/app/views/shared/issuable/form/_contribution.html.haml index 47766008c9a..c9dda22de46 100644 --- a/app/views/shared/issuable/form/_contribution.html.haml +++ b/app/views/shared/issuable/form/_contribution.html.haml @@ -10,7 +10,7 @@ %hr .form-group.row - %label.col-form-label.col-sm-2 + %label.col-form-label.col-sm-2.pt-sm-0 = _('Contribution') .col-sm-10 = form.gitlab_ui_checkbox_component :allow_collaboration, diff --git a/doc/ci/secure_files/index.md b/doc/ci/secure_files/index.md new file mode 100644 index 00000000000..3cc38a8b74c --- /dev/null +++ b/doc/ci/secure_files/index.md @@ -0,0 +1,98 @@ +--- +stage: Verify +group: Pipeline Authoring +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments +type: reference +--- + +# Project-level Secure Files **(FREE)** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/78227) in GitLab 14.8. [Deployed behind the `ci_secure_files` flag](../../administration/feature_flags.md), disabled by default. + +FLAG: +On self-managed GitLab, by default this feature is not available. To make it available, +ask an administrator to [enable the feature flag](../../administration/feature_flags.md) +named `ci_secure_files`. Limited to 100 secure files per project. Files must be smaller +than 5 MB. The feature is not ready for production use. + +You can securely store files for use in CI/CD pipelines as "secure files". These files +are stored securely outside of your project's repository, and are not version controlled. +It is safe to store sensitive information in these files. Secure files support both +plain text and binary file types. + +Secure files can be [downloaded and used by CI/CD jobs](#use-secure-files-in-cicd-jobs) +by using the [load-secure-files](https://gitlab.com/gitlab-org/incubation-engineering/devops-for-mobile-apps/load-secure-files) +tool. + +NOTE: +This feature is in active development and is likely to change, potentially in a breaking way. +Additional features and capabilities are planned. + +## Add a secure file to a project + +To add a secure file to a project, use the [Secure Files API](../../api/secure_files.md#create-secure-file). + +Send a POST request to the secure files endpoint for your project: + +```shell +curl --request POST --header "PRIVATE-TOKEN: " \ + "https://gitlab.example.com/api/v4/projects/:project_id/secure_files" --form "name=myfile.jks" --form "file=@/path/to/file/myfile.jks" +``` + +The response returns all of the metadata for the file you just uploaded. For example: + +```json +{ + "id": 1, + "name": "myfile.jks", + "checksum": "16630b189ab34b2e3504f4758e1054d2e478deda510b2b08cc0ef38d12e80aac", + "checksum_algorithm": "sha256", + "permissions": "read_only", + "created_at": "2022-02-22T22:22:22.222Z" +} +``` + +## List all secure files in a project + +To list all secure files in a project, use the [Secure Files API](../../api/secure_files.md#list-project-secure-files). + +Send a GET request to the secure files endpoint for your project: + +```shell +curl --request GET --header "PRIVATE-TOKEN: " \ + "https://gitlab.example.com/api/v4/projects/:project_id/secure_files" +``` + +The response returns an array of all of the secure files in the project. For example: + +```json +[{ + "id": 1, + "name": "myfile.jks", + "checksum": "16630b189ab34b2e3504f4758e1054d2e478deda510b2b08cc0ef38d12e80aac", + "checksum_algorithm": "sha256", + "permissions": "read_only", + "created_at": "2022-02-22T22:22:22.222Z" +}] +``` + +## Use secure files in CI/CD jobs + +To use your secure files in a CI/CD job, you must use the [`load-secure-files`](https://gitlab.com/gitlab-org/incubation-engineering/devops-for-mobile-apps/load-secure-files) +tool to download the files in the job. After they are downloaded, you can use them +with your other script commands. + +Add a command in the `script` section of your job to download the `load-secure-files` tool +and execute it. The files download into a `.secure_files` directory in the root of the project. +To change the download location for the secure files, set the path in the `SECURE_FILES_DOWNLOAD_PATH` +[CI/CD variable](../variables/index.md). + +For example: + +```yaml +test: + variables: + SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/' + script: + - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/devops-for-mobile-apps/load-secure-files/-/raw/main/installer" | bash +``` diff --git a/doc/user/group/value_stream_analytics/index.md b/doc/user/group/value_stream_analytics/index.md index db742da7ea9..3fce9baa9ce 100644 --- a/doc/user/group/value_stream_analytics/index.md +++ b/doc/user/group/value_stream_analytics/index.md @@ -291,6 +291,9 @@ To create a value stream: ![New value stream](img/new_value_stream_v13_12.png "Creating a new value stream") +NOTE: +If you have recently upgraded to GitLab Premium, it can take up to 30 minutes for data to collect and display. + ### Create a value stream with stages > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50229) in GitLab 13.7. diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 4905d89abc6..99af4253870 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -11146,6 +11146,9 @@ msgstr "" msgid "CycleAnalytics|%{selectedLabelsCount} selected (%{maxLabels} max)" msgstr "" +msgid "CycleAnalytics|'%{name}' is collecting the data. This can take a few minutes." +msgstr "" + msgid "CycleAnalytics|Aggregation disabled" msgstr "" @@ -11164,6 +11167,9 @@ msgstr "" msgid "CycleAnalytics|Custom value streams to measure your DevSecOps lifecycle" msgstr "" +msgid "CycleAnalytics|Data is collecting and loading." +msgstr "" + msgid "CycleAnalytics|Date" msgstr "" @@ -11173,6 +11179,9 @@ msgstr "" msgid "CycleAnalytics|Filter by stop date" msgstr "" +msgid "CycleAnalytics|If you have recently upgraded to GitLab Premium, it can take up to 30 minutes for data to collect and display." +msgstr "" + msgid "CycleAnalytics|Lead Time for Changes" msgstr "" diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index f5e11f46067..044ec56b1cc 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -93,6 +93,18 @@ module CycleAnalyticsHelpers wait_for_requests end + def create_value_stream_group_aggregation(group) + aggregation = Analytics::CycleAnalytics::Aggregation.safe_create_for_group(group) + Analytics::CycleAnalytics::AggregatorService.new(aggregation: aggregation).execute + end + + def select_group_and_custom_value_stream(group, custom_value_stream_name) + create_value_stream_group_aggregation(group) + + select_group(group) + select_value_stream(custom_value_stream_name) + end + def toggle_dropdown(field) page.within("[data-testid*='#{field}']") do find('.dropdown-toggle').click