Skip to content

Commit dac7290

Browse files
subatoifelicitymay
andauthored
Adds reusables and content to support public beta release of CodeQL for Kotlin (github#32859)
Co-authored-by: Felicity Chapman <[email protected]>
1 parent 94ba389 commit dac7290

File tree

9 files changed

+24
-9
lines changed

9 files changed

+24
-9
lines changed

content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,11 @@ If you have a workflow that generates more than one {% data variables.product.pr
441441
{% raw %}
442442
``` yaml
443443
packs:
444-
# Use these packs for JavaScript analysis
444+
# Use these packs for JavaScript and TypeScript analysis
445445
javascript:
446446
- scope/js-pack1
447447
- scope/js-pack2
448-
# Use these packs for Java analysis
448+
# Use these packs for Java and Kotlin analysis
449449
java:
450450
- scope/java-pack1
451451

content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ shortTitle: Configure compiled languages
44
intro: 'You can configure how {% data variables.product.prodname_dotcom %} uses the {% data variables.code-scanning.codeql_workflow %} to scan code written in compiled languages for vulnerabilities and errors.'
55
product: '{% data reusables.gated-features.code-scanning %}'
66
permissions: 'If you have write permissions to a repository, you can configure {% data variables.product.prodname_code_scanning %} for that repository.'
7+
miniTocMaxHeadingLevel: 3
78
redirect_from:
89
- /github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning-for-compiled-languages
910
- /github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-the-codeql-action-for-compiled-languages
@@ -25,6 +26,7 @@ topics:
2526
- C/C++
2627
- C#
2728
- Java
29+
- Kotlin
2830
---
2931

3032

@@ -41,7 +43,7 @@ For general information about configuring {% data variables.product.prodname_cod
4143
## About autobuild for {% data variables.product.prodname_codeql %}
4244

4345
{% data variables.product.prodname_code_scanning_capc %} works by running queries against one or more databases. Each database contains a representation of all of the code in a single language in your repository.
44-
For the compiled languages C/C++, C#,{% ifversion codeql-go-autobuild %} Go,{% endif %} and Java, the process of populating this database involves building the code and extracting data. {% data reusables.code-scanning.analyze-go %}
46+
For the compiled languages C/C++, C#,{% ifversion codeql-go-autobuild %} Go,{% endif %}{% ifversion codeql-kotlin-beta %} Kotlin, {% endif %} and Java, the process of populating this database involves building the code and extracting data. {% data reusables.code-scanning.analyze-go %}
4547

4648
{% data reusables.code-scanning.autobuild-compiled-languages %}
4749

@@ -108,7 +110,7 @@ The `autobuild` process attempts to autodetect a suitable way to install the dep
108110

109111
{% endif %}
110112

111-
### Java
113+
### Java {% ifversion codeql-kotlin-beta %} and Kotlin {% endif %}
112114

113115
| Supported system type | System name |
114116
|----|----|

content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ You can display the command-line help for any command using the <nobr>`--help`</
7474
| Option | Required | Usage |
7575
|--------|:--------:|-----|
7676
| `<database>` | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the name and location of a directory to create for the {% data variables.product.prodname_codeql %} database. The command will fail if you try to overwrite an existing directory. If you also specify `--db-cluster`, this is the parent directory and a subdirectory is created for each language analyzed.|
77-
| <nobr>`--language`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the identifier for the language to create a database for, one of: `{% data reusables.code-scanning.codeql-languages-keywords %}` (use `javascript` to analyze TypeScript code). When used with <nobr>`--db-cluster`</nobr>, the option accepts a comma-separated list, or can be specified more than once.
77+
| <nobr>`--language`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the identifier for the language to create a database for, one of: `{% data reusables.code-scanning.codeql-languages-keywords %}` (use `javascript` to analyze TypeScript code {% ifversion codeql-kotlin-beta %} and `java` to analyze Kotlin code{% endif %}). When used with <nobr>`--db-cluster`</nobr>, the option accepts a comma-separated list, or can be specified more than once.
7878
| <nobr>`--command`</nobr> | | Recommended. Use to specify the build command or script that invokes the build process for the codebase. Commands are run from the current folder or, where it is defined, from <nobr>`--source-root`</nobr>. Not needed for Python and JavaScript/TypeScript analysis. |
7979
| <nobr>`--db-cluster`</nobr> | | Optional. Use in multi-language codebases to generate one database for each language specified by <nobr>`--language`</nobr>.
8080
| <nobr>`--no-run-unnecessary-builds`</nobr> | | Recommended. Use to suppress the build command for languages where the {% data variables.product.prodname_codeql_cli %} does not need to monitor the build (for example, Python and JavaScript/TypeScript).

data/allowed-topics.js

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export default [
8686
'Java',
8787
'JavaScript',
8888
'Jenkins',
89+
'Kotlin',
8990
'Legal',
9091
'LFS',
9192
'Licensing',

data/features/codeql-kotlin-beta.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
versions:
2+
fpt: '*'
3+
ghec: '*'
4+
ghes: '>3.8'
5+
ghae: '>3.8'
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
For compiled languages like Java,{% ifversion codeql-go-autobuild %} Go,{% endif %} C, C++, and C#, {% data variables.product.prodname_codeql %} analyzes all of the code which was built during the workflow run. To limit the amount of code being analyzed, build ony the code which you wish to analyze by specifying your own build steps in a `run` block. You can combine specifying your own build steps with using the `paths` or `paths-ignore` filters on the `pull_request` and `push` events to ensure that your workflow only runs when specific code is changed. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)."
1+
For compiled languages like Java,{% ifversion codeql-kotlin-beta %} Kotlin, {% endif %}{% ifversion codeql-go-autobuild %} Go,{% endif %} C, C++, and C#, {% data variables.product.prodname_codeql %} analyzes all of the code which was built during the workflow run. To limit the amount of code being analyzed, build ony the code which you wish to analyze by specifying your own build steps in a `run` block. You can combine specifying your own build steps with using the `paths` or `paths-ignore` filters on the `pull_request` and `push` events to ensure that your workflow only runs when specific code is changed. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)."
22

33
For languages like{% ifversion codeql-go-autobuild %}{% else %} Go,{% endif %} JavaScript, Python, and TypeScript, that {% data variables.product.prodname_codeql %} analyzes without compiling the source code, you can specify additional configuration options to limit the amount of code to analyze. For more information, see "[Specifying directories to scan](/code-security/secure-coding/configuring-code-scanning#specifying-directories-to-scan)."
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
If `autobuild` fails, or you want to analyze a different set of source files from those built by the `autobuild` process, you'll need to remove the `autobuild` step from the workflow, and manually add build steps. For C/C++, C#, Go, and Java projects, {% data variables.product.prodname_codeql %} will analyze whatever source code is built by your specified build steps.
1+
If `autobuild` fails, or you want to analyze a different set of source files from those built by the `autobuild` process, you'll need to remove the `autobuild` step from the workflow, and manually add build steps. For C/C++, C#, Go,{% ifversion codeql-kotlin-beta %} Kotlin, {% endif %} and Java projects, {% data variables.product.prodname_codeql %} will analyze whatever source code is built by your specified build steps.
22

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
For the supported compiled languages, you can use the `autobuild` action in the {% data variables.code-scanning.codeql_workflow %} to build your code. This avoids you having to specify explicit build commands for C/C++, C#,{% ifversion codeql-go-autobuild %} Go,{% endif %} and Java.
1+
For the supported compiled languages, you can use the `autobuild` action in the {% data variables.code-scanning.codeql_workflow %} to build your code. This avoids you having to specify explicit build commands for C/C++, C#,{% ifversion codeql-go-autobuild %} Go,{% endif %}{% ifversion codeql-kotlin-beta %} Kotlin, {% endif %} and Java.

data/reusables/code-scanning/codeql-languages-bullets.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@
1212

1313
**Note**: {% data variables.product.prodname_codeql %} analysis for Ruby is currently in beta. During the beta, analysis of Ruby will be less comprehensive than {% data variables.product.prodname_codeql %} analysis of other languages.
1414

15+
{% endnote %}
16+
{% endif %}{% endif %}{% ifversion codeql-kotlin-beta %}
17+
- Kotlin
18+
19+
{% note %}
20+
21+
**Note**: {% data variables.product.prodname_codeql %} analysis for Kotlin is currently in beta. During the beta, analysis of Kotlin will be less comprehensive than {% data variables.product.prodname_codeql %} analysis of other languages.
22+
1523
{% endnote %}
1624
{% endif %}
1725

1826
For more information, see the documentation on the {% data variables.product.prodname_codeql %} website: "[Supported languages and frameworks](https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/)."
19-
{% endif %}

0 commit comments

Comments
 (0)