Commit Graph

977 Commits

Author SHA1 Message Date
Andrew Eisenberg
7cfaeddbc0 Prepare for release v1.3.4
Some checks failed
Code Scanning - CodeQL / codeql (push) Has been cancelled
Release / Release (push) Has been cancelled
v1.3.4
2020-10-22 10:45:18 -07:00
Andrew Eisenberg
093646c8a3 Remove the --kind dil options from decompile command
This option is not recognized.
2020-10-22 10:28:43 -07:00
Andrew Eisenberg
d8ab85748f Add some config listener tests
This also renames the config listeners for more consistency.
2020-10-21 15:48:35 -07:00
Andrew Eisenberg
1a5deab711 Remove unnecessary preLaunchTask 2020-10-21 15:48:35 -07:00
Andrew Eisenberg
68fe3bfbef Use the codeQL.runningTests.numberOfThreads
This setting has existed for a while, but it was not used for some
reason.
2020-10-21 15:48:35 -07:00
Andrew Eisenberg
899f988df8 Fix other locations where we create an invalid codeql-zip-archive uri
Also, create a convenience function for generating a codeql-zip-archive
at the root of the archive.
2020-10-21 14:23:51 -07:00
Andrew Eisenberg
9547aa3851 Remove feature flag for the AST Viewer 2020-10-21 14:07:05 -07:00
Andrew Eisenberg
e7e8ebab98 Fix flaky tests
These tests make API calls and may need extra time to complete.
2020-10-21 10:40:30 -07:00
Andrew Eisenberg
5b6371fb94 Fix archive encoding when there is an empty uri authority
This commit fixes a bug uncovered by
c66fe07b06.

The findSourceArchive function in databases.ts creates a
codeql-zip-archive uri with an empty authority component. This will
fail to decode. Until recently, this situation never happened. But in
the commit linked above, we start decoding some of these incorrectly
encoded uris.

This commit fixes that issue.
2020-10-21 08:07:48 -07:00
Andrew Eisenberg
542bb85490 Avoid running workflows on all push events
Only run on push events to main. This ensures that our main branch
is always passing.
2020-10-20 12:48:46 -07:00
Andrew Eisenberg
c66fe07b06 Return undefined for finding file ranges on empty URI
Also, refactor resolveSourceFile to make it easier to read.
And add unit tests for resolveSourceFile.

This commit fixes a bug in resolveSourceFile where the 
`pathWithinSourceArchive` was being removed and appended to the
`sourceArchiveZipPath`. In normal situations, we don't hit this bug
because most database source archive uris have an empty path for the
`pathWithinSourceArchive`.
2020-10-19 07:10:12 -07:00
Andrew Eisenberg
fe219e05d8 Refactor extension context subscriptions
Use DiposableObject more consistently and ensure all commands are
added as a disposable to the ExtensionContext.
2020-10-13 13:54:04 -07:00
Andrew Eisenberg
2dcf3b3feb Fix whitespace in CONTRIBUTING.md
Co-authored-by: jcreedcmu <jcreed@gmail.com>
2020-10-13 11:35:40 -07:00
Andrew Eisenberg
50efdea9d6 Remove build before launch in launch.json
And update contributing with new instructions.
2020-10-13 11:35:40 -07:00
Andrew Eisenberg
9300c07d42 Add command to view the DIL of a query 2020-10-13 11:07:43 -07:00
Andrew Eisenberg
8e817ee01a Refactor the commandRunner
Split commandRunner into two functions: commandRunner and
commandRunnerWithProgress.

Also, take advantage of default arguments for ProgressOptions.

And updates changelog.
2020-10-09 10:48:44 -07:00
Andrew Eisenberg
e5d439ae89 Update changelog
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2020-10-09 10:48:44 -07:00
Andrew Eisenberg
2c75a5c8cb Ensure database upgrade request happens only once
When a user runs multiple queries on a non-upgraded database, ensure
that only one dialog appears for upgrade.

This commit also migrates the upgrades.ts file to using the passed-in
cancellation token and progress monitor. This ensures that cancelling
a database upgrade command will also cancel out of any wrapper
operations.

Fixes #534
2020-10-09 10:48:44 -07:00
Andrew Eisenberg
7f472ac100 Add the commandRunner
The commandRunner wraps all vscode command registrations. It provides
uniform error handling and an optional progress monitor.

In general, progress monitors should only be created by the
commandRunner and passed through to the locations that use it.
2020-10-09 10:48:44 -07:00
Andrew Eisenberg
43d5ee78ea Add comments to interfaces.ts and databases-ui.ts
Also, small refactoring of the vscodeMessageHandler.
2020-10-08 12:32:27 -07:00
Andrew Eisenberg
54fee0bed8 Add unit tests for event emitting in database manager 2020-10-08 12:32:27 -07:00
Andrew Eisenberg
6bc720468c Update changelog 2020-10-08 12:32:27 -07:00
Andrew Eisenberg
7961816906 Only clear problems view when a database is removed
This commit adds DatabaseChangedEvent and ensures that all events
fired by the DatabaseManager includes one of these kinds.

Currently, the only kind that we care about is `Remove`. We ensure that
the problems view is only cleared on Remove events.
2020-10-08 12:32:27 -07:00
Andrew Eisenberg
672b20d4aa Clear problems view when a database is removed
This commit fixes the problem whereby a database is removed and the
problems associated with queries run from that database stick around
in the problems view.

Also, once problems are cleared, we need to make sure that we uncheck
the checkbox in the results view.

This commit has several limitations:

1. There is duplicated code for message handling in both results.tsx and
result-tables.tsx.
2. Problems are cleared whenever there is *any* change to any database.
Ideally we should only clear problems when a database is removed and
only problems associated with that database. I'll fix part of this in
a future commit.

Resolves #525
2020-10-08 12:32:27 -07:00
Andrew Eisenberg
c83d1b305e Rename AstItem -> ChildAstItem and RootAstItem -> AstItem
This simplifies some of our type conversions since all ChildAstItem
are AstItem.
2020-10-07 17:48:40 -07:00
Andrew Eisenberg
732eb83d07 Select the appropriate node in the AST viewer when the editor text selection changes
When a user clicks in an editor that whose source tree is currently being displayed in
the ast viewer, the viewer selection will stay in sync with the editor selection.
2020-10-07 17:48:40 -07:00
Andrew Eisenberg
7e5d5922db Update changelog 2020-10-06 08:42:29 -07:00
Andrew Eisenberg
15f38c6f18 Add icons for various query history view commands
And show these commands in the title bar.
2020-10-06 08:42:29 -07:00
Andrew Eisenberg
4adbfa4e81 Update changelog 2020-10-06 08:42:29 -07:00
Andrew Eisenberg
7c10d72117 Adds a message that appears in an empty databases view
Also, fixes a regex.
2020-10-06 08:42:29 -07:00
Andrew Eisenberg
7800c68065 Allow setting number of threads to 0
Fixes #603
2020-10-05 07:54:42 -07:00
Andrew Eisenberg
c4d9eed734 Update error message when there is a missing contextual query
References #476
2020-10-01 14:15:07 -07:00
Andrew Eisenberg
c34c9fae6a Avoid using path.join for sarif uris
These are uris, not paths and always use '/', even on windows.
2020-10-01 07:44:47 -07:00
Andrew Eisenberg
03f1e4ef08 Update changelog 2020-10-01 07:44:47 -07:00
Andrew Eisenberg
06b6a4705a Ensure backslashes are properly escaped in sarif messages
Problem was that we were not globally replaceing `\\` with `\`.

Also, this PR adds some new tests to sarif-utils.ts. In doing so, we
have fixed a small bug in getPathRelativeToSourceLocationPrefix.

Previously, we were uri decoding the sarifRelativeUri. However, this is
no longer correct because the result is another URI and it should
remain encoded if it originally was.

Resolves #585
2020-10-01 07:44:47 -07:00
Andrew Eisenberg
7ca456d6a0 Ensure all fields have labels
Never show an empty string in the results view. This fixes #535 (again).
2020-09-30 11:05:20 -07:00
Jason Reed
5244a1c3b0 Actually refresh the treeview when updating SARIF context value 2020-09-29 15:04:00 -07:00
Jason Reed
f4775954b6 Fix #597. 2020-09-29 15:04:00 -07:00
Andrew Eisenberg
7c48c5f887 Update changelog 2020-09-29 15:03:15 -07:00
Andrew Eisenberg
3e3a31d5e2 Add unit tests for query-results.ts 2020-09-29 15:03:15 -07:00
Andrew Eisenberg
72160a24bd Fix incorrect call to bqrs info when retrieving paginated results
When retrieving paginated results, need to make sure we are getting
page offsets from the correct results file.

Previously, we were incorrectly extracting page offsets from the default
(unsorted) file. With this change, we ensure that we get offsets from
the proper results file when there is a request for a page of results.
2020-09-29 15:03:15 -07:00
Andrew Eisenberg
456c25f617 Fix invalid sort after reloading query results
With this change, we use the stored sort order if it exists
after reloading a query results page.
2020-09-29 15:03:15 -07:00
Andrew Eisenberg
0c571b1942 Fix mocha test running (#600)
PR #591 broke the build.
2020-09-29 16:34:51 -04:00
Andrew Eisenberg
7e4491ac45 Update mocha version (#591)
This fixes a dependabot error on yargs-parser
2020-09-29 09:04:46 -04:00
Andrew Eisenberg
75b5c1d316 Allow max queries to be configurable
Max number of simultaneous queries launchable by runQueries command is
now configurable by codeQL.runningQueries.maxQueries.
2020-09-25 07:54:41 -07:00
Andrew Eisenberg
db6fc5d7f0 Refactor: Change renderLocation in webview
* It is now more general and the logic is simplified
* Also, add more comments
* Rename `adaptBqrs` to `transformBqrsResultSet`
* Remove a react error for missing a key attribute in a list
2020-09-24 07:54:50 -07:00
Andrew Eisenberg
84028434e0 Refactor: Remove duplicated BQRS types
This refactoring combines the types in `bqrs-types.ts` and
`bqrs-cli-types.ts`. Historically, the former was used for BQRS files
parsed by the extension and the latter for BQRS files parsed by the cli.
They describe the same file types, but using different property and type
names.

We have moved to parsing all BQRS files by the cli. This refactoring
removes the `bqrs-types.ts` file and replaces all BQRS references to
use types in `bqrs-cli-types.ts`.

Additionally, the `adapt.ts` file has been deleted since its purpose
was to convert between extension and cli BQRS types. Some one type and
one function from `adapt.ts` has been moved from `adapt.ts` to
`bqrs-types.ts`. It's possible that we want to do a further refactoring
to simply remove them both.
2020-09-24 07:54:50 -07:00
github-actions[bot]
b917a204ba Bump version to v1.3.4 (#580)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-16 16:35:21 -04:00
jcreedcmu
8a5514c696 Date CHANGELOG for release (#579)
Some checks failed
Code Scanning - CodeQL / codeql (push) Has been cancelled
Build Extension / Build (ubuntu-latest) (push) Has been cancelled
Build Extension / Build (windows-latest) (push) Has been cancelled
Build Extension / Test (ubuntu-latest) (push) Has been cancelled
Build Extension / Test (windows-latest) (push) Has been cancelled
Release / Release (push) Has been cancelled
v1.3.3
2020-09-16 16:22:01 -04:00
Andrew Eisenberg
29f92575ee Update npm dependencies fix security vulns
* node-fetch
* bl
2020-09-16 07:57:31 -07:00