Skip to content

Deleting RPMs via ui does not update filelists/other/primary xml metadata #34691

Closed
@lukester1975

Description

@lukester1975

Description

Hello

As per subject. Given a valid rpm registry state, e.g.

> curl -s --user ... http://localhost:3000/api/packages/test/rpm/fedora/42/repodata/other.xml.gz | gunzip | xmllint --format -

<?xml version="1.0" encoding="UTF-8"?>
<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
  <package pkgid="d79745646597f9186213d64754acc39180e4b0058c659d2457d55d4d3096e141" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="2.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
  <package pkgid="fe3424957ed8f542b5efa7dd1960118de74e858950540c8287a80596cf689045" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="1.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
</otherdata>

Deleting a package via the UI (either the package settings page, or admin) does not update the registry's metadata:

> curl -s --user ... http://localhost:3000/api/packages/test/rpm/fedora/42/repodata/other.xml.gz | gunzip | xmllint --format -

<?xml version="1.0" encoding="UTF-8"?>
<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
  <package pkgid="d79745646597f9186213d64754acc39180e4b0058c659d2457d55d4d3096e141" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="2.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
  <package pkgid="fe3424957ed8f542b5efa7dd1960118de74e858950540c8287a80596cf689045" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="1.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
</otherdata>

Both packages are still there, which obviously causes issues with dnf seeing incorrect state.

Deleting with a request directly to the rpm endpoint:

> curl --user ... -X DELETE http://localhost:3000/api/packages/test/rpm/fedora/42/package/onload/9.0.2_sdci-1.fc42/x86_64/

> curl -s --user ... http://localhost:3000/api/packages/test/rpm/fedora/42/repodata/other.xml.gz | gunzip | xmllint --format -

<?xml version="1.0" encoding="UTF-8"?>
<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="1">
  <package pkgid="d79745646597f9186213d64754acc39180e4b0058c659d2457d55d4d3096e141" name="onload" arch="x86_64">
    <version epoch="0" ver="9.0.2_sdci" rel="2.fc42"/>
    <changelog author="Solarflare" date="1561982400">- 2010-current: solarflare miscellaneous updates
- Details can found in onload Changelog</changelog>
  </package>
</otherdata>

updates the metadata correctly.

The UI route services/packages/packages.go:RemovePackageVersion() never gets through to services/packages/rpm/repository.go:BuildSpecificRepositoryFiles() AFAICT. I'd offer to help figure out a solution, but go is not my thing... I'm guessing the rpm service needs to get the notification from notify_service.PackageDelete(ctx, doer, pd) from packages.go:RemovePackageVersion(), though.

Thanks

PS I have not looked if other registry types are similarly affected.

Gitea Version

1.24

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

n/a

Operating System

n/a

How are you running Gitea?

n/a

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions