SUSE / rmt

RPM repository mirroring tool and registration proxy for SUSE Customer Center.
Other
37 stars 46 forks source link

[2/x] Add debian mirroring support to RMT #1057

Closed ngetahun closed 5 months ago

ngetahun commented 7 months ago

This PR is part of our code sprint: https://trello.com/c/hU27QHob/3134-rdeb-sprint-tracker

The whole changeset is:

[1/5] Prepare code sprint and implement repository type detection [2/5] Add flat debian mirroring support to RMT [3/5] Refactor suma mirroring [4/5] Refactor repomd mirroring [5/5] Fixes and cleanup [6/6] Nested debian repository support

Implementations in this PR:

How to review this pull request:

Test the new Debian mirroring implementation

$ bin/rails c
> debian = Repository.find_by(name: 'Debian-10-SUSE-Manager-Tools')
> mirror = RMT::Mirror::Debian.new(repository: debian, logger: RMT::Logger.new($stdout))
> mirror.mirror
# expect: this will download all debs of this repository

# In another terminal
$ tree <devrmt>/public/repo/SUSE/Updates/Debian/10-CLIENT-TOOLS/x86_64/update/
# expect: all debs are downloaded as in the original repository
# expect: metadata is existing in the directory

# back to the rails console
> mirror.mirror
# expect: It should not download any new packages only update timestamps

Debian integration test

# Terminal A
$ python3 -m http.server -d <devrmt>/public

# Terminal B
$ docker run --rm --network host -it debian:10
$ echo 'deb [trusted=yes allow-insecure=yes] http://0.0.0.0:8000/repo/SUSE/Updates/Debian/10-CLIENT-TOOLS/x86_64/update/ /' >> /etc/apt/sources.list
$ apt update
$ apt install spacecmd
# expect: It works! It is alive! It has a name! Its name is Herold!

Thanks for reviewing this pull request!

If you have any question please do not hesitate to approach me! :rocket:

DO NOT MERGE UNTIL COMPLETELY READY

suse-tests-pass commented 5 months ago

Well Done! Your tests are still passing. https://ci.suse.de/job/scc-RMT-integration-tests/354752/console If the given link has expired,you can force a Prophet rerun by just deleting this comment. (Merged 1efd7d95193eb6f0e9e379f9e111b7b60faaa307 into 024478b7c8a9b7c45d617377f2c472917220d603)