#2548 kojira: don't expire ignored tags with targets
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue2542  into  master

file modified
+11 -7
@@ -780,16 +780,20 @@ 

  

          n_need = len(self.needed_tags)

          ignore = self.options.ignore_tags.split()

-         self.build_tags = set([

-             t['build_tag'] for t in self.session.getBuildTargets()

-             if not koji.util.multi_fnmatch(t['build_tag_name'], ignore)

-         ])

+         build_tags = set()

+         ignored_build_tags = set()

+         for t in self.session.getBuildTargets():

+             if koji.util.multi_fnmatch(t['build_tag_name'], ignore):

+                 ignored_build_tags.add(t['build_tag'])

+             else:

+                 build_tags.add(t['build_tag'])

+ 

          # index repos by tag

          tag_repos = {}

          for repo in to_list(self.repos.values()):

              tag_repos.setdefault(repo.tag_id, []).append(repo)

  

-         for tag_id in self.build_tags:

+         for tag_id in build_tags:

              covered = False

              for repo in tag_repos.get(tag_id, []):

                  if repo.current:
@@ -841,12 +845,12 @@ 

          # some cleanup

          for tag_id in list(self.needed_tags):

              entry = self.needed_tags.get(tag_id)

-             if tag_id not in self.build_tags:

+             if tag_id not in build_tags:

                  self.logger.info("Tag %(name)s is no longer a build tag",

                                   entry['taginfo'])

                  del self.needed_tags[tag_id]

          for tag_id, repolist in tag_repos.items():

-             if tag_id not in self.build_tags:

+             if tag_id not in build_tags and tag_id not in ignored_build_tags:

                  # repos for these tags are no longer required

                  for repo in repolist:

                      if repo.ready():

I think it is just ok to not expire these. @mikem any concerns?

I think it is just ok to not expire these. @mikem any concerns?

Hmm. So, this is all with MBS in mind, and MBS cleans up its own targets. Once it does that Kojira will delete the repos.

However, MBS never cleans up repos. So if these repos are regenerated multiple times (which MBS definitely does), I don't think we have a process that will get rid of those, at least until the target itself is removed.

Maybe this is ok, but with the current long target lifetime we have configured, I'm not sure.

The ignored_build_tags set is only used within the checkNeeded function. Does it need to be an instance variable? Granted, the same is true for self.build_tags.

I don't think we have a process that will get rid of those

Oh, nm, I guess that's handled in repoDone when a new repo replaces the old.

1 new commit added

  • remove instance variables
2 years ago

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

2 years ago

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

2 years ago

Commit 88ad685 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago
Metadata