Skip to content

Commit 70290b2

Browse files
committed
make autoindexing more conservative, now that there is an actual interface for this
1 parent 21bc9d0 commit 70290b2

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

Sources/UnidocServer/Operations/Interactions/Unidoc.WebhookOperation.swift

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,10 @@ extension Unidoc.WebhookOperation
148148

149149
if let id:Int32 = event.installation
150150
{
151-
if case .private = event.repo.visibility
152-
{
153-
// This is our only chance to index a private repository.
154-
indexEligible = true
155-
}
156-
else if
157-
case "Swift"? = event.repo.language,
158-
repo.origin.alive,
159-
repo.stars > 1
160-
{
161-
// If the repo is public, has more than one star, and contains enough Swift
162-
// code for GitHub to recognize it as a Swift project, we will also take this
163-
// opportunity to index it.
164-
indexEligible = true
165-
}
166-
else
167-
{
168-
indexEligible = false
169-
}
170-
151+
/// This webhook came from an app installation. There’s a decent chance the user
152+
/// selected “all repositories” when installing the app, so we don’t want to
153+
/// automatically index this package if it’s not already in the database.
154+
indexEligible = false
171155
repoWebhook = "github.com/settings/installations/\(id)"
172156
}
173157
else

0 commit comments

Comments
 (0)