#4206 latest symlink generation stopped working in 1.35
Closed: Fixed by mikem. Opened by alexbrett.

We have recently updated a Koji deployment to 1.35, and observed that the latest symlink was not being created whenever a repository was generated.

Reviewing the code, this appears to be because the check for a newer repository in symlink_if_latest is matching the current repository, thus it always thinks there is a newer one:

# only symlink if we are actually latest
    clauses = [
        ['tag_id', '=', repo['tag_id']],
        ['state', '=', koji.REPO_READY],
        ['create_event', '>=', repo['create_event']]]
    if repo['dist']:
        clauses.append(['dist', 'IS', True])
    else:
        clauses.append(['custom_opts', '=', '{}'])
    query = RepoQuery(clauses)
    newer = query.execute()
    if newer:
        logger.debug('Skipping latest symlink, %i newer repos found', len(newer))
        return False

To fix this I think it needs one of the following:

  • The criteria for create_event should be simply > rather than >= (this is the temporary fix we have put in place on our deployment which seems to be working)
  • Add extra criteria to ignore the repository we are currently considering symlinking

I'm happy to create a PR for either of these approaches, but would appreciate someone more familiar with the code to suggest which is the best one to take...


Thanks for the report!
I think when I used >= I was worried about possible redundant regens. However that's really a corner case. Should it happen, I think it's probably more accurate to let the subsequent regen claim the link than to leave it unchanged, so that means >.
Filed #4207

Metadata Update from @mikem:
- Custom field Size adjusted to None

Metadata Update from @mikem:
- Issue set to the milestone: 1.35.1

Metadata Update from @tkopecek:
- Issue tagged with: testing-ready

Metadata Update from @mikem:
- Issue set to the milestone: 1.35.2 (was: 1.35.1)

Metadata Update from @mfilip:
- Issue tagged with: testing-done

Commit c4b65076 fixes this issue

Commit 75a214c0 fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/4206

Please continue any further discussion there.

Metadata
Related Pull Requests