Skip to content

Commit 8e8c880

Browse files
authored
chore: add a label column to the activityTypes table and TB datasource [IN-761] (#3488)
Signed-off-by: Raúl Santos <4837+borfast@users.noreply.github.com>
1 parent 6fdbee7 commit 8e8c880

3 files changed

Lines changed: 111 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "activityTypes" DROP COLUMN "label";
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
ALTER TABLE "activityTypes" ADD COLUMN "label" VARCHAR(300) DEFAULT NULL;
2+
3+
-- SQL UPDATE statements for activityTypes table
4+
-- Generated on: 2025-10-09T15:38:09.528Z
5+
6+
-- Platform: GitHub
7+
UPDATE "activityTypes" SET "label" = 'Authored a commit' WHERE "platform" = 'github' AND "activityType" = 'authored-commit';
8+
UPDATE "activityTypes" SET "label" = 'Closed a pull request' WHERE "platform" = 'github' AND "activityType" = 'pull_request-closed';
9+
UPDATE "activityTypes" SET "label" = 'Opened a pull request' WHERE "platform" = 'github' AND "activityType" = 'pull_request-opened';
10+
UPDATE "activityTypes" SET "label" = 'Commented on a pull request' WHERE "platform" = 'github' AND "activityType" = 'pull_request-comment';
11+
UPDATE "activityTypes" SET "label" = 'Merged a pull request' WHERE "platform" = 'github' AND "activityType" = 'pull_request-merged';
12+
UPDATE "activityTypes" SET "label" = 'Requested a review for a pull request' WHERE "platform" = 'github' AND "activityType" = 'pull_request-review-requested';
13+
UPDATE "activityTypes" SET "label" = 'Commented on a pull request review thread' WHERE "platform" = 'github' AND "activityType" = 'pull_request-review-thread-comment';
14+
UPDATE "activityTypes" SET "label" = 'Closed an issue' WHERE "platform" = 'github' AND "activityType" = 'issues-closed';
15+
UPDATE "activityTypes" SET "label" = 'Opened an issue' WHERE "platform" = 'github' AND "activityType" = 'issues-opened';
16+
UPDATE "activityTypes" SET "label" = 'Commented on an issue' WHERE "platform" = 'github' AND "activityType" = 'issue-comment';
17+
UPDATE "activityTypes" SET "label" = 'Started a discussion' WHERE "platform" = 'github' AND "activityType" = 'discussion-started';
18+
UPDATE "activityTypes" SET "label" = 'Commented on a discussion' WHERE "platform" = 'github' AND "activityType" = 'discussion-comment';
19+
20+
-- Platform: Git
21+
UPDATE "activityTypes" SET "label" = 'Authored a commit' WHERE "platform" = 'git' AND "activityType" = 'authored-commit';
22+
UPDATE "activityTypes" SET "label" = 'Reviewed a commit' WHERE "platform" = 'git' AND "activityType" = 'reviewed-commit';
23+
UPDATE "activityTypes" SET "label" = 'Tested a commit' WHERE "platform" = 'git' AND "activityType" = 'tested-commit';
24+
UPDATE "activityTypes" SET "label" = 'Co-authored a commit' WHERE "platform" = 'git' AND "activityType" = 'co-authored-commit';
25+
UPDATE "activityTypes" SET "label" = 'Informed a commit' WHERE "platform" = 'git' AND "activityType" = 'informed-commit';
26+
UPDATE "activityTypes" SET "label" = 'Influenced a commit' WHERE "platform" = 'git' AND "activityType" = 'influenced-commit';
27+
UPDATE "activityTypes" SET "label" = 'Approved a commit' WHERE "platform" = 'git' AND "activityType" = 'approved-commit';
28+
UPDATE "activityTypes" SET "label" = 'Committed a commit' WHERE "platform" = 'git' AND "activityType" = 'committed-commit';
29+
UPDATE "activityTypes" SET "label" = 'Reported a commit' WHERE "platform" = 'git' AND "activityType" = 'reported-commit';
30+
UPDATE "activityTypes" SET "label" = 'Resolved a commit' WHERE "platform" = 'git' AND "activityType" = 'resolved-commit';
31+
UPDATE "activityTypes" SET "label" = 'Signed off a commit' WHERE "platform" = 'git' AND "activityType" = 'signed-off-commit';
32+
33+
-- Platform: Gerrit
34+
UPDATE "activityTypes" SET "label" = 'Created a changeset' WHERE "platform" = 'gerrit' AND "activityType" = 'changeset-created';
35+
UPDATE "activityTypes" SET "label" = 'Merged a changeset' WHERE "platform" = 'gerrit' AND "activityType" = 'changeset-merged';
36+
UPDATE "activityTypes" SET "label" = 'Closed a changeset' WHERE "platform" = 'gerrit' AND "activityType" = 'changeset-closed';
37+
UPDATE "activityTypes" SET "label" = 'Abandoned a changeset' WHERE "platform" = 'gerrit' AND "activityType" = 'changeset-abandoned';
38+
UPDATE "activityTypes" SET "label" = 'Created a changeset comment' WHERE "platform" = 'gerrit' AND "activityType" = 'changeset_comment-created';
39+
UPDATE "activityTypes" SET "label" = 'Created a patchset' WHERE "platform" = 'gerrit' AND "activityType" = 'patchset-created';
40+
UPDATE "activityTypes" SET "label" = 'Created a patchset comment' WHERE "platform" = 'gerrit' AND "activityType" = 'patchset_comment-created';
41+
UPDATE "activityTypes" SET "label" = 'Created a patchset approval' WHERE "platform" = 'gerrit' AND "activityType" = 'patchset_approval-created';
42+
43+
-- Platform: GitLab
44+
UPDATE "activityTypes" SET "label" = 'Opened an issue' WHERE "platform" = 'gitlab' AND "activityType" = 'issues-opened';
45+
UPDATE "activityTypes" SET "label" = 'Closed an issue' WHERE "platform" = 'gitlab' AND "activityType" = 'issues-closed';
46+
UPDATE "activityTypes" SET "label" = 'Closed a merge request' WHERE "platform" = 'gitlab' AND "activityType" = 'merge_request-closed';
47+
UPDATE "activityTypes" SET "label" = 'Opened a merge request' WHERE "platform" = 'gitlab' AND "activityType" = 'merge_request-opened';
48+
UPDATE "activityTypes" SET "label" = 'Commented on a merge request review thread' WHERE "platform" = 'gitlab' AND "activityType" = 'merge_request-review-thread-comment';
49+
UPDATE "activityTypes" SET "label" = 'Merged a merge request' WHERE "platform" = 'gitlab' AND "activityType" = 'merge_request-merged';
50+
UPDATE "activityTypes" SET "label" = 'Commented on a merge request' WHERE "platform" = 'gitlab' AND "activityType" = 'merge_request-comment';
51+
UPDATE "activityTypes" SET "label" = 'Commented on an issue' WHERE "platform" = 'gitlab' AND "activityType" = 'issue-comment';
52+
UPDATE "activityTypes" SET "label" = 'Authored a commit' WHERE "platform" = 'gitlab' AND "activityType" = 'authored-commit';
53+
54+
-- Platform: Groups.io
55+
UPDATE "activityTypes" SET "label" = 'Sent a message' WHERE "platform" = 'groupsio' AND "activityType" = 'message';
56+
57+
-- Platform: Confluence
58+
UPDATE "activityTypes" SET "label" = 'Created a page' WHERE "platform" = 'confluence' AND "activityType" = 'page-created';
59+
UPDATE "activityTypes" SET "label" = 'Updated a page' WHERE "platform" = 'confluence' AND "activityType" = 'page-updated';
60+
UPDATE "activityTypes" SET "label" = 'Created a comment' WHERE "platform" = 'confluence' AND "activityType" = 'comment-created';
61+
UPDATE "activityTypes" SET "label" = 'Created an attachment' WHERE "platform" = 'confluence' AND "activityType" = 'attachment-created';
62+
UPDATE "activityTypes" SET "label" = 'Created a blog post' WHERE "platform" = 'confluence' AND "activityType" = 'blogpost-created';
63+
UPDATE "activityTypes" SET "label" = 'Updated a blog post' WHERE "platform" = 'confluence' AND "activityType" = 'blogpost-updated';
64+
UPDATE "activityTypes" SET "label" = 'Attached a file' WHERE "platform" = 'confluence' AND "activityType" = 'attachment';
65+
UPDATE "activityTypes" SET "label" = 'Commented on a page' WHERE "platform" = 'confluence' AND "activityType" = 'comment';
66+
67+
-- Platform: Jira
68+
UPDATE "activityTypes" SET "label" = 'Created an issue' WHERE "platform" = 'jira' AND "activityType" = 'issue-created';
69+
UPDATE "activityTypes" SET "label" = 'Closed an issue' WHERE "platform" = 'jira' AND "activityType" = 'issues-closed';
70+
UPDATE "activityTypes" SET "label" = 'Assigned an issue' WHERE "platform" = 'jira' AND "activityType" = 'issue-assigned';
71+
UPDATE "activityTypes" SET "label" = 'Updated an issue' WHERE "platform" = 'jira' AND "activityType" = 'issue-updated';
72+
UPDATE "activityTypes" SET "label" = 'Created an issue comment' WHERE "platform" = 'jira' AND "activityType" = 'issue-comment-created';
73+
UPDATE "activityTypes" SET "label" = 'Updated an issue comment' WHERE "platform" = 'jira' AND "activityType" = 'issue-comment-updated';
74+
UPDATE "activityTypes" SET "label" = 'Added an attachment to an issue' WHERE "platform" = 'jira' AND "activityType" = 'issue-attachment-added';
75+
76+
-- Platform: Dev.to
77+
UPDATE "activityTypes" SET "label" = 'Commented on a post' WHERE "platform" = 'devto' AND "activityType" = 'comment';
78+
79+
-- Platform: Discord
80+
UPDATE "activityTypes" SET "label" = 'Sent a message' WHERE "platform" = 'discord' AND "activityType" = 'message';
81+
UPDATE "activityTypes" SET "label" = 'Started a thread' WHERE "platform" = 'discord' AND "activityType" = 'thread-started';
82+
UPDATE "activityTypes" SET "label" = 'Sent a message in a thread' WHERE "platform" = 'discord' AND "activityType" = 'thread-message';
83+
84+
-- Platform: Discourse
85+
UPDATE "activityTypes" SET "label" = 'Created a topic' WHERE "platform" = 'discourse' AND "activityType" = 'create-topic';
86+
UPDATE "activityTypes" SET "label" = 'Sent a message in a topic' WHERE "platform" = 'discourse' AND "activityType" = 'message-in-topic';
87+
88+
-- Platform: Hacker News
89+
UPDATE "activityTypes" SET "label" = 'Posted a post' WHERE "platform" = 'hackernews' AND "activityType" = 'post';
90+
UPDATE "activityTypes" SET "label" = 'Commented on a post' WHERE "platform" = 'hackernews' AND "activityType" = 'comment';
91+
92+
-- Platform: LinkedIn
93+
UPDATE "activityTypes" SET "label" = 'Commented on a post' WHERE "platform" = 'linkedin' AND "activityType" = 'comment';
94+
95+
-- Platform: Reddit
96+
UPDATE "activityTypes" SET "label" = 'Posted a post' WHERE "platform" = 'reddit' AND "activityType" = 'post';
97+
UPDATE "activityTypes" SET "label" = 'Commented on a post' WHERE "platform" = 'reddit' AND "activityType" = 'comment';
98+
99+
-- Platform: Slack
100+
UPDATE "activityTypes" SET "label" = 'Sent a message' WHERE "platform" = 'slack' AND "activityType" = 'message';
101+
102+
-- Platform: Stack Overflow
103+
UPDATE "activityTypes" SET "label" = 'Asked a question' WHERE "platform" = 'stackoverflow' AND "activityType" = 'question';
104+
UPDATE "activityTypes" SET "label" = 'Answered a question' WHERE "platform" = 'stackoverflow' AND "activityType" = 'answer';
105+
106+
-- Platform: X/Twitter
107+
UPDATE "activityTypes" SET "label" = 'Used a hashtag' WHERE "platform" = 'twitter' AND "activityType" = 'hashtag';
108+
UPDATE "activityTypes" SET "label" = 'Mentioned a user' WHERE "platform" = 'twitter' AND "activityType" = 'mention';

services/libs/tinybird/datasources/activityTypes.datasource

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ DESCRIPTION >
66
- `description` provides a human-readable description of what the activity type and platform represents.
77
- `isCodeContribution` indicates whether this activity counts as a code contribution.
88
- `isCollaboration` indicates whether this activity counts as a collaboration.
9+
- `label` the text that is displayed in the Insights UI for each activity type.
910
- `createdAt` and `updatedAt` are standard timestamp fields for record lifecycle tracking.
1011

1112
TAGS "Activity preprocessing pipeline"
@@ -17,6 +18,7 @@ SCHEMA >
1718
`description` String `json:$.record.description`,
1819
`isCodeContribution` Bool `json:$.record.isCodeContribution`,
1920
`isCollaboration` Bool `json:$.record.isCollaboration`,
21+
`label` LowCardinality(String) `json:$.record.label`,
2022
`createdAt` DateTime64(3) `json:$.record.createdAt`,
2123
`updatedAt` DateTime64(3) `json:$.record.updatedAt`
2224

0 commit comments

Comments
 (0)