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

Allow running repoclosure based on a URL and dist #362

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Aug 30, 2023

Example:

obal-source repoclosure rubygem-pulp_file_client --check https://download.copr.fedorainfracloud.org/results/@theforeman/foreman-katello-nightly-staging-scratch-0b6bfd0a-f472-5d75-9280-3ae62f547728/rhel-8-x86_64/ --dist el8

This will allow us to stop downloading RPMs to create a local repository from and instead use the repositories created by the scratch repos from Copr to do repoclosure.

@ehelms ehelms force-pushed the allow-repoclosure-by-url branch 2 times, most recently from 34e93a2 to 6a224bb Compare August 31, 2023 16:52
@ehelms
Copy link
Member Author

ehelms commented Aug 31, 2023

@evgeni Take a look when you can

@evgeni
Copy link
Member

evgeni commented Sep 6, 2023

So I am trying to wrap my head around "why do we need to introduce new args".

The URL makes sense -- it changes on every scratch build, and that is the one we wanna check.
But the dist?

Comment on lines 667 to 669
"--check downloaded_rpms",
"--check check_repo",
"--repofrompath=check_repo,https://test.example.com/myrepo",
Copy link
Member

Choose a reason for hiding this comment

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

this looks weird where we tell to --check two repos, but only really define one of them. I know it works, but still.

Is there ever a case where we want both the remote repo and "downloaded rpms" be checked together?
Otherwise we could call both repos something like check_repo and only pass --check once?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is sort of ugly and tricky due to how much if/else checking and construction has to happen. For example, constructing this variable (https://github.com/theforeman/obal/pull/362/files#diff-1f4bf62d8dfa1c838d5fae334e87225b942dc26f92086eb2ab754cbe77237a24R4). Honestly, I feel like the whole role needs an overhaul and introduction of a module to handle things cleanly and do the logic more cleanly inside python code.

My initial goal with this support was to not break the Koji method while providing a fix for the Copr method.

Copy link
Member Author

Choose a reason for hiding this comment

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

In addition, this gets a big ugly too because in CI I am going to have to write the copr repository out to a file from the build step that can then be used as input to the repoclosure step.

An all-in-one obal scratch is nice for users, but it creates a bit of yuck in CI where we need to pass data around from invocation to invocation.

Status output has a similar issue, having to print out a yaml file so that the status generation can then slurp it in (https://github.com/theforeman/jenkins-jobs/blob/master/theforeman.org/pipelines/lib/copr.groovy#L1).

Copy link
Member Author

Choose a reason for hiding this comment

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

Ehh, I decided to go ahead and write a module and then I can re-factor on top of that: #364

@ehelms
Copy link
Member Author

ehelms commented Sep 6, 2023

So I am trying to wrap my head around "why do we need to introduce new args".

The URL makes sense -- it changes on every scratch build, and that is the one we wanna check. But the dist?

The dist is what tells our code which set of lookaside repositories to use -- https://github.com/theforeman/foreman-packaging/blob/rpm/develop/package_manifest.yaml#L155-L156

@ehelms
Copy link
Member Author

ehelms commented Sep 19, 2023

This has been completely re-worked and re-designed using the module. Expected usage:

obal-source repoclosure rubygem-pulp_file_client --check https://download.copr.fedorainfracloud.org/results/@theforeman/foreman-katello-nightly-staging-scratch-0b6bfd0a-f472-5d75-9280-3ae62f547728/rhel-8-x86_64/ --dist el8

@ehelms ehelms force-pushed the allow-repoclosure-by-url branch 2 times, most recently from 9a2d1a8 to 3f11ea4 Compare September 19, 2023 15:55
@ehelms ehelms requested a review from evgeni September 19, 2023 16:41
Copy link
Member

@evgeni evgeni left a comment

Choose a reason for hiding this comment

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

I think you got a stray file in here, but otherwise LGTM

obal/data/roles/repoclosure/tasks/rpms_repoclosure.yml Outdated Show resolved Hide resolved
@ehelms ehelms merged commit 2399da2 into theforeman:master Sep 22, 2023
8 of 10 checks passed
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.

2 participants