Skip to content

Commit 74af513

Browse files
committed
add explanatory comments
1 parent 27923f4 commit 74af513

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Sources/UnidocDB/Packages/PackageDatabase.Editions.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ extension PackageDatabase.Editions
8888
package:Int32,
8989
with session:Mongo.Session) async throws -> Int32?
9090
{
91+
// We use the SHA-1 hash as “proof” that the edition has at least one symbol graph.
92+
// Therefore, merely registering tags does not update hashes.
9193
let placement:Placement = try await self.register(package: package,
9294
refname: tag.name,
93-
sha1: tag.hash,
95+
sha1: nil,
9496
with: session)
9597

9698
return placement.new ? placement.coordinate : nil

Sources/UnidocDB/Packages/PackageDatabase.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ extension PackageDatabase
9696
else if case .swift = docs.metadata.package,
9797
let tagname:String = docs.metadata.commit?.refname
9898
{
99+
/// Standard library symbol graphs don’t come with hashes, so we can’t efficiently
100+
/// “prove” that a particular edition has at least one symbol graph. But we don’t
101+
/// need to query that in the first place.
99102
let placement:Editions.Placement = try await self.editions.register(
100103
package: placement.coordinate,
101104
refname: tagname,

0 commit comments

Comments
 (0)