@@ -3,8 +3,10 @@ use crate::github::{
33 client, enqueue_shas, parse_homu_comment, rollup_pr_number, unroll_rollup,
44 COMMENT_MARK_TEMPORARY , RUST_REPO_GITHUB_API_URL ,
55} ;
6+ use crate :: job_queue:: run_new_queue;
67use crate :: load:: SiteCtxt ;
78
9+ use database:: { BenchmarkRequest , BenchmarkRequestStatus } ;
810use hashbrown:: HashMap ;
911use std:: sync:: Arc ;
1012
@@ -72,6 +74,29 @@ async fn handle_issue(
7274 Ok ( github:: Response )
7375}
7476
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+
75100async fn handle_rust_timer (
76101 ctxt : Arc < SiteCtxt > ,
77102 main_client : & client:: Client ,
@@ -97,6 +122,13 @@ async fn handle_rust_timer(
97122 let msg = match queue {
98123 Ok ( cmd) => {
99124 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 ;
100132 conn. queue_pr (
101133 issue. number ,
102134 cmd. params . include ,
@@ -137,6 +169,12 @@ async fn handle_rust_timer(
137169 {
138170 let conn = ctxt. conn ( ) . await ;
139171 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 ;
140178 conn. queue_pr (
141179 issue. number ,
142180 command. params . include ,
0 commit comments