Skip to content
Merged
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
2 changes: 2 additions & 0 deletions codeql-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ provide:
- "*/ql/test/qlpack.yml"
- "*/ql/examples/qlpack.yml"
- "*/ql/consistency-queries/qlpack.yml"
- "*/ql/automodel/src/qlpack.yml"
- "*/ql/automodel/test/qlpack.yml"
- "shared/*/qlpack.yml"
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
- "go/ql/config/legacy-support/qlpack.yml"
Expand Down
2 changes: 1 addition & 1 deletion csharp/ql/campaigns/Solorigate/publish.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -e

SOLORIGATE_ROOT="$(dirname $0)"
SOLORIGATE_ROOT="$(readlink -f "$(dirname $0)")"
WORKSPACE_ROOT="$SOLORIGATE_ROOT/../../../.."
GRPS="solorigate,-test"

Expand Down
28 changes: 28 additions & 0 deletions java/ql/automodel/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
set -e

AUTOMODEL_ROOT="$(readlink -f "$(dirname $0)")"
WORKSPACE_ROOT="$AUTOMODEL_ROOT/../../.."
GRPS="automodel,-test"

if [ -z "$CODEQL_DIST" ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Optional)...you could also check if gh codeql is available and use that if CODEQL_DIST is unset.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Lets defer that in case we want to make changes to the solorigate pack as well.

echo "CODEQL_DIST not set"
exit -1
fi

cd "$AUTOMODEL_ROOT"
echo Testing automodel queries
"${CODEQL_DIST}/codeql" test run test

cd "$WORKSPACE_ROOT"

echo Preparing release
"${CODEQL_DIST}/codeql" pack release --groups $GRPS

echo Publishing automodel
"${CODEQL_DIST}/codeql" pack publish --groups $GRPS

echo Bumping versions
"${CODEQL_DIST}/codeql" pack post-release --groups $GRPS

echo Automodel packs successfully published. Please commit and push the version changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you wanted to be extra fancy, you could commit and push directly from this script.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm... I kind of like it not committing for me, then there is less that suddenly happens. But we can also tweak this afterwards. It almost seems like there should be a generic publish script we could have for all the separate packs, but I am not sure how frequent these separate packs are?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this script is going to be run in CI, then something will have to commit and push the change, but maybe that is a longer term goal.

Eventually, all of our core packs will be publishable separately. But, that won't happen for a while. I still would hope that something like this script would become the default way of publishing.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extensions:
- addsTo:
pack: codeql/java-queries
pack: codeql/java-automodel-queries
extensible: automodelCandidateFilter
data: []
10 changes: 10 additions & 0 deletions java/ql/automodel/src/qlpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: codeql/java-automodel-queries
version: 0.0.3-dev
groups:
- java
- automodel
dependencies:
codeql/java-all: ${workspace}
dataExtensions:
- AutomodelCandidateFilter.yml
warnOnImplicitThis: true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AutomodelApplicationModeExtractCandidates.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AutomodelApplicationModeExtractNegativeExamples.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AutomodelApplicationModeExtractPositiveExamples.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AutomodelFrameworkModeExtractCandidates.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AutomodelFrameworkModeExtractNegativeExamples.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AutomodelFrameworkModeExtractPositiveExamples.ql
12 changes: 12 additions & 0 deletions java/ql/automodel/test/qlpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: codeql/java-automodel-tests
version: 0.0.1-dev
groups:
- java
- automodel
- test
dependencies:
codeql/java-all: ${workspace}
codeql/java-automodel-queries: ${workspace}
extractor: java
tests: .
warnOnImplicitThis: true
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TestLibrary extends RefType {
/** Holds if the given file is a test file. */
private predicate isInTestFile(File file) {
file.getAbsolutePath().matches(["%/test/%", "%/guava-tests/%", "%/guava-testlib/%"]) and
not file.getAbsolutePath().matches("%/ql/test/%") // allows our test cases to work
not file.getAbsolutePath().matches(["%/ql/test/%", "%/ql/automodel/test/%"]) // allows our test cases to work
}

/** Holds if the given compilation unit's package is a JDK internal. */
Expand Down
1 change: 0 additions & 1 deletion java/ql/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ dependencies:
codeql/util: ${workspace}
dataExtensions:
- Telemetry/ExtractorInformation.yml
- Telemetry/AutomodelCandidateFilter.yml
warnOnImplicitThis: true

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.