Skip to content

Commit 17bff5d

Browse files
committed
codeql: removing the coding-standard repo
adding conditional jq chore: extend codeowners list (#175) * chore: extend codeowners list * fix: no commas Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alexander Lanin <alex@lanin.de> --------- Signed-off-by: Alexander Lanin <alex@lanin.de> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Integrates datarouter (#178) * Integrates datarouter - Deploys datarouetr in linux x86_64 and qnx_x86_64 image - Multicast route added to qnx guest in network_setup_dhcp.sh required for capturing DLTs. - dlt_config added for x86_64 and qnx x86_64 targets that includes the vlan_address updated for dlt_receive to capture untagged ethernet frames on tap0 interface * Adds datarouter test_remote_logging integration test - Adds test_remote_logging integration test that verifies remote logging of datarouter and network config. of the linux x86_64 and qnx qemu image by capturing DLT logs on the host. Use py_itf_test rule with select support (#177) - Update score_itf to 44c75de and score_bazel_platforms to b72a5c3 in known_good.json and MODULE.bazel overrides - Add explicit bazel_dep on platforms 1.0.0 (required by new config_settings) - Merge the two py_itf_test targets (linux_x86_64, qnx_x86_64) in feature_integration_tests/itf/BUILD into a single 'itf' target that uses config_setting + select() to switch args/data/plugins per platform; keep backward-compatible aliases for the old target names - Upgrade rules_oci from 1.8.0 to 2.2.7; adapt docker images to use oci_load (replacing the removed oci_tarball) and add the platform-specific repo variants revert the filters to test adding jd check and filter regex matches relative path
1 parent 13fbcdf commit 17bff5d

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

scripts/workflow/recategorize_guidelines.sh

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,37 @@ RECATEGORIZE_SCRIPT="codeql-coding-standards-repo/scripts/guideline_recategoriza
1515
CODING_STANDARDS_CONFIG="./.github/codeql/coding-standards.yml"
1616
CODING_STANDARDS_SCHEMA="codeql-coding-standards-repo/schemas/coding-standards-schema-1.0.0.json"
1717
SARIF_SCHEMA="codeql-coding-standards-repo/schemas/sarif-schema-2.1.0.json"
18-
SARIF_FILE="sarif-results/cpp.sarif"
18+
SARIF_FILE="sarif-results/cpp.sarif"
1919
mkdir -p sarif-results-recategorized
20+
2021
echo "Processing $SARIF_FILE for recategorization..."
2122
python3 "$RECATEGORIZE_SCRIPT" \
2223
--coding-standards-schema-file "$CODING_STANDARDS_SCHEMA" \
2324
--sarif-schema-file "$SARIF_SCHEMA" \
2425
"$CODING_STANDARDS_CONFIG" \
2526
"$SARIF_FILE" \
2627
"sarif-results-recategorized/$(basename "$SARIF_FILE")"
27-
rm "$SARIF_FILE"
28-
mv "sarif-results-recategorized/$(basename "$SARIF_FILE")" "$SARIF_FILE"
28+
PY_EXIT=$?
29+
if [ $PY_EXIT -ne 0 ]; then
30+
echo "Recategorization failed (exit code $PY_EXIT). SARIF file not updated." >&2
31+
exit $PY_EXIT
32+
fi
33+
rm "$SARIF_FILE"
34+
mv "sarif-results-recategorized/$(basename "$SARIF_FILE")" "$SARIF_FILE"
35+
36+
# Ensure jq is available
37+
if ! command -v jq >/dev/null 2>&1; then
38+
echo "Error: jq is required but not installed. Please install jq and rerun this script." >&2
39+
exit 1
40+
fi
41+
42+
# Filter SARIF to only include results from repos/* (relative or absolute)
43+
echo "Filtering SARIF results to only include entries with paths matching (^|/)repos/ ..."
44+
jq '(.runs) |= map(.results |= map(select((.locations // [] | length > 0) and ((.locations[0].physicalLocation.artifactLocation.uri // "") | test("(^|/)repos/")))) )' "$SARIF_FILE" > "${SARIF_FILE}.filtered"
45+
if [ $? -eq 0 ]; then
46+
mv "${SARIF_FILE}.filtered" "$SARIF_FILE"
47+
else
48+
echo "jq filtering failed. SARIF file was not modified." >&2
49+
rm -f "${SARIF_FILE}.filtered"
50+
exit 1
51+
fi

0 commit comments

Comments
 (0)