Skip to content

Commit

Permalink
TC-1609 Improve package's qualifiers management
Browse files Browse the repository at this point in the history
Signed-off-by: mrizzi <[email protected]>
  • Loading branch information
mrizzi authored and dejanb committed Jul 1, 2024
1 parent dbaaba0 commit f068819
Show file tree
Hide file tree
Showing 6 changed files with 18,127 additions and 1 deletion.
14 changes: 14 additions & 0 deletions demo/graphql/queries-trustification.gql
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,17 @@ query TC_1593_HasMetadata {
}
}
}

query TC_1609_HasMetadata {
HasMetadata (hasMetadataSpec: {
key: "topLevelPackage",
value: "pkg:maven/com.example/[email protected]?type=jar",
subject: {package: {name:"org-crac"}}
}) {
subject {
... on Package {
...allPkgTree
}
}
}
}
8 changes: 8 additions & 0 deletions internal/testing/e2e-trustification/e2e
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,13 @@ diff -u "${SCRIPT_DIR}/expectTC_1593_HasMetadata.json" "${GUAC_DIR}/gotTC_1593_H
cat "$queries" | gql-cli http://localhost:8080/query -o TC_1593_FindDependentProduct | jq 'del(.. | .id?) | del(.. | .downloadLocation?) | .findDependentProduct' > "${GUAC_DIR}/gotTC_1593_FindDependentProduct.json"
diff -u "${SCRIPT_DIR}/expectTC_1593_FindDependentProduct.json" "${GUAC_DIR}/gotTC_1593_FindDependentProduct.json"

# IMPORTANT: this must happen after the above 'ds1/sbom' has been executed to reproduce the issue
echo @@@@ Ingesting TC_1609_sbom.json into server
time go run ./cmd/guacone collect files ${GUAC_DIR}/internal/testing/testdata/exampledata/TC_1609_sbom.json;

echo @@@@ Running TC_1609 queries and validating output

cat "$queries" | gql-cli http://localhost:8080/query -o TC_1609_HasMetadata | jq 'del(.. | .id?) | .HasMetadata | sort ' > "${GUAC_DIR}/gotTC_1609_HasMetadata.json"
diff -u "${SCRIPT_DIR}/expectTC_1609_HasMetadata.json" "${GUAC_DIR}/gotTC_1609_HasMetadata.json"

# Note: graphql_playground is left running, CI will clean it up
29 changes: 29 additions & 0 deletions internal/testing/e2e-trustification/expectTC_1609_HasMetadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"subject": {
"type": "maven",
"namespaces": [
{
"namespace": "io.github.crac",
"names": [
{
"name": "org-crac",
"versions": [
{
"version": "0.1.1.redhat-00002",
"qualifiers": [
{
"key": "type",
"value": "jar"
}
],
"subpath": ""
}
]
}
]
}
]
}
}
]
Loading

0 comments on commit f068819

Please sign in to comment.