#4021 newRepo: support hints for oldrepo value
Merged by tkopecek. Opened by mikem.
mikem/koji oldrepo-hint  into  master

Download 4021.patch

Opening this for discussion.

In tag clone situations and similar, the initial repo can't use --update, even though the content is substantially similar to existing tags. This change allows setting a hint in tag.extra that the newRepo task will consider.

For readability, I moved the oldrepo logic into its own call, but it's basically the same except for the bit in the middle that handles the hint.

A couple other tweaks are here:

  • the oldrepo_state option really only makes sense for SHADOWBUILD tags, so we don't pass it for the related tags
  • renamed a couple variables for clarity
  • moved the options.createrepo_update check up

Fixes https://pagure.io/koji/issue/4129

Side note: the code is (and was) tacitly assuming that options.createrepo_update is the same for all the createrepo builders. Of course, it's fairly nonsensical to have the setting vary, but it is technically a local setting on each host.

I think it usable in this state. Anyway, not sure where it would make sense to set this flag. Doing it for any clone operation probably doesn't make much sense as most cloned tags are not build tags. So, can we use it more broadly than in plugins?

This fell by the wayside. Needs rebasing (conflicts with kojira work) and I see a couple issues in the code. Maybe a good candidate for 1.35.1

rebased onto 9544b865a42e50bd72606f073afcd9438d00c811

1 new commit added

  • fix rebase issue and missing return values

1 new commit added

  • add unit test. drop redundant call arg

Doing it for any clone operation probably doesn't make much sense as most cloned tags are not build tags

It would be harmless for it to be there if the tag is not used to make a repo, and it would help in the few cases where a cloned tag is used for building.

But yeah, this is definitely aimed at a narrow special case in a plugin. It might not get much use otherwise, but it will save a ton of time in the target case.

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

Commit b7d193c4 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata