Skip to content
Snippets Groups Projects

Display Cost Factored Storage Sizes on Project Usage Quotas Page

Merged Ammar Alakkad requested to merge 416097-use-cost-factored-storage-size-on-frontend into master
All threads resolved!

What does this MR do and why?

It displays the cost factored storage size statistics on the project's usage quotas page.

When display_cost_factored_storage_size_on_project_pages feature flag is enabled, we fetch the cost factored storage sizes and show them to the users.

Note: I opted to have two GraphQL queries for this change and based feature flag decide which one we use.

The new query has the same structure as the original one except it aliases all costFactored* types to the original type name without costFactored prefix, this way the frontend would just works without much changes or additional complexity.

It might not be recommended to use this method, but I think it's justified in this case since the costFactored* types are EE only, and having them in a conditional @include will break the FOSS version.

MR Description Status
!136867 (merged) Duplicate project_storage query to EE :white_check_mark:
!134758 (merged) Add cost_factored query to both CE and EE and load it behind FF :point_left:
Upcoming Clean-up feature flag, and move cost_factored properties to the EE version of project_storage query :soon:

Screenshots or screen recordings

Before After
Screenshot_2023-11-01_at_14.21.24 Screenshot_2023-11-01_at_14.20.49

How to set up and validate locally

  1. In bin/rails console run Feature.enable(:display_cost_factored_storage_size_on_project_pages)
  2. As root, navigate to /admin/application_settings/namespace_storage and set the cost factor to something less than 1 (e.g. 0.3) and save
  3. In local gitlab, fork a public project to a private fork
  4. Navigate to the forked project > Settings > Usage Quotas
  5. Observe the storage size displayed is less than original repo's storage
  6. Try disable the feature flag in step 1 and refresh the page, the storage size in the forked project should match the original repo
  • To run the frontend tests, make sure to generate the fixtures first bin/rspec ee/spec/frontend/fixtures/projects.rb
  • In case the storage didn't get updated, click the "Recalculate repository usage" button on the project's usage quotas page

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #416097

Edited by Ammar Alakkad

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ghost User
  • Ghost User
  • Ghost User
  • Contributor

    Allure report

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 4be917f8

    expand test summary
    +-----------------------------------------------------------------------+
    |                            suites summary                             |
    +------------------+--------+--------+---------+-------+-------+--------+
    |                  | passed | failed | skipped | flaky | total | result |
    +------------------+--------+--------+---------+-------+-------+--------+
    | Verify           | 31     | 0      | 0       | 0     | 31    | ✅     |
    | Plan             | 55     | 0      | 0       | 0     | 55    | ✅     |
    | Create           | 48     | 0      | 9       | 0     | 57    | ✅     |
    | Data Stores      | 23     | 0      | 0       | 0     | 23    | ✅     |
    | Govern           | 57     | 0      | 0       | 0     | 57    | ✅     |
    | Monitor          | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Manage           | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Package          | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Framework sanity | 0      | 0      | 1       | 0     | 1     | ➖     |
    +------------------+--------+--------+---------+-------+-------+--------+
    | Total            | 222    | 0      | 12      | 0     | 234   | ✅     |
    +------------------+--------+--------+---------+-------+-------+--------+

    e2e-package-and-test: :exclamation: test report for bffeb887

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Fulfillment | 8      | 0      | 69      | 1     | 77    | ❗     |
    | Create      | 130    | 0      | 21      | 0     | 151   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 138    | 0      | 90      | 1     | 228   | ❗     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-review-qa: :white_check_mark: test report for 4be917f8

    expand test summary
    +-----------------------------------------------------------------------+
    |                            suites summary                             |
    +------------------+--------+--------+---------+-------+-------+--------+
    |                  | passed | failed | skipped | flaky | total | result |
    +------------------+--------+--------+---------+-------+-------+--------+
    | Create           | 8      | 0      | 2       | 0     | 10    | ✅     |
    | Data Stores      | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Package          | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Govern           | 3      | 0      | 0       | 0     | 3     | ✅     |
    | Framework sanity | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Monitor          | 4      | 0      | 0       | 0     | 4     | ✅     |
    | Plan             | 3      | 0      | 1       | 0     | 4     | ✅     |
    +------------------+--------+--------+---------+-------+-------+--------+
    | Total            | 20     | 0      | 5       | 0     | 25    | ✅     |
    +------------------+--------+--------+---------+-------+-------+--------+
  • Ammar Alakkad marked this merge request as draft

    marked this merge request as draft

  • Ammar Alakkad added 422 commits

    added 422 commits

    Compare with previous version

  • Ammar Alakkad added 965 commits

    added 965 commits

    • 1cd4002a...dbdd3384 - 956 commits from branch master
    • 47fe8ac0 - Add cost factored storage sizes to graphql project statistics type
    • b1ea12bb - Add cost factored attributes to project statistics type
    • 4cae841f - Add graphql documentation
    • 1cdb1549 - Change double quotes to single in a spec
    • 55da3127 - Pass feature flag down to project storage app
    • 41566dc8 - Add fixture for cost factored project storage stats
    • 1fba9ccc - Add cost factored stats to graphql query
    • 9121e960 - Clean-up console from project_storage_app.vue
    • 66111b76 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad changed title from Draft: Resolve "Display Cost Factored Storage Sizes on Project Usage Quotas Page" to Draft: Display Cost Factored Storage Sizes on Project Usage Quotas Page

    changed title from Draft: Resolve "Display Cost Factored Storage Sizes on Project Usage Quotas Page" to Draft: Display Cost Factored Storage Sizes on Project Usage Quotas Page

  • Ammar Alakkad marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed

    marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed

  • Ammar Alakkad changed the description

    changed the description

  • Ammar Alakkad changed the description

    changed the description

  • Ammar Alakkad added 4 commits

    added 4 commits

    • 58a4b5c2 - Add fixture for cost factored project storage stats
    • b7eae544 - Add cost factored stats to graphql query
    • f913d1cb - Clean-up console from project_storage_app.vue
    • 892769b4 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ghost User
  • Ammar Alakkad added 4 commits

    added 4 commits

    • ab122fb3 - Add fixture for cost factored project storage stats
    • f453a1e6 - Add cost factored stats to graphql query
    • 4dd258ee - Clean-up console from project_storage_app.vue
    • 964add78 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad resolved all threads

    resolved all threads

  • Ammar Alakkad added 3 commits

    added 3 commits

    • 92239e79 - Add cost factored stats to GraphQL query
    • b4a0fd0f - Clean-up console from project_storage_app.vue
    • 3066c7b6 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad changed target branch from master to add-cost-factored-sizes-to-graphql-project-statistics-type

    changed target branch from master to add-cost-factored-sizes-to-graphql-project-statistics-type

  • Jason Goodman deleted the add-cost-factored-sizes-to-graphql-project-statistics-type branch. This merge request now targets the master branch

    deleted the add-cost-factored-sizes-to-graphql-project-statistics-type branch. This merge request now targets the master branch

  • Ammar Alakkad added 373 commits

    added 373 commits

    • 3066c7b6...ad532cc9 - 368 commits from branch master
    • fb8c722a - Pass feature flag down to project storage app
    • 9aa16ba8 - Add fixture for cost factored project storage stats
    • cb3b1cbf - Add cost factored stats to GraphQL query
    • ac768031 - Clean-up console from project_storage_app.vue
    • 0f44bf27 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad marked this merge request as ready

    marked this merge request as ready

  • Ammar Alakkad
  • Ammar Alakkad added 5 commits

    added 5 commits

    • dc520e18 - Pass feature flag down to project storage app
    • 1c7a055a - Add fixture for cost factored project storage stats
    • 1687006b - Add cost factored stats to GraphQL query
    • 6f226b51 - Clean-up console from project_storage_app.vue
    • 45321039 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad changed the description

    changed the description

  • Ammar Alakkad added 224 commits

    added 224 commits

    • 45321039...88ef89e9 - 219 commits from branch master
    • 86f860f2 - Pass feature flag down to project storage app
    • 2bf3b7d0 - Add cost factored stats GraphQL query
    • 21c37280 - Add fixture for cost factored project storage stats
    • 6d88fecd - Clean-up console from project_storage_app.vue
    • 996abd68 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad added 3 commits

    added 3 commits

    • b31402ca - Add fixture for cost factored project storage stats
    • fa8df1b9 - Clean-up console from project_storage_app.vue
    • 3a35bec4 - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad added 2 commits

    added 2 commits

    • e0e7b8ee - Clean-up console from project_storage_app.vue
    • c7831d3c - Test we use cost factored query on the frontend

    Compare with previous version

  • Ammar Alakkad requested review from @kpalchyk

    requested review from @kpalchyk

  • Kos Palchyk approved this merge request

    approved this merge request

  • Ammar Alakkad resolved all threads

    resolved all threads

  • Author Developer

    Hey @vitallium :wave:

    Would you review this merge request, please?

    Thanks!

  • Ammar Alakkad requested review from @vitallium

    requested review from @vitallium

  • Jason Goodman
  • Ammar Alakkad added 1 commit

    added 1 commit

    • bffeb887 - Move pushing the FF to before_action block

    Compare with previous version

  • Contributor

    @aalakkad Some end-to-end (E2E) tests should run based on the stage label.

    Please start the trigger-omnibus-and-follow-up-e2e job in the qa stage and ensure tests in the follow-up-e2e:package-and-test-ee pipeline pass before this MR is merged. (E2E tests are computationally intensive and don't run automatically for every push/rebase, so we ask you to run this job manually at least once.)

    To run all E2E tests, apply the pipeline:run-all-e2e label and run a new pipeline.

    E2E test jobs are allowed to fail due to flakiness. See current failures at the latest pipeline triage issue.

    Once done, apply the :white_check_mark: emoji on this comment.

    Team members only: for any questions or help, reach out on the internal #quality Slack channel.

  • Contributor

    :tools: Generated by gitlab_quality-test_tooling.

    :recycle: Please share your feedback and suggestions.


    :snail: Slow tests detected in this merge request, might be related with changed RSpec files.

    Job File Name Duration Expected duration
    #5491639524 spec/features/projects_spec.rb#L72 Project template create with project template behaves like creates from template is created from template 64.69 s < 50.13 s
  • A deleted user added rspec:slow test detected label
  • Ammar Alakkad added 1409 commits

    added 1409 commits

    • bffeb887...269d3ab1 - 1403 commits from branch master
    • e927475a - Pass feature flag down to project storage app
    • 8e1311a9 - Add cost factored stats GraphQL query
    • e855e500 - Clean-up console from project_storage_app.vue
    • 069b0144 - Test we use cost factored query on the frontend
    • c28403ab - Move pushing the FF to before_action block
    • 40517da6 - Duplicate cost factored project_storage gql to ee

    Compare with previous version

  • Contributor
    1 Warning
    :warning: da745068: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.

    Reviewer roulette

    Changes that require review have been detected!

    Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:

    Category Reviewer Maintainer
    backend @jmontal profile link current availability (UTC-7, 10 hours behind author) @eurie profile link current availability (UTC-5, 8 hours behind author)
    frontend @thomasrandolph profile link current availability (UTC-7, 10 hours behind author) @afontaine profile link current availability (UTC-5, 8 hours behind author)

    Please check reviewer's status!

    • available Reviewer is available!
    • unavailable Reviewer is unavailable!

    Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.

    To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.

    Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

  • Contributor

    Bundle size analysis [beta]

    This compares changes in bundle size for entry points between the commits af0322ab and 4be917f8

    :sparkles: Special assets

    Entrypoint / Name Size before Size after Diff Diff in percent
    average 4.06 MB 4.06 MB - -0.0 %
    mainChunk 3.05 MB 3.05 MB - -0.0 %

    :fearful: Significant Growth: 1

    Expand
    Entrypoint / Name Size before Size after Diff Diff in percent
    pages.projects.usage_quotas 264.33 KB 271.64 KB +7.31 KB 2.8 %

    Your MR has at least one entrypoint growing significantly (more > 1 KB or 2%). If you write new or extend existing features, this is expected and there is nothing to worry about.

    Please consider pinging someone from the FE Foundations (@leipert, @markrian, @ohoral or @pgascouvaillancourt) for review, if you are unsure about the size increase.

    Note: We do not have exact data for af0322ab. So we have used data from: 50ff9b8c.
    The target commit was too new, so we used the latest commit from master we have info on.
    It might help to rerun the bundle-size-review job
    This might mean that you have a few false positives in this report. If something unrelated to your code changes is reported, you can check this comparison in order to see if they caused this change.

    Please look at the full report for more details


    Read more about how this report works.

    Generated by :no_entry_sign: Danger

  • Kos Palchyk approved this merge request

    approved this merge request

  • 🤖 GitLab Bot 🤖 changed milestone to %16.7

    changed milestone to %16.7

  • removed Solutions label

  • Ammar Alakkad mentioned in merge request !136867 (merged)

    mentioned in merge request !136867 (merged)

  • Ammar Alakkad changed the description

    changed the description

  • Ammar Alakkad added 1 commit

    added 1 commit

    • 22239f8f - Duplicate cost factored project_storage gql to ee

    Compare with previous version

  • Ammar Alakkad added 654 commits

    added 654 commits

    • 22239f8f...33f4d15f - 648 commits from branch master
    • 6d4442b2 - Pass feature flag down to project storage app
    • 18dd17d3 - Add cost factored stats GraphQL query
    • f1edf611 - Clean-up console from project_storage_app.vue
    • 5d7cd8f7 - Test we use cost factored query on the frontend
    • dc9ed8ef - Move pushing the FF to before_action block
    • da745068 - Duplicate cost factored project_storage gql to ee

    Compare with previous version

  • Ammar Alakkad changed the description

    changed the description

  • Ammar Alakkad added 759 commits

    added 759 commits

    • da745068...097dcdad - 758 commits from branch master
    • c0a03397 - Merge branch 'master' into 416097-use-cost-factored-storage-size-on-frontend

    Compare with previous version

  • Ammar Alakkad removed review request for @vitallium

    removed review request for @vitallium

  • Ammar Alakkad added 394 commits

    added 394 commits

    • c0a03397...05fe432c - 393 commits from branch master
    • 4be917f8 - Merge branch 'master' into 416097-use-cost-factored-storage-size-on-frontend

    Compare with previous version

  • Ammar Alakkad requested review from @vitallium

    requested review from @vitallium

  • Vitaly Slobodin
  • @aalakkad looks good! I would to ask @jagood to also look here if possible, since he knows that part better than me.

  • Vitaly Slobodin approved this merge request

    approved this merge request

  • Vitaly Slobodin requested review from @jagood

    requested review from @jagood

  • Vitaly Slobodin removed review request for @vitallium

    removed review request for @vitallium

  • Jason Goodman removed review request for @jagood

    removed review request for @jagood

  • Ammar Alakkad requested review from @vitallium

    requested review from @vitallium

  • Vitaly Slobodin resolved all threads

    resolved all threads

  • merged

  • Ammar Alakkad mentioned in commit 5bbafe9b

    mentioned in commit 5bbafe9b

  • Author Developer

    I wonder how I was able to merge my own MR even thought I'm not a maintainer :thinking:

    @vitallium is it because you (maintainer) approved it?

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading