Skip to content

Fix NamedType error in tests #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
uses: github/codeql-action/init@v3
- name: Run tests
run: |
${{ steps.init.outputs.codeql-path }} test run ./cpp/test/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cpp and go tests are removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to fix the test failures in main, but I've been unable to reproduce locally. I removed the cpp and go tests here to limit the number of tests being run in CI, just for debugging.

It's been a while, but my suspicion was that there is some dependency discrepancy between CI and local dev. Maybe some caching layer is affecting something somewhere. Anyway, I could never fully understand why this single Recursion.ql test fails in CI, but I'm unable to reproduce locally. I'll probably just close this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will give it a try later too.

${{ steps.init.outputs.codeql-path }} test run ./go/test/
${{ steps.init.outputs.codeql-path }} test extract ./java/test/
${{ steps.init.outputs.codeql-path }} query run --database=java/test/test.testproj/ -- java/src/security/Recursion/Recursion.ql
${{ steps.init.outputs.codeql-path }} test run ./java/test/
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ predicate configOrConfigPointer(Type t) {
) or
exists(Type tp |
tp.hasQualifiedName("crypto/tls", "Config") and
t.(NamedType).getUnderlyingType().(StructType).hasField(_, tp)
t.(DefinedType).getUnderlyingType().(StructType).hasField(_, tp)
) or
exists(Type tp, Type tp2 |
tp.hasQualifiedName("crypto/tls", "Config") and
tp2 = tp.getPointerType+() and
t.(NamedType).getUnderlyingType().(StructType).hasField(_, tp2)
t.(DefinedType).getUnderlyingType().(StructType).hasField(_, tp2)
)
}

Expand Down Expand Up @@ -149,4 +149,4 @@ where
) else
any()

select configStruct, "TLS.Config.MinVersion is never set for variable $@ ", v, v.getName()
select configStruct, "TLS.Config.MinVersion is never set for variable $@ ", v, v.getName()
24 changes: 12 additions & 12 deletions java/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
lockVersion: 1.0.0
dependencies:
codeql/dataflow:
version: 1.1.5
version: 2.0.4
codeql/java-all:
version: 4.2.0
version: 7.1.2
codeql/mad:
version: 1.0.11
version: 1.0.20
codeql/rangeanalysis:
version: 1.0.11
version: 1.0.20
codeql/regex:
version: 1.0.11
version: 1.0.20
codeql/ssa:
version: 1.0.11
version: 1.0.20
codeql/threat-models:
version: 1.0.11
version: 1.0.20
codeql/tutorial:
version: 1.0.11
version: 1.0.20
codeql/typeflow:
version: 1.0.11
version: 1.0.20
codeql/typetracking:
version: 1.0.11
version: 2.0.4
codeql/util:
version: 1.0.11
version: 2.0.7
codeql/xml:
version: 1.0.11
version: 1.0.20
compiled: false
24 changes: 12 additions & 12 deletions java/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
lockVersion: 1.0.0
dependencies:
codeql/dataflow:
version: 1.1.5
version: 2.0.4
codeql/java-all:
version: 4.2.0
version: 7.1.2
codeql/mad:
version: 1.0.11
version: 1.0.20
codeql/rangeanalysis:
version: 1.0.11
version: 1.0.20
codeql/regex:
version: 1.0.11
version: 1.0.20
codeql/ssa:
version: 1.0.11
version: 1.0.20
codeql/threat-models:
version: 1.0.11
version: 1.0.20
codeql/tutorial:
version: 1.0.11
version: 1.0.20
codeql/typeflow:
version: 1.0.11
version: 1.0.20
codeql/typetracking:
version: 1.0.11
version: 2.0.4
codeql/util:
version: 1.0.11
version: 2.0.7
codeql/xml:
version: 1.0.11
version: 1.0.20
compiled: false
Loading