-
Notifications
You must be signed in to change notification settings - Fork 733
feat: data pipeline changes for segmentRepositories [IN-552] [IN-554] #3326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5f62954
9e4f39d
dbb4398
24c7b05
24e3fa6
0056db5
00f8cfa
af5e5f0
3a3d9af
e78438a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE "segmentRepositories" | ||
DROP COLUMN updated_at; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER PUBLICATION sequin_pub ADD TABLE "segmentRepositories"; | ||
ALTER TABLE "segmentRepositories" REPLICA IDENTITY FULL; | ||
GRANT SELECT ON "segmentRepositories" to sequin; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE "segmentRepositories" | ||
ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
DESCRIPTION > | ||
- `segmentRepositories` contains the repository data associated with segments. | ||
- Replicated from Postgres - it is meant to become the single source of truth about repositories in the future. | ||
- Schema: | ||
- `repository` is the URL for the repository. | ||
- `segmentId` links to the segment the repository belongs to. | ||
- `insightsProjectId` links to the insightsProject the repository belongs to. | ||
- `archived` indicates whether the repository is archived (true/false). | ||
- `excluded` indicates whether the repository is excluded from analytics and metrics (true/false). | ||
- `last_archived_check` is the timestamp of the last check for whether the repository is archived. | ||
- `createdAt` is a standard timestamp field to record lifecycle tracking. | ||
- `updatedAt` is a standard timestamp field to record lifecycle tracking. | ||
|
||
SCHEMA > | ||
`repository` String `json:$.record.repository`, | ||
`segmentId` UUID `json:$.record.segmentId`, | ||
`insightsProjectId` UUID `json:$.record.insightsProjectId`, | ||
`archived` Bool `json:$.record.archived`, | ||
`excluded` Bool `json:$.record.excluded`, | ||
`last_archived_check` Nullable(DateTime64(3)) `json:$.record.last_archived_check`, | ||
`createdAt` DateTime64(3) `json:$.record.createdAt`, | ||
`updatedAt` DateTime64(3) `json:$.record.updated_at` | ||
|
||
|
||
ENGINE ReplacingMergeTree | ||
ENGINE_PARTITION_KEY toYear(createdAt) | ||
ENGINE_SORTING_KEY repository | ||
ENGINE_VER createdAt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll need an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, yeah, I forgot about that. The original table Umberto created doesn't have it and I wondered if it was necessary, but forgot to check it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the column and also updated the worker code to update its timestamp whenever it updates a repository archived / excluded status. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this grant - sequin user only works on the sequin schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it need access to do the backfills? I confess I never checked how it does them, but I assumed it was just querying the database normally.