Skip to content

Commit beddd30

Browse files
committed
Docs: Update references to github/codeql-go
github/codeql-go is being merged into github/codeql. Update references to `codeql-go` within the CodeQL CLI docs. Add Go to the list of mentioned languages where applicable. Leave an explanatory note in the setup instructions about the previous requirement to check out `github/codeql-go`, and mention this is no longer necessary. The remaining references are to historical commits, which will continue to exist.
1 parent 7f96319 commit beddd30

13 files changed

+32
-39
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodeQL
22

3-
This open source repository contains the standard CodeQL libraries and queries that power [GitHub Advanced Security](https://github.com/features/security/code) and the other application security products that [GitHub](https://github.com/features/security/) makes available to its customers worldwide. For the queries, libraries, and extractor that power Go analysis, visit the [CodeQL for Go repository](https://github.com/github/codeql-go).
3+
This open source repository contains the standard CodeQL libraries and queries that power [GitHub Advanced Security](https://github.com/features/security/code) and the other application security products that [GitHub](https://github.com/features/security/) makes available to its customers worldwide.
44

55
## How do I learn CodeQL and run queries?
66

docs/codeql/codeql-cli/about-ql-packs.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ QL packs are used to organize the files used in CodeQL analysis. They
77
contain queries, library files, query suites, and important metadata.
88

99
The `CodeQL repository <https://github.com/github/codeql>`__ contains QL packs for
10-
C/C++, C#, Java, JavaScript, Python, and Ruby. The `CodeQL for Go
11-
<https://github.com/github/codeql-go/>`__ repository contains a QL pack for Go
12-
analysis. You can also make custom QL packs to contain your own queries and
13-
libraries.
10+
C/C++, C#, Go, Java, JavaScript, Python, and Ruby.
11+
You can also make custom QL packs to contain your own queries and libraries.
1412

1513
QL pack structure
1614
-----------------

docs/codeql/codeql-cli/getting-started-with-the-codeql-cli.rst

+10-9
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ further options on the command line.
193193
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
194194

195195
The `CodeQL repository <https://github.com/github/codeql>`__ contains
196-
the queries and libraries required for CodeQL analysis of C/C++, C#, Java,
196+
the queries and libraries required for CodeQL analysis of C/C++, C#, Go, Java,
197197
JavaScript/TypeScript, Python, and Ruby.
198198
Clone a copy of this repository into ``codeql-home``.
199199

@@ -203,15 +203,16 @@ CLI that you will extract in step 4. If you use git on the command line, you can
203203
clone and rename the repository in a single step by running
204204
``git clone [email protected]:github/codeql.git codeql-repo`` in the ``codeql-home`` folder.
205205

206-
The CodeQL libraries and queries for Go analysis live in the `CodeQL for Go
207-
repository <https://github.com/github/codeql-go/>`__. Clone a copy of this
208-
repository into ``codeql-home``, and run ``codeql-go/scripts/install-deps.sh``
209-
to install its dependencies.
206+
For Go analysis, run ``codeql-repo/go/scripts/install-deps.sh`` to install its dependencies.
210207

211-
The cloned repositories should have a sibling relationship.
212-
For example, if the root of the cloned CodeQL repository is
213-
``$HOME/codeql-home/codeql-repo``, then the root of the cloned CodeQL for Go
214-
repository should be ``$HOME/codeql-home/codeql-go``.
208+
.. pull-quote:: Note
209+
210+
The CodeQL libraries and queries for Go analysis used to live in a
211+
separate `CodeQL for Go repository <https://github.com/github/codeql-go/>`__.
212+
These have been moved to the ``github/codeql`` repository.
213+
It is no longer necessary to clone the ``github/codeql-go`` into a separate ``codeql-home/codeql-go`` folder.
214+
215+
For more information, see `this announcement <https://github.com/github/codeql-go/issues/741>`__.
215216

216217
Within these repositories, the queries and libraries are organized into QL
217218
packs. Along with the queries themselves, QL packs contain important metadata

docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Viewing the abstract syntax tree of a source file
2828

2929
.. pull-quote:: Note
3030

31-
If you don't have an appropriate ``printAST.ql`` query in your workspace, the **CodeQL: View AST** command won't work. To fix this, you can update your copy of the `CodeQL <https://github.com/github/codeql>`__ repository (or `CodeQL for Go <https://github.com/github/codeql-go>`__ repository) from ``main``. If you do this, you may need to upgrade your databases. Also, query caches may be discarded and your next query runs could be slower.
31+
If you don't have an appropriate ``printAST.ql`` query in your workspace, the **CodeQL: View AST** command won't work. To fix this, you can update your copy of the `CodeQL <https://github.com/github/codeql>`__ repository from ``main``. If you do this, you may need to upgrade your databases. Also, query caches may be discarded and your next query runs could be slower.
3232

3333
3. Once the query has run, the AST viewer displays the structure of the source file.
3434
4. To see the nested structure, click the arrows and expand the nodes.

docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst

+2-8
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,15 @@ There are two ways to do this:
6969
This ensures that the queries and libraries you write in VS Code also work in the query console on LGTM Enterprise.
7070

7171
If you prefer to add the CodeQL queries and libraries to an :ref:`existing workspace <existing-workspace>` instead of the starter workspace, then you should
72-
clone the appropriate branch of the `general CodeQL repository <https://github.com/github/codeql>`__ and the
73-
`CodeQL repository for Go <https://github.com/github/codeql-go>`__ and add them to your workspace.
72+
clone the appropriate branch of the `general CodeQL repository <https://github.com/github/codeql>`__ and add it to your workspace.
7473

7574
.. _starter-workspace:
7675

7776
Using the starter workspace
7877
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7978
The starter workspace is a Git repository. It contains:
8079

81-
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql>`__ for C/C++, C#, Java, JavaScript, Python, and Ruby. This is included as a submodule, so it can be updated without affecting your custom queries.
82-
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql-go>`__ for Go. This is also included as a submodule.
80+
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql>`__ for C/C++, C#, Go, Java, JavaScript, Python, and Ruby. This is included as a submodule, so it can be updated without affecting your custom queries.
8381
* A series of folders named ``codeql-custom-queries-<language>``. These are ready for you to start developing your own custom queries for each language, using the standard libraries. There are some example queries to get you started.
8482

8583
To use the starter workspace:
@@ -114,10 +112,6 @@ For example, to make a custom CodeQL folder called ``my-custom-cpp-pack`` depend
114112
115113
For more information about why you need to add a ``qlpack.yml`` file, see ":ref:`About QL packs <about-ql-packs>`."
116114

117-
.. pull-quote:: Note
118-
119-
The CodeQL libraries for Go are not included in the ``github/codeql`` repository, but are stored separately. To analyze Go projects, clone the repository at https://github.com/github/codeql-go and add it to your workspace as above.
120-
121115
Further reading
122116
----------------
123117

docs/codeql/codeql-language-guides/modeling-data-flow-in-go-libraries.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ When analyzing a Go program, CodeQL does not examine the source code for
77
external packages. To track the flow of untrusted data through a library, you
88
can create a model of the library.
99

10-
You can find existing models in the ``ql/lib/semmle/go/frameworks/`` folder of the
11-
`CodeQL for Go repository <https://github.com/github/codeql-go/tree/main/ql/lib/semmle/go/frameworks>`__.
10+
You can find existing models in the ``go/ql/lib/semmle/go/frameworks/`` folder of the
11+
`CodeQL repository <https://github.com/github/codeql/tree/main/go/ql/lib/semmle/go/frameworks>`__.
1212
To add a new model, you should make a new file in that folder, named after the library.
1313

1414
Sources
@@ -102,8 +102,8 @@ Data-flow sinks are specified by queries rather than by library models.
102102
However, you can use library models to indicate when functions belong to
103103
special categories. Queries can then use these categories when specifying
104104
sinks. Classes representing these special categories are contained in
105-
``ql/lib/semmle/go/Concepts.qll`` in the `CodeQL for Go repository
106-
<https://github.com/github/codeql-go/blob/main/ql/lib/semmle/go/Concepts.qll>`__.
105+
``go/ql/lib/semmle/go/Concepts.qll`` in the `CodeQL repository
106+
<https://github.com/github/codeql/blob/main/go/ql/lib/semmle/go/Concepts.qll>`__.
107107
``Concepts.qll`` includes classes for logger mechanisms,
108108
HTTP response writers, HTTP redirects, and marshaling and unmarshaling
109109
functions.

docs/codeql/query-help/go.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ CodeQL query help for Go
33

44
.. include:: ../reusables/query-help-overview.rst
55

6-
For shorter queries that you can use as building blocks when writing your own queries, see the `example queries in the CodeQL for Go repository <https://github.com/github/codeql-go/tree/main/ql/examples>`__.
6+
For shorter queries that you can use as building blocks when writing your own queries, see the `example queries in the CodeQL repository <https://github.com/github/codeql/tree/main/go/ql/examples>`__.
77

88
.. include:: toc-go.rst
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
- `CodeQL queries for Go <https://github.com/github/codeql-go/tree/main/ql/src>`__
2-
- `Example queries for Go <https://github.com/github/codeql-go/tree/main/ql/examples>`__
1+
- `CodeQL queries for Go <https://github.com/github/codeql/tree/main/go/ql/src>`__
2+
- `Example queries for Go <https://github.com/github/codeql/tree/main/go/ql/examples>`__
33
- `CodeQL library reference for Go <https://codeql.github.com/codeql-standard-libraries/go/>`__

docs/codeql/writing-codeql-queries/about-codeql-queries.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Select clauses for diagnostic queries (``@kind diagnostic``) and summary metric
121121
Viewing the standard CodeQL queries
122122
***********************************
123123

124-
One of the easiest ways to get started writing your own queries is to modify an existing query. To view the standard CodeQL queries, or to try out other examples, visit the `CodeQL <https://github.com/github/codeql>`__ and `CodeQL for Go <https://github.com/github/codeql-go>`__ repositories on GitHub.
124+
One of the easiest ways to get started writing your own queries is to modify an existing query. To view the standard CodeQL queries, or to try out other examples, visit the `CodeQL <https://github.com/github/codeql>`__ repository on GitHub.
125125

126126
You can also find examples of queries developed to find security vulnerabilities and bugs in open source software projects on the `GitHub Security Lab website <https://securitylab.github.com/research>`__ and in the associated `repository <https://github.com/github/securitylab>`__.
127127

docs/codeql/writing-codeql-queries/creating-path-queries.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Declaring sources and sinks
116116
You must provide information about the ``source`` and ``sink`` in your path query. These are objects that correspond to the nodes of the paths that you are exploring.
117117
The name and the type of the ``source`` and the ``sink`` must be declared in the ``from`` statement of the query, and the types must be compatible with the nodes of the graph computed by the ``edges`` predicate.
118118

119-
If you are querying C/C++, C#, Java, JavaScript, Python, or Ruby code (and you have used ``import DataFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the ``Configuration`` class in the data flow library. You should declare all three of these objects in the ``from`` statement.
119+
If you are querying C/C++, C#, Go, Java, JavaScript, Python, or Ruby code (and you have used ``import DataFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the ``Configuration`` class in the data flow library. You should declare all three of these objects in the ``from`` statement.
120120
For example:
121121

122122
.. code-block:: ql

go/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Please note that this project is released with a [Contributor Code of Conduct](C
1212

1313
2. Ensure that `<extraction-root>/codeql` is in your `PATH`.
1414

15-
3. Clone this repository into `<extraction-root>/codeql-go` and change to this directory.
15+
3. Clone this repository (`github/codeql`) into `<extraction-root>/codeql-repo` and change to the directory `<extraction-root>/codeql-repo/go`.
1616

1717
4. To build, run `make`.
1818

go/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ interface](https://codeql.github.com/docs/codeql-cli/) to create a database your
3333
download a pre-built database from [LGTM.com](https://lgtm.com/). You can then run any of the
3434
queries contained in this repository either on the command line or using the VS Code extension.
3535

36-
Note that the [lgtm.com](https://github.com/github/codeql-go/tree/lgtm.com) branch of this
36+
Note that the [lgtm.com](https://github.com/github/codeql/tree/lgtm.com) branch of this
3737
repository corresponds to the version of the queries that is currently deployed on LGTM.com.
38-
The [main](https://github.com/github/codeql-go/tree/main) branch may contain changes that
38+
The [main](https://github.com/github/codeql/tree/main) branch may contain changes that
3939
have not been deployed yet, so you may need to upgrade databases downloaded from LGTM.com before
4040
running queries on them.
4141

go/docs/language/learn-ql/go/library-modeling-go.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ When analyzing a Go program, CodeQL does not examine the source code for
55
external packages. To track the flow of untrusted data through a library, you
66
can create a model of the library.
77

8-
You can find existing models in the ``ql/src/semmle/go/frameworks/`` folder of the
9-
`CodeQL for Go repository <https://github.com/github/codeql-go/tree/main/ql/src/semmle/go/frameworks>`__.
8+
You can find existing models in the ``go/ql/lib/semmle/go/frameworks/`` folder of the
9+
`CodeQL repository <https://github.com/github/codeql/tree/main/go/ql/lib/semmle/go/frameworks>`__.
1010
To add a new model, you should make a new file in that folder, named after the library.
1111

1212
Sources
@@ -100,8 +100,8 @@ Data-flow sinks are specified by queries rather than by library models.
100100
However, you can use library models to indicate when functions belong to
101101
special categories. Queries can then use these categories when specifying
102102
sinks. Classes representing these special categories are contained in
103-
``ql/src/semmle/go/Concepts.qll`` in the `CodeQL for Go repository
104-
<https://github.com/github/codeql-go/blob/main/ql/src/semmle/go/Concepts.qll>`__.
103+
``go/ql/lib/semmle/go/Concepts.qll`` in the `CodeQL for Go repository
104+
<https://github.com/github/codeql/blob/main/go/ql/lib/semmle/go/Concepts.qll>`__.
105105
``Concepts.qll`` includes classes for logger mechanisms,
106106
HTTP response writers, HTTP redirects, and marshaling and unmarshaling
107107
functions.

0 commit comments

Comments
 (0)