7766 Commits

Author SHA1 Message Date
Alexander Eyers-Taylor
722619f2d6 Merge pull request #189 from henrymercer/no-db-info-handling
Log if a database metadata file could not be found
2019-12-11 14:21:40 +00:00
Henry Mercer
8190e7c642 Enable unused value compiler checks
Specifically, enable the noUnusedLocals and noUnusedParameters options.
2019-12-11 11:57:07 +00:00
Alexander Eyers-Taylor
7c183d0f1c Merge pull request #193 from jcreedcmu/result-count
Show number of results in results view
2019-12-10 19:24:42 +00:00
Alexander Eyers-Taylor
8d0d4bb7ba Merge pull request #176 from jcreedcmu/jcreed/label
Improvements to Query History Labels
2019-12-10 19:05:29 +00:00
Jason Reed
4af73484e0 Show number of results in results view 2019-12-09 13:25:22 -08:00
jcreedcmu
7fc18d3aa8 Merge pull request #192 from dbartol/dbartol/int32
Fix display of negative integers in results
2019-12-09 11:36:25 -08:00
Dave Bartolomeo
43549eeb53 Fix display of negative integers in results 2019-12-09 12:14:45 -07:00
Henry Mercer
b0302caa7f Log if a database metadata file could not be found
This is a key cause of not being able to produce interpreted results, so
logging it helps us debug a lack of interpreted results.
Also make the database metadata check async
2019-12-05 16:03:51 +00:00
Dave Bartolomeo
2f9a31484c Merge from master 2019-12-04 09:53:06 -07:00
jcreedcmu
513d76364d Merge pull request #187 from adityasharad/actions/bump-version-after-release
Actions: Open a PR after each release to bump the patch version.
2019-12-04 09:19:15 -05:00
Jason Reed
4bbd5af53d Fix LGTM warning 2019-12-04 08:23:47 -05:00
Jason Reed
ccffbb8258 Allow configuring default query history format in settings
Changes to settings should be immediately reflected in query history.
2019-12-04 08:23:47 -05:00
Jason Reed
3a43cfe8db Allow simple templating of query history labels 2019-12-04 08:23:47 -05:00
Jason Reed
52b83847dc Allow custom labels in query history 2019-12-04 08:23:47 -05:00
Aditya Sharad
ee30c311a0 Actions: Exclude build artifacts from version bump PRs. 2019-12-03 15:16:33 -08:00
Aditya Sharad
1efce610f2 Actions: Open a PR after each release to bump the patch version. 2019-12-03 15:05:15 -08:00
jcreedcmu
e056c61a44 Merge pull request #175 from asgerf/asgerf/path-result-nav
Add commands for navigating the steps on a path
2019-11-25 13:57:03 -05:00
Asger F
8c3bd77d67 TS: Use const instead of let 2019-11-25 16:43:19 +00:00
Alexander Eyers-Taylor
0d7eb93037 Merge pull request #182 from henrymercer/tweak-view-results-message
Use quoted query name in view results message
2019-11-25 16:21:50 +00:00
Henry Mercer
cf118ceb81 Use quoted query name in view results message
This gives better results for query names that start with for example
a multiple letter acronym.
2019-11-25 15:49:11 +00:00
Henry Mercer
1577dfd4ee Merge pull request #181 from alexet/alexet/fix-sorted-filename
Store the current counter value and use it for the sorted results path.
2019-11-25 14:30:45 +00:00
alexet
b04d84c194 Rename queryCounter to nextQueryId. 2019-11-25 14:22:10 +00:00
alexet
5a5681db12 Store the current counter value and use it for the sorted results path.
This way they don't clash when switching between sorted queries.
2019-11-25 12:14:18 +00:00
Alexander Eyers-Taylor
6e9c64d9fc Merge pull request #177 from henrymercer/improve-errors
Improve error handling for CLI installation and updates
2019-11-25 12:09:12 +00:00
Dave Bartolomeo
9e6100f383 Merge remote-tracking branch 'upstream/master' into dbartol/QLTest 2019-11-22 10:35:04 -07:00
Aditya Sharad
6f4211b579 Merge pull request #180 from github/dbartol/Bump-1.02
Bump version to 1.0.2
2019-11-22 09:33:25 -08:00
Dave Bartolomeo
4c8c4ef153 Bump version to 1.0.2
Now that we've released 1.0.1, all subsequent builds should be prerelease versions of 1.0.2
2019-11-22 10:28:29 -07:00
Henry Mercer
72023abaaf Merge pull request #179 from shati-patel/move-changelog
Move changelog to be packaged with extension
2019-11-22 11:45:30 +00:00
Shati Patel
b65a0ceb74 Move changelog to be packaged with extension 2019-11-22 11:26:48 +00:00
Dave Bartolomeo
7d325e3832 Fix file-watching bug in QLTest discovery 2019-11-21 14:13:55 -07:00
jcreedcmu
07f96bf43e Merge pull request #178 from adityasharad/add-changelog
Some checks failed
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
Add changelog.
v1.0.1
2019-11-21 13:21:33 -05:00
Aditya Sharad
5d8e12865d Add changelog. 2019-11-21 10:11:04 -08:00
Henry Mercer
b48fbdebff Report rate limiting errors more clearly
Also report problems updating the distribution on extension activation
as warnings, and improve task names in error messages.
2019-11-21 16:46:57 +00:00
Alexander Eyers-Taylor
36fedac2ca Merge pull request #174 from henrymercer/settings-scope
Change distribution settings to machine scope
2019-11-21 15:10:03 +00:00
Asger F
7a2edfbbf9 Add commands for path navigation 2019-11-21 15:09:49 +00:00
Asger F
c0ffb7eaf1 Lift parseSarifLocation out of class 2019-11-21 15:04:17 +00:00
Asger F
3e8c53be78 Highlight currently selected path node 2019-11-21 14:49:15 +00:00
Henry Mercer
8400f75bb5 Change distribution settings to machine scope 2019-11-21 12:43:54 +00:00
Dave Bartolomeo
cbe3c055b6 odasa -> Semmle Core 2019-11-20 17:19:29 -07:00
Dave Bartolomeo
e37807c45e Better error message when odasa is not configured properly 2019-11-20 17:12:29 -07:00
Dave Bartolomeo
be72e9b67a Activate when Test Explorer view is opened 2019-11-20 17:11:43 -07:00
Dave Bartolomeo
85f7ff1d11 Attempt to fix pure test failure 2019-11-20 16:28:03 -07:00
Dave Bartolomeo
ddf42d81d1 Fix LGTM alerts 2019-11-20 14:55:08 -07:00
Dave Bartolomeo
444aca3bae Implement QL Test support (using odasa for now)
The PR contains the initial implementing of QL Test support in CodeQL for Visual Studio Code. Because QL Test support isn't quite ready in the CLI yet, this PR uses `odasa` to run the tests for now. As CLI support comes online, it should be straightforward to swap out the implementation to use the CLI.

The treeview UI for the tests is implemented via the `hbenl.vscode-test-explorer` extension. This extension is open source, and appears to be actively maintained. It's used by a couple dozen existing extensions for tests for various languages. The extension doesn't really do anything on its own, so taking it as a dependency isn't introducing any unwanted UI clutter. Note that I did have to remove the `--disable-extensions` argument from `launch.json`, because otherwise the test explorer extension gets disabled, preventing our own extension from loading.

The UI will display a root node for each QL pack that contains tests, with the actual test directories and files as descendants of that root node. We consider only those QL packs in the workspace; QL packs on the default CodeQL search path are ignored. We use `codeql resolve qlpacks` to find the packs, and then watch all `qlpack.yml` files in the workspace for changes in order to refresh the pack discovery when necessary. Ideally, we'd have the CLI return a set of path patterns to watch, but for now the current implementation works fine.

To discover the tests within a given pack, we walk the pack's directory tree manually for now, until the relevant CLI command is available. Because we do not yet have a mechanism in `qlpack.yml` to specify whether or not the pack contains tests, we assume that any pack whose name ends with "-tests" to contain nothing but tests, and any other pack to contain no tests. This is sufficient for the tests in the QL repo. As with QL pack discovery, we watch the file system for changes in `.ql` and `.qlref` files in order to refresh the tree of tests if anything changes.

To actually run the tests, we just invoke `odasa qltest` with the appropriate arguments. This code is pretty much a straight copy-and-paste from the repo where I've had a private version of QL Test support for several months. Once we can run tests via the CLI, this will all be deleted.

The `test-ui.ts` file implements a couple of additional commands for the context menu of the test treeview. You can accept the output of a failing test (copying the `.actual` file to the `.expected` file), and you can bring up a diff view of the `.expected` and `.actual` files).

This PR includes a couple of related utility classes. `UIService` makes it a little easier to implement a service that handles VS Code commands. `Discovery` is a base class that handles most of the work that is shared between the different kinds of discovery that we do, like avoiding running multiple discovery operations simultaneously if we get a storm of file change notifications.
2019-11-20 14:42:33 -07:00
jcreedcmu
a5594043e1 Merge pull request #164 from asgerf/asgerf/decorate-selected-path-node
Add decoration to focused item
2019-11-20 09:04:23 -05:00
Asger F
1fc5e77de6 Fix typo in comment 2019-11-20 11:13:45 +00:00
Asger F
0c45210021 Treat single-line and multi-line ranges differently 2019-11-20 10:22:56 +00:00
Aditya Sharad
4287f4d01b Merge pull request #169 from jcreedcmu/no-selected-class
Simplify selected results table handling
2019-11-19 08:47:42 -08:00
Aditya Sharad
cfcbdcd3d0 Merge pull request #170 from jcreedcmu/fix-upgrades
Fix auto-upgrade script path
2019-11-18 13:08:27 -08:00
Jason Reed
a1f0af9086 Fix auto-upgrade script path
This was a simple case of passing entirely the wrong data as an
argument to the `upgradeDatabase` call in `queries.ts`. We were
passing the list of search paths for upgrades, when we should have
been passing the list of directories directly containing upgrade
scripts to be applied.
2019-11-18 15:56:45 -05:00