Skip to content

Commit 342c376

Browse files
committed
Rewrite pack resolver and ordering logic
1 parent 086e8c2 commit 342c376

File tree

3 files changed

+386
-365
lines changed

3 files changed

+386
-365
lines changed

codeql_bundle/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,32 +80,32 @@ def main(
8080
try:
8181
bundle = CustomBundle(bundle_path, workspace)
8282
logger.info(f"Looking for CodeQL packs in workspace {workspace}")
83-
packs_in_workspace = bundle.codeql.pack_ls(workspace)
83+
packs_in_workspace = bundle.getCodeQLPacks()
8484
logger.info(
85-
f"Found the CodeQL packs: {','.join(map(lambda p: p.name, packs_in_workspace))}"
85+
f"Found the CodeQL packs: {','.join(map(lambda p: p.config.name, packs_in_workspace))}"
8686
)
8787

8888
if len(packs) > 0:
8989
selected_packs = [
9090
available_pack
9191
for available_pack in packs_in_workspace
92-
if available_pack.name in packs
92+
if available_pack.config.name in packs
9393
]
9494
else:
9595
selected_packs = packs_in_workspace
9696

9797
logger.info(
98-
f"Considering the following CodeQL packs for inclusion in the custom bundle: {','.join(map(lambda p: p.name, selected_packs))}"
98+
f"Considering the following CodeQL packs for inclusion in the custom bundle: {','.join(map(lambda p: p.config.name, selected_packs))}"
9999
)
100-
missing_packs = set(packs) - {pack.name for pack in selected_packs}
100+
missing_packs = set(packs) - {pack.config.name for pack in selected_packs}
101101
if len(missing_packs) > 0:
102102
logger.fatal(
103103
f"The provided CodeQL workspace doesn't contain the provided packs '{','.join(missing_packs)}'",
104104
)
105105
sys.exit(1)
106106

107107
logger.info(
108-
f"Adding the packs {','.join(map(lambda p: p.name, selected_packs))} to the custom bundle."
108+
f"Adding the packs {','.join(map(lambda p: p.config.name, selected_packs))} and its workspace dependencies to the custom bundle."
109109
)
110110
bundle.add_packs(*selected_packs)
111111
logger.info(f"Bundling custom bundle at {output}")

0 commit comments

Comments
 (0)