@@ -39,7 +39,8 @@ const mdMatch = (md, ref) => nlToSpace(httpToHttps(md.toLowerCase())).indexOf(nl
39
39
40
40
const fullName = r => r . owner . login + '/' + r . name ;
41
41
42
- function validateRepo ( r , licenses , repoData , cgData , repoMap ) {
42
+ // Also potentially sets `r.prpreview` and `r.w3c`.
43
+ function validateRepo ( r , data , licenses ) {
43
44
const { contributing, contributingSw, license, licenseSw} = licenses ;
44
45
45
46
const errors = [ ] ;
@@ -70,20 +71,12 @@ function validateRepo(r, licenses, repoData, cgData, repoMap) {
70
71
let shouldBeRepoManaged = false ;
71
72
const hasRecTrack = { ashnazg : null , repotype : null , tr : null } ; // TODO detect conflicting information (repo-type vs ash-nazg vs TR doc)
72
73
73
- // is the repo associated with a CG in the CG monitor?
74
- const cg = cgData . data . find ( cg => {
75
- return cg . repositories . includes ( 'https://github.com/' + fullName ( r ) ) ||
76
- cg . repositories . includes ( 'https://github.com/' + fullName ( r ) + '/' ) ;
77
- } ) ;
78
-
79
- // is the repo associated with a WG in the spec dashboard?
80
- const wgRepo = repoMap [ fullName ( r ) ] ;
81
-
82
- if ( wgRepo ) {
83
- hasRecTrack . tr = wgRepo . some ( x => x . recTrack ) ;
74
+ const { specs} = data ;
75
+ if ( specs && specs . length ) {
76
+ hasRecTrack . tr = specs . some ( s => s . recTrack ) ;
84
77
}
85
78
86
- const ashRepo = repoData . find ( x => x . owner . toLowerCase ( ) === r . owner . login . toLowerCase ( ) && x . name . toLowerCase ( ) === r . name . toLowerCase ( ) ) ;
79
+ const { ashRepo} = data ;
87
80
if ( ashRepo ) {
88
81
hasRecTrack . ashnazg = ashRepo . groups . some ( g => g . groupType === "WG" ) ;
89
82
}
@@ -123,6 +116,7 @@ function validateRepo(r, licenses, repoData, cgData, repoMap) {
123
116
if ( ! conf . group && [ "rec-track" , "note" , "cg-report" ] . includes ( conf [ "repo-type" ] ) ) {
124
117
reportError ( 'incompletew3cjson' , { error : "group" } ) ;
125
118
} else {
119
+ // Note that `data.groups` is unused here.
126
120
groups = arrayify ( conf . group ) . map ( id => parseInt ( id , 10 ) ) ;
127
121
shouldBeRepoManaged = conf [ "repo-type" ] && ( conf [ "repo-type" ] === 'rec-track' || conf [ "repo-type" ] === 'cg-report' ) ;
128
122
}
@@ -134,17 +128,7 @@ function validateRepo(r, licenses, repoData, cgData, repoMap) {
134
128
}
135
129
}
136
130
} else {
137
- if ( cg ) {
138
- groups = [ cg . id ] ;
139
- } else if ( r . owner . login === 'WICG' ) {
140
- groups = [ 80485 ] ;
141
- }
142
- if ( wgRepo && wgRepo . length ) {
143
- groups = groups . concat ( wgRepo . map ( x => x . group ) ) ;
144
- }
145
- if ( r . owner . login === 'WebAudio' ) {
146
- groups . push ( 46884 ) ;
147
- }
131
+ groups = data . groups ;
148
132
reportError ( 'now3cjson' ) ;
149
133
}
150
134
const recTrackStatus = hasRecTrack . tr || hasRecTrack . ashnazg || hasRecTrack . repo ;
@@ -177,7 +161,6 @@ function validateRepo(r, licenses, repoData, cgData, repoMap) {
177
161
178
162
return {
179
163
errors, groups,
180
- isAshRepo : ! ! ashRepo ,
181
164
hasRecTrack : ! ! recTrackStatus ,
182
165
} ;
183
166
}
0 commit comments