diff --git a/app/assets/javascripts/ide/components/repo_file_status_icon.vue b/app/assets/javascripts/ide/components/repo_file_status_icon.vue index 1402f7aaf39..72c56daf69c 100644 --- a/app/assets/javascripts/ide/components/repo_file_status_icon.vue +++ b/app/assets/javascripts/ide/components/repo_file_status_icon.vue @@ -1,7 +1,6 @@ diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 553accefd89..232d0a6b05d 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -96,7 +96,8 @@ class Namespace < ApplicationRecord 'COALESCE(SUM(ps.snippets_size), 0) AS snippets_size', 'COALESCE(SUM(ps.lfs_objects_size), 0) AS lfs_objects_size', 'COALESCE(SUM(ps.build_artifacts_size), 0) AS build_artifacts_size', - 'COALESCE(SUM(ps.packages_size), 0) AS packages_size' + 'COALESCE(SUM(ps.packages_size), 0) AS packages_size', + 'COALESCE(SUM(ps.uploads_size), 0) AS uploads_size' ) end diff --git a/app/models/namespace/root_storage_statistics.rb b/app/models/namespace/root_storage_statistics.rb index 5723a823e98..a3df82998c4 100644 --- a/app/models/namespace/root_storage_statistics.rb +++ b/app/models/namespace/root_storage_statistics.rb @@ -11,6 +11,7 @@ class Namespace::RootStorageStatistics < ApplicationRecord packages_size #{SNIPPETS_SIZE_STAT_NAME} pipeline_artifacts_size + uploads_size ).freeze self.primary_key = :namespace_id @@ -50,7 +51,8 @@ class Namespace::RootStorageStatistics < ApplicationRecord 'COALESCE(SUM(ps.build_artifacts_size), 0) AS build_artifacts_size', 'COALESCE(SUM(ps.packages_size), 0) AS packages_size', "COALESCE(SUM(ps.snippets_size), 0) AS #{SNIPPETS_SIZE_STAT_NAME}", - 'COALESCE(SUM(ps.pipeline_artifacts_size), 0) AS pipeline_artifacts_size' + 'COALESCE(SUM(ps.pipeline_artifacts_size), 0) AS pipeline_artifacts_size', + 'COALESCE(SUM(ps.uploads_size), 0) AS uploads_size' ) end diff --git a/app/models/project_statistics.rb b/app/models/project_statistics.rb index 0d2f89fb18d..c11a7fea1c6 100644 --- a/app/models/project_statistics.rb +++ b/app/models/project_statistics.rb @@ -19,14 +19,14 @@ class ProjectStatistics < ApplicationRecord before_save :update_storage_size - COLUMNS_TO_REFRESH = [:repository_size, :wiki_size, :lfs_objects_size, :commit_count, :snippets_size].freeze + COLUMNS_TO_REFRESH = [:repository_size, :wiki_size, :lfs_objects_size, :commit_count, :snippets_size, :uploads_size].freeze INCREMENTABLE_COLUMNS = { build_artifacts_size: %i[storage_size], packages_size: %i[storage_size], pipeline_artifacts_size: %i[storage_size], snippets_size: %i[storage_size] }.freeze - NAMESPACE_RELATABLE_COLUMNS = [:repository_size, :wiki_size, :lfs_objects_size].freeze + NAMESPACE_RELATABLE_COLUMNS = [:repository_size, :wiki_size, :lfs_objects_size, :uploads_size].freeze scope :for_project_ids, ->(project_ids) { where(project_id: project_ids) } @@ -72,6 +72,12 @@ class ProjectStatistics < ApplicationRecord self.lfs_objects_size = project.lfs_objects.sum(:size) end + def update_uploads_size + return uploads_size unless Feature.enabled?(:count_uploads_size_in_storage_stats, project) + + self.uploads_size = project.uploads.sum(:size) + end + # `wiki_size` and `snippets_size` have no default value in the database # and the column can be nil. # This means that, when the columns were added, all rows had nil @@ -98,6 +104,10 @@ class ProjectStatistics < ApplicationRecord # might try to update project statistics before the `pipeline_artifacts_size` column has been created. storage_size += pipeline_artifacts_size if self.class.column_names.include?('pipeline_artifacts_size') + # The `uploads_size` column was added on 20201105021637 but db/post_migrate/20190527194900_schedule_calculate_wiki_sizes.rb + # might try to update project statistics before the `uploads_size` column has been created. + storage_size += uploads_size if self.class.column_names.include?('uploads_size') + self.storage_size = storage_size end diff --git a/changelogs/unreleased/241980-uploads-count-as-used-storage.yml b/changelogs/unreleased/241980-uploads-count-as-used-storage.yml new file mode 100644 index 00000000000..cfb14145757 --- /dev/null +++ b/changelogs/unreleased/241980-uploads-count-as-used-storage.yml @@ -0,0 +1,5 @@ +--- +title: Account for uploads as part of used repository storage +merge_request: 46941 +author: +type: added diff --git a/config/feature_flags/development/count_uploads_size_in_storage_stats.yml b/config/feature_flags/development/count_uploads_size_in_storage_stats.yml new file mode 100644 index 00000000000..524e4f4abd8 --- /dev/null +++ b/config/feature_flags/development/count_uploads_size_in_storage_stats.yml @@ -0,0 +1,8 @@ +--- +name: count_uploads_size_in_storage_stats +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46941 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/281950 +milestone: '13.6' +type: development +group: group::project management +default_enabled: false diff --git a/config/feature_flags/development/sse_image_uploads.yml b/config/feature_flags/development/sse_image_uploads.yml deleted file mode 100644 index 070704da024..00000000000 --- a/config/feature_flags/development/sse_image_uploads.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: sse_image_uploads -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35126 -rollout_issue_url: -milestone: '13.2' -type: development -group: group::static site editor -default_enabled: false diff --git a/db/migrate/20201105021637_add_uploads_size_to_project_statistics.rb b/db/migrate/20201105021637_add_uploads_size_to_project_statistics.rb new file mode 100644 index 00000000000..1d2251f6c37 --- /dev/null +++ b/db/migrate/20201105021637_add_uploads_size_to_project_statistics.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddUploadsSizeToProjectStatistics < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def up + add_column :project_statistics, :uploads_size, :bigint, default: 0, null: false + end + + def down + remove_column :project_statistics, :uploads_size + end +end diff --git a/db/migrate/20201105024127_add_uploads_size_to_namespace_root_storage_statistics.rb b/db/migrate/20201105024127_add_uploads_size_to_namespace_root_storage_statistics.rb new file mode 100644 index 00000000000..c3cccc7d5f2 --- /dev/null +++ b/db/migrate/20201105024127_add_uploads_size_to_namespace_root_storage_statistics.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddUploadsSizeToNamespaceRootStorageStatistics < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def up + add_column :namespace_root_storage_statistics, :uploads_size, :bigint, default: 0, null: false + end + + def down + remove_column :namespace_root_storage_statistics, :uploads_size + end +end diff --git a/db/schema_migrations/20201105021637 b/db/schema_migrations/20201105021637 new file mode 100644 index 00000000000..05a76d22568 --- /dev/null +++ b/db/schema_migrations/20201105021637 @@ -0,0 +1 @@ +b04e37c8713a333afbff4c7034d9f3ffca4a4490d0b563b73d9e6bffd45f3f6a \ No newline at end of file diff --git a/db/schema_migrations/20201105024127 b/db/schema_migrations/20201105024127 new file mode 100644 index 00000000000..fecda19cb2f --- /dev/null +++ b/db/schema_migrations/20201105024127 @@ -0,0 +1 @@ +afeff8d6bf5ca14f955f5d387e8d219e852e9617b80fe07ed2e1b57af19fd4fa \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 418fee39134..44a00c8f7aa 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -13876,7 +13876,8 @@ CREATE TABLE namespace_root_storage_statistics ( storage_size bigint DEFAULT 0 NOT NULL, packages_size bigint DEFAULT 0 NOT NULL, snippets_size bigint DEFAULT 0 NOT NULL, - pipeline_artifacts_size bigint DEFAULT 0 NOT NULL + pipeline_artifacts_size bigint DEFAULT 0 NOT NULL, + uploads_size bigint DEFAULT 0 NOT NULL ); CREATE TABLE namespace_settings ( @@ -15260,7 +15261,8 @@ CREATE TABLE project_statistics ( packages_size bigint DEFAULT 0 NOT NULL, wiki_size bigint, snippets_size bigint, - pipeline_artifacts_size bigint DEFAULT 0 NOT NULL + pipeline_artifacts_size bigint DEFAULT 0 NOT NULL, + uploads_size bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE project_statistics_id_seq diff --git a/doc/administration/troubleshooting/img/network_monitor_xid.png b/doc/administration/troubleshooting/img/network_monitor_xid.png index 5392f77327f..7fc2cf47ea0 100644 Binary files a/doc/administration/troubleshooting/img/network_monitor_xid.png and b/doc/administration/troubleshooting/img/network_monitor_xid.png differ diff --git a/doc/user/group/epics/img/containing_epic.png b/doc/user/group/epics/img/containing_epic.png index dc13d55e2bc..1ba5a30708f 100644 Binary files a/doc/user/group/epics/img/containing_epic.png and b/doc/user/group/epics/img/containing_epic.png differ diff --git a/doc/user/group/settings/img/new_group_navigation_v13_1.png b/doc/user/group/settings/img/new_group_navigation_v13_1.png index 98d45a694b6..307175727c7 100644 Binary files a/doc/user/group/settings/img/new_group_navigation_v13_1.png and b/doc/user/group/settings/img/new_group_navigation_v13_1.png differ diff --git a/doc/user/infrastructure/img/terraform_list_view.png b/doc/user/infrastructure/img/terraform_list_view.png deleted file mode 100644 index f1af3225833..00000000000 Binary files a/doc/user/infrastructure/img/terraform_list_view.png and /dev/null differ diff --git a/doc/user/infrastructure/img/terraform_list_view_v13_5.png b/doc/user/infrastructure/img/terraform_list_view_v13_5.png new file mode 100644 index 00000000000..b23dfa6289e Binary files /dev/null and b/doc/user/infrastructure/img/terraform_list_view_v13_5.png differ diff --git a/doc/user/infrastructure/terraform_state.md b/doc/user/infrastructure/terraform_state.md index e85a34a8de8..ef36f0217be 100644 --- a/doc/user/infrastructure/terraform_state.md +++ b/doc/user/infrastructure/terraform_state.md @@ -345,9 +345,9 @@ location. You can then go back to running it from within GitLab CI. ## Managing state files NOTE: **Note:** -We are currently working on [providing a graphical for managing state files](https://gitlab.com/groups/gitlab-org/-/epics/4563). +We are currently working on [providing a graphical interface for managing state files](https://gitlab.com/groups/gitlab-org/-/epics/4563). -![Terraform state list](img/terraform_list_view.png) +![Terraform state list](img/terraform_list_view_v13_5.png) The state files attached to a project can be found under Operations / Terraform. diff --git a/doc/user/packages/conan_repository/index.md b/doc/user/packages/conan_repository/index.md index 92ccdca1019..f6f8d6d61b6 100644 --- a/doc/user/packages/conan_repository/index.md +++ b/doc/user/packages/conan_repository/index.md @@ -12,23 +12,27 @@ info: To determine the technical writer assigned to the Stage/Group associated w Publish Conan packages in your project’s Package Registry. Then install the packages whenever you need to use them as a dependency. -To publish Conan packages to the Package Registry, add the -Package Registry as a remote and authenticate with it. +To publish Conan packages to the Package Registry, add the Package Registry as a +remote and authenticate with it. -Then you can run `conan` commands and publish your package to the Package Registry. +Then you can run `conan` commands and publish your package to the +Package Registry. ## Build a Conan package -This section explains how to install Conan and build a package for your C/C++ project. +This section explains how to install Conan and build a package for your C/C++ +project. -If you already use Conan and know how to build your own packages, go to the [next section](#add-the-package-registry-as-a-conan-remote). +If you already use Conan and know how to build your own packages, go to the +[next section](#add-the-package-registry-as-a-conan-remote). ### Install Conan -Download the Conan package manager to your local development environment by following -the instructions at [conan.io](https://conan.io/downloads.html). +Download the Conan package manager to your local development environment by +following the instructions at [conan.io](https://conan.io/downloads.html). -When installation is complete, verify you can use Conan in your terminal by running: +When installation is complete, verify you can use Conan in your terminal by +running: ```shell conan --version @@ -42,15 +46,16 @@ Conan version 1.20.5 ### Install CMake -When you develop with C++ and Conan, you have a range of compilers to choose from. -This example uses the CMake compiler. +When you develop with C++ and Conan, you can select from many available +compilers. This example uses the CMake compiler. To install CMake: - For Mac, use [homebrew](https://brew.sh/) and run `brew install cmake`. - For other operating systems, follow the instructions at [cmake.org](https://cmake.org/install/). -When installation is complete, verify you can use CMake in your terminal by running: +When installation is complete, verify you can use CMake in your terminal by +running: ```shell cmake --version @@ -60,8 +65,8 @@ The CMake version is printed in the output. ### Create a project -To test the Package Registry, you need a C++ project. If you don't already have one, you can clone the -Conan [hello world starter project](https://github.com/conan-io/hello). +To test the Package Registry, you need a C++ project. If you don't already have +one, you can clone the Conan [hello world starter project](https://github.com/conan-io/hello). ### Build a package @@ -74,22 +79,26 @@ To build a package: conan new Hello/0.1 -t ``` -1. Create a package for the recipe by running `conan create` with the Conan user and channel: +1. Create a package for the recipe by running `conan create` with the Conan user + and channel: ```shell conan create . mycompany/beta ``` NOTE: **Note:** - If you use an [instance remote](#add-a-remote-for-your-instance), you must follow a specific [naming convention](#package-recipe-naming-convention-for-instance-remotes). + If you use an [instance remote](#add-a-remote-for-your-instance), you must + follow a specific [naming convention](#package-recipe-naming-convention-for-instance-remotes). A package with the recipe `Hello/0.1@mycompany/beta` is created. -For more details on creating and managing Conan packages, see the [Conan docs](https://docs.conan.io/en/latest/creating_packages.html). +For more details about creating and managing Conan packages, see the +[Conan documentation](https://docs.conan.io/en/latest/creating_packages.html). ## Add the Package Registry as a Conan remote -To run `conan` commands, you must add the Package Registry as a Conan remote for your project or instance. +To run `conan` commands, you must add the Package Registry as a Conan remote for +your project or instance. ### Add a remote for your project @@ -143,9 +152,9 @@ To add the remote: #### Package recipe naming convention for instance remotes -The standard Conan recipe convention is `package_name/version@user/channel`, -but if you're using an [instance remote](#add-a-remote-for-your-instance), the recipe -`user` must be the plus sign (`+`) separated project path. +The standard Conan recipe convention is `package_name/version@user/channel`, but +if you're using an [instance remote](#add-a-remote-for-your-instance), the +recipe `user` must be the plus sign (`+`) separated project path. Example recipe names: @@ -156,58 +165,68 @@ Example recipe names: | `gitlab-org/gitlab-ce` | `my-package/1.0.0@gitlab-org+gitlab-ce/stable` | Yes | | `gitlab-org/gitlab-ce` | `my-package/1.0.0@foo/stable` | No | -[Project remotes](#add-a-remote-for-your-project) have a more flexible naming convention. +[Project remotes](#add-a-remote-for-your-project) have a more flexible naming +convention. ## Authenticate to the Package Registry -To authenticate to the Package Registry, you need either a personal access token or deploy token. +To authenticate to the Package Registry, you need either a personal access token +or deploy token. -- If you use a [personal access token](../../../user/profile/personal_access_tokens.md), set the scope to `api`. -- If you use a [deploy token](../../project/deploy_tokens/index.md), set the scope to `read_package_registry`, `write_package_registry`, or both. +- If you use a [personal access token](../../../user/profile/personal_access_tokens.md), + set the scope to `api`. +- If you use a [deploy token](../../project/deploy_tokens/index.md), set the + scope to `read_package_registry`, `write_package_registry`, or both. ### Add your credentials to the GitLab remote -Associate your token with the GitLab remote, so that you don't have to explicitly -add a token to every Conan command. +Associate your token with the GitLab remote, so that you don't have to +explicitly add a token to every Conan command. Prerequisites: - You must have an authentication token. -- The Conan remote [must be set](#add-the-package-registry-as-a-conan-remote). +- The Conan remote [must be configured](#add-the-package-registry-as-a-conan-remote). -In a terminal, run this command. In this example, the remote name is `gitlab`. Use the name of your remote. +In a terminal, run this command. In this example, the remote name is `gitlab`. +Use the name of your remote. ```shell conan user -r gitlab -p ``` -Now when you run commands with `--remote=gitlab`, your username and password are automatically included in the requests. +Now when you run commands with `--remote=gitlab`, your username and password are +included in the requests. -Alternately, you can explicitly include your credentials in any given command. For example: +Alternatively, you can explicitly include your credentials in any given command. +For example: ```shell CONAN_LOGIN_USERNAME= CONAN_PASSWORD= conan upload Hello/0.1@mycompany/beta --all --remote=gitlab ``` NOTE: **Note:** -Your authentication with GitLab expires on a regular basis, -so occasionally you may need to re-enter your personal access token. +Because your authentication with GitLab expires on a regular basis, you may +occasionally need to re-enter your personal access token. ### Set a default remote for your project (optional) -If you want to interact with the GitLab Package Registry without having to specify a remote, -you can tell Conan to always use the Package Registry for your packages. +If you want to interact with the GitLab Package Registry without having to +specify a remote, you can tell Conan to always use the Package Registry for your +packages. -In a terminal, run this command. +In a terminal, run this command: ```shell conan remote add_ref Hello/0.1@mycompany/beta gitlab ``` NOTE: **Note:** -The package recipe includes the version, so the default remote for `Hello/0.1@user/channel` does not work for `Hello/0.2@user/channel`. +The package recipe includes the version, so the default remote for +`Hello/0.1@user/channel` doesn't work for `Hello/0.2@user/channel`. -If you do not set a default user or remote, you can still include the user and remote in your commands: +If you don't set a default user or remote, you can still include the user and +remote in your commands: ```shell `CONAN_LOGIN_USERNAME= CONAN_PASSWORD= --remote=gitlab @@ -215,17 +234,18 @@ If you do not set a default user or remote, you can still include the user and r ## Publish a Conan package -Publish a Conan package to the Package Registry, so that anyone who can access the project can use the package as a dependency. +Publish a Conan package to the Package Registry, so that anyone who can access +the project can use the package as a dependency. Prerequisites: -To publish a Conan package, you need: - -- The Package Registry [set as a remote](#add-the-package-registry-as-a-conan-remote). -- [Authentication](#authenticate-to-the-package-registry) set up with the Package Registry. -- A local [Conan package](https://docs.conan.io/en/latest/creating_packages/getting_started.html). +- The Conan remote [must be configured](#add-the-package-registry-as-a-conan-remote). +- [Authentication](#authenticate-to-the-package-registry) with the + Package Registry must be configured. +- A local [Conan package](https://docs.conan.io/en/latest/creating_packages/getting_started.html) + must exist. - For an instance remote, the package must meet the [naming convention](#package-recipe-naming-convention-for-instance-remotes). -- A project ID, which is on the project's homepage. +- You must have the project ID, which is on the project's homepage. To publish the package, use the `conan upload` command: @@ -237,11 +257,11 @@ conan upload Hello/0.1@mycompany/beta --all > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11678) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.7. -To work with Conan commands in [GitLab CI/CD](../../../ci/README.md), you can use -`CI_JOB_TOKEN` in place of the personal access token in your commands. +To work with Conan commands in [GitLab CI/CD](../../../ci/README.md), you can +use `CI_JOB_TOKEN` in place of the personal access token in your commands. -You can provide the `CONAN_LOGIN_USERNAME` and `CONAN_PASSWORD` with each -Conan command in your `.gitlab-ci.yml` file. For example: +You can provide the `CONAN_LOGIN_USERNAME` and `CONAN_PASSWORD` with each Conan +command in your `.gitlab-ci.yml` file. For example: ```yaml image: conanio/gcc7 @@ -255,24 +275,26 @@ create_package: - CONAN_LOGIN_USERNAME=ci_user CONAN_PASSWORD=${CI_JOB_TOKEN} conan upload /0.1@+/stable --all --remote=gitlab ``` -Additional Conan images to use as the basis of your CI file are available -in the [Conan docs](https://docs.conan.io/en/latest/howtos/run_conan_in_docker.html#available-docker-images). +Additional Conan images to use as the basis of your CI file are available in the +[Conan docs](https://docs.conan.io/en/latest/howtos/run_conan_in_docker.html#available-docker-images). ## Install a Conan package -Install a Conan package from the Package Registry so you can use it as a dependency. +Install a Conan package from the Package Registry so you can use it as a +dependency. -Conan packages are often installed as dependencies by using the `conanfile.txt` file. +Conan packages are often installed as dependencies by using the `conanfile.txt` +file. Prerequisites: -To install a Conan package, you need: +- The Conan remote [must be configured](#add-the-package-registry-as-a-conan-remote). +- [Authentication](#authenticate-to-the-package-registry) with the + Package Registry must be configured. -- The Package Registry [set as a remote](#add-the-package-registry-as-a-conan-remote). -- [Authentication](#authenticate-to-the-package-registry) set up with the Package Registry. - -1. In the project where you want to install the package as a dependency, open `conanfile.txt`. - Or, in the root of your project, create a file called `conanfile.txt`. +1. In the project where you want to install the package as a dependency, open + `conanfile.txt`. Or, in the root of your project, create a file called + `conanfile.txt`. 1. Add the Conan recipe to the `[requires]` section of the file: @@ -284,7 +306,8 @@ To install a Conan package, you need: cmake ``` -1. At the root of your project, create a `build` directory and change to that directory: +1. At the root of your project, create a `build` directory and change to that + directory: ```shell mkdir build && cd build @@ -298,7 +321,7 @@ To install a Conan package, you need: NOTE: **Note:** If you try to install the package you just created in this tutorial, the package -already exists on your local machine, so this command has no effect. +already exists on your local computer, so this command has no effect. ## Remove a Conan package @@ -310,19 +333,22 @@ There are two ways to remove a Conan package from the GitLab Package Registry. conan remove Hello/0.2@user/channel --remote=gitlab ``` - You must explicitly include the remote in this command, otherwise the package is only removed from your - local system cache. + You must explicitly include the remote in this command, otherwise the package + is removed only from your local system cache. NOTE: **Note:** - This command removes all recipe and binary package files from the Package Registry. + This command removes all recipe and binary package files from the + Package Registry. - From the GitLab user interface: - Go to your project's **Packages & Registries > Package Registry**. Remove the package by clicking the red trash icon. + Go to your project's **Packages & Registries > Package Registry**. Remove the + package by clicking the red trash icon. ## Search for Conan packages in the Package Registry -To search by full or partial package name, or by exact recipe, run the `conan search` command. +To search by full or partial package name, or by exact recipe, run the +`conan search` command. - To search for all packages with a specific package name: @@ -336,7 +362,8 @@ To search by full or partial package name, or by exact recipe, run the `conan se conan search He* --remote=gitlab ``` -The scope of your search includes all projects you have permission to access. This includes your private projects as well as all public projects. +The scope of your search includes all projects you have permission to access. +This includes your private projects as well as all public projects. ## Fetch Conan package information from the Package Registry @@ -351,7 +378,9 @@ conan info Hello/0.1@mycompany/beta The GitLab Conan repository supports the following Conan CLI commands: - `conan upload`: Upload your recipe and package files to the Package Registry. -- `conan install`: Install a Conan package from the Package Registry, this includes using the `conanfile.txt` file. -- `conan search`: Search the Package Registry for public packages, and private packages you have permission to view. +- `conan install`: Install a Conan package from the Package Registry, which + includes using the `conanfile.txt` file. +- `conan search`: Search the Package Registry for public packages, and private + packages you have permission to view. - `conan info`: View the information on a given package from the Package Registry. - `conan remove`: Delete the package from the Package Registry. diff --git a/doc/user/project/import/img/gemnasium/connect_github.png b/doc/user/project/import/img/gemnasium/connect_github.png index 5933f4d5d0a..fae62e8d840 100644 Binary files a/doc/user/project/import/img/gemnasium/connect_github.png and b/doc/user/project/import/img/gemnasium/connect_github.png differ diff --git a/doc/user/project/import/img/gemnasium/create_project.png b/doc/user/project/import/img/gemnasium/create_project.png index 6e00bf63405..8edbf711629 100644 Binary files a/doc/user/project/import/img/gemnasium/create_project.png and b/doc/user/project/import/img/gemnasium/create_project.png differ diff --git a/doc/user/project/import/img/gemnasium/project_connected.png b/doc/user/project/import/img/gemnasium/project_connected.png index 8e7216c015b..332d2230ef8 100644 Binary files a/doc/user/project/import/img/gemnasium/project_connected.png and b/doc/user/project/import/img/gemnasium/project_connected.png differ diff --git a/doc/user/project/merge_requests/img/project_merge_requests_list_view.png b/doc/user/project/merge_requests/img/project_merge_requests_list_view.png index 457716d811c..2c86a1ad839 100644 Binary files a/doc/user/project/merge_requests/img/project_merge_requests_list_view.png and b/doc/user/project/merge_requests/img/project_merge_requests_list_view.png differ diff --git a/doc/user/project/milestones/img/milestones_new_group_milestone.png b/doc/user/project/milestones/img/milestones_new_group_milestone.png index a517f0f7537..5bbe8e51f23 100644 Binary files a/doc/user/project/milestones/img/milestones_new_group_milestone.png and b/doc/user/project/milestones/img/milestones_new_group_milestone.png differ diff --git a/doc/user/project/milestones/img/milestones_new_project_milestone.png b/doc/user/project/milestones/img/milestones_new_project_milestone.png index 482c73f6568..2d0bdce542d 100644 Binary files a/doc/user/project/milestones/img/milestones_new_project_milestone.png and b/doc/user/project/milestones/img/milestones_new_project_milestone.png differ diff --git a/doc/user/project/repository/branches/img/compare_branches.png b/doc/user/project/repository/branches/img/compare_branches.png index 52d5c518c45..e6f88da4989 100644 Binary files a/doc/user/project/repository/branches/img/compare_branches.png and b/doc/user/project/repository/branches/img/compare_branches.png differ diff --git a/doc/user/project/repository/img/file_ext_icons_repo_v12_10.png b/doc/user/project/repository/img/file_ext_icons_repo_v12_10.png index 346f0e58325..04a8f38871b 100644 Binary files a/doc/user/project/repository/img/file_ext_icons_repo_v12_10.png and b/doc/user/project/repository/img/file_ext_icons_repo_v12_10.png differ diff --git a/doc/user/project/web_ide/img/solarized_light_theme_v13_0.png b/doc/user/project/web_ide/img/solarized_light_theme_v13_0.png index adf6d3c6b02..b4b14f1fc7f 100644 Binary files a/doc/user/project/web_ide/img/solarized_light_theme_v13_0.png and b/doc/user/project/web_ide/img/solarized_light_theme_v13_0.png differ diff --git a/spec/factories/project_statistics.rb b/spec/factories/project_statistics.rb index ea003b67db0..ee2ad507c2d 100644 --- a/spec/factories/project_statistics.rb +++ b/spec/factories/project_statistics.rb @@ -23,6 +23,7 @@ FactoryBot.define do project_statistics.packages_size = evaluator.size_multiplier * 5 project_statistics.snippets_size = evaluator.size_multiplier * 6 project_statistics.pipeline_artifacts_size = evaluator.size_multiplier * 7 + project_statistics.uploads_size = evaluator.size_multiplier * 8 end end end diff --git a/spec/frontend/ide/components/repo_tab_spec.js b/spec/frontend/ide/components/repo_tab_spec.js index 6b10afd31ca..a44c8b4d5ee 100644 --- a/spec/frontend/ide/components/repo_tab_spec.js +++ b/spec/frontend/ide/components/repo_tab_spec.js @@ -134,9 +134,7 @@ describe('RepoTab', () => { }); it('renders a tooltip', () => { - expect(wrapper.find('span:nth-child(2)').attributes('data-original-title')).toContain( - 'Locked by testuser', - ); + expect(wrapper.find('span:nth-child(2)').attributes('title')).toBe('Locked by testuser'); }); }); diff --git a/spec/models/namespace/root_storage_statistics_spec.rb b/spec/models/namespace/root_storage_statistics_spec.rb index 92a8d17a2a8..b725d2366a1 100644 --- a/spec/models/namespace/root_storage_statistics_spec.rb +++ b/spec/models/namespace/root_storage_statistics_spec.rb @@ -45,6 +45,7 @@ RSpec.describe Namespace::RootStorageStatistics, type: :model do total_storage_size = stat1.storage_size + stat2.storage_size total_snippets_size = stat1.snippets_size + stat2.snippets_size total_pipeline_artifacts_size = stat1.pipeline_artifacts_size + stat2.pipeline_artifacts_size + total_uploads_size = stat1.uploads_size + stat2.uploads_size expect(root_storage_statistics.repository_size).to eq(total_repository_size) expect(root_storage_statistics.wiki_size).to eq(total_wiki_size) @@ -54,6 +55,7 @@ RSpec.describe Namespace::RootStorageStatistics, type: :model do expect(root_storage_statistics.storage_size).to eq(total_storage_size) expect(root_storage_statistics.snippets_size).to eq(total_snippets_size) expect(root_storage_statistics.pipeline_artifacts_size).to eq(total_pipeline_artifacts_size) + expect(root_storage_statistics.uploads_size).to eq(total_uploads_size) end it 'works when there are no projects' do diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index 9f40dbb3401..2d283766edb 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -34,7 +34,8 @@ RSpec.describe ProjectStatistics do lfs_objects_size: 2.exabytes, build_artifacts_size: 1.exabyte, snippets_size: 1.exabyte, - pipeline_artifacts_size: 1.exabyte - 1 + pipeline_artifacts_size: 512.petabytes - 1, + uploads_size: 512.petabytes ) statistics.reload @@ -46,7 +47,8 @@ RSpec.describe ProjectStatistics do expect(statistics.build_artifacts_size).to eq(1.exabyte) expect(statistics.storage_size).to eq(8.exabytes - 1) expect(statistics.snippets_size).to eq(1.exabyte) - expect(statistics.pipeline_artifacts_size).to eq(1.exabyte - 1) + expect(statistics.pipeline_artifacts_size).to eq(512.petabytes - 1) + expect(statistics.uploads_size).to eq(512.petabytes) end end @@ -57,6 +59,7 @@ RSpec.describe ProjectStatistics do statistics.lfs_objects_size = 3 statistics.build_artifacts_size = 4 statistics.snippets_size = 5 + statistics.uploads_size = 3 expect(statistics.total_repository_size).to eq 5 end @@ -98,6 +101,7 @@ RSpec.describe ProjectStatistics do allow(statistics).to receive(:update_lfs_objects_size) allow(statistics).to receive(:update_snippets_size) allow(statistics).to receive(:update_storage_size) + allow(statistics).to receive(:update_uploads_size) end context "without arguments" do @@ -111,6 +115,7 @@ RSpec.describe ProjectStatistics do expect(statistics).to have_received(:update_wiki_size) expect(statistics).to have_received(:update_lfs_objects_size) expect(statistics).to have_received(:update_snippets_size) + expect(statistics).to have_received(:update_uploads_size) end end @@ -125,6 +130,7 @@ RSpec.describe ProjectStatistics do expect(statistics).not_to have_received(:update_repository_size) expect(statistics).not_to have_received(:update_wiki_size) expect(statistics).not_to have_received(:update_snippets_size) + expect(statistics).not_to have_received(:update_uploads_size) end end @@ -139,10 +145,12 @@ RSpec.describe ProjectStatistics do expect(statistics).to have_received(:update_repository_size) expect(statistics).to have_received(:update_wiki_size) expect(statistics).to have_received(:update_snippets_size) + expect(statistics).to have_received(:update_uploads_size) expect(statistics.repository_size).to eq(0) expect(statistics.commit_count).to eq(0) expect(statistics.wiki_size).to eq(0) expect(statistics.snippets_size).to eq(0) + expect(statistics.uploads_size).to eq(0) end end @@ -163,10 +171,12 @@ RSpec.describe ProjectStatistics do expect(statistics).to have_received(:update_repository_size) expect(statistics).to have_received(:update_wiki_size) expect(statistics).to have_received(:update_snippets_size) + expect(statistics).to have_received(:update_uploads_size) expect(statistics.repository_size).to eq(0) expect(statistics.commit_count).to eq(0) expect(statistics.wiki_size).to eq(0) expect(statistics.snippets_size).to eq(0) + expect(statistics.uploads_size).to eq(0) end end @@ -211,6 +221,7 @@ RSpec.describe ProjectStatistics do expect(statistics).not_to receive(:update_wiki_size) expect(statistics).not_to receive(:update_lfs_objects_size) expect(statistics).not_to receive(:update_snippets_size) + expect(statistics).not_to receive(:update_uploads_size) expect(statistics).not_to receive(:save!) expect(Namespaces::ScheduleAggregationWorker) .not_to receive(:perform_async) @@ -295,6 +306,26 @@ RSpec.describe ProjectStatistics do end end + describe '#update_uploads_size' do + let!(:upload1) { create(:upload, model: project, size: 1.megabyte) } + let!(:upload2) { create(:upload, model: project, size: 2.megabytes) } + + it 'stores the size of related uploaded files' do + expect(statistics.update_uploads_size).to eq(3.megabytes) + end + + context 'with feature flag disabled' do + before do + statistics.update_columns(uploads_size: 0) + stub_feature_flags(count_uploads_size_in_storage_stats: false) + end + + it 'does not store the size of related uploaded files' do + expect(statistics.update_uploads_size).to eq(0) + end + end + end + describe '#update_storage_size' do it "sums all storage counters" do statistics.update!( @@ -302,12 +333,13 @@ RSpec.describe ProjectStatistics do wiki_size: 4, lfs_objects_size: 3, snippets_size: 2, - pipeline_artifacts_size: 3 + pipeline_artifacts_size: 3, + uploads_size: 5 ) statistics.reload - expect(statistics.storage_size).to eq 14 + expect(statistics.storage_size).to eq 19 end it 'works during wiki_size backfill' do