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

Incorrect package location in metadata when relative path contains a / #3719

Closed
dkliban opened this issue Aug 26, 2024 · 2 comments · Fixed by fedora-copr/copr#3391
Closed
Labels
COPR Features desired by the COPR Team Issue Triage-Needed

Comments

@dkliban
Copy link
Member

dkliban commented Aug 26, 2024

Version
pulpcore 3.56.1
pulp_rpm 3.27.1

Describe the bug

When I create a package in a repository from an artifact using the following commands, the package is published to the correct location, however, the metadata does not match that location.

pulp rpm repository create --name myrepo --autopublish
pulp rpm distribution create --name myrepo --repository myrepo
curl -o camel-0.1-1.noarch.rpm https://fixtures.pulpproject.org/rpm-signed/camel-0.1-1.noarch.rpm
pulp artifact upload --file camel-0.1-1.noarch.rpm
pulp rpm content create --sha256 db0ebc34f184188d4520b6213f1bafd3ccfec84304eb22d3a0c03fd93575a4eb --repository myrepo --relative-path frostyx/test-pulp-1/camel-0.1-1.noarch.rpm

Package location: http://localhost:5001/pulp/content/default/myrepo/Packages/f/frostyx/test-pulp-1/camel-0.1-1.noarch.rpm

Metadata in primary.xml:

<package type="rpm">
<name>camel</name>
<arch>noarch</arch>
<version epoch="0" ver="0.1" rel="1"/>
<checksum type="sha256" pkgid="YES">db0ebc34f184188d4520b6213f1bafd3ccfec84304eb22d3a0c03fd93575a4eb</checksum>
<summary>A dummy package of camel</summary>
<description>A dummy package of camel</description>
<packager/>
<url>http://tstrachota.fedorapeople.org</url>
<time file="1724691102" build="1331831360"/>
<size package="3087" installed="42" archive="296"/>
<location href="Packages/c/camel-0.1-1.noarch.rpm"/>
<format>
<rpm:license>GPLv2</rpm:license>
<rpm:vendor/>
<rpm:group>Internet/Applications</rpm:group>
<rpm:buildhost>smqe-ws15</rpm:buildhost>
<rpm:sourcerpm>camel-0.1-1.src.rpm</rpm:sourcerpm>
<rpm:header-range start="1520" end="2937"/>
<rpm:provides>
<rpm:entry name="camel" flags="EQ" epoch="0" ver="0.1" rel="1"/>
</rpm:provides>
</format>
</package>

Note that location is "Packages/c/camel-0.1-1.noarch.rpm"

@pulp pulp deleted a comment Aug 26, 2024
@dkliban dkliban added the COPR Features desired by the COPR Team label Aug 26, 2024
FrostyX added a commit to FrostyX/copr that referenced this issue Aug 28, 2024
Fix pulp/pulp_rpm#3719

Instead of uploading RPM packages as artifacts in one API call, and
then creating a content from them in a separate call, we will now
create the content directly.

There are mutiple reasons to do so:

- One API call instead of two
- It fixes the issue with installing packages mentioned above
- @dkliban says there is an effort to not allow uploading artifacts on
  shared Pulp instances

There is only one disadvantage of doing this, we lose track of what
RPM packages belong to a specific Copr build ID. We will use labels
for this, once they are implemented.

See pulp/pulpcore#3338 (comment)
praiskup pushed a commit to fedora-copr/copr that referenced this issue Sep 2, 2024
Fix pulp/pulp_rpm#3719

Instead of uploading RPM packages as artifacts in one API call, and
then creating a content from them in a separate call, we will now
create the content directly.

There are mutiple reasons to do so:

- One API call instead of two
- It fixes the issue with installing packages mentioned above
- @dkliban says there is an effort to not allow uploading artifacts on
  shared Pulp instances

There is only one disadvantage of doing this, we lose track of what
RPM packages belong to a specific Copr build ID. We will use labels
for this, once they are implemented.

See pulp/pulpcore#3338 (comment)
@dralley
Copy link
Contributor

dralley commented Sep 12, 2024

Is there a practical issue here or is it mostly inconsequential?

location_href is something that really should never have been added to our schema at all, it was a mistake. Preferably we would remove it entirely. So my inclination is not to change anything until we can do that.

#2580

@FrostyX
Copy link

FrostyX commented Sep 15, 2024

@dkliban proposed I shouldn't upload RPM packages as artifacts and create content out of them but rather do this in one step. And also to not specify the relative path. Everything works as expected now, so solving or not solving this issue won't affect me.

@dralley dralley closed this as completed Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COPR Features desired by the COPR Team Issue Triage-Needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@dkliban @FrostyX @dralley and others