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

[1/x] Prepare code sprint and implement repository type detection #1056

Merged
merged 9 commits into from
Jan 3, 2024

Conversation

felixsch
Copy link
Contributor

@felixsch felixsch commented Dec 19, 2023

Description

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

The whole changeset is:
[1/x] Prepare code sprint and implement repository type detection
[2/x] Add debian mirroring support to RMT

Implementations in this PR:

The repository type is not yet used in any way and is only there for future use.

How to test this pull request:

Make sure mirroring is working as expected

$ bin/rmt-cli mirror
# Expect: mirroring to work normally

Test repository type detection

# Sync any of our test accounts or our RMT reference account
$ rails c
> debian = Repository.find_by(name: 'Debian-10-SUSE-Manager-Tools')
> repomd = Repository.find_by(name: 'SLE-Product-SLED15-SP6-Pool')
> debian_mirror = RMT::Mirror.new(repository: debian, logger: nil, base_dir: '/tmp')
> repomd_mirror = RMT::Mirror.new(repository: repomd, logger: nil, base_dir: '/tmp')


> repomd_mirror.detect_repository_type
# expect: to return :repomd

> debian_mirror.detect_repository_type
# expect: to return :debian

Thanks for reviewing this pull request!

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

@felixsch felixsch changed the title Moved repomd parser implementation out of the way detect debian and repomd repository types Dec 19, 2023
@felixsch felixsch changed the title detect debian and repomd repository types [1/x] Prepare code sprint and implement repository type detection Dec 28, 2023
@SUSE SUSE deleted a comment from suse-tests-pass Jan 2, 2024
@suse-tests-pass
Copy link
Collaborator

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

logger: logger,
mirroring_base_dir: RMT::DEFAULT_MIRROR_DIR,
mirror_src: RMT::Config.mirror_src_files?,
airgap_mode: false
Copy link
Member

Choose a reason for hiding this comment

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

Was it a bug that we didn't set airgap_mode before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It defaults to to false. For the sake of being explicit we added it here

base_url: URI.join(repository_url),
base_dir: repository_dir,
cache_dir: repository_dir
def detect_repository_type
Copy link
Member

Choose a reason for hiding this comment

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

Imho the 'detect_' prefix is superfluous.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, we keep it in mind and change the naming when we switch to our new implementations!

Copy link
Member

@digitaltom digitaltom left a comment

Choose a reason for hiding this comment

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

Great 👍

@felixsch felixsch merged commit 56477e7 into master Jan 3, 2024
3 checks passed
@felixsch felixsch deleted the detect-repo-type branch January 3, 2024 12:54
@felixsch felixsch restored the detect-repo-type branch January 3, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants