Monorepo for Tangled tangled.org

appview/notify: add Clone notifier, enqueue posthog event for clones #1265

merged opened by anirudh.fi targeting master from icy/prsznk
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:hwevmowznbiukdf6uk5dwrrq/sh.tangled.repo.pull/3miisjgqysp22
+2 -1
Interdiff #0 โ†’ #1
appview/notify/db/db.go

This file has not been changed.

appview/notify/logging_notifier.go

This file has not been changed.

appview/notify/merged_notifier.go

This file has not been changed.

appview/notify/notifier.go

This file has not been changed.

appview/notify/posthog/notifier.go

This file has not been changed.

appview/notify/webhook_notifier.go

This file has not been changed.

+2 -1
appview/state/git_http.go
··· 1 1 package state 2 2 3 3 import ( 4 + "context" 4 5 "fmt" 5 6 "io" 6 7 "net/http" ··· 54 55 default: 55 56 // git-upload-pack is the default service for git-clone / git-fetch. 56 57 contentType = "application/x-git-upload-pack-advertisement" 57 - go s.notifier.Clone(r.Context(), repo) 58 + go s.notifier.Clone(context.Background(), repo) 58 59 } 59 60 60 61 targetURL := fmt.Sprintf("%s://%s/%s/%s/info/refs?%s", scheme, repo.Knot, user.DID, repo.Name, r.URL.RawQuery)

History

3 rounds 2 comments
sign up or login to add to the discussion
1 commit
expand
appview/notify: add Clone notifier, enqueue posthog event for clones
3/3 failed
expand
expand 0 comments
pull request successfully merged
1 commit
expand
appview/notify: add Clone notifier, enqueue posthog event for clones
1/3 failed, 1/3 timeout, 1/3 success
expand
expand 0 comments
1 commit
expand
appview/notify: add Clone notifier, enqueue posthog event for clones
expand 2 comments

appview/state/git_http.go:57 I think it will be fine in most cases, but shouldn't we use context.Background() here?

otherwise lgtm!

Good catch; it might be racy, although it's very likely that the Posthog request completes before the clone does.