Skip to content

Commit 87968fc

Browse files
tomassrnkae2b-bot[bot]
authored andcommitted
refactor(api): remove the deprecated V1 template build path
GitOrigin-RevId: c8ffd2d53ee6b794de14db752865994da41060e8
1 parent 5852a01 commit 87968fc

36 files changed

Lines changed: 575 additions & 3919 deletions

‎packages/api/internal/analytics_collector/analytics.go‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,6 @@ func (p *PosthogClient) CreateAnalyticsTeamEvent(ctx context.Context, teamID, ev
9090
}
9191
}
9292

93-
func (p *PosthogClient) CreateAnalyticsUserEvent(ctx context.Context, userID string, teamID string, event string, properties posthog.Properties) {
94-
err := p.client.Enqueue(posthog.Capture{
95-
DistinctId: userID,
96-
Event: event,
97-
Properties: properties.Set(infraVersionKey, infraVersion).Set(teamIDKey, teamID),
98-
Groups: posthog.NewGroups().
99-
Set("team", teamID),
100-
})
101-
if err != nil {
102-
logger.L().Error(ctx, "error when sending event to Posthog", zap.Error(err))
103-
}
104-
}
105-
10693
func (p *PosthogClient) GetPackageToPosthogProperties(header *http.Header) posthog.Properties {
10794
properties := posthog.NewProperties().
10895
Set("browser", header.Get("browser")).

‎packages/api/internal/analytics_collector/analytics_test.go‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,3 @@ func TestTeamEventCarriesTeamID(t *testing.T) {
152152
assert.Equal(t, "tpl", capture.Properties["environment"])
153153
assert.Equal(t, infraVersion, capture.Properties[infraVersionKey])
154154
}
155-
156-
func TestUserEventCarriesTeamID(t *testing.T) {
157-
t.Parallel()
158-
159-
recorder := &captureRecorder{}
160-
p := &PosthogClient{client: recorder}
161-
162-
p.CreateAnalyticsUserEvent(t.Context(), "user-id", "team-uuid", "built environment", posthog.NewProperties())
163-
164-
capture := recorder.capture(t)
165-
assert.Equal(t, "user-id", capture.DistinctId)
166-
assert.Equal(t, "team-uuid", capture.Properties[teamIDKey])
167-
assert.Equal(t, "team-uuid", capture.Groups[teamGroup])
168-
}

0 commit comments

Comments
 (0)