22
22
import glob
23
23
import os
24
24
import re
25
+ import semver
25
26
26
27
log = logging .getLogger (f'mkdocs.plugins.{ __name__ } ' )
27
28
@@ -149,7 +150,7 @@ def generate_conformance_tables(reports, currVersion, mkdocsConfig):
149
150
150
151
return new_file
151
152
152
- def generate_profiles_report (reports , route ,version ):
153
+ def generate_profiles_report (reports , route , version ):
153
154
154
155
http_reports = reports .loc [reports ["name" ] == route ]
155
156
http_reports .set_index ('organization' )
@@ -159,21 +160,32 @@ def generate_profiles_report(reports, route,version):
159
160
columns = http_reports ['organization' ])
160
161
161
162
http_table = http_reports [['organization' , 'project' ,
162
- 'version' ,'mode' , 'extended.supportedFeatures' ]].T
163
+ 'version' , 'mode' , 'core.result ' , 'extended.supportedFeatures' ]].T
163
164
http_table .columns = http_table .iloc [0 ]
164
165
http_table = http_table [1 :].T
166
+ # change core.result value
165
167
166
168
for row in http_table .itertuples ():
167
- if type (row ._4 ) is list :
168
- for feat in row ._4 :
169
+ if row ._4 == "success" :
170
+ http_table .loc [(row .Index , 'core.result' )] = ':white_check_mark:'
171
+ else :
172
+ http_table .loc [(row .Index , 'core.result' )] = ':x:'
173
+
174
+ if type (row ._5 ) is list :
175
+ for feat in row ._5 :
169
176
# Process feature name before using it as a column
170
177
processed_feat = process_feature_name (feat )
171
- http_table .loc [row .Index , processed_feat ] = ':white_check_mark:'
178
+ http_table .loc [(http_table .index == row .Index ) & \
179
+ (http_table ['project' ] == row .project ) & \
180
+ (http_table ['version' ] == row .version ) & \
181
+ (http_table ['mode' ] == row .mode ), processed_feat ] = ':white_check_mark:'
172
182
http_table = http_table .fillna (':x:' )
173
183
http_table = http_table .drop (['extended.supportedFeatures' ], axis = 1 )
174
184
175
185
http_table = http_table .rename (
176
- columns = {"project" : "Project" , "version" : "Version" , "mode" :"Mode" })
186
+ columns = {"project" : "Project" , "version" : "Version" , "mode" : "Mode" , "core.result" : "Core" })
187
+ if semver .compare (version .removeprefix ('v' ), '1.3.0' ) < 0 :
188
+ http_table = http_table .drop (columns = ["Core" ])
177
189
if version == 'v1.0.0' :
178
190
http_table = http_table .drop (columns = ["Mode" ])
179
191
return http_table
0 commit comments