Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store repo size (in kB) in database #1221

Merged
merged 10 commits into from
Nov 15, 2024
Merged

Store repo size (in kB) in database #1221

merged 10 commits into from
Nov 15, 2024

Conversation

rmunn
Copy link
Contributor

@rmunn rmunn commented Nov 11, 2024

Fix #1088.

Work completed:

  • hg command runner command to get the repo size in kilobytes (it'll always be a multiple of 4 kb, so getting it in bytes isn't really necessary).
  • store size in Project table
  • update size after each Send/Receive
  • GQL mutation to update project size
  • frontend updates project size automatically if it's null
    • GQL mutation has CanViewProject permissions, so this will work no matter who's viewing the project page

Screenshot:

image

image

@rmunn rmunn self-assigned this Nov 11, 2024
Copy link

github-actions bot commented Nov 11, 2024

C# Unit Tests

90 tests  +15   90 ✅ +15   5s ⏱️ ±0s
14 suites + 1    0 💤 ± 0 
 1 files   ± 0    0 ❌ ± 0 

Results for commit b5b8cbd. ± Comparison against base commit 85f9555.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 11, 2024

UI unit Tests

12 tests   12 ✅  0s ⏱️
 4 suites   0 💤
 1 files     0 ❌

Results for commit b5b8cbd.

♻️ This comment has been updated with latest results.

@rmunn rmunn marked this pull request as ready for review November 11, 2024 08:37
@rmunn
Copy link
Contributor Author

rmunn commented Nov 11, 2024

Note: currently this does not add an "update" button like the others; instead, the frontend project page automatically issues the updateRepoSizeInKb mutation request if the size is null. That would display a spinner while it updates, but it's so fast (even on the elawa-dev-flex repo) that I've never actually seen the spinner during my testing.

But if we want to change this to have the "update" button accessible only to admins (or to project managers?) then I can do that.

@rmunn rmunn requested review from myieye and hahn-kev November 11, 2024 08:39
We upgraded from Entity Framework Core 8.0.8 to 8.0.10 a little while
ago, so it's best for the dotnet-ef tool to use the same version.
This one is open to anyone who can view the project, so that frontend
code can automatically look up the project size if it's missing, with no
manual button clicks necessary.
@rmunn rmunn force-pushed the feat/repo-size-on-disk branch from 663539c to 4cccb8e Compare November 11, 2024 09:12
@rmunn
Copy link
Contributor Author

rmunn commented Nov 11, 2024

Rebased on top of develop to fix FwHeadless build issue fixed in #1217.

Only use one digit after the decimal point; nobody cares if a project's
size is 766.734 MB. 766.7 MB is more than precise enough.
@rmunn rmunn force-pushed the feat/repo-size-on-disk branch from f8df62a to c5a4cae Compare November 12, 2024 03:05
Copy link
Collaborator

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good though I'd like to move the updateRepoSize call, there's no need for that to be reactive it just opens the possibility for it to be called more often then we want

Copy link
Contributor

@myieye myieye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

I changed where you put the loading indicator.

@rmunn rmunn merged commit 10a107f into develop Nov 15, 2024
19 checks passed
@rmunn rmunn deleted the feat/repo-size-on-disk branch November 15, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report size on disk of repos
3 participants