commit 7c0f5a1425593975d49059f50e2ba6a42d1a61d3 from: Stefan Sperling date: Wed Sep 18 08:20:59 2024 UTC for now, send tags to the archive unconditionally commit - 59f842daf3f3d4f07db6375b2c32552556453e86 commit + 7c0f5a1425593975d49059f50e2ba6a42d1a61d3 blob - 496828cd69e0755ca1138d8062b346abc39efa01 blob + e7297fdbd9ff799ebafe7b1ef4416af54913fc14 --- swh/loader/git/loader.py +++ swh/loader/git/loader.py @@ -1056,33 +1056,18 @@ class GitLoader(BaseGitLoader): else: raise TypeError(f"Unexpected content type: {content}") + # For now, always submit all received tags to the archive. + # Tags will not necessarily point at objects sent within the same + # pack file. Releases could be "retagged" to an arbitrary commit. + # + # XXX This could result in tags pointing at commits which are + # missing from the archive. try: tag_vertices = self._object_graph.vs.select(object_type=GitObjectType.TAG) - except KeyError: - tag_vertices = set() - missing_releases = set() - if len(missing_revisions) > 0: - self.log.debug( - "Searching for packed tags which depend on missing packed objects" - ) - for t in tag_vertices: - tag_hash = t["name"] - for dep_hash, dep_type in get_neighbors(t): - if ( - dep_hash in missing_revisions - or dep_hash in missing_directories - or dep_hash in missing_contents - ): - # We can infer that the tag is also missing. - missing_releases.add(tag_hash) - break - self.log.debug( - "Number of packed tag considered missing by implication: " - f"{len(missing_releases)}" - ) - else: tag_hashes = [t["name"] for t in tag_vertices] missing_releases = set(self.storage.release_missing(tag_hashes)) + except KeyError: + pass for tree_hash in missing_directories: obj = self.pack[hashutil.hash_to_bytehex(tree_hash)]