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

Add support for repository-size command #3313

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

gerrod3
Copy link
Contributor

@gerrod3 gerrod3 commented Nov 15, 2023

fixes: #3312

Is there an easy way to add tests for this (know repository sizes)?

@@ -261,6 +264,63 @@ def on_new_version(self, version):
repo_config=self.repo_config,
)

@property
def all_content_pks(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason these all need to be properties as opposed to functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That one could be a function, but disk_size and on_demand_size need to be properties as that is how it is defined in pulpcore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please make this one and on_demand_artifacts_for_version into normal functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on_demand_artifacts_for_version has to be a static method as that is how it is in pulpcore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I misread it as @property. It's fine then

@dralley
Copy link
Contributor

dralley commented Nov 15, 2023

Is there an easy way to add tests for this (know repository sizes)?

You could measure the size of one of the fixtures we use.

@gerrod3
Copy link
Contributor Author

gerrod3 commented Nov 15, 2023

Is there an easy way to add tests for this (know repository sizes)?

You could measure the size of one of the fixtures we use.

What fixture has sub-repos in it?

@dralley
Copy link
Contributor

dralley commented Nov 15, 2023

This one, I think https://fixtures.pulpproject.org/rpm-distribution-tree/

You'll also want to test one without distribution trees, the standard fixture will be fine for that https://fixtures.pulpproject.org/rpm-unsigned/

@dralley
Copy link
Contributor

dralley commented Nov 21, 2023

Ignore the test failure, it's unrelated.

@@ -126,6 +126,9 @@
"content_summary" field on "../repositories/../versions/../".
"""

RPM_UNSIGNED_FIXTURE_SIZE = 79260
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these numbers manually verified?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I manually added up the sizes on the fixture. I then double checked by performing a sync on an empty system and adding up all the artifact sizes.

@dralley
Copy link
Contributor

dralley commented Nov 28, 2023

The CI should also now be un-broken, if you rebase.

@gerrod3
Copy link
Contributor Author

gerrod3 commented Nov 30, 2023

Orphan cleanup is sort of broken for subrepos it seems. The artifacts are not being properly cleaned before the test runs.

@dralley
Copy link
Contributor

dralley commented Jan 2, 2024

@gerrod3 IIRC this PR should pass now that the other one is merged, if it gets rebased?

@gerrod3 gerrod3 force-pushed the artifact-size branch 6 times, most recently from 66b839a to 03bfc08 Compare January 17, 2024 02:19
Copy link
Member

@ipanova ipanova left a comment

Choose a reason for hiding this comment

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

s3 ci failure is unrelated but needs rebase

@dralley dralley merged commit dc1011a into pulp:main Jan 25, 2024
15 of 16 checks passed
@gerrod3 gerrod3 deleted the artifact-size branch January 28, 2024 01:38
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.

Add support for new disk-size field on Repository model
4 participants