@@ -3,8 +3,10 @@ use crate::github::{
3
3
client, enqueue_shas, parse_homu_comment, rollup_pr_number, unroll_rollup,
4
4
COMMENT_MARK_TEMPORARY , RUST_REPO_GITHUB_API_URL ,
5
5
} ;
6
+ use crate :: job_queue:: run_new_queue;
6
7
use crate :: load:: SiteCtxt ;
7
8
9
+ use database:: { BenchmarkRequest , BenchmarkRequestStatus } ;
8
10
use hashbrown:: HashMap ;
9
11
use std:: sync:: Arc ;
10
12
@@ -72,6 +74,29 @@ async fn handle_issue(
72
74
Ok ( github:: Response )
73
75
}
74
76
77
+ /// The try does not have a `sha` or a `parent_sha` but we need to keep a record
78
+ /// of this commit existing. We make sure there can only be one `pr` with a
79
+ /// status of `WaitingForArtifacts` to ensure we don't have duplicates.
80
+ async fn queue_partial_try_benchmark_request (
81
+ conn : & dyn database:: pool:: Connection ,
82
+ pr : u32 ,
83
+ backends : & str ,
84
+ ) {
85
+ // We only want to run this if the new system is running
86
+ if run_new_queue ( ) {
87
+ let try_request = BenchmarkRequest :: create_try (
88
+ None ,
89
+ None ,
90
+ pr,
91
+ chrono:: Utc :: now ( ) ,
92
+ BenchmarkRequestStatus :: WaitingForArtifacts ,
93
+ backends,
94
+ "" ,
95
+ ) ;
96
+ conn. insert_benchmark_request ( & try_request) . await ;
97
+ }
98
+ }
99
+
75
100
async fn handle_rust_timer (
76
101
ctxt : Arc < SiteCtxt > ,
77
102
main_client : & client:: Client ,
@@ -97,6 +122,13 @@ async fn handle_rust_timer(
97
122
let msg = match queue {
98
123
Ok ( cmd) => {
99
124
let conn = ctxt. conn ( ) . await ;
125
+
126
+ queue_partial_try_benchmark_request (
127
+ & * conn,
128
+ issue. number ,
129
+ cmd. params . backends . unwrap_or ( "" ) ,
130
+ )
131
+ . await ;
100
132
conn. queue_pr (
101
133
issue. number ,
102
134
cmd. params . include ,
@@ -137,6 +169,12 @@ async fn handle_rust_timer(
137
169
{
138
170
let conn = ctxt. conn ( ) . await ;
139
171
for command in & valid_build_cmds {
172
+ queue_partial_try_benchmark_request (
173
+ & * conn,
174
+ issue. number ,
175
+ command. params . backends . unwrap_or ( "" ) ,
176
+ )
177
+ . await ;
140
178
conn. queue_pr (
141
179
issue. number ,
142
180
command. params . include ,
0 commit comments