File tree Expand file tree Collapse file tree 3 files changed +27
-15
lines changed
javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap Expand file tree Collapse file tree 3 files changed +27
-15
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,20 @@ jobs:
87
87
# Compile .cds files to .cds.json files.
88
88
- name : Compile CAP CDS files
89
89
run : |
90
- for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
90
+ for test_dir in $(find . -type f -name '*.expected' -exec dirname {} \;);
91
91
do
92
- echo "I am compiling $cds_file"
93
- cds compile $cds_file \
94
- -2 json \
95
- -o "$cds_file.json" \
96
- --locations
92
+ # The CDS compiler produces locations relative to the working directory
93
+ # so we switch to the test directory before running the compiler.
94
+ pushd $test_dir
95
+ for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
96
+ do
97
+ echo "I am compiling $cds_file"
98
+ cds compile $cds_file \
99
+ -2 json \
100
+ -o "$cds_file.json" \
101
+ --locations
102
+ done
103
+ popd
97
104
done
98
105
99
106
- name : Run test suites
@@ -105,7 +112,7 @@ jobs:
105
112
CODEQL_STDLIB_IDENT : ${{matrix.codeql_standard_library_ident}}
106
113
RUNNER_TMP : ${{ runner.temp }}
107
114
LGTM_INDEX_XML_MODE : all
108
- LGTM_INDEX_FILETYPES : " .json:JSON"
115
+ LGTM_INDEX_FILETYPES : " .json:JSON\n .cds:JSON "
109
116
110
117
shell : bash
111
118
run : >
Original file line number Diff line number Diff line change @@ -14,11 +14,16 @@ abstract class CdlObject extends JsonObject {
14
14
exists ( Location loc , JsonValue locValue |
15
15
loc = this .getLocation ( ) and
16
16
locValue = this .getPropValue ( "$location" ) and
17
- path =
18
- any ( File f |
19
- f .getAbsolutePath ( )
20
- .matches ( "%" + locValue .getPropValue ( "file" ) .getStringValue ( ) + ".json" )
21
- ) .getAbsolutePath ( ) .regexpReplaceAll ( "\\.json$" , "" ) and
17
+ // The path in the cds.json file is relative to the working directory used when running
18
+ // the cds compile command. In our extractor, that's always the root of the repository,
19
+ // so we can identify the sourceLocationPrefix to find the path of the root of the repo
20
+ // then append the relative path
21
+ exists ( string sourceLocationPrefix |
22
+ sourceLocationPrefix ( sourceLocationPrefix ) and
23
+ path =
24
+ sourceLocationPrefix .regexpReplaceAll ( "/$" , "" ) + "/" +
25
+ locValue .getPropValue ( "file" ) .getStringValue ( )
26
+ ) and
22
27
if
23
28
not exists ( locValue .getPropValue ( "line" ) ) and
24
29
not exists ( locValue .getPropValue ( "col" ) )
Original file line number Diff line number Diff line change 1
1
{
2
- "CodeQLCLI" : " 2.19.0 " ,
3
- "CodeQLStandardLibrary" : " codeql-cli/v2.19.0 " ,
4
- "CodeQLCLIBundle" : " codeql-bundle-v2.19.0 "
2
+ "CodeQLCLI" : " 2.19.4 " ,
3
+ "CodeQLStandardLibrary" : " codeql-cli/v2.19.4 " ,
4
+ "CodeQLCLIBundle" : " codeql-bundle-v2.19.4 "
5
5
}
You can’t perform that action at this time.
0 commit comments