@@ -26,9 +26,7 @@ use axum_extra::{
26
26
TypedHeader ,
27
27
} ;
28
28
use futures:: { future:: BoxFuture , FutureExt } ;
29
- use orchestrator:: coordinator:: {
30
- self , CoordinatorFactory , DockerBackend , Versions , TRACKED_CONTAINERS ,
31
- } ;
29
+ use orchestrator:: coordinator:: { self , CoordinatorFactory , DockerBackend , TRACKED_CONTAINERS } ;
32
30
use snafu:: prelude:: * ;
33
31
use std:: {
34
32
convert:: TryInto ,
@@ -90,12 +88,6 @@ pub(crate) async fn serve(config: Config) {
90
88
. route ( "/macro-expansion" , post ( macro_expansion) )
91
89
. route ( "/meta/crates" , get_or_post ( meta_crates) )
92
90
. route ( "/meta/versions" , get ( meta_versions) )
93
- . route ( "/meta/version/stable" , get_or_post ( meta_version_stable) )
94
- . route ( "/meta/version/beta" , get_or_post ( meta_version_beta) )
95
- . route ( "/meta/version/nightly" , get_or_post ( meta_version_nightly) )
96
- . route ( "/meta/version/rustfmt" , get_or_post ( meta_version_rustfmt) )
97
- . route ( "/meta/version/clippy" , get_or_post ( meta_version_clippy) )
98
- . route ( "/meta/version/miri" , get_or_post ( meta_version_miri) )
99
91
. route ( "/meta/gist" , post ( meta_gist_create) )
100
92
. route ( "/meta/gist/" , post ( meta_gist_create) ) // compatibility with lax frontend code
101
93
. route ( "/meta/gist/:id" , get ( meta_gist_get) )
@@ -506,76 +498,6 @@ async fn meta_versions(
506
498
apply_timestamped_caching ( value, if_none_match)
507
499
}
508
500
509
- async fn meta_version_stable (
510
- Extension ( factory) : Extension < Factory > ,
511
- Extension ( cache) : Extension < Arc < SandboxCache > > ,
512
- if_none_match : Option < TypedHeader < IfNoneMatch > > ,
513
- ) -> Result < impl IntoResponse > {
514
- let value = track_metric_no_request_async ( Endpoint :: MetaVersionStable , || {
515
- cache. version_stable ( & factory. 0 )
516
- } )
517
- . await ?;
518
- apply_timestamped_caching ( value, if_none_match)
519
- }
520
-
521
- async fn meta_version_beta (
522
- Extension ( factory) : Extension < Factory > ,
523
- Extension ( cache) : Extension < Arc < SandboxCache > > ,
524
- if_none_match : Option < TypedHeader < IfNoneMatch > > ,
525
- ) -> Result < impl IntoResponse > {
526
- let value =
527
- track_metric_no_request_async ( Endpoint :: MetaVersionBeta , || cache. version_beta ( & factory. 0 ) )
528
- . await ?;
529
- apply_timestamped_caching ( value, if_none_match)
530
- }
531
-
532
- async fn meta_version_nightly (
533
- Extension ( factory) : Extension < Factory > ,
534
- Extension ( cache) : Extension < Arc < SandboxCache > > ,
535
- if_none_match : Option < TypedHeader < IfNoneMatch > > ,
536
- ) -> Result < impl IntoResponse > {
537
- let value = track_metric_no_request_async ( Endpoint :: MetaVersionNightly , || {
538
- cache. version_nightly ( & factory. 0 )
539
- } )
540
- . await ?;
541
- apply_timestamped_caching ( value, if_none_match)
542
- }
543
-
544
- async fn meta_version_rustfmt (
545
- Extension ( factory) : Extension < Factory > ,
546
- Extension ( cache) : Extension < Arc < SandboxCache > > ,
547
- if_none_match : Option < TypedHeader < IfNoneMatch > > ,
548
- ) -> Result < impl IntoResponse > {
549
- let value = track_metric_no_request_async ( Endpoint :: MetaVersionRustfmt , || {
550
- cache. version_rustfmt ( & factory. 0 )
551
- } )
552
- . await ?;
553
- apply_timestamped_caching ( value, if_none_match)
554
- }
555
-
556
- async fn meta_version_clippy (
557
- Extension ( factory) : Extension < Factory > ,
558
- Extension ( cache) : Extension < Arc < SandboxCache > > ,
559
- if_none_match : Option < TypedHeader < IfNoneMatch > > ,
560
- ) -> Result < impl IntoResponse > {
561
- let value = track_metric_no_request_async ( Endpoint :: MetaVersionClippy , || {
562
- cache. version_clippy ( & factory. 0 )
563
- } )
564
- . await ?;
565
- apply_timestamped_caching ( value, if_none_match)
566
- }
567
-
568
- async fn meta_version_miri (
569
- Extension ( factory) : Extension < Factory > ,
570
- Extension ( cache) : Extension < Arc < SandboxCache > > ,
571
- if_none_match : Option < TypedHeader < IfNoneMatch > > ,
572
- ) -> Result < impl IntoResponse > {
573
- let value =
574
- track_metric_no_request_async ( Endpoint :: MetaVersionMiri , || cache. version_miri ( & factory. 0 ) )
575
- . await ?;
576
- apply_timestamped_caching ( value, if_none_match)
577
- }
578
-
579
501
fn apply_timestamped_caching < T > (
580
502
value : Stamped < T > ,
581
503
if_none_match : Option < TypedHeader < IfNoneMatch > > ,
@@ -751,7 +673,6 @@ type Stamped<T> = (T, SystemTime);
751
673
struct SandboxCache {
752
674
crates : CacheOne < api:: MetaCratesResponse > ,
753
675
versions : CacheOne < api:: MetaVersionsResponse > ,
754
- raw_versions : CacheOne < Arc < Versions > > ,
755
676
}
756
677
757
678
impl SandboxCache {
@@ -792,81 +713,6 @@ impl SandboxCache {
792
713
793
714
v
794
715
}
795
-
796
- async fn raw_versions ( & self , factory : & CoordinatorFactory ) -> Result < Stamped < Arc < Versions > > > {
797
- let coordinator = factory. build :: < DockerBackend > ( ) ;
798
-
799
- let rv = self
800
- . raw_versions
801
- . fetch ( || async {
802
- Ok ( Arc :: new (
803
- coordinator. versions ( ) . await . context ( VersionsSnafu ) ?,
804
- ) )
805
- } )
806
- . await ;
807
-
808
- coordinator
809
- . shutdown ( )
810
- . await
811
- . context ( ShutdownCoordinatorSnafu ) ?;
812
-
813
- rv
814
- }
815
-
816
- async fn version_stable (
817
- & self ,
818
- factory : & CoordinatorFactory ,
819
- ) -> Result < Stamped < api:: MetaVersionResponse > > {
820
- let ( v, t) = self . raw_versions ( factory) . await ?;
821
- let v = ( & v. stable . rustc ) . into ( ) ;
822
- Ok ( ( v, t) )
823
- }
824
-
825
- async fn version_beta (
826
- & self ,
827
- factory : & CoordinatorFactory ,
828
- ) -> Result < Stamped < api:: MetaVersionResponse > > {
829
- let ( v, t) = self . raw_versions ( factory) . await ?;
830
- let v = ( & v. beta . rustc ) . into ( ) ;
831
- Ok ( ( v, t) )
832
- }
833
-
834
- async fn version_nightly (
835
- & self ,
836
- factory : & CoordinatorFactory ,
837
- ) -> Result < Stamped < api:: MetaVersionResponse > > {
838
- let ( v, t) = self . raw_versions ( factory) . await ?;
839
- let v = ( & v. nightly . rustc ) . into ( ) ;
840
- Ok ( ( v, t) )
841
- }
842
-
843
- async fn version_rustfmt (
844
- & self ,
845
- factory : & CoordinatorFactory ,
846
- ) -> Result < Stamped < api:: MetaVersionResponse > > {
847
- let ( v, t) = self . raw_versions ( factory) . await ?;
848
- let v = ( & v. nightly . rustfmt ) . into ( ) ;
849
- Ok ( ( v, t) )
850
- }
851
-
852
- async fn version_clippy (
853
- & self ,
854
- factory : & CoordinatorFactory ,
855
- ) -> Result < Stamped < api:: MetaVersionResponse > > {
856
- let ( v, t) = self . raw_versions ( factory) . await ?;
857
- let v = ( & v. nightly . clippy ) . into ( ) ;
858
- Ok ( ( v, t) )
859
- }
860
-
861
- async fn version_miri (
862
- & self ,
863
- factory : & CoordinatorFactory ,
864
- ) -> Result < Stamped < api:: MetaVersionResponse > > {
865
- let ( v, t) = self . raw_versions ( factory) . await ?;
866
- let v = v. nightly . miri . as_ref ( ) . context ( MiriVersionSnafu ) ?;
867
- let v = v. into ( ) ;
868
- Ok ( ( v, t) )
869
- }
870
716
}
871
717
872
718
#[ derive( Debug ) ]
@@ -1063,9 +909,6 @@ enum Error {
1063
909
source : orchestrator:: coordinator:: VersionsError ,
1064
910
} ,
1065
911
1066
- #[ snafu( display( "The Miri version was missing" ) ) ]
1067
- MiriVersion ,
1068
-
1069
912
#[ snafu( display( "Unable to shutdown the coordinator" ) ) ]
1070
913
ShutdownCoordinator {
1071
914
source : orchestrator:: coordinator:: Error ,
0 commit comments