`createLockFileForStandardQuery` always creates temp lock because `packPacklist` doesn't return lock files

Open Beginner friendly
#4,471 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript, vscode
Domain
devtools

Research direction

Start in src/local-queries/standard-queries.ts at createLockFileForStandardQuery and trace the cli.packPacklist(queryPath, false) result and lockFilePath check. Verify the behavior with a pack containing codeql-pack.lock.yml, then ensure an existing lock file is detected instead of always creating a temporary one.

Written by the indexing model from the issue text.

Description

bug VSCode

Describe the bug
In src/local-queries/standard-queries.ts , createLockFileForStandardQuery tries to detect whether a pack already has a codeql-pack.lock.yml by checking the output of cli.packPacklist():

const packContents = await cli.packPacklist(queryPath, false);
const lockFilePath = packContents.find((p) =>
    QLPACK_LOCK_FILENAMES.includes(basename(p)),
  );

However, codeql pack packlist doesn't return codeql-pack.lock.yml. This means lockFilePath is always undefined, so the check for an existing lock file can never succeed.

Dominant language
TypeScript
Stars
539
Forks
240
Avg merge
2d 6h
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/vscode-codeql

All issues in github/vscode-codeql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.