Skip to content

Commit ca9b6b4

Browse files
committed
.sync/workflows/codeql: Add more inline documentation
Updates and adds some additional comments to the CodeQL workflow files to give better context. Signed-off-by: Michael Kubacki <[email protected]>
1 parent 7760245 commit ca9b6b4

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

.sync/workflows/leaf/codeql-platform.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
# Any platform that supports the `--codeql` parameter will be built and the
44
# results will be uploaded to GitHub Code Scanning.
55
#
6+
# Note: Important: This file only works with "platform" builds. "CI" builds are
7+
# supported with the codeql.yml file.
8+
#
69
# Note: This workflow only supports Windows as CodeQL CLI has confirmed issues running
710
# against edk2-style codebases on Linux (only tested on Ubuntu). Therefore, this
811
# workflow is written only for Windows but could easily be adapted to run on Linux
912
# in the future if needed (e.g. swap out "windows" with agent OS var value, etc.)
1013
#
14+
# For details about the Linux issue see: https://github.com/github/codeql-action/issues/1338
15+
#
1116
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
1217
# instead of the file in this repo.
1318
#
@@ -323,7 +328,14 @@ jobs:
323328
import sys
324329
from pathlib import Path
325330
326-
# Find the plugin directory that contains the CodeQL plugin
331+
#
332+
# Find the plugin directory that contains the CodeQL plugin.
333+
#
334+
# Prior to Mu Basecore 202311, the CodeQL plugin was located in .pytool. After it
335+
# is located in BaseTools. First check BaseTools, but consider .pytool as a backup
336+
# for backward compatibility. The .pytool backup can be removed when no longer needed
337+
# for supported branches.
338+
#
327339
plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('BaseTools/Plugin/CodeQL'))
328340
if not plugin_dir:
329341
plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('.pytool/Plugin/CodeQL'))
@@ -407,7 +419,14 @@ jobs:
407419
import shutil
408420
from pathlib import Path
409421
410-
# Only these two plugins are needed for CodeQL
422+
# Only these two plugins are needed for CodeQL.
423+
#
424+
# CodeQL build time is reduced by removing other plugins that are not needed for the CodeQL
425+
# build in the .pytool directory. The CompilerPlugin is required to compile code for CodeQL
426+
# to extract results from and the CodeQL plugin is necessary to to analyze the results and
427+
# build the CodeQL database from them. The CodeQL plugin should be in BaseTools moving forward
428+
# but still might be in .pytool in older branches so it is kept here as an exception.
429+
#
411430
plugins_to_keep = ['CodeQL', 'CompilerPlugin']
412431
413432
plugin_dir = Path(os.environ['PYTOOL_PLUGIN_DIR']).absolute()

.sync/workflows/leaf/codeql.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
#
33
# Results are uploaded to GitHub Code Scanning.
44
#
5-
# Note: Important: This file currently only works with "CI" builds. "Platform" builds can
6-
# be supported without much effort but that will be done in the future.
5+
# Note: Important: This file only works with "CI" builds. "Platform" builds are
6+
# supported with the codeql-platform.yml file.
77
#
88
# Note: This workflow only supports Windows as CodeQL CLI has confirmed issues running
99
# against edk2-style codebases on Linux (only tested on Ubuntu). Therefore, this
1010
# workflow is written only for Windows but could easily be adapted to run on Linux
11-
# in the future if needed (e.g. swap out "windows" with agent OS var value, etc.)
11+
# in the future if needed (e.g. swap out "windows" with agent OS var value, etc.).
12+
#
13+
# For details about the Linux issue see: https://github.com/github/codeql-action/issues/1338
1214
#
1315
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
1416
# instead of the file in this repo.
@@ -270,7 +272,14 @@ jobs:
270272
import sys
271273
from pathlib import Path
272274
273-
# Find the plugin directory that contains the CodeQL plugin
275+
#
276+
# Find the plugin directory that contains the CodeQL plugin.
277+
#
278+
# Prior to Mu Basecore 202311, the CodeQL plugin was located in .pytool. After it
279+
# is located in BaseTools. First check BaseTools, but consider .pytool as a backup
280+
# for backward compatibility. The .pytool backup can be removed when no longer needed
281+
# for supported branches.
282+
#
274283
plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('BaseTools/Plugin/CodeQL'))
275284
if not plugin_dir:
276285
plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('.pytool/Plugin/CodeQL'))
@@ -352,7 +361,14 @@ jobs:
352361
import shutil
353362
from pathlib import Path
354363
355-
# Only these two plugins are needed for CodeQL
364+
# Only these two plugins are needed for CodeQL.
365+
#
366+
# CodeQL build time is reduced by removing other plugins that are not needed for the CodeQL
367+
# build in the .pytool directory. The CompilerPlugin is required to compile code for CodeQL
368+
# to extract results from and the CodeQL plugin is necessary to to analyze the results and
369+
# build the CodeQL database from them. The CodeQL plugin should be in BaseTools moving forward
370+
# but still might be in .pytool in older branches so it is kept here as an exception.
371+
#
356372
plugins_to_keep = ['CodeQL', 'CompilerPlugin']
357373
358374
plugin_dir = Path(os.environ['PYTOOL_PLUGIN_DIR']).absolute()

0 commit comments

Comments
 (0)