Skip to content

Commit 421cd57

Browse files
committed
fixed new config
1 parent 7f95046 commit 421cd57

File tree

3 files changed

+1
-55
lines changed

3 files changed

+1
-55
lines changed

.github/codeql/codeql-config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: "Custom CodeQL Configuration for MISRA"
22

33
queries:
4-
- uses: codeql/cpp-queries
54
- uses: codeql/misra-cpp-coding-standards
65

76
paths-ignore:

.github/workflows/codeql-multiple-repo-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
mkdir -p sarif-results-recategorized
172172
for sarif_file in sarif-results/*.sarif; do
173173
echo "Processing $sarif_file for recategorization..."
174-
python3.9 "$RECATEGORIZE_SCRIPT" \
174+
python3 "$RECATEGORIZE_SCRIPT" \
175175
coding_standards_config_file "$CODING_STANDARDS_CONFIG" \
176176
sarif_in "$sarif_file" \
177177
sarif_out "sarif-results-recategorized/$(basename "$sarif_file")"

integration_test.sh

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -107,46 +107,11 @@ overall_depr_total=0
107107

108108
# Track if any build group failed
109109
any_failed=0
110-
binary_path="${CODEQL_WORK_DIR}/codeql-cli/codeql/codeql"
111-
112-
if [ -x "${binary_path}" ]; then
113-
echo "Local CodeQL CLI found at ${binary_path}. Adding to PATH."
114-
export PATH="$(pwd)/${CODEQL_WORK_DIR}/codeql-cli/codeql:${PATH}"
115-
else
116-
echo "CodeQL CLI not found. Downloading..."
117-
mkdir -p "${CODEQL_WORK_DIR}/codeql-cli"
118-
curl -L "${CODEQL_URL}" -o "${CODEQL_WORK_DIR}/${CODEQL_BUNDLE}"
119-
unzip "${CODEQL_WORK_DIR}/${CODEQL_BUNDLE}" -d "${CODEQL_WORK_DIR}/codeql-cli"
120-
export PATH="$(pwd)/${CODEQL_WORK_DIR}/codeql-cli/codeql:${PATH}"
121-
echo "CodeQL CLI downloaded and added to PATH."
122-
fi
123-
124-
# Verify CodeQL CLI is now available
125-
if ! command -v codeql &> /dev/null; then
126-
echo "Error: CodeQL CLI could not be set up. Exiting."
127-
exit 1
128-
else
129-
echo "codeql found in path"
130-
fi
131-
132-
133-
mkdir -p "${CODEQL_DATABASES_DIR}"
134-
mkdir -p "${CODEQL_SARIF_DIR}"
135110

136111
for group in "${!BUILD_TARGET_GROUPS[@]}"; do
137112
targets="${BUILD_TARGET_GROUPS[$group]}"
138113
log_file="${LOG_DIR}/${group}.log"
139114

140-
db_path="${CODEQL_DATABASES_DIR}/${group}_db"
141-
sarif_output="${CODEQL_SARIF_DIR}/${group}.sarif"
142-
current_bazel_output_base="/tmp/codeql_bazel_output_${group}_$(date +%s%N)" # Add timestamp for extra uniqueness
143-
144-
145-
# 1. Clean Bazel to ensure a fresh build for CodeQL tracing
146-
echo "Running 'bazel clean --expunge' and 'bazel shutdown'..."
147-
bazel --output_base="${current_bazel_output_base}" clean --expunge || { echo "Bazel clean failed for ${group}"; exit 1; }
148-
bazel --output_base="${current_bazel_output_base}" shutdown || { echo "Bazel shutdown failed for ${group}"; exit 1; }
149-
150115
# Log build group banner only to stdout/stderr (not into summary table file)
151116
echo "--- Building group: ${group} ---"
152117
start_ts=$(date +%s)
@@ -168,24 +133,6 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do
168133
d_count=$(depr_count "$log_file")
169134
overall_warn_total=$(( overall_warn_total + w_count ))
170135
overall_depr_total=$(( overall_depr_total + d_count ))
171-
172-
# Shutdown Bazel again after the traced build
173-
echo "Running 'bazel shutdown' after CodeQL database creation..."
174-
bazel shutdown || { echo "Bazel shutdown failed after tracing for ${group}"; exit 1; }
175-
176-
# 4. Analyze the created database
177-
echo "Analyzing CodeQL database for ${group}..."
178-
codeql database analyze "${DB_PATH}" \
179-
--format=sarifv2.1.0 \
180-
--output="${SARIF_OUTPUT}" \
181-
--sarif-category="${group}-${CODEQL_LANGUAGE}" \
182-
--packs "${CODEQL_QUERY_PACKS}" \
183-
|| { echo "CodeQL analysis failed for ${group}"; exit 1; }
184-
185-
echo "CodeQL analysis for ${group} complete. Results saved to: ${SARIF_OUTPUT}"
186-
echo ""
187-
188-
189136
# Append as a markdown table row (duration without trailing 's')
190137
if [[ ${build_status} -eq 0 ]]; then
191138
status_symbol=""

0 commit comments

Comments
 (0)