Discovery: calculate and note database size related to license compliance

Problem to solve

From https://gitlab.com/gitlab-org/gitlab/-/issues/226004#note_395092330

License Compliance also depends on the software_licenses and software_license_policies DB tables. ... The data in the software_license_policies table is controlled by users via changes in the UI and does not have a retention policy.

It is unknown today how much space this is using, and we want users to be able to know this.

The outcome of this issue should be a plan (epic with plan if large, otherwise issue with plan) on how to calculate per project space used, and make it available to the team working on the UI. you can do a proof of concept if you have time but i do NOT expect this issue to solve the problem only show if it can be solved and the plan for how.

User experience goal

make this available in such a way it can be shown in the new planned interface that shows utilization of disk space here: https://gitlab.com/gitlab-org/gitlab/-/issues/223030#note_403956626

Note the UI is owned by another team.

Proposal

We need to expose ways to show users the amount of space being used by these tables, and also how to clear out these tables. The way we display that information to the users is handled in a generic fashion as part of another issue: https://gitlab.com/gitlab-org/gitlab/-/issues/223030. The proposal here is focused on calculating the amount of storage used by these tables on gitlab.com and define how to provide that information to the generic logic so that it gets displayed to the user.

Related discussion: https://gitlab.com/gitlab-org/gitlab/-/issues/223030#note_403956626

  • Step 1: figure out how much space is used on gitlab.com for these tables by defining and executing dedicated queries
  • Step 2: figure out how easy it would be to get storage usage per account (including potential performance issues of these queries)

Further details

Permissions and Security

this should be a calculation and show values (read only) but NOT a create, update or delete.

Documentation

maybe? ask the team doing the UI if/where we should document this

Availability & Testing

This looks like it is non-behavioural for the most part. The displaying the storage to the user could potentially be unit tested. End to end testing would be trickier as it would require capturing both the storage size and calculating that independently and comparing both. If no licence compliance data is being captured at this stage of testing it would be hoped that there would be no variance.

Note: We may want to test our calculation is working (0 satte, no LC on state, and has data state) but leave UI tests to UI team.

Is this a cross-stage feature?

yes

~"group::conversion" devopsgrowth

Links / references

Edited by Nicole Schwartz