Commit 769d341a authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'sh-pipeline-artifacts-size' into 'master'

Include Pipeline Artifacts on storage usage page

See merge request gitlab-org/gitlab!44645
parents d6603201 6e0dcd8d
<script> <script>
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { numberToHumanSize } from '~/lib/utils/number_utils'; import { numberToHumanSize } from '~/lib/utils/number_utils';
export default { export default {
components: {
GlIcon,
},
directives: {
GlTooltip: GlTooltipDirective,
},
props: { props: {
rootStorageStatistics: { rootStorageStatistics: {
required: true, required: true,
...@@ -17,6 +24,7 @@ export default { ...@@ -17,6 +24,7 @@ export default {
storageTypes() { storageTypes() {
const { const {
buildArtifactsSize, buildArtifactsSize,
pipelineArtifactsSize,
lfsObjectsSize, lfsObjectsSize,
packagesSize, packagesSize,
repositorySize, repositorySize,
...@@ -24,6 +32,7 @@ export default { ...@@ -24,6 +32,7 @@ export default {
wikiSize, wikiSize,
snippetsSize, snippetsSize,
} = this.rootStorageStatistics; } = this.rootStorageStatistics;
const artifactsSize = buildArtifactsSize + pipelineArtifactsSize;
if (storageSize === 0) { if (storageSize === 0) {
return null; return null;
...@@ -49,10 +58,11 @@ export default { ...@@ -49,10 +58,11 @@ export default {
size: packagesSize, size: packagesSize,
}, },
{ {
name: s__('UsageQuota|Build Artifacts'), name: s__('UsageQuota|Artifacts'),
style: this.usageStyle(this.barRatio(buildArtifactsSize)), style: this.usageStyle(this.barRatio(artifactsSize)),
class: 'gl-bg-data-viz-green-600', class: 'gl-bg-data-viz-green-600',
size: buildArtifactsSize, size: artifactsSize,
tooltip: s__('UsageQuota|Artifacts is a sum of build and pipeline artifacts.'),
}, },
{ {
name: s__('UsageQuota|Wikis'), name: s__('UsageQuota|Wikis'),
...@@ -116,6 +126,15 @@ export default { ...@@ -116,6 +126,15 @@ export default {
<span class="gl-text-gray-500 gl-font-sm"> <span class="gl-text-gray-500 gl-font-sm">
{{ formatSize(storageType.size) }} {{ formatSize(storageType.size) }}
</span> </span>
<span
v-if="storageType.tooltip"
v-gl-tooltip
:title="storageType.tooltip"
:aria-label="storageType.tooltip"
class="gl-ml-2"
>
<gl-icon name="question" :size="12" />
</span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -14,6 +14,7 @@ query getStorageCounter($fullPath: ID!, $withExcessStorageData: Boolean = false) ...@@ -14,6 +14,7 @@ query getStorageCounter($fullPath: ID!, $withExcessStorageData: Boolean = false)
repositorySize repositorySize
lfsObjectsSize lfsObjectsSize
buildArtifactsSize buildArtifactsSize
pipelineArtifactsSize
packagesSize packagesSize
wikiSize wikiSize
snippetsSize snippetsSize
......
---
title: Include pipeline artifacts size on storage usage page
merge_request: 44645
author:
type: added
...@@ -27,7 +27,8 @@ describe('Storage Counter usage graph component', () => { ...@@ -27,7 +27,8 @@ describe('Storage Counter usage graph component', () => {
repositorySize: 4000, repositorySize: 4000,
packagesSize: 3000, packagesSize: 3000,
lfsObjectsSize: 2000, lfsObjectsSize: 2000,
buildArtifactsSize: 1000, buildArtifactsSize: 500,
pipelineArtifactsSize: 500,
snippetsSize: 2000, snippetsSize: 2000,
storageSize: 17000, storageSize: 17000,
}, },
...@@ -45,6 +46,7 @@ describe('Storage Counter usage graph component', () => { ...@@ -45,6 +46,7 @@ describe('Storage Counter usage graph component', () => {
const { const {
buildArtifactsSize, buildArtifactsSize,
pipelineArtifactsSize,
lfsObjectsSize, lfsObjectsSize,
packagesSize, packagesSize,
repositorySize, repositorySize,
...@@ -66,7 +68,7 @@ describe('Storage Counter usage graph component', () => { ...@@ -66,7 +68,7 @@ describe('Storage Counter usage graph component', () => {
`Snippets ${numberToHumanSize(snippetsSize)}`, `Snippets ${numberToHumanSize(snippetsSize)}`,
); );
expect(types.at(5).text()).toMatchInterpolatedText( expect(types.at(5).text()).toMatchInterpolatedText(
`Build Artifacts ${numberToHumanSize(buildArtifactsSize)}`, `Artifacts ${numberToHumanSize(buildArtifactsSize + pipelineArtifactsSize)}`,
); );
}); });
......
...@@ -28207,7 +28207,7 @@ msgstr "" ...@@ -28207,7 +28207,7 @@ msgstr ""
msgid "UsageQuota|Artifacts" msgid "UsageQuota|Artifacts"
msgstr "" msgstr ""
msgid "UsageQuota|Build Artifacts" msgid "UsageQuota|Artifacts is a sum of build and pipeline artifacts."
msgstr "" msgstr ""
msgid "UsageQuota|Buy additional minutes" msgid "UsageQuota|Buy additional minutes"
......
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