pulp / pulp_ostree

OSTree support for the Pulp Platform
https://docs.pulpproject.org/pulp_ostree/
GNU General Public License v2.0
59 stars 42 forks source link

import_commits not working with rpm-ostree #366

Closed fayalalebrun closed 3 months ago

fayalalebrun commented 4 months ago

Version

{
      "component": "core",
      "version": "3.52.0",
      "package": "pulpcore",
      "module": "pulpcore.app",
      "domain_compatible": true
    }
{
      "component": "ostree",
      "version": "2.3.0",
      "package": "pulp-ostree",
      "module": "pulp_ostree.app",
      "domain_compatible": true
    }

Both are installed via the pulp multi-process image.

Describe the bug When using a repo generated by rpm-ostree, import-commits fails with:

Error: Task /pulp/api/v3/tasks/018fce77-9944-7aba-a947-8b2224f16b74/ failed: 'The provided ref does not exist in the repository yet. Try importing first the whole repository, then additional commits.'

To Reproduce

#!/bin/bash
set -euxo pipefail

REPO_NAME=test
BRANCH=fedora/stable/x86_64/iot

pulp ostree repository create --name $REPO_NAME

ostree init --mode=archive --repo=repo
mkdir cache
git clone https://pagure.io/fedora-iot/ostree.git -n fedora-iot-spec/ || true
git -C fedora-iot-spec checkout c1eb922887dcb3301b73a8d5f058340eaef5c6b1

rpm-ostree compose tree --unified-core --cachedir="cache" --repo="repo" "fedora-iot-spec/fedora-iot.yaml"
ostree summary --repo=repo --update

tar cf repo.tar repo
pulp ostree repository import-all --name $REPO_NAME --repository_name repo --file repo.tar

git -C fedora-iot-spec checkout f40

PARENT_COMMIT=$(ostree --repo=repo rev-parse $BRANCH)
rpm-ostree compose tree --unified-core --cachedir="cache" --repo="repo" --parent=$PARENT_COMMIT --previous-commit=$PARENT_COMMIT "fedora-iot-spec/fedora-iot.yaml"
ostree summary --repo=repo --update

tar cf repo.tar repo
pulp ostree repository import-commits --name $REPO_NAME --repository_name repo --ref $BRANCH --file repo.tar --parent_commit=$PARENT_COMMIT

Expected behavior Command runs succesfully and updated repo is available on the server.

Additional context https://matrix.to/#/!HWvLQmBGVPfJfTQBAu:matrix.org/$wW-z73oAxNv0foajr5KaK0hIBP7z-CzR6JG3xj1ZZTI?via=matrix.org&via=ctrl-c.liu.se&via=matrix.videowindow.eu

lubosmj commented 3 months ago

@fayalalebrun, the fix has been released in pulp-ostree v2.3.1. We expect the change to land into the pulp nightly image tomorrow.