Skip to content

Commit b6ff2a0

Browse files
committed
Clean up direct references to codeql-go
This commit removes special handling of the github/codeql-go repository in the ql-for-ql-dataset_measure.yml and the query-list.yml workflows.
1 parent 3137276 commit b6ff2a0

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

.github/workflows/ql-for-ql-dataset_measure.yml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
matrix:
2020
repo:
2121
- github/codeql
22-
- github/codeql-go
2322
runs-on: ubuntu-latest
2423
steps:
2524
- uses: actions/checkout@v2

.github/workflows/query-list.yml

-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
uses: actions/checkout@v2
2121
with:
2222
path: codeql
23-
- name: Clone github/codeql-go
24-
uses: actions/checkout@v2
25-
with:
26-
repository: 'github/codeql-go'
27-
path: codeql-go
2823
- name: Set up Python 3.8
2924
uses: actions/setup-python@v2
3025
with:

misc/scripts/generate-code-scanning-query-list.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
as long as you run the script from one of the following locations:
1616
- anywhere from within a clone of the CodeQL Git repo
1717
- from the parent directory of a clone of the CodeQL Git repo (assuming 'codeql'
18-
and 'codeql-go' directories both exist)
18+
directory exists)
1919
"""
2020

2121
parser = argparse.ArgumentParser(__name__)
@@ -75,7 +75,7 @@ def prefix_repo_nwo(filename):
7575
becomes:
7676
github/codeql/java/ql/src/MyQuery.ql
7777
78-
If we can't detect a known NWO (e.g. github/codeql, github/codeql-go), the
78+
If we can't detect a known NWO (e.g. github/codeql), the
7979
path will be truncated to the root of the git repo:
8080
ql/java/ql/src/MyQuery.ql
8181
@@ -92,13 +92,12 @@ def prefix_repo_nwo(filename):
9292

9393
git_toplevel_dir = git_toplevel_dir_subp.stdout.strip()
9494

95-
# Detect 'github/codeql' and 'github/codeql-go' repositories by checking the remote (it's a bit
96-
# of a hack but will work in most cases, as long as the remotes have 'codeql' and 'codeql-go'
95+
# Detect 'github/codeql' repository by checking the remote (it's a bit
96+
# of a hack but will work in most cases, as long as the remotes have 'codeql'
9797
# in the URL
9898
git_remotes = subprocess_run(["git","-C",dirname,"remote","-v"]).stdout.strip()
9999

100-
if "codeql-go" in git_remotes: prefix = "github/codeql-go"
101-
elif "codeql" in git_remotes: prefix = "github/codeql"
100+
if "codeql" in git_remotes: prefix = "github/codeql"
102101
else: prefix = os.path.basename(git_toplevel_dir)
103102

104103
return os.path.join(prefix, filename[len(git_toplevel_dir)+1:])
@@ -142,9 +141,7 @@ def subprocess_run(cmd):
142141
# Define CodeQL search path so it'll find the CodeQL repositories:
143142
# - anywhere in the current Git clone (including current working directory)
144143
# - the 'codeql' subdirectory of the cwd
145-
#
146-
# (and assumes the codeql-go repo is in a similar location)
147-
codeql_search_path = "./codeql:./codeql-go:." # will be extended further down
144+
codeql_search_path = "./codeql:." # will be extended further down
148145

149146
# Extend CodeQL search path by detecting root of the current Git repo (if any). This means that you
150147
# can run this script from any location within the CodeQL git repository.
@@ -153,7 +150,7 @@ def subprocess_run(cmd):
153150

154151
# Current working directory is in a Git repo. Add it to the search path, just in case it's the CodeQL repo
155152
git_toplevel_dir = git_toplevel_dir.stdout.strip()
156-
codeql_search_path += ":" + git_toplevel_dir + ":" + git_toplevel_dir + "/../codeql-go"
153+
codeql_search_path += ":" + git_toplevel_dir
157154
except:
158155
# git rev-parse --show-toplevel exited with non-zero exit code. We're not in a Git repo
159156
pass
@@ -172,7 +169,7 @@ def subprocess_run(cmd):
172169
try:
173170
queries_subp = codeql.command(["resolve","queries","--search-path", codeql_search_path, "%s-%s.qls" % (lang, pack)])
174171
except Exception as e:
175-
# Resolving queries might go wrong if the github/codeql and github/codeql-go repositories are not
172+
# Resolving queries might go wrong if the github/codeql repository is not
176173
# on the search path.
177174
level = "Warning" if arguments.ignore_missing_query_packs else "Error"
178175
print(

0 commit comments

Comments
 (0)