Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7cc5b57

Browse files
committed
Upgrade all qlpacks
Otherwise the lock files may not be updated for packs which transitively depend on codeql/cpp-all
1 parent 51e4d95 commit 7cc5b57

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/upgrade-codeql-dependencies/upgrade-codeql-dependencies.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def main(cli_version : str, github_token: str) -> None:
6767
qlpack_files = [f for f in qlpack_files if not any(part for part in f.parts if part.startswith("."))]
6868

6969
# Update the "codeql/cpp-all" entries in the "dependencies" property in every qlpack.yml file
70-
updated_qlpacks = []
7170
for qlpack_file in qlpack_files:
7271
with qlpack_file.open("r") as f:
7372
qlpack = yaml.safe_load(f)
@@ -76,12 +75,14 @@ def main(cli_version : str, github_token: str) -> None:
7675
qlpack["dependencies"]["codeql/cpp-all"] = compatible_stdlib_version
7776
with qlpack_file.open("w") as f:
7877
yaml.safe_dump(qlpack, f, sort_keys=False)
79-
updated_qlpacks.append(qlpack_file.parent)
8078

8179
# Call CodeQL to update the lock files by running codeql pack upgrade
8280
# Note: we need to do this after updating all the qlpack files,
8381
# otherwise we may get dependency resolution errors
84-
for qlpack in updated_qlpacks:
82+
# Note: we need to update all qlpack files, because they may
83+
# transitively depend on the packs we changed
84+
for qlpack_file in qlpack_files:
85+
qlpack = qlpack.parent
8586
print("Updating lock files for " + str(qlpack))
8687
os.system(f"codeql pack upgrade {qlpack}")
8788

0 commit comments

Comments
 (0)