@@ -22,41 +22,92 @@ INSERT INTO git_host_webhook_event (git_host_name, name, event_types_csv,
22
22
VALUES (' Gitlab_Devtron' , ' Pull Request' , ' Merge Request Hook' , ' non-merged' ,' t' , NOW()),
23
23
(' Gitlab_Devtron' , ' Tag Creation' , ' Tag Push Hook' , ' merged' ,' t' , NOW());
24
24
25
+ -- pr queries
25
26
INSERT INTO git_host_webhook_event_selectors
26
27
(event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
27
- VALUES (5 , ' unique id' , ' object_attributes.id' , ' f' , ' f' , ' t' , NULL , NOW()),
28
- (5 , ' repository url' , ' project.http_url' , ' f' , ' f' , ' t' , NULL , NOW()),
29
- (5 , ' title' , ' object_attributes.title' , ' t' , ' t' , ' t' , NULL , NOW()),
30
- (5 , ' git url' , ' object_attributes.url' , ' t' , ' f' , ' t' , NULL , NOW()),
31
- (5 , ' author' , ' user.username' , ' t' , ' t' , ' t' , NULL , NOW()),
32
- (5 , ' date' , ' object_attributes.updated_at' , ' t' , ' f' , ' t' , NULL , NOW()),
33
- (5 , ' source checkout' , ' object_attributes.last_commit.id' , ' t' , ' f' , ' t' , NULL , NOW()),
34
- (5 , ' target branch name' , ' object_attributes.target_branch' , ' t' , ' t' , ' t' , NULL , NOW()),
35
- (5 , ' source branch name' , ' object_attributes.source_branch' , ' t' , ' t' , ' t' , NULL , NOW()),
36
- (5 , ' repository ssh url' , ' project.ssh_url' , ' t' , ' t' , ' t' , NULL , NOW()),
37
- (5 , ' description' , ' object_attributes.description' , ' t' , ' t' , ' t' , NULL , NOW()),
38
- (5 , ' state' , ' object_attributes.state' , ' t' , ' t' , ' t' , ' opened' , NOW());
28
+ select id, ' unique id' , ' object_attributes.id' , ' f' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
39
29
30
+ INSERT INTO git_host_webhook_event_selectors
31
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
32
+ select id, ' repository url' , ' project.http_url' , ' f' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
33
+
34
+ INSERT INTO git_host_webhook_event_selectors
35
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
36
+ select id, ' title' , ' object_attributes.title' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
37
+
38
+ INSERT INTO git_host_webhook_event_selectors
39
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
40
+ select id, ' git url' , ' object_attributes.url' , ' t' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
41
+
42
+ INSERT INTO git_host_webhook_event_selectors
43
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
44
+ select id, ' author' , ' user.username' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
45
+
46
+ INSERT INTO git_host_webhook_event_selectors
47
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
48
+ select id, ' date' , ' object_attributes.updated_at' , ' t' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
49
+
50
+ INSERT INTO git_host_webhook_event_selectors
51
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
52
+ select id, ' source checkout' , ' object_attributes.last_commit.id' , ' t' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
53
+
54
+ INSERT INTO git_host_webhook_event_selectors
55
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
56
+ select id, ' target branch name' , ' object_attributes.target_branch' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
57
+
58
+ INSERT INTO git_host_webhook_event_selectors
59
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
60
+ select id, ' source branch name' , ' object_attributes.source_branch' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
61
+
62
+ INSERT INTO git_host_webhook_event_selectors
63
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
64
+ select id, ' repository ssh url' , ' project.ssh_url' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
65
+
66
+ INSERT INTO git_host_webhook_event_selectors
67
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
68
+ select id, ' description' , ' object_attributes.description' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
69
+
70
+ INSERT INTO git_host_webhook_event_selectors
71
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
72
+ select id, ' state' , ' object_attributes.state' , ' t' , ' t' , ' t' , ' opened' , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ;
73
+
74
+ -- tag queries
75
+
76
+ INSERT INTO git_host_webhook_event_selectors
77
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
78
+ select id, ' repository url' , ' project.web_url' , ' f' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Tag Creation' ;
79
+
80
+ INSERT INTO git_host_webhook_event_selectors
81
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
82
+ select id, ' author' , ' user_username' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Tag Creation' ;
83
+
84
+ INSERT INTO git_host_webhook_event_selectors
85
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
86
+ select id, ' date' , ' object_attributes.updated_at' , ' t' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Tag Creation' ;
87
+
88
+ INSERT INTO git_host_webhook_event_selectors
89
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
90
+ select id, ' tag name' , ' ref' , ' t' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Tag Creation' ;
91
+
92
+ INSERT INTO git_host_webhook_event_selectors
93
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
94
+ select id, ' target checkout' , ' checkout_sha' , ' t' , ' f' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Tag Creation' ;
95
+
96
+ INSERT INTO git_host_webhook_event_selectors
97
+ (event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
98
+ select id, ' tag creation identifier' , ' checkout_sha' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Tag Creation' ;
40
99
41
100
INSERT INTO git_host_webhook_event_selectors
42
101
(event_id, name, selector, to_show, to_show_in_ci_filter, is_active, possible_values, created_on)
43
- VALUES
44
- (6 , ' repository url' , ' project.web_url' , ' f' , ' f' , ' t' , NULL , NOW()),
45
- (6 , ' author' , ' user_username' , ' t' , ' t' , ' t' , NULL , NOW()),
46
- (6 , ' date' , ' object_attributes.updated_at' , ' t' , ' f' , ' t' , NULL , NOW()),
47
- (6 , ' tag name' , ' ref' , ' t' , ' f' , ' t' , NULL , NOW()),
48
- (6 , ' target checkout' , ' checkout_sha' , ' t' , ' f' , ' t' , NULL , NOW()),
49
- (6 , ' tag creation identifier' , ' checkout_sha' , ' t' , ' t' , ' t' , NULL , NOW()),
50
- (6 , ' repository ssh url' , ' project.ssh_url' , ' t' , ' t' , ' t' , NULL , NOW());
102
+ select id, ' repository ssh url' , ' project.ssh_url' , ' t' , ' t' , ' t' , NULL , NOW() from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Tag Creation' ;
51
103
52
104
53
105
-- - set fix_value for gitlab pull_request state
54
106
update git_host_webhook_event_selectors
55
107
set fix_value = ' ^opened$'
56
- where event_id = 5
57
- and name = ' state' ;
108
+ where event_id = (select id from git_host_webhook_event where git_host_name= ' Gitlab_Devtron' and name= ' Pull Request' ) and name = ' state' ;
58
109
59
110
-- - set fix_value for gitlab tag creation identifier ref_type
60
111
update git_host_webhook_event_selectors
61
112
set fix_value = ' \b [0-9a-f]{5,40}\b '
62
- where event_id= 6 and name= ' tag creation identifier' ;
113
+ where event_id= ( select id from git_host_webhook_event where git_host_name = ' Gitlab_Devtron ' and name = ' Tag Creation ' ) and name= ' tag creation identifier' ;
0 commit comments