Skip to content

Conversation

@jobselko
Copy link
Contributor

closes #933

@jobselko jobselko self-assigned this Aug 19, 2025
@jobselko jobselko force-pushed the fix_933 branch 3 times, most recently from dcac506 to 86c2977 Compare August 19, 2025 17:40
Copy link
Contributor

@gerrod3 gerrod3 left a comment

Choose a reason for hiding this comment

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

This looks really good. A few changes and we can merge.

Comment on lines 412 to 411
# e.g. '/var/lib/pulp/tmp/tmphexlltu1.upload.gz'
data["relative_path"] = vars(metadata)["filename"]
# e.g. 'shelf-reader-0.1.tar.gz' instead of '/var/lib/pulp/tmp/tmphexlltu1.upload.gz'
data["filename"] = file.name
Copy link
Contributor

Choose a reason for hiding this comment

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

relative_path and filename should both be the same. They should both be file.name, just the name of the file, not path.

Copy link
Contributor

@dralley dralley Aug 20, 2025

Choose a reason for hiding this comment

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

IMO the name ought to be canonicalized ideally, and pulled from the metadata and nothing related to the upload request. We had problems in the past with user-provided relative_path / filename in the RPM plugin.

But agree that they absolutely need to be the same value, we also had problems with that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dralley Metadata provides only the name and version, so I can take the filename extension from file.name and use the metadata values like f"{metadata["name"]}-{metadata["version"]}{extension}". Or I can at least check that the name and version from metadata are included in file.name. How does this sound?

Copy link
Contributor Author

@jobselko jobselko Aug 21, 2025

Choose a reason for hiding this comment

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

It seems to be doable to create a file name based on the package data only (https://packaging.python.org/en/latest/specifications/section-distribution-formats/), but this would require too much work for now. We can revisit it later if needed.

EDIT: I created PULP-760 to track this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. I just mention it because it's best to not rely on user-provided data when constructing metadata. But that's the current state of things too, I agree it's a separate issue.

@jobselko jobselko force-pushed the fix_933 branch 2 times, most recently from 3cfc249 to 9ad386a Compare August 20, 2025 14:13
@jobselko jobselko marked this pull request as ready for review August 20, 2025 14:27
@github-actions github-actions bot added multi-commit Add to bypass single commit lint check no-changelog no-issue labels Aug 20, 2025
@github-actions github-actions bot removed multi-commit Add to bypass single commit lint check no-issue no-changelog labels Aug 21, 2025
@jobselko jobselko force-pushed the fix_933 branch 3 times, most recently from 8d0a351 to 3df3095 Compare August 21, 2025 17:40
@github-actions github-actions bot added multi-commit Add to bypass single commit lint check no-changelog no-issue labels Aug 21, 2025
Copy link
Contributor

@gerrod3 gerrod3 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! LGTM

@gerrod3 gerrod3 merged commit 339fa59 into pulp:main Aug 26, 2025
13 checks passed
@jobselko jobselko deleted the fix_933 branch August 26, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multi-commit Add to bypass single commit lint check no-changelog no-issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to upload wheels synchronously

3 participants