Skip to content

Commit d0e81b4

Browse files
Andrei-Stepanovmgrabovsky
authored andcommitted
OSCI-5442: fix metadata lookup for modules
Signed-off-by: Andrei Stepanov <[email protected]>
1 parent 4e31aae commit d0e81b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/schema/db_types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ const StateType = new GraphQLObjectType({
302302
// The metadata_consolidated query requires the test case name to be non-null.
303303
if (!testcase_name) return null;
304304
// Guess product version from the NVR.
305-
const { nvr, type } = parentValue.broker_msg_body.artifact;
305+
const { nsvc, type } = parentValue.broker_msg_body.artifact;
306+
let { nvr } = parentValue.broker_msg_body.artifact;
306307
// Currently, only RPM and module builds are supported.
307308
if (!['brew-build', 'redhat-module'].includes(type)) {
308309
log(
@@ -311,14 +312,15 @@ const StateType = new GraphQLObjectType({
311312
);
312313
return null;
313314
}
315+
if (type === 'redhat-module') {
316+
nvr = convertNsvcToNvr(nsvc);
317+
}
314318
const product_version = `rhel-${getOSVersionFromNvr(nvr, type)}`;
315-
316319
log(
317320
'Delegating metadata query for state: testcase %s, product %s',
318321
testcase_name,
319322
product_version,
320323
);
321-
322324
return await delegateToSchema({
323325
schema,
324326
operation: 'query',

0 commit comments

Comments
 (0)