-
Notifications
You must be signed in to change notification settings - Fork 202
Allow synthetic variant analysis packs to handle ${workspace}
#1774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also, we're no longer using the rush package manager, so delete that from gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a test is failing, but I'll be around to review any changes/release changes.
Of course... |
9129e05
to
647a718
Compare
...ons/ql-vscode/src/vscode-tests/cli-integration/remote-queries/remote-queries-manager.test.ts
Fixed
Show fixed
Hide fixed
8de6ae0
to
0f66afe
Compare
I think I found out why the CLI tests are failing locally. I made a change to https://github.com/aeisenberg/vscode-codeql/blob/aeisenberg/fix-mrva-packs/extensions/ql-vscode/src/vscode-tests/test-config.ts#L110 to add a timeout. Also, the |
@angelapwen would you mind taking another look? I think the tests are passing now. I had to do a bit of magic to get the tests working. I'll explain better in the PR description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍 just some requests for code comments 😄
codeql/javascript-all: '*' | ||
codeql/javascript-all: '${workspace}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know these tests well, but do you think you could add a comment here to explain that the '${workspace}'
bit is important to ensure tests pass? Not sure that it's clear from the name of the test/directory.
@@ -122,3 +125,34 @@ export async function cleanDatabases(databaseManager: DatabaseManager) { | |||
await commands.executeCommand("codeQLDatabases.removeDatabase", item); | |||
} | |||
} | |||
|
|||
export async function fixWorkspaceReferences( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wonder if you could add a comment here to describe why someone would use this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return undefined; | ||
} | ||
|
||
export async function restoreWorkspaceReferences( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above (comment description)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
`${workspace}` references are new in CLI version 2.11.3. These mean that the version depended upon in a pack must be the version available in the current codeql workspace. When generating a variant analysis pack, however, we copy the target query and generate a synthetic pack with the original dependencies. This breaks workspace references since the synthetic pack is no longer in the same workspace. A simple workaround is to replace `${workspace}` with `*` references.
0f66afe
to
24bbd51
Compare
${workspace}
references are new in CLI version 2.11.3. These mean thatthe version depended upon in a pack must be the version available in the
current codeql workspace.
When generating a variant analysis pack, however, we copy the target
query and generate a synthetic pack with the original dependencies.
This breaks workspace references since the synthetic pack is no longer
in the same workspace.
A simple workaround is to replace
${workspace}
with*
references.I wanted to ensure the tests exercise this feature, so I altered one of our test qlpacks to use the
${workspace}
reference. This will work on CLI v2.11.3 and later. For earlier versions, I needed to change that reference to a*
reference.I also fixed a problem I was having locally where the CLI tests were timing out. By bumping the timeout to 20s in the
testConfigHelper
, I got around that error.Checklist
ready-for-doc-review
label there.