@@ -2,12 +2,11 @@ use serde::Serialize;
2
2
use structopt:: StructOpt ;
3
3
4
4
use rover_client:: operations:: subgraph:: check:: { self , SubgraphCheckInput } ;
5
- use rover_client:: shared:: { CheckConfig , GitContext , ValidationPeriod } ;
5
+ use rover_client:: shared:: { CheckConfig , GitContext } ;
6
6
7
7
use crate :: command:: RoverOutput ;
8
- use crate :: options:: { GraphRefOpt , ProfileOpt , SchemaOpt , SubgraphOpt } ;
8
+ use crate :: options:: { CheckConfigOpts , GraphRefOpt , ProfileOpt , SchemaOpt , SubgraphOpt } ;
9
9
use crate :: utils:: client:: StudioClientConfig ;
10
- use crate :: utils:: parsers:: { parse_query_count_threshold, parse_query_percentage_threshold} ;
11
10
use crate :: Result ;
12
11
13
12
#[ derive( Debug , Serialize , StructOpt ) ]
@@ -25,20 +24,8 @@ pub struct Check {
25
24
#[ serde( skip_serializing) ]
26
25
schema : SchemaOpt ,
27
26
28
- /// The minimum number of times a query or mutation must have been executed
29
- /// in order to be considered in the check operation
30
- #[ structopt( long, parse( try_from_str = parse_query_count_threshold) ) ]
31
- query_count_threshold : Option < i64 > ,
32
-
33
- /// Minimum percentage of times a query or mutation must have been executed
34
- /// in the time window, relative to total request count, for it to be
35
- /// considered in the check. Valid numbers are in the range 0 <= x <= 100
36
- #[ structopt( long, parse( try_from_str = parse_query_percentage_threshold) ) ]
37
- query_percentage_threshold : Option < f64 > ,
38
-
39
- /// Size of the time window with which to validate schema against (i.e "24h" or "1w 2d 5h")
40
- #[ structopt( long) ]
41
- validation_period : Option < ValidationPeriod > ,
27
+ #[ structopt( flatten) ]
28
+ config : CheckConfigOpts ,
42
29
}
43
30
44
31
impl Check {
@@ -65,9 +52,9 @@ impl Check {
65
52
subgraph : self . subgraph . subgraph_name . clone ( ) ,
66
53
git_context,
67
54
config : CheckConfig {
68
- query_count_threshold : self . query_count_threshold ,
69
- query_count_threshold_percentage : self . query_percentage_threshold ,
70
- validation_period : self . validation_period . clone ( ) ,
55
+ query_count_threshold : self . config . query_count_threshold ,
56
+ query_count_threshold_percentage : self . config . query_percentage_threshold ,
57
+ validation_period : self . config . validation_period . clone ( ) ,
71
58
} ,
72
59
} ,
73
60
& client,
0 commit comments