File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ export type APIConfigEntity = {
21
21
defaultValue : boolean | Record < string , any > ;
22
22
enabled : boolean ;
23
23
rules : Array < APIConfigRule > ;
24
+ } & APIConfigSpecExtraData ;
25
+
26
+ export type APIConfigSpecExtraData = {
27
+ checksInPast30Days ?: number ;
24
28
} ;
25
29
26
30
export type APIConfigRule = {
Original file line number Diff line number Diff line change 1
1
import * as vsc from 'vscode' ;
2
2
import { APIConfigRule } from '../contracts/projects' ;
3
3
import { StatsigConfig } from '../state/ProjectsState' ;
4
+ import ProjectsState from '../state/ProjectsState' ;
4
5
import { getTierPrefix } from './webUtils' ;
5
6
6
7
export function getConfigUrl ( c : StatsigConfig ) : vsc . Uri {
@@ -27,6 +28,15 @@ function isPublic(rule: APIConfigRule): boolean {
27
28
return rule . conditions [ 0 ] . type === 'public' ;
28
29
}
29
30
31
+ export function getStaleConfig ( configName : string ) : StatsigConfig [ ] {
32
+ const configs = getConfigsFromName ( configName ) ;
33
+ return configs . filter ( ( config ) => config . data . checksInPast30Days === 0 ) ;
34
+ }
35
+
36
+ export function getConfigsFromName ( configName : string ) : StatsigConfig [ ] {
37
+ return ProjectsState . instance . findConfig ( configName ) ;
38
+ }
39
+
30
40
export type StaticConfigResult = 'pass' | 'fail' | 'mixed' ;
31
41
// A quick heuristic to show GK pass rate. This is expected to work for simple
32
42
// GKs (eg disabled, or a single public group that always passes), and might
@@ -114,6 +124,10 @@ export function renderConfigInMarkdown(
114
124
) } \n\`\`\``;
115
125
}
116
126
127
+ if ( c . data . checksInPast30Days !== undefined ) {
128
+ body = `${ body } \n\n Checks in past 30 days: ${ c . data . checksInPast30Days } ` ;
129
+ }
130
+
117
131
return new vsc . MarkdownString (
118
132
`
119
133
#### Statsig ${ c . type === 'feature_gate' ? 'gate' : 'config' } \`${ c . data . name } \`
You can’t perform that action at this time.
0 commit comments