#4285 Improve min_event handling in RepoWatcher
Merged by tkopecek. Opened by mikem.
mikem/koji min_event_tweaks  into  master

Download 4285.patch

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

@tkopecek

:thumbsup:

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

Testing notes. To observe this issue, you'll need an existing state=ready repo for the build tag that is older than the hub's RepoLag setting. In that situation, the old code will report the old repo rather than creating a new request, e.g. using the koji request-repo command. This PR should fix that issue, so that the client waits for a new repo rather than using one that is older than the configured lag.

Addendum to the testing notes

you'll need an existing state=ready repo for the build tag that is older than the hub's RepoLag setting

Here I meant "older" in the sense of repo validity range. Every repo has a range of events where it accurately represents the tag contents. That is from begin_event until end_event. A still-valid repo will have end_event=None. Once there is a change to the tag, the repo will be marked with the appropriate end_event.

So, as far as lag is concerned, the age we're concerned about is how long it has been since the repo became invalid. I.e. the time since the end event (or now - end_ts).

To create this situation, you'll need to make a change to the tag and make sure that the end events have been updated (kojira triggers this normally, but an admin can also call repo.updateEndEvents directly)

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

Commit 5e1584ec fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata