Compare commits
680 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acc37fb4de | ||
|
|
05951b6c74 | ||
|
|
473569df5b | ||
|
|
97c985b716 | ||
|
|
84b9d9c994 | ||
|
|
639487be0a | ||
|
|
f9a19b6a4a | ||
|
|
ab0e8a0ff2 | ||
|
|
03f58593ce | ||
|
|
a24e7c6172 | ||
|
|
e164bbb79e | ||
|
|
bbdad0afc4 | ||
|
|
89359e30bf | ||
|
|
4c0c93d120 | ||
|
|
94b411e3b2 | ||
|
|
2baf99b38a | ||
|
|
082d4b8c78 | ||
|
|
66cb7dc92f | ||
|
|
9519efe525 | ||
|
|
71daf0b8c6 | ||
|
|
b526ff4d3a | ||
|
|
03bc63c689 | ||
|
|
916b840407 | ||
|
|
4858be6ac8 | ||
|
|
daec8b691d | ||
|
|
3df94b92cd | ||
|
|
5f1431ffc2 | ||
|
|
3bb10d8c6e | ||
|
|
3f001c981d | ||
|
|
09bae13732 | ||
|
|
93054e14a2 | ||
|
|
a661daaa37 | ||
|
|
b062f61544 | ||
|
|
1fdb1e23f4 | ||
|
|
145f0bf1f2 | ||
|
|
2ca15f3665 | ||
|
|
20b127c693 | ||
|
|
620cc39e63 | ||
|
|
8345284327 | ||
|
|
ae3c0888e8 | ||
|
|
4d00c4abfc | ||
|
|
99e523f645 | ||
|
|
6e19b5200c | ||
|
|
45bb643a8a | ||
|
|
c6548cbe41 | ||
|
|
3cc7d3ce8a | ||
|
|
3dbd071570 | ||
|
|
fe90f38ad4 | ||
|
|
588351b101 | ||
|
|
c0ba9c5f6e | ||
|
|
18e1cfa8aa | ||
|
|
49f97e1bcc | ||
|
|
f6b50bb3d6 | ||
|
|
544ff89bf8 | ||
|
|
e7a0c7e652 | ||
|
|
5ff7b8a1c1 | ||
|
|
f0aa0a5ef6 | ||
|
|
52ee4563dc | ||
|
|
a7431bdc1d | ||
|
|
a1d3c612ad | ||
|
|
2fe0c7925d | ||
|
|
028cc79bb9 | ||
|
|
0639c66bb0 | ||
|
|
e6d0646786 | ||
|
|
fcc814c0c9 | ||
|
|
ea0887622e | ||
|
|
d4fb0fa177 | ||
|
|
44aeaf7d32 | ||
|
|
dd55b7e03e | ||
|
|
304c9fb12d | ||
|
|
4e3b201054 | ||
|
|
4fa5355239 | ||
|
|
7cff1fb84d | ||
|
|
684c492a43 | ||
|
|
20e7432ca0 | ||
|
|
26e2021551 | ||
|
|
18111ff4bf | ||
|
|
75ed7d20dc | ||
|
|
abfd1e2e83 | ||
|
|
8e7fa4f1d6 | ||
|
|
afc0d4e6db | ||
|
|
aba2277053 | ||
|
|
cf6a10ccb2 | ||
|
|
7296c645b9 | ||
|
|
d8a3e49d19 | ||
|
|
b639f62cfd | ||
|
|
1487ff5e0e | ||
|
|
0965448c02 | ||
|
|
cb1233d018 | ||
|
|
3c860cfcff | ||
|
|
4064da640b | ||
|
|
30dd163265 | ||
|
|
bd1f6cf30e | ||
|
|
25fec684e2 | ||
|
|
06fd3a58a7 | ||
|
|
f6702844b3 | ||
|
|
aac9971e2e | ||
|
|
7835ba45a4 | ||
|
|
841c66c7f8 | ||
|
|
78f091729f | ||
|
|
aff369ad7f | ||
|
|
d610701d45 | ||
|
|
36754a8a10 | ||
|
|
4cc423217d | ||
|
|
5a4015900f | ||
|
|
e0a0051f70 | ||
|
|
be62bd3b25 | ||
|
|
ae31a17344 | ||
|
|
9359d5de24 | ||
|
|
fcb1ef4fd7 | ||
|
|
a1daa91502 | ||
|
|
a21dec7461 | ||
|
|
8cfa82f334 | ||
|
|
cc955c70f9 | ||
|
|
594d879640 | ||
|
|
5174afed00 | ||
|
|
5a2a9fc4bf | ||
|
|
be2ca6c368 | ||
|
|
99af9ca47d | ||
|
|
b3c8ef115d | ||
|
|
661638517f | ||
|
|
6d3f7e3fdb | ||
|
|
8550778609 | ||
|
|
f837508d86 | ||
|
|
4b9db6a298 | ||
|
|
6289411e08 | ||
|
|
0164d1094c | ||
|
|
b0ba1e0576 | ||
|
|
718a6d6948 | ||
|
|
6ccaf5302f | ||
|
|
952f033377 | ||
|
|
12d5255073 | ||
|
|
bf1e3c10db | ||
|
|
453cc77c3e | ||
|
|
6dc684f2b6 | ||
|
|
6b578c830d | ||
|
|
76119e40fb | ||
|
|
c9038f5334 | ||
|
|
45764d9bff | ||
|
|
804632274a | ||
|
|
847cb13694 | ||
|
|
dad6467599 | ||
|
|
b6410073d4 | ||
|
|
1e1c7d4a5f | ||
|
|
31a28e70b2 | ||
|
|
ccf03cbcff | ||
|
|
47045f23c3 | ||
|
|
c1f24142c9 | ||
|
|
762288b57f | ||
|
|
c36fa0f5d3 | ||
|
|
b751cee618 | ||
|
|
b497c4fa00 | ||
|
|
b53366f277 | ||
|
|
1cce7ae0e2 | ||
|
|
9b59b65591 | ||
|
|
7e59d4c736 | ||
|
|
cdbdf62612 | ||
|
|
c36ce4867e | ||
|
|
7748f82c96 | ||
|
|
5b217220fa | ||
|
|
7685d7651e | ||
|
|
25a9ee1606 | ||
|
|
12e2eb2d8b | ||
|
|
84b48f416f | ||
|
|
606ffe41b0 | ||
|
|
75b4934d97 | ||
|
|
77c28e0453 | ||
|
|
72b335649c | ||
|
|
2a437c0d1a | ||
|
|
bc10a7a38a | ||
|
|
562986546d | ||
|
|
c4d9ef26a8 | ||
|
|
a9e49f2d72 | ||
|
|
b15626853b | ||
|
|
f04c34629e | ||
|
|
a217b53bf3 | ||
|
|
626592ee79 | ||
|
|
4826a7e91f | ||
|
|
d12cdbe679 | ||
|
|
599a9ed5d9 | ||
|
|
caeaba2f2f | ||
|
|
51589e953e | ||
|
|
c4b1134903 | ||
|
|
1ec3d044cf | ||
|
|
dbb549d5fb | ||
|
|
4c469e7386 | ||
|
|
2ccdb9e577 | ||
|
|
00145bbfd4 | ||
|
|
123219aace | ||
|
|
ecdc485e79 | ||
|
|
3812e3dcb0 | ||
|
|
eb09a0db8a | ||
|
|
ad7a04e385 | ||
|
|
158bebd03f | ||
|
|
c4b4cee057 | ||
|
|
7cffb997a7 | ||
|
|
83291c5ceb | ||
|
|
3c870a10e2 | ||
|
|
2a722ba264 | ||
|
|
da754a23e4 | ||
|
|
4a237ba019 | ||
|
|
319d8ce0f5 | ||
|
|
f313648ab7 | ||
|
|
1a3fecd3e8 | ||
|
|
1348de5a5f | ||
|
|
8521138bce | ||
|
|
8569fa7399 | ||
|
|
ee37fbff63 | ||
|
|
d49bffe98e | ||
|
|
832211d789 | ||
|
|
f9553d7033 | ||
|
|
f18f1b0ca7 | ||
|
|
50ec71893c | ||
|
|
56af69e58d | ||
|
|
d209e52a0b | ||
|
|
09b30fe5a3 | ||
|
|
c6d54de748 | ||
|
|
a3fafc8e59 | ||
|
|
6a636baa21 | ||
|
|
9e92d0c4a7 | ||
|
|
78a0a4e580 | ||
|
|
f0f01720f1 | ||
|
|
c8b0461f7f | ||
|
|
00de0820fb | ||
|
|
5a76df8489 | ||
|
|
9764a93900 | ||
|
|
130d8efe35 | ||
|
|
63a5021e5e | ||
|
|
e891169ca3 | ||
|
|
98284d9b2c | ||
|
|
b480f8f375 | ||
|
|
ead1fb4cd9 | ||
|
|
0acf9f7b66 | ||
|
|
9cb4b9d372 | ||
|
|
8a10a49f66 | ||
|
|
40d281aa3f | ||
|
|
b25cb8adbe | ||
|
|
88edcaf067 | ||
|
|
8737cfde0b | ||
|
|
593ca57497 | ||
|
|
471ead37c0 | ||
|
|
436af066fc | ||
|
|
c85338d11a | ||
|
|
1523babcb3 | ||
|
|
4ed0e0fa09 | ||
|
|
79bb894a7d | ||
|
|
da63b99a94 | ||
|
|
c325a725ea | ||
|
|
6c8c15155b | ||
|
|
3cd025f879 | ||
|
|
6b1fce9cd5 | ||
|
|
104055e703 | ||
|
|
add5417a42 | ||
|
|
31ef6aef29 | ||
|
|
bd81d3c4a7 | ||
|
|
4e5abee2ea | ||
|
|
bdf7208476 | ||
|
|
e1a56dd91d | ||
|
|
d4a58a64ee | ||
|
|
71b1b49502 | ||
|
|
65777b5e60 | ||
|
|
53bb9d797b | ||
|
|
cbf15e6d02 | ||
|
|
ecc07a50be | ||
|
|
7288712e47 | ||
|
|
74ae5a7fdc | ||
|
|
302722b982 | ||
|
|
22f28fa6ff | ||
|
|
9ba06ef562 | ||
|
|
cff56b7e7b | ||
|
|
ad41a043a7 | ||
|
|
66c6bf5e86 | ||
|
|
463633334c | ||
|
|
9278422406 | ||
|
|
57ba12db8b | ||
|
|
ccdffc296c | ||
|
|
24e9fbe8ca | ||
|
|
6e33b3c032 | ||
|
|
a625a39999 | ||
|
|
94ef752c0b | ||
|
|
9957b211e0 | ||
|
|
38f22b65ef | ||
|
|
4eecdbfada | ||
|
|
7637f9428a | ||
|
|
0e3679d186 | ||
|
|
e5dcffc04b | ||
|
|
0ce25eef63 | ||
|
|
2ca4fb052e | ||
|
|
dab67f148e | ||
|
|
a032678f24 | ||
|
|
dcac6f56da | ||
|
|
57ee00efd0 | ||
|
|
4bc799246f | ||
|
|
6a7856052c | ||
|
|
fe31730dd1 | ||
|
|
cc74533267 | ||
|
|
1a219af821 | ||
|
|
43de90f03d | ||
|
|
9624858335 | ||
|
|
3d4cdb69b1 | ||
|
|
6b7ebf543c | ||
|
|
7e8782723d | ||
|
|
55fb0b7078 | ||
|
|
45b6288363 | ||
|
|
424520613e | ||
|
|
304a96cb25 | ||
|
|
32dbc87049 | ||
|
|
baf1b70460 | ||
|
|
a254ceaa59 | ||
|
|
7fd5999ead | ||
|
|
c85ef15d9e | ||
|
|
986749b40f | ||
|
|
9c2821a418 | ||
|
|
93a6f50c0e | ||
|
|
0413b01990 | ||
|
|
157a5d6afd | ||
|
|
6b27a4209a | ||
|
|
1bb68d65f9 | ||
|
|
fd13c35b5d | ||
|
|
77deea77fc | ||
|
|
2eaa923019 | ||
|
|
ad9b46e494 | ||
|
|
fa4766fe91 | ||
|
|
28eb9ead01 | ||
|
|
0013a0f1b2 | ||
|
|
25b71e8651 | ||
|
|
31a97897c8 | ||
|
|
bf7509e3df | ||
|
|
4fd9b54c58 | ||
|
|
7d2bae1f1b | ||
|
|
1f4e1f27ae | ||
|
|
3a1800319a | ||
|
|
f2fe1063d9 | ||
|
|
7e1b35eae4 | ||
|
|
3283b68ff9 | ||
|
|
aaf21d35f6 | ||
|
|
67a6ab5c8e | ||
|
|
64994d7c03 | ||
|
|
362094b8de | ||
|
|
e791e77ef9 | ||
|
|
0009114f7b | ||
|
|
3b644fea7b | ||
|
|
04c9f17398 | ||
|
|
60e9f552db | ||
|
|
38caad032b | ||
|
|
7c1a8b3bc9 | ||
|
|
c7c709b366 | ||
|
|
bf662354fe | ||
|
|
131e72b162 | ||
|
|
4b875e7e42 | ||
|
|
6ea36867a2 | ||
|
|
8df061f443 | ||
|
|
0885a22984 | ||
|
|
0354b1caac | ||
|
|
d32a3a0deb | ||
|
|
e41dba7627 | ||
|
|
b2f4fecfb4 | ||
|
|
21b6adb92c | ||
|
|
90577f516f | ||
|
|
a2825162ac | ||
|
|
9b0d4bd7b8 | ||
|
|
2e26b857f4 | ||
|
|
7bdd452d63 | ||
|
|
be9a7a35bc | ||
|
|
dd8600fcc6 | ||
|
|
cc8f304f96 | ||
|
|
1ca623f68a | ||
|
|
53c404b131 | ||
|
|
f8d5fd8f6e | ||
|
|
d49c2d7958 | ||
|
|
01d7329bc3 | ||
|
|
e8d230c8f5 | ||
|
|
44a3e6b557 | ||
|
|
8b2a3b18ce | ||
|
|
fad5bb31a0 | ||
|
|
484b7668cb | ||
|
|
33dd50ca4d | ||
|
|
195cd69567 | ||
|
|
268199e9e2 | ||
|
|
6cef629507 | ||
|
|
563489d1e0 | ||
|
|
ebfcce30ba | ||
|
|
159d900edb | ||
|
|
46233b9355 | ||
|
|
1d6a7f8df1 | ||
|
|
e380c78876 | ||
|
|
cd67ce9242 | ||
|
|
cd8d82daac | ||
|
|
726feb19e1 | ||
|
|
8c324a3263 | ||
|
|
119649144e | ||
|
|
4c527a3573 | ||
|
|
525f5234b6 | ||
|
|
908abb4413 | ||
|
|
a69ec03c6e | ||
|
|
a071470c5a | ||
|
|
2ae95144a5 | ||
|
|
60faed1ccc | ||
|
|
6e6ea76c97 | ||
|
|
d30eb27320 | ||
|
|
2104cb3d09 | ||
|
|
5644206777 | ||
|
|
a6a0ee5f50 | ||
|
|
74c1e583b4 | ||
|
|
326653e25a | ||
|
|
0d057aed3f | ||
|
|
c90eede573 | ||
|
|
ebba9949a8 | ||
|
|
d18e3dd40e | ||
|
|
9355f0633a | ||
|
|
f553523f73 | ||
|
|
627bb59bd5 | ||
|
|
95cbe02768 | ||
|
|
d08e005b46 | ||
|
|
e73a6874b2 | ||
|
|
dc6ae6cc39 | ||
|
|
3902596823 | ||
|
|
c400485a4e | ||
|
|
1a7ddcf843 | ||
|
|
7cef45c434 | ||
|
|
69b06ae95c | ||
|
|
ae2bd81215 | ||
|
|
b9be9cff9f | ||
|
|
4871728216 | ||
|
|
8c5d73bd76 | ||
|
|
81b53c9c19 | ||
|
|
a232b56bcd | ||
|
|
c26d786a1c | ||
|
|
f759eed0f5 | ||
|
|
99d2df2067 | ||
|
|
866b137fd4 | ||
|
|
76a00e5fa5 | ||
|
|
f0d71ba356 | ||
|
|
b4fbfb6d2b | ||
|
|
1d02c19854 | ||
|
|
3167ceec91 | ||
|
|
fba49020e3 | ||
|
|
dea36820e4 | ||
|
|
60df319754 | ||
|
|
0bdee6e77e | ||
|
|
88440ba148 | ||
|
|
a0fb3b47c8 | ||
|
|
86d10b439b | ||
|
|
5a694653d7 | ||
|
|
902c489979 | ||
|
|
0f6100cc42 | ||
|
|
7fed5baebc | ||
|
|
d3e961ffb3 | ||
|
|
a20d9102e6 | ||
|
|
88bfd19c91 | ||
|
|
131d252a8b | ||
|
|
125f63887a | ||
|
|
20dea5ea46 | ||
|
|
3c4682e556 | ||
|
|
bb61b5ea25 | ||
|
|
2949fc33d1 | ||
|
|
ab933fcb81 | ||
|
|
90023137ca | ||
|
|
fcecfa112e | ||
|
|
303a7d1662 | ||
|
|
7c935b37b0 | ||
|
|
339fc9a755 | ||
|
|
4138ca1085 | ||
|
|
6941584214 | ||
|
|
525d7f5f3d | ||
|
|
84621b7ecc | ||
|
|
2baa53a149 | ||
|
|
15579012f1 | ||
|
|
28b00b249b | ||
|
|
401da636a0 | ||
|
|
ab9cf465cc | ||
|
|
bb7246b612 | ||
|
|
b82cd8b6f4 | ||
|
|
f56f017a84 | ||
|
|
7dc5eebcc1 | ||
|
|
644a83d6d8 | ||
|
|
4f84376faa | ||
|
|
5e76c08f84 | ||
|
|
765c956481 | ||
|
|
deac8c8c02 | ||
|
|
a47031b0d5 | ||
|
|
3bf27b3472 | ||
|
|
9422c6d65c | ||
|
|
b81e3c7b94 | ||
|
|
011eee1d16 | ||
|
|
924d24b106 | ||
|
|
54ba5ced09 | ||
|
|
78a90ffa92 | ||
|
|
b95ee896df | ||
|
|
d33b07b2d1 | ||
|
|
3d7f303c65 | ||
|
|
540d6758d1 | ||
|
|
b5b34743f1 | ||
|
|
0a6db47b5f | ||
|
|
f679a2efec | ||
|
|
72253a1bb8 | ||
|
|
2065c7d75c | ||
|
|
ff4ea3e4c8 | ||
|
|
9bd932294a | ||
|
|
afdc8164c8 | ||
|
|
ea022f4cde | ||
|
|
48ced51035 | ||
|
|
177688dc56 | ||
|
|
c5cbf92b3a | ||
|
|
529ceb133e | ||
|
|
baaa3d31c0 | ||
|
|
9629c99ccb | ||
|
|
7ade7be0c4 | ||
|
|
4272cee01b | ||
|
|
d8fbc56ec2 | ||
|
|
e41b0ff779 | ||
|
|
cf3ba32906 | ||
|
|
741d364a52 | ||
|
|
49a2555dab | ||
|
|
f4e6a0db9b | ||
|
|
4e7b89864c | ||
|
|
02443b5ddd | ||
|
|
50b507dba5 | ||
|
|
aea5d33c42 | ||
|
|
b2427a6534 | ||
|
|
b95f6a5afb | ||
|
|
7b7413ba26 | ||
|
|
d33fa5df8a | ||
|
|
2efff809eb | ||
|
|
c442ff5599 | ||
|
|
e4de8c6b9b | ||
|
|
c032e4f9a7 | ||
|
|
487cc7b088 | ||
|
|
d9e9c1b885 | ||
|
|
e19637b59c | ||
|
|
066bf3fd26 | ||
|
|
7ab1f3a83d | ||
|
|
e3e2fcc349 | ||
|
|
17ed18a29d | ||
|
|
110d930b68 | ||
|
|
f8cc3aec32 | ||
|
|
f408418f23 | ||
|
|
0b638b6ae1 | ||
|
|
ce7c7119c7 | ||
|
|
5dce5e83b0 | ||
|
|
ac3b94dac8 | ||
|
|
519c3039b8 | ||
|
|
0a5c272b17 | ||
|
|
32ec043cbe | ||
|
|
454a1eab39 | ||
|
|
d3701944bf | ||
|
|
43bcd69e39 | ||
|
|
53a17d5728 | ||
|
|
b0dab966f3 | ||
|
|
e4a3161283 | ||
|
|
47e53da89c | ||
|
|
f8f81cfb40 | ||
|
|
fd43bed99d | ||
|
|
ffc3d406c2 | ||
|
|
11bf3c9462 | ||
|
|
9b2c40b298 | ||
|
|
abf6c6f108 | ||
|
|
910c1b7352 | ||
|
|
f47d6ec21c | ||
|
|
0e23dd59db | ||
|
|
160a0aebfe | ||
|
|
4d3385825b | ||
|
|
80862944d8 | ||
|
|
91344a74f6 | ||
|
|
7538ad1ba4 | ||
|
|
24c2663fe7 | ||
|
|
50aaf3b537 | ||
|
|
847082cd30 | ||
|
|
8c7c197b22 | ||
|
|
1f95eb2f49 | ||
|
|
7874a34947 | ||
|
|
a74c8a7cee | ||
|
|
3aced3c4d3 | ||
|
|
bec23f36d2 | ||
|
|
92bbf3a2e8 | ||
|
|
5c478e98d9 | ||
|
|
f26988731e | ||
|
|
e6f9ce050b | ||
|
|
52f993f748 | ||
|
|
99fe65f6f7 | ||
|
|
7d721d9544 | ||
|
|
1005ecdc6a | ||
|
|
c9f65be721 | ||
|
|
9ad28f36b4 | ||
|
|
9c076152cb | ||
|
|
bbb6f10f17 | ||
|
|
8a671be85c | ||
|
|
0476815f8a | ||
|
|
53dfd1243f | ||
|
|
d69772d1f8 | ||
|
|
2fd5f38574 | ||
|
|
06d22841cf | ||
|
|
0133cd7734 | ||
|
|
a53c04e2c1 | ||
|
|
eba6c190e8 | ||
|
|
d0e6e3ca89 | ||
|
|
cc00456cbc | ||
|
|
434567aa34 | ||
|
|
7b1a93d7c6 | ||
|
|
d3ea84e863 | ||
|
|
1b6685ef6f | ||
|
|
f26795ca17 | ||
|
|
617f7bab0a | ||
|
|
8da1a28478 | ||
|
|
4518d9a81d | ||
|
|
3817133b5b | ||
|
|
c9b68caee4 | ||
|
|
60c4d8d40a | ||
|
|
1a9d63315f | ||
|
|
5c8098f28d | ||
|
|
bcf70c6962 | ||
|
|
64f33a5f44 | ||
|
|
48a527ad52 | ||
|
|
faabe6d887 | ||
|
|
4b8d611d86 | ||
|
|
bfc9a17ffb | ||
|
|
a4a3f70984 | ||
|
|
98bae3253d | ||
|
|
70098aa19c | ||
|
|
1261fdd41e | ||
|
|
c914312e85 | ||
|
|
cd2b5a8c59 | ||
|
|
29a43c7dc1 | ||
|
|
8ef3c3713b | ||
|
|
54f83d11d6 | ||
|
|
22cfad6711 | ||
|
|
cbc2650f30 | ||
|
|
55b060af97 | ||
|
|
9f347d136b | ||
|
|
0d0367c39d | ||
|
|
ba0a30dcfe | ||
|
|
3079d7f285 | ||
|
|
10eb355900 | ||
|
|
0daea7399a | ||
|
|
1b0077a115 | ||
|
|
db5e743055 | ||
|
|
a6d63222f5 | ||
|
|
58e80ecce3 | ||
|
|
0ad44a3fe2 | ||
|
|
09dccc13a2 | ||
|
|
2cdded9cca | ||
|
|
e8a0b24f57 | ||
|
|
182c2f3b8e | ||
|
|
e5376b3469 | ||
|
|
ef22cf174e | ||
|
|
d158487081 | ||
|
|
2e9c0c301c | ||
|
|
f256e18041 | ||
|
|
aa23680603 | ||
|
|
e5fe2148ab | ||
|
|
c44b7b1d78 | ||
|
|
24ede1b66f | ||
|
|
6335b9881b | ||
|
|
8c0fee5a2e | ||
|
|
e95f8e85a8 | ||
|
|
c6531a293e | ||
|
|
e648d9c67c | ||
|
|
45efca9425 | ||
|
|
9071f54863 | ||
|
|
0aa34a51ff | ||
|
|
181b5d6f7b | ||
|
|
7502fdee67 | ||
|
|
24652a84e4 | ||
|
|
2ee46cfd81 | ||
|
|
7c4eac8520 | ||
|
|
6fdc632743 | ||
|
|
a38a0356a0 | ||
|
|
9383b03971 | ||
|
|
baf130d60e | ||
|
|
d15e3885d7 | ||
|
|
2211e2317d | ||
|
|
6018ebaca9 | ||
|
|
da9065101f | ||
|
|
80867e6f58 | ||
|
|
5067fbc452 | ||
|
|
d88b5170ac | ||
|
|
57666bbbe3 | ||
|
|
951d0b1004 | ||
|
|
2989e4cfb9 | ||
|
|
8f869813a9 |
6
.gitattributes
vendored
6
.gitattributes
vendored
@@ -18,4 +18,8 @@ yarn.lock merge=binary
|
||||
# https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||
# suggests that this might interleave lines arbitrarily, but empirically
|
||||
# it keeps added chunks contiguous
|
||||
CHANGELOG.md merge=union
|
||||
CHANGELOG.md merge=union
|
||||
|
||||
# Mark some JSON files containing test data as generated so they are not included
|
||||
# as part of diffs or language statistics.
|
||||
extensions/ql-vscode/src/stories/remote-queries/data/*.json linguist-generated
|
||||
|
||||
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@main
|
||||
|
||||
34
.github/workflows/main.yml
vendored
34
.github/workflows/main.yml
vendored
@@ -16,13 +16,13 @@ jobs:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.14.0'
|
||||
node-version: '16.14.2'
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: extensions/ql-vscode
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
# This workflow step gets an unstable testing version of the CodeQL CLI. It should not be used outside of these tests.
|
||||
run: |
|
||||
LATEST=`gh api repos/dsp-testing/codeql-cli-nightlies/releases --jq '.[].tag_name' --method GET --raw-field 'per_page=1'`
|
||||
echo "::set-output name=nightly-url::https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST"
|
||||
echo "nightly-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST" >> "$GITHUB_OUTPUT"
|
||||
|
||||
test:
|
||||
name: Test
|
||||
@@ -76,13 +76,13 @@ jobs:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.14.0'
|
||||
node-version: '16.14.2'
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: extensions/ql-vscode
|
||||
@@ -103,6 +103,11 @@ jobs:
|
||||
run: |
|
||||
npm run lint
|
||||
|
||||
- name: Lint scenarios
|
||||
working-directory: extensions/ql-vscode
|
||||
run: |
|
||||
npm run lint:scenarios
|
||||
|
||||
- name: Run unit tests (Linux)
|
||||
working-directory: extensions/ql-vscode
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
@@ -121,7 +126,7 @@ jobs:
|
||||
env:
|
||||
VSCODE_CODEQL_GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||
run: |
|
||||
sudo apt-get install xvfb
|
||||
unset DBUS_SESSION_BUS_ADDRESS
|
||||
/usr/bin/xvfb-run npm run integration
|
||||
|
||||
- name: Run integration tests (Windows)
|
||||
@@ -139,7 +144,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
version: ['v2.6.3', 'v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.4', 'nightly']
|
||||
version: ['v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.5', 'v2.11.2', 'nightly']
|
||||
env:
|
||||
CLI_VERSION: ${{ matrix.version }}
|
||||
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}
|
||||
@@ -147,11 +152,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.14.0'
|
||||
node-version: '16.14.2'
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: extensions/ql-vscode
|
||||
@@ -175,10 +180,10 @@ jobs:
|
||||
else
|
||||
REF="codeql-cli/${{ matrix.version }}"
|
||||
fi
|
||||
echo "::set-output name=ref::$REF"
|
||||
echo "ref=$REF" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Checkout QL
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: github/codeql
|
||||
ref: ${{ steps.choose-ref.outputs.ref }}
|
||||
@@ -188,6 +193,7 @@ jobs:
|
||||
working-directory: extensions/ql-vscode
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
unset DBUS_SESSION_BUS_ADDRESS
|
||||
/usr/bin/xvfb-run npm run cli-integration
|
||||
|
||||
- name: Run CLI tests (Windows)
|
||||
|
||||
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -18,11 +18,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.14.0'
|
||||
node-version: '16.14.2'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@@ -47,11 +47,11 @@ jobs:
|
||||
# Record the VSIX path as an output of this step.
|
||||
# This will be used later when uploading a release asset.
|
||||
VSIX_PATH="$(ls dist/*.vsix)"
|
||||
echo "::set-output name=vsix_path::$VSIX_PATH"
|
||||
echo "vsix_path=$VSIX_PATH" >> "$GITHUB_OUTPUT"
|
||||
# Transform the GitHub ref so it can be used in a filename.
|
||||
# The last sed invocation is used for testing branches that modify this workflow.
|
||||
REF_NAME="$(echo ${{ github.ref }} | sed -e 's:^refs/tags/::' | sed -e 's:/:-:g')"
|
||||
echo "::set-output name=ref_name::$REF_NAME"
|
||||
echo "ref_name=$REF_NAME" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
# Bump to the next patch version. Major or minor version bumps will have to be done manually.
|
||||
# Record the next version number as an output of this step.
|
||||
NEXT_VERSION="$(npm version patch)"
|
||||
echo "::set-output name=next_version::$NEXT_VERSION"
|
||||
echo "next_version=$NEXT_VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Add changelog for next release
|
||||
if: success()
|
||||
@@ -136,7 +136,7 @@ jobs:
|
||||
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: vscode-codeql-extension
|
||||
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: vscode-codeql-extension
|
||||
|
||||
|
||||
27
.vscode/launch.json
vendored
27
.vscode/launch.json
vendored
@@ -35,14 +35,17 @@
|
||||
"runtimeArgs": [
|
||||
"--inspect=9229"
|
||||
],
|
||||
"env": {
|
||||
"LANG": "en-US"
|
||||
},
|
||||
"args": [
|
||||
"--exit",
|
||||
"-u",
|
||||
"bdd",
|
||||
"--colors",
|
||||
"--diff",
|
||||
"-r",
|
||||
"ts-node/register",
|
||||
"--config",
|
||||
".mocharc.json",
|
||||
"test/pure-tests/**/*.ts"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
@@ -50,6 +53,18 @@
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
},
|
||||
{
|
||||
"name": "Launch Unit Tests - React (vscode-codeql)",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/jest/bin/jest.js",
|
||||
"showAsyncStacks": true,
|
||||
"cwd": "${workspaceFolder}/extensions/ql-vscode",
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
},
|
||||
{
|
||||
"name": "Launch Integration Tests - No Workspace (vscode-codeql)",
|
||||
"type": "extensionHost",
|
||||
@@ -124,6 +139,14 @@
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
|
||||
],
|
||||
},
|
||||
{
|
||||
"name": "Launch Storybook",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}/extensions/ql-vscode",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run-script", "storybook"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
@@ -30,12 +30,11 @@
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"eslint.options": {
|
||||
// This is necessary so that eslint can properly resolve its plugins
|
||||
"resolvePluginsRelativeTo": "./extensions/ql-vscode"
|
||||
},
|
||||
// This is necessary to ensure that ESLint can find the correct configuration files and plugins.
|
||||
"eslint.workingDirectories": ["./extensions/ql-vscode"],
|
||||
"editor.formatOnSave": false,
|
||||
"typescript.preferences.quoteStyle": "single",
|
||||
"javascript.preferences.quoteStyle": "single",
|
||||
"editor.wordWrapColumn": 100
|
||||
"editor.wordWrapColumn": 100,
|
||||
"jest.rootPath": "./extensions/ql-vscode"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
**/* @github/codeql-vscode-reviewers
|
||||
/extensions/ql-vscode/src/remote-queries/ @github/code-scanning-secexp-reviewers
|
||||
**/remote-queries/ @github/code-scanning-secexp-reviewers
|
||||
**/variant-analysis/ @github/code-scanning-secexp-reviewers
|
||||
**/databases/ @github/code-scanning-secexp-reviewers
|
||||
|
||||
123
CONTRIBUTING.md
123
CONTRIBUTING.md
@@ -77,29 +77,121 @@ $ vscode/scripts/code-cli.sh --install-extension dist/vscode-codeql-*.vsix # if
|
||||
|
||||
You can use VS Code to debug the extension without explicitly installing it. Just open this directory as a workspace in VS Code, and hit `F5` to start a debugging session.
|
||||
|
||||
### Running the unit tests and integration tests that do not require a CLI instance
|
||||
### Storybook
|
||||
|
||||
Unit tests and many integration tests do not require a copy of the CodeQL CLI.
|
||||
|
||||
Outside of vscode, in the `extensions/ql-vscode` directory, run:
|
||||
You can use [Storybook](https://storybook.js.org/) to preview React components outside VSCode. Inside the `extensions/ql-vscode` directory, run:
|
||||
|
||||
```shell
|
||||
npm run test && npm run integration
|
||||
npm run storybook
|
||||
```
|
||||
|
||||
Alternatively, you can run the tests inside of vscode. There are several vscode launch configurations defined that run the unit and integration tests. They can all be found in the debug view.
|
||||
Your browser should automatically open to the Storybook UI. Stories live in the `src/stories` directory.
|
||||
|
||||
Only the _With CLI_ tests require a CLI instance to run. See below on how to do that.
|
||||
Alternatively, you can start Storybook inside of VSCode. There is a VSCode launch configuration for starting Storybook. It can be found in the debug view.
|
||||
|
||||
Running from a terminal, you _must_ set the `TEST_CODEQL_PATH` variable to point to a checkout of the `github/codeql` repository. The appropriate CLI version will be downloaded as part of the test.
|
||||
More information about Storybook can be found inside the **Overview** page once you have launched Storybook.
|
||||
|
||||
### Running the integration tests
|
||||
### Testing
|
||||
|
||||
You will need to run CLI tests using a task from inside of VS Code called _Launch Integration Tests - With CLI_.
|
||||
We have several types of tests:
|
||||
|
||||
* Unit tests: these live in the `tests/pure-tests/` directory
|
||||
* View tests: these live in `src/view/variant-analysis/__tests__/`
|
||||
* VSCode integration tests: these live in `src/vscode-tests/no-workspace` and `src/vscode-tests/minimal-workspace`
|
||||
* CLI integration tests: these live in `src/vscode-tests/cli-integration`
|
||||
|
||||
The CLI integration tests require an instance of the CodeQL CLI to run so they will require some extra setup steps. When adding new tests to our test suite, please be mindful of whether they need to be in the cli-integration folder. If the tests don't depend on the CLI, they are better suited to being a VSCode integration test.
|
||||
|
||||
Any test data you're using (sample projects, config files, etc.) must go in a `src/vscode-tests/*/data` directory. When you run the tests, the test runner will copy the data directory to `out/vscode-tests/*/data`.
|
||||
|
||||
#### Running the tests
|
||||
|
||||
Pre-requisites:
|
||||
1. Run `npm run build`.
|
||||
2. You will need to have `npm run watch` running in the background.
|
||||
|
||||
##### 1. From the terminal
|
||||
|
||||
Then, from the `extensions/ql-vscode` directory, use the appropriate command to run the tests:
|
||||
|
||||
* Unit tests: `npm run test:unit`
|
||||
* View Tests: `npm test:view`
|
||||
* VSCode integration tests: `npm run integration`
|
||||
|
||||
###### CLI integration tests
|
||||
|
||||
The CLI integration tests require the CodeQL standard libraries in order to run so you will need to clone a local copy of the `github/codeql` repository.
|
||||
|
||||
From inside of VSCode, open the `launch.json` file and in the _Launch Integration Tests - With CLI_ task, uncomment the `"${workspaceRoot}/../codeql"` line. If necessary, replace value with a path to your checkout, and then run the task.
|
||||
1. Set the `TEST_CODEQL_PATH` environment variable: running from a terminal, you _must_ set the `TEST_CODEQL_PATH` variable to point to a checkout of the `github/codeql` repository. The appropriate CLI version will be downloaded as part of the test.
|
||||
|
||||
2. Run your test command:
|
||||
|
||||
```shell
|
||||
cd extensions/ql-vscode && npm run cli-integration
|
||||
```
|
||||
|
||||
##### 2. From VSCode
|
||||
|
||||
Alternatively, you can run the tests inside of VSCode. There are several VSCode launch configurations defined that run the unit and integration tests.
|
||||
|
||||
You will need to run tests using a task from inside of VS Code, under the "Run and Debug" view:
|
||||
|
||||
* Unit tests: run the _Launch Unit Tests - React_ task
|
||||
* View Tests: run the _Launch Unit Tests_ task
|
||||
* VSCode integration tests: run the _Launch Unit Tests - No Workspace_ and _Launch Unit Tests - Minimal Workspace_ tasks
|
||||
|
||||
###### CLI integration tests
|
||||
|
||||
The CLI integration tests require the CodeQL standard libraries in order to run so you will need to clone a local copy of the `github/codeql` repository.
|
||||
|
||||
1. Set the `TEST_CODEQL_PATH` environment variable: running from a terminal, you _must_ set the `TEST_CODEQL_PATH` variable to point to a checkout of the `github/codeql` repository. The appropriate CLI version will be downloaded as part of the test.
|
||||
|
||||
2. Set the codeql path in VSCode's launch configuration: open `launch.json` and under the _Launch Integration Tests - With CLI_ section, uncomment the `"${workspaceRoot}/../codeql"` line. If you've cloned the `github/codeql` repo to a different path, replace the value with the correct path.
|
||||
|
||||
3. Run the VSCode task from the "Run and Debug" view called _Launch Integration Tests - With CLI_.
|
||||
|
||||
#### Using a mock GitHub API server
|
||||
|
||||
Multi-Repo Variant Analyses (MRVA) rely on the GitHub API. In order to make development and testing easy, we have functionality that allows us to intercept requests to the GitHub API and provide mock responses.
|
||||
|
||||
##### Using a pre-recorded test scenario
|
||||
|
||||
To run a mock MRVA scenario, follow these steps:
|
||||
1. Enable the mock GitHub API server by adding the following in your VS Code user settings (which can be found by running the `Preferences: Open User Settings (JSON)` VS Code command):
|
||||
```json
|
||||
"codeQL.mockGitHubApiServer": {
|
||||
"enabled": true
|
||||
}
|
||||
```
|
||||
|
||||
1. Run the `CodeQL: Mock GitHub API Server: Load Scenario` command from the command pallet, and choose one of the scenarios to load.
|
||||
1. Execute a normal MRVA. At this point you should see the scenario being played out, rather than an actual MRVA running.
|
||||
1. Once you're done, you can stop using the mock scenario with `CodeQL: Mock GitHub API Server: Unload Scenario`
|
||||
|
||||
If you want to replay the same scenario you should unload and reload it so requests are replayed from the start.
|
||||
|
||||
##### Recording a new test scenario
|
||||
To record a new mock MRVA scenario, follow these steps:
|
||||
|
||||
1. Enable the mock GitHub API server by adding the following in your VS Code user settings (which can be found by running the `Preferences: Open User Settings (JSON)` VS Code command):
|
||||
```json
|
||||
"codeQL.mockGitHubApiServer": {
|
||||
"enabled": true
|
||||
}
|
||||
```
|
||||
|
||||
1. Run the `CodeQL: Mock GitHub API Server: Start Scenario Recording` VS Code command from the command pallet.
|
||||
1. Execute a normal MRVA.
|
||||
1. Once what you wanted to record is done (e.g. the MRVA has finished), then run the `CodeQL: Mock GitHub API Server: Save Scenario` command from the command pallet.
|
||||
1. The scenario should then be available for replaying.
|
||||
|
||||
If you want to cancel recording, run the `CodeQL: Mock GitHub API Server: Cancel Scenario Recording` command.
|
||||
|
||||
Once the scenario has been recorded, it's often useful to remove some of the requests to speed up the replay, particularly ones that fetch the variant analysis status. Once some of the request files have manually been removed, the [fix-scenario-file-numbering script](./extensions/ql-vscode/scripts/fix-scenario-file-numbering.ts) can be used to update the number of the files. See the script file for details on how to use.
|
||||
|
||||
#### Scenario data location
|
||||
|
||||
Pre-recorded scenarios are stored in `./src/mocks/scenarios`. However, it's possible to configure the location, by setting the `codeQL.mockGitHubApiServer.scenariosPath` configuration property in the VS Code user settings.
|
||||
|
||||
## Releasing (write access required)
|
||||
|
||||
@@ -123,7 +215,7 @@ From inside of VSCode, open the `launch.json` file and in the _Launch Integratio
|
||||
git tag v1.3.6
|
||||
```
|
||||
|
||||
If you've accidentally created a badly named tag, you can delete it via
|
||||
If you've accidentally created a badly named tag, you can delete it via
|
||||
```bash
|
||||
git tag -d badly-named-tag
|
||||
```
|
||||
@@ -134,18 +226,19 @@ From inside of VSCode, open the `launch.json` file and in the _Launch Integratio
|
||||
```bash
|
||||
git push upstream refs/tags/v1.3.6
|
||||
```
|
||||
|
||||
|
||||
b. If you're working straight in this repo:
|
||||
|
||||
```bash
|
||||
git push origin refs/tags/v1.3.6
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
This will trigger [a release build](https://github.com/github/vscode-codeql/releases) on Actions.
|
||||
|
||||
* **IMPORTANT** Make sure you are on the `main` branch and your local checkout is fully updated when you add the tag.
|
||||
* If you accidentally add the tag to the wrong ref, you can just force push it to the right one later.
|
||||
1. Monitor the status of the release build in the `Release` workflow in the Actions tab.
|
||||
* DO NOT approve the "publish" stages of the workflow yet.
|
||||
1. Download the VSIX from the draft GitHub release at the top of [the releases page](https://github.com/github/vscode-codeql/releases) that is created when the release build finishes.
|
||||
1. Unzip the `.vsix` and inspect its `package.json` to make sure the version is what you expect,
|
||||
or look at the source if there's any doubt the right code is being shipped.
|
||||
|
||||
6
extensions/ql-vscode/.eslintignore
Normal file
6
extensions/ql-vscode/.eslintignore
Normal file
@@ -0,0 +1,6 @@
|
||||
.vscode-test/
|
||||
node_modules/
|
||||
out/
|
||||
|
||||
# Include the Storybook config
|
||||
!.storybook
|
||||
@@ -3,14 +3,14 @@ module.exports = {
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: "module",
|
||||
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json"],
|
||||
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json", "./scripts/tsconfig.json", "./.storybook/tsconfig.json"],
|
||||
},
|
||||
plugins: ["@typescript-eslint"],
|
||||
env: {
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
||||
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:jest-dom/recommended"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-use-before-define": 0,
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
|
||||
4
extensions/ql-vscode/.mocharc.json
Normal file
4
extensions/ql-vscode/.mocharc.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"exit": true,
|
||||
"require": ["test/mocha.setup.js"]
|
||||
}
|
||||
2
extensions/ql-vscode/.npmrc
Normal file
2
extensions/ql-vscode/.npmrc
Normal file
@@ -0,0 +1,2 @@
|
||||
# Storybook requires this option to be set. See https://github.com/storybookjs/storybook/issues/18298
|
||||
legacy-peer-deps=true
|
||||
@@ -1 +1 @@
|
||||
v16.14.0
|
||||
v16.14.2
|
||||
|
||||
20
extensions/ql-vscode/.storybook/main.ts
Normal file
20
extensions/ql-vscode/.storybook/main.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { StorybookConfig } from '@storybook/core-common';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
stories: [
|
||||
'../src/**/*.stories.mdx',
|
||||
'../src/**/*.stories.@(js|jsx|ts|tsx)'
|
||||
],
|
||||
addons: [
|
||||
'@storybook/addon-links',
|
||||
'@storybook/addon-essentials',
|
||||
'@storybook/addon-interactions',
|
||||
'./vscode-theme-addon/preset.ts',
|
||||
],
|
||||
framework: '@storybook/react',
|
||||
core: {
|
||||
builder: '@storybook/builder-webpack5'
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
7
extensions/ql-vscode/.storybook/manager.ts
Normal file
7
extensions/ql-vscode/.storybook/manager.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { addons } from '@storybook/addons';
|
||||
import { themes } from '@storybook/theming';
|
||||
|
||||
addons.setConfig({
|
||||
theme: themes.dark,
|
||||
enableShortcuts: false,
|
||||
});
|
||||
31
extensions/ql-vscode/.storybook/preview.ts
Normal file
31
extensions/ql-vscode/.storybook/preview.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { themes } from '@storybook/theming';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
// Allow all stories/components to use Codicons
|
||||
import '@vscode/codicons/dist/codicon.css';
|
||||
|
||||
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
|
||||
export const parameters = {
|
||||
// All props starting with `on` will automatically receive an action as a prop
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
// All props matching these names will automatically get the correct control
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
// Use a dark theme to be aligned with VSCode
|
||||
docs: {
|
||||
theme: themes.dark,
|
||||
},
|
||||
backgrounds: {
|
||||
// The background is injected by our theme CSS files
|
||||
disable: true,
|
||||
}
|
||||
};
|
||||
|
||||
(window as any).acquireVsCodeApi = () => ({
|
||||
postMessage: action('post-vscode-message'),
|
||||
setState: action('set-vscode-state'),
|
||||
});
|
||||
19
extensions/ql-vscode/.storybook/tsconfig.json
Normal file
19
extensions/ql-vscode/.storybook/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"target": "es6",
|
||||
"outDir": "out",
|
||||
"lib": ["ES2021", "dom"],
|
||||
"jsx": "react",
|
||||
"sourceMap": true,
|
||||
"rootDir": "..",
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import * as React from 'react';
|
||||
import { FunctionComponent, useCallback } from 'react';
|
||||
|
||||
import { useGlobals } from '@storybook/api';
|
||||
import { IconButton, Icons, WithTooltip, TooltipLinkList, Link, WithHideFn } from '@storybook/components';
|
||||
|
||||
import { themeNames, VSCodeTheme } from './theme';
|
||||
|
||||
export const ThemeSelector: FunctionComponent = () => {
|
||||
const [{ vscodeTheme }, updateGlobals] = useGlobals();
|
||||
|
||||
const changeTheme = useCallback((theme: VSCodeTheme) => {
|
||||
updateGlobals({
|
||||
vscodeTheme: theme,
|
||||
});
|
||||
}, [updateGlobals]);
|
||||
|
||||
const createLinks = useCallback((onHide: () => void): Link[] => Object.values(VSCodeTheme).map((theme) => ({
|
||||
id: theme,
|
||||
onClick() {
|
||||
changeTheme(theme);
|
||||
onHide();
|
||||
},
|
||||
title: themeNames[theme],
|
||||
value: theme,
|
||||
active: vscodeTheme === theme,
|
||||
})), [vscodeTheme, changeTheme]);
|
||||
|
||||
return (
|
||||
<WithTooltip
|
||||
placement="top"
|
||||
trigger="click"
|
||||
closeOnClick
|
||||
tooltip={({ onHide }: WithHideFn) => (
|
||||
<TooltipLinkList
|
||||
links={createLinks(onHide)}
|
||||
/>
|
||||
)}
|
||||
>
|
||||
<IconButton
|
||||
key="theme"
|
||||
title="Change the theme of the preview"
|
||||
active={vscodeTheme !== VSCodeTheme.Dark}
|
||||
>
|
||||
<Icons icon="dashboard" />
|
||||
</IconButton>
|
||||
</WithTooltip>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import { addons, types } from '@storybook/addons';
|
||||
import { ThemeSelector } from './ThemeSelector';
|
||||
|
||||
const ADDON_ID = 'vscode-theme-addon';
|
||||
|
||||
addons.register(ADDON_ID, () => {
|
||||
addons.add(ADDON_ID, {
|
||||
title: 'VSCode Themes',
|
||||
type: types.TOOL,
|
||||
match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
|
||||
render: () => <ThemeSelector />,
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
export function config(entry = []) {
|
||||
return [...entry, require.resolve('./preview.ts')];
|
||||
}
|
||||
|
||||
export function managerEntries(entry = []) {
|
||||
return [...entry, require.resolve('./manager.tsx')];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { withTheme } from './withTheme';
|
||||
import { VSCodeTheme } from './theme';
|
||||
|
||||
export const decorators = [withTheme];
|
||||
|
||||
export const globals = {
|
||||
vscodeTheme: VSCodeTheme.Dark,
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
export enum VSCodeTheme {
|
||||
Dark = 'dark',
|
||||
Light = 'light',
|
||||
}
|
||||
|
||||
export const themeNames: { [key in VSCodeTheme]: string } = {
|
||||
[VSCodeTheme.Dark]: 'Dark+',
|
||||
[VSCodeTheme.Light]: 'Light+',
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
import { useEffect, useGlobals } from '@storybook/addons';
|
||||
import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';
|
||||
|
||||
import { VSCodeTheme } from './theme';
|
||||
|
||||
const themeFiles: { [key in VSCodeTheme]: string } = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
[VSCodeTheme.Dark]: require('!file-loader?modules!../../src/stories/vscode-theme-dark.css').default,
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
[VSCodeTheme.Light]: require('!file-loader?modules!../../src/stories/vscode-theme-light.css').default,
|
||||
};
|
||||
|
||||
export const withTheme = (
|
||||
StoryFn: StoryFunction<AnyFramework>,
|
||||
context: StoryContext<AnyFramework>
|
||||
) => {
|
||||
const [{ vscodeTheme }] = useGlobals();
|
||||
|
||||
useEffect(() => {
|
||||
const styleSelectorId =
|
||||
context.viewMode === 'docs'
|
||||
? `addon-vscode-theme-docs-${context.id}`
|
||||
: 'addon-vscode-theme-theme';
|
||||
|
||||
const theme = Object.values(VSCodeTheme).includes(vscodeTheme) ? vscodeTheme as VSCodeTheme : VSCodeTheme.Dark;
|
||||
|
||||
document.getElementById(styleSelectorId)?.remove();
|
||||
|
||||
const link = document.createElement('link');
|
||||
link.id = styleSelectorId;
|
||||
link.href = themeFiles[theme];
|
||||
link.rel = 'stylesheet';
|
||||
|
||||
document.head.appendChild(link);
|
||||
}, [vscodeTheme]);
|
||||
|
||||
return StoryFn();
|
||||
};
|
||||
@@ -1,5 +1,33 @@
|
||||
# CodeQL for Visual Studio Code: Changelog
|
||||
|
||||
## 1.7.5 - 8 November 2022
|
||||
|
||||
- Fix a bug where the AST Viewer was not working unless the associated CodeQL library pack is in the workspace. [#1735](https://github.com/github/vscode-codeql/pull/1735)
|
||||
|
||||
## 1.7.4 - 29 October 2022
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 1.7.3 - 28 October 2022
|
||||
|
||||
- Fix a bug where databases may be lost if VS Code is restarted while the extension is being started up. [#1638](https://github.com/github/vscode-codeql/pull/1638)
|
||||
- Add commands for navigating up, down, left, or right in the result viewer. Previously there were only commands for moving up and down the currently-selected path. We suggest binding keyboard shortcuts to these commands, for navigating the result viewer using the keyboard. [#1568](https://github.com/github/vscode-codeql/pull/1568)
|
||||
|
||||
## 1.7.2 - 14 October 2022
|
||||
|
||||
- Fix a bug where results created in older versions were thought to be unsuccessful. [#1605](https://github.com/github/vscode-codeql/pull/1605)
|
||||
|
||||
## 1.7.1 - 12 October 2022
|
||||
|
||||
- Fix a bug where it was not possible to add a database folder if the folder name starts with `db-`. [#1565](https://github.com/github/vscode-codeql/pull/1565)
|
||||
- Ensure the results view opens in an editor column beside the currently active editor. [#1557](https://github.com/github/vscode-codeql/pull/1557)
|
||||
|
||||
## 1.7.0 - 20 September 2022
|
||||
|
||||
- Remove ability to download databases from LGTM. [#1467](https://github.com/github/vscode-codeql/pull/1467)
|
||||
- Remove the ability to manually upgrade databases from the context menu on databases. Databases are non-destructively upgraded automatically so for most users this was not needed. For advanced users this is still available in the Command Palette. [#1501](https://github.com/github/vscode-codeql/pull/1501)
|
||||
- Always restart the query server after a manual database upgrade. This avoids a bug in the query server where an invalid dbscheme was being retained in memory after an upgrade. [#1519](https://github.com/github/vscode-codeql/pull/1519)
|
||||
|
||||
## 1.6.12 - 1 September 2022
|
||||
|
||||
- Add ability for users to download databases directly from GitHub. [#1485](https://github.com/github/vscode-codeql/pull/1485)
|
||||
@@ -14,7 +42,7 @@ No user facing changes.
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 1.6.9 - 20 July 2022
|
||||
## 1.6.9 - 20 July 2022
|
||||
|
||||
No user facing changes.
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ For information about other configurations, see the separate [CodeQL help](https
|
||||
|
||||
### Quick start: Using CodeQL
|
||||
|
||||
1. [Import a database from LGTM](#importing-a-database-from-lgtm).
|
||||
1. [Import a database from GitHub](#importing-a-database-from-github).
|
||||
1. [Run a query](#running-a-query).
|
||||
|
||||
---
|
||||
@@ -73,18 +73,19 @@ If you're using your own clone of the CodeQL standard libraries, you can do a `g
|
||||
|
||||
You can find all the commands contributed by the extension in the Command Palette (**Ctrl+Shift+P** or **Cmd+Shift+P**) by typing `CodeQL`, many of them are also accessible through the interface, and via keyboard shortcuts.
|
||||
|
||||
### Importing a database from LGTM
|
||||
### Importing a database from GitHub
|
||||
|
||||
While you can use the [CodeQL CLI to create your own databases](https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/), the simplest way to start is by downloading a database from LGTM.com.
|
||||
While you can use the [CodeQL CLI to create your own databases](https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/), the simplest way to start is by downloading a database from GitHub.com.
|
||||
|
||||
1. Open [LGTM.com](https://lgtm.com/#explore) in your browser.
|
||||
1. Search for a project you're interested in, for example [Apache Kafka](https://lgtm.com/projects/g/apache/kafka).
|
||||
1. Copy the link to that project, for example `https://lgtm.com/projects/g/apache/kafka`.
|
||||
1. In VS Code, open the Command Palette and choose the **CodeQL: Download Database from LGTM** command.
|
||||
1. Find a project that you're interested in on GitHub.com, for example [Apache Kafka](https://github.com/apache/kafka).
|
||||
1. Copy the link to that project, for example `https://github.com/apache/kafka`.
|
||||
1. In VS Code, open the Command Palette and choose the **CodeQL: Download Database from GitHub** command.
|
||||
1. Paste the link you copied earlier.
|
||||
1. Select the language for the database you want to download (only required if the project has databases for multiple languages).
|
||||
1. Once the CodeQL database has been imported, it is displayed in the Databases view.
|
||||
|
||||
For more information, see [Choosing a database](https://codeql.github.com/docs/codeql-for-visual-studio-code/analyzing-your-projects/#choosing-a-database) on codeql.github.com.
|
||||
|
||||
### Running a query
|
||||
|
||||
The instructions below assume that you're using the CodeQL starter workspace, or that you've added the CodeQL libraries and queries repository to your workspace.
|
||||
@@ -98,6 +99,10 @@ When the results are ready, they're displayed in the CodeQL Query Results view.
|
||||
|
||||
If there are any problems running a query, a notification is displayed in the bottom right corner of the application. In addition to the error message, the notification includes details of how to fix the problem.
|
||||
|
||||
### Keyboad navigation
|
||||
|
||||
If you wish to navigate the query results from your keyboard, you can bind shortcuts to the **CodeQL: Navigate Up/Down/Left/Right in Result Viewer** commands.
|
||||
|
||||
## What next?
|
||||
|
||||
For more information about the CodeQL extension, [see the documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/). Otherwise, you could:
|
||||
|
||||
@@ -15,7 +15,8 @@ const packageFiles = [
|
||||
'snippets.json',
|
||||
'media',
|
||||
'node_modules',
|
||||
'out'
|
||||
'out',
|
||||
'workspace-databases-schema.json'
|
||||
];
|
||||
|
||||
async function copyPackage(sourcePath: string, destPath: string): Promise<void> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as gulp from 'gulp';
|
||||
import { compileTypeScript, watchTypeScript, cleanOutput } from './typescript';
|
||||
import { compileTextMateGrammar } from './textmate';
|
||||
import { copyTestData } from './tests';
|
||||
import { copyTestData, watchTestData } from './tests';
|
||||
import { compileView, watchView } from './webpack';
|
||||
import { packageExtension } from './package';
|
||||
import { injectAppInsightsKey } from './appInsights';
|
||||
@@ -21,6 +21,7 @@ export {
|
||||
watchView,
|
||||
compileTypeScript,
|
||||
copyTestData,
|
||||
watchTestData,
|
||||
injectAppInsightsKey,
|
||||
compileView,
|
||||
};
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import * as gulp from 'gulp';
|
||||
|
||||
export function copyTestData() {
|
||||
copyNoWorkspaceData();
|
||||
copyCliIntegrationData();
|
||||
return Promise.resolve();
|
||||
return Promise.all([
|
||||
copyNoWorkspaceData(),
|
||||
copyCliIntegrationData()
|
||||
]);
|
||||
}
|
||||
|
||||
export function watchTestData() {
|
||||
return gulp.watch(['src/vscode-tests/*/data/**/*'], copyTestData);
|
||||
}
|
||||
|
||||
function copyNoWorkspaceData() {
|
||||
|
||||
214
extensions/ql-vscode/jest.config.js
Normal file
214
extensions/ql-vscode/jest.config.js
Normal file
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* For a detailed explanation regarding each configuration property and type check, visit:
|
||||
* https://jestjs.io/docs/configuration
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// All imported modules in your tests should be mocked automatically
|
||||
// automock: false,
|
||||
|
||||
// Stop running tests after `n` failures
|
||||
// bail: 0,
|
||||
|
||||
// The directory where Jest should store its cached dependency information
|
||||
// cacheDirectory: "/private/var/folders/6m/1394pht172qgd7dmw1fwjk100000gn/T/jest_dx",
|
||||
|
||||
// Automatically clear mock calls, instances, contexts and results before every test
|
||||
// clearMocks: true,
|
||||
|
||||
// Indicates whether the coverage information should be collected while executing the test
|
||||
// collectCoverage: false,
|
||||
|
||||
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
||||
// collectCoverageFrom: undefined,
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
// coverageDirectory: undefined,
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
// coveragePathIgnorePatterns: [
|
||||
// "/node_modules/"
|
||||
// ],
|
||||
|
||||
// Indicates which provider should be used to instrument code for coverage
|
||||
coverageProvider: 'v8',
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
// coverageReporters: [
|
||||
// "json",
|
||||
// "text",
|
||||
// "lcov",
|
||||
// "clover"
|
||||
// ],
|
||||
|
||||
// An object that configures minimum threshold enforcement for coverage results
|
||||
// coverageThreshold: undefined,
|
||||
|
||||
// A path to a custom dependency extractor
|
||||
// dependencyExtractor: undefined,
|
||||
|
||||
// Make calling deprecated APIs throw helpful error messages
|
||||
// errorOnDeprecated: false,
|
||||
|
||||
// The default configuration for fake timers
|
||||
// fakeTimers: {
|
||||
// "enableGlobally": false
|
||||
// },
|
||||
|
||||
// Force coverage collection from ignored files using an array of glob patterns
|
||||
// forceCoverageMatch: [],
|
||||
|
||||
// A path to a module which exports an async function that is triggered once before all test suites
|
||||
// globalSetup: undefined,
|
||||
|
||||
// A path to a module which exports an async function that is triggered once after all test suites
|
||||
// globalTeardown: undefined,
|
||||
|
||||
// A set of global variables that need to be available in all test environments
|
||||
// globals: {},
|
||||
|
||||
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
||||
// maxWorkers: "50%",
|
||||
|
||||
// An array of directory names to be searched recursively up from the requiring module's location
|
||||
// moduleDirectories: [
|
||||
// "node_modules"
|
||||
// ],
|
||||
|
||||
// An array of file extensions your modules use
|
||||
moduleFileExtensions: [
|
||||
'js',
|
||||
'mjs',
|
||||
'cjs',
|
||||
'jsx',
|
||||
'ts',
|
||||
'tsx',
|
||||
'json'
|
||||
],
|
||||
|
||||
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
||||
'moduleNameMapper': {
|
||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/test/__mocks__/fileMock.ts',
|
||||
'\\.(css|less)$': '<rootDir>/test/__mocks__/styleMock.ts'
|
||||
},
|
||||
|
||||
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
||||
// modulePathIgnorePatterns: [],
|
||||
|
||||
// Activates notifications for test results
|
||||
// notify: false,
|
||||
|
||||
// An enum that specifies notification mode. Requires { notify: true }
|
||||
// notifyMode: "failure-change",
|
||||
|
||||
// A preset that is used as a base for Jest's configuration
|
||||
preset: 'ts-jest',
|
||||
|
||||
// Run tests from one or more projects
|
||||
// projects: undefined,
|
||||
|
||||
// Use this configuration option to add custom reporters to Jest
|
||||
// reporters: undefined,
|
||||
|
||||
// Automatically reset mock state before every test
|
||||
// resetMocks: false,
|
||||
|
||||
// Reset the module registry before running each individual test
|
||||
// resetModules: false,
|
||||
|
||||
// A path to a custom resolver
|
||||
// resolver: undefined,
|
||||
|
||||
// Automatically restore mock state and implementation before every test
|
||||
// restoreMocks: false,
|
||||
|
||||
// The root directory that Jest should scan for tests and modules within
|
||||
// rootDir: undefined,
|
||||
|
||||
// A list of paths to directories that Jest should use to search for files in
|
||||
// roots: [
|
||||
// "<rootDir>"
|
||||
// ],
|
||||
|
||||
// Allows you to use a custom runner instead of Jest's default test runner
|
||||
// runner: "jest-runner",
|
||||
|
||||
// The paths to modules that run some code to configure or set up the testing environment before each test
|
||||
// setupFiles: [],
|
||||
|
||||
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
||||
setupFilesAfterEnv: ['<rootDir>/test/jest.setup.ts'],
|
||||
|
||||
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
||||
// slowTestThreshold: 5,
|
||||
|
||||
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
||||
// snapshotSerializers: [],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
testEnvironment: 'jsdom',
|
||||
|
||||
// Options that will be passed to the testEnvironment
|
||||
// testEnvironmentOptions: {},
|
||||
|
||||
// Adds a location field to test results
|
||||
// testLocationInResults: false,
|
||||
|
||||
// The glob patterns Jest uses to detect test files
|
||||
testMatch: [
|
||||
'**/__tests__/**/*.[jt]s?(x)'
|
||||
],
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
// testPathIgnorePatterns: [
|
||||
// "/node_modules/"
|
||||
// ],
|
||||
|
||||
// The regexp pattern or array of patterns that Jest uses to detect test files
|
||||
// testRegex: [],
|
||||
|
||||
// This option allows the use of a custom results processor
|
||||
// testResultsProcessor: undefined,
|
||||
|
||||
// This option allows use of a custom test runner
|
||||
// testRunner: "jest-circus/runner",
|
||||
|
||||
// A map from regular expressions to paths to transformers
|
||||
transform: {
|
||||
'^.+\\.tsx?$': [
|
||||
'ts-jest',
|
||||
{
|
||||
tsconfig: 'src/view/tsconfig.spec.json',
|
||||
},
|
||||
],
|
||||
'node_modules': [
|
||||
'babel-jest',
|
||||
{
|
||||
presets: [
|
||||
'@babel/preset-env'
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-transform-modules-commonjs',
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
||||
'transformIgnorePatterns': [
|
||||
// These use ES modules, so need to be transformed
|
||||
'node_modules/(?!(?:@vscode/webview-ui-toolkit|@microsoft/.+|exenv-es6)/.*)'
|
||||
],
|
||||
|
||||
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
||||
// unmockedModulePathPatterns: undefined,
|
||||
|
||||
// Indicates whether each individual test should be reported during the run
|
||||
// verbose: undefined,
|
||||
|
||||
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
||||
// watchPathIgnorePatterns: [],
|
||||
|
||||
// Whether to use watchman for file crawling
|
||||
// watchman: true,
|
||||
};
|
||||
48362
extensions/ql-vscode/package-lock.json
generated
48362
extensions/ql-vscode/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
"description": "CodeQL for Visual Studio Code",
|
||||
"author": "GitHub",
|
||||
"private": true,
|
||||
"version": "1.6.12",
|
||||
"version": "1.7.5",
|
||||
"publisher": "GitHub",
|
||||
"license": "MIT",
|
||||
"icon": "media/VS-marketplace-CodeQL-icon.png",
|
||||
@@ -37,6 +37,7 @@
|
||||
"onLanguage:ql",
|
||||
"onLanguage:ql-summary",
|
||||
"onView:codeQLDatabases",
|
||||
"onView:codeQLDatabasesExperimental",
|
||||
"onView:codeQLQueryHistory",
|
||||
"onView:codeQLAstViewer",
|
||||
"onView:codeQLEvalLogViewer",
|
||||
@@ -63,6 +64,7 @@
|
||||
"onCommand:codeQL.quickQuery",
|
||||
"onCommand:codeQL.restartQueryServer",
|
||||
"onWebviewPanel:resultsView",
|
||||
"onWebviewPanel:codeQL.variantAnalysis",
|
||||
"onFileSystem:codeql-zip-archive"
|
||||
],
|
||||
"main": "./out/extension",
|
||||
@@ -82,6 +84,12 @@
|
||||
"editor.wordBasedSuggestions": false
|
||||
}
|
||||
},
|
||||
"jsonValidation": [
|
||||
{
|
||||
"fileMatch": "workspace-databases.json",
|
||||
"url": "./workspace-databases-schema.json"
|
||||
}
|
||||
],
|
||||
"languages": [
|
||||
{
|
||||
"id": "ql",
|
||||
@@ -289,6 +297,13 @@
|
||||
"pattern": "^$|^(?:[a-zA-Z0-9]+-)*[a-zA-Z0-9]+/[a-zA-Z0-9-_]+$",
|
||||
"patternErrorMessage": "Please enter a valid GitHub repository",
|
||||
"markdownDescription": "[For internal use only] The name of the GitHub repository in which the GitHub Actions workflow is run when using the \"Run Variant Analysis\" command. The repository should be of the form `<owner>/<repo>`)."
|
||||
},
|
||||
"codeQL.logInsights.joinOrderWarningThreshold": {
|
||||
"type": "number",
|
||||
"default": 50,
|
||||
"scope": "window",
|
||||
"minimum": 0,
|
||||
"description": "Report a warning for any join order whose metric exceeds this value."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -313,6 +328,10 @@
|
||||
"command": "codeQL.exportVariantAnalysisResults",
|
||||
"title": "CodeQL: Export Variant Analysis Results"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.openVariantAnalysis",
|
||||
"title": "CodeQL: Open Variant Analysis"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.runQueries",
|
||||
"title": "CodeQL: Run Queries in Selected Files"
|
||||
@@ -341,6 +360,14 @@
|
||||
"command": "codeQL.copyVersion",
|
||||
"title": "CodeQL: Copy Version Information"
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabasesExperimental.openConfigFile",
|
||||
"title": "Open Database Configuration File",
|
||||
"icon": {
|
||||
"light": "media/light/edit.svg",
|
||||
"dark": "media/dark/edit.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabases.chooseDatabaseFolder",
|
||||
"title": "Choose Database from Folder",
|
||||
@@ -590,12 +617,20 @@
|
||||
"title": "Copy Repository List"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueryResults.nextPathStep",
|
||||
"title": "CodeQL: Show Next Step on Path"
|
||||
"command": "codeQLQueryResults.down",
|
||||
"title": "CodeQL: Navigate Down in Local Result Viewer"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueryResults.previousPathStep",
|
||||
"title": "CodeQL: Show Previous Step on Path"
|
||||
"command": "codeQLQueryResults.up",
|
||||
"title": "CodeQL: Navigate Up in Local Result Viewer"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueryResults.right",
|
||||
"title": "CodeQL: Navigate Right in Local Result Viewer"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueryResults.left",
|
||||
"title": "CodeQL: Navigate Left in Local Result Viewer"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.restartQueryServer",
|
||||
@@ -633,6 +668,26 @@
|
||||
"command": "codeQL.gotoQL",
|
||||
"title": "CodeQL: Go to QL Code",
|
||||
"enablement": "codeql.hasQLSource"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.startRecording",
|
||||
"title": "CodeQL: Mock GitHub API Server: Start Scenario Recording"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.saveScenario",
|
||||
"title": "CodeQL: Mock GitHub API Server: Save Scenario"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.cancelRecording",
|
||||
"title": "CodeQL: Mock GitHub API Server: Cancel Scenario Recording"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.loadScenario",
|
||||
"title": "CodeQL: Mock GitHub API Server: Load Scenario"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.unloadScenario",
|
||||
"title": "CodeQL: Mock GitHub API Server: Unload Scenario"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
@@ -669,7 +724,7 @@
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabases.chooseDatabaseLgtm",
|
||||
"when": "view == codeQLDatabases",
|
||||
"when": "config.codeQL.canary && view == codeQLDatabases",
|
||||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
@@ -711,6 +766,11 @@
|
||||
"command": "codeQLEvalLogViewer.clear",
|
||||
"when": "view == codeQLEvalLogViewer",
|
||||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabasesExperimental.openConfigFile",
|
||||
"when": "view == codeQLDatabasesExperimental",
|
||||
"group": "navigation"
|
||||
}
|
||||
],
|
||||
"view/item/context": [
|
||||
@@ -724,11 +784,6 @@
|
||||
"group": "9_qlCommands",
|
||||
"when": "view == codeQLDatabases"
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabases.upgradeDatabase",
|
||||
"group": "9_qlCommands",
|
||||
"when": "view == codeQLDatabases"
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabases.renameDatabase",
|
||||
"group": "9_qlCommands",
|
||||
@@ -752,7 +807,7 @@
|
||||
{
|
||||
"command": "codeQLQueryHistory.removeHistoryItem",
|
||||
"group": "9_qlCommands",
|
||||
"when": "viewItem == interpretedResultsItem || viewItem == rawResultsItem || viewItem == remoteResultsItem || viewItem == cancelledResultsItem"
|
||||
"when": "viewItem == interpretedResultsItem || viewItem == rawResultsItem || viewItem == remoteResultsItem || viewItem == cancelledResultsItem || viewItem == cancelledRemoteResultsItem"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueryHistory.setLabel",
|
||||
@@ -827,7 +882,7 @@
|
||||
{
|
||||
"command": "codeQLQueryHistory.openOnGithub",
|
||||
"group": "9_qlCommands",
|
||||
"when": "viewItem == remoteResultsItem || viewItem == inProgressRemoteResultsItem || viewItem == cancelledResultsItem"
|
||||
"when": "viewItem == remoteResultsItem || viewItem == inProgressRemoteResultsItem || viewItem == cancelledRemoteResultsItem"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueryHistory.copyRepoList",
|
||||
@@ -894,6 +949,10 @@
|
||||
"command": "codeQL.runVariantAnalysis",
|
||||
"when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.openVariantAnalysis",
|
||||
"when": "config.codeQL.canary && config.codeQL.variantAnalysis.liveResults"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.exportVariantAnalysisResults",
|
||||
"when": "config.codeQL.canary"
|
||||
@@ -926,6 +985,14 @@
|
||||
"command": "codeQL.viewCfg",
|
||||
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.chooseDatabaseLgtm",
|
||||
"when": "config.codeQL.canary"
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabasesExperimental.openConfigFile",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "codeQLDatabases.setCurrentDatabase",
|
||||
"when": "false"
|
||||
@@ -1089,6 +1156,26 @@
|
||||
{
|
||||
"command": "codeQLTests.showOutputDifferences",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.startRecording",
|
||||
"when": "config.codeQL.mockGitHubApiServer.enabled && !codeQL.mockGitHubApiServer.recording"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.saveScenario",
|
||||
"when": "config.codeQL.mockGitHubApiServer.enabled && codeQL.mockGitHubApiServer.recording"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.cancelRecording",
|
||||
"when": "config.codeQL.mockGitHubApiServer.enabled && codeQL.mockGitHubApiServer.recording"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.loadScenario",
|
||||
"when": "config.codeQL.mockGitHubApiServer.enabled && !codeQL.mockGitHubApiServer.recording"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.mockGitHubApiServer.unloadScenario",
|
||||
"when": "config.codeQL.mockGitHubApiServer.enabled && codeQL.mockGitHubApiServer.scenarioLoaded"
|
||||
}
|
||||
],
|
||||
"editor/context": [
|
||||
@@ -1145,6 +1232,11 @@
|
||||
"id": "codeQLDatabases",
|
||||
"name": "Databases"
|
||||
},
|
||||
{
|
||||
"id": "codeQLDatabasesExperimental",
|
||||
"name": "Databases",
|
||||
"when": "config.codeQL.canary && config.codeQL.newQueryRunExperience"
|
||||
},
|
||||
{
|
||||
"id": "codeQLQueryHistory",
|
||||
"name": "Query History"
|
||||
@@ -1171,7 +1263,7 @@
|
||||
},
|
||||
{
|
||||
"view": "codeQLDatabases",
|
||||
"contents": "Add a CodeQL database:\n[From a folder](command:codeQLDatabases.chooseDatabaseFolder)\n[From an archive](command:codeQLDatabases.chooseDatabaseArchive)\n[From a URL (as a zip file)](command:codeQLDatabases.chooseDatabaseInternet)\n[From GitHub](command:codeQLDatabases.chooseDatabaseGithub)\n[From LGTM](command:codeQLDatabases.chooseDatabaseLgtm)"
|
||||
"contents": "Add a CodeQL database:\n[From a folder](command:codeQLDatabases.chooseDatabaseFolder)\n[From an archive](command:codeQLDatabases.chooseDatabaseArchive)\n[From a URL (as a zip file)](command:codeQLDatabases.chooseDatabaseInternet)\n[From GitHub](command:codeQLDatabases.chooseDatabaseGithub)"
|
||||
},
|
||||
{
|
||||
"view": "codeQLEvalLogViewer",
|
||||
@@ -1184,23 +1276,32 @@
|
||||
"watch": "npm-run-all -p watch:*",
|
||||
"watch:extension": "tsc --watch",
|
||||
"watch:webpack": "gulp watchView",
|
||||
"test": "mocha --exit -r ts-node/register test/pure-tests/**/*.ts",
|
||||
"preintegration": "rm -rf ./out/vscode-tests && gulp",
|
||||
"watch:files": "gulp watchTestData",
|
||||
"test": "npm-run-all -p test:*",
|
||||
"test:unit": "mocha --config .mocharc.json 'test/pure-tests/**/*.ts'",
|
||||
"test:view": "jest",
|
||||
"integration": "node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace",
|
||||
"cli-integration": "npm run preintegration && node ./out/vscode-tests/run-integration-tests.js cli-integration",
|
||||
"integration:no-workspace": "node ./out/vscode-tests/run-integration-tests.js no-workspace",
|
||||
"integration:minimal-workspace": "node ./out/vscode-tests/run-integration-tests.js minimal-workspace",
|
||||
"cli-integration": "node ./out/vscode-tests/run-integration-tests.js cli-integration",
|
||||
"update-vscode": "node ./node_modules/vscode/bin/install",
|
||||
"format": "tsfmt -r && eslint src test --ext .ts,.tsx --fix",
|
||||
"lint": "eslint src test --ext .ts,.tsx --max-warnings=0",
|
||||
"format-staged": "lint-staged"
|
||||
"format": "tsfmt -r && eslint . --ext .ts,.tsx --fix",
|
||||
"lint": "eslint . --ext .ts,.tsx --max-warnings=0",
|
||||
"format-staged": "lint-staged",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"build-storybook": "build-storybook",
|
||||
"lint:scenarios": "ts-node scripts/lint-scenarios.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
"@octokit/rest": "^18.5.6",
|
||||
"@primer/octicons-react": "^16.3.0",
|
||||
"@octokit/rest": "^19.0.4",
|
||||
"@primer/octicons-react": "^17.6.0",
|
||||
"@primer/react": "^35.0.0",
|
||||
"@vscode/codicons": "^0.0.31",
|
||||
"@vscode/webview-ui-toolkit": "^1.0.1",
|
||||
"ajv": "^8.11.0",
|
||||
"child-process-promise": "^2.2.1",
|
||||
"chokidar": "^3.5.3",
|
||||
"classnames": "~2.2.6",
|
||||
"d3": "^7.6.1",
|
||||
"d3-graphviz": "^2.6.1",
|
||||
@@ -1209,8 +1310,10 @@
|
||||
"immutable": "^4.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"minimist": "~1.2.6",
|
||||
"msw": "^0.47.4",
|
||||
"nanoid": "^3.2.0",
|
||||
"node-fetch": "~2.6.7",
|
||||
"p-queue": "^6.0.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
@@ -1233,6 +1336,21 @@
|
||||
"zip-a-folder": "~1.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.13",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
|
||||
"@faker-js/faker": "^7.5.0",
|
||||
"@octokit/plugin-throttling": "^4.3.2",
|
||||
"@storybook/addon-actions": "^6.5.10",
|
||||
"@storybook/addon-essentials": "^6.5.10",
|
||||
"@storybook/addon-interactions": "^6.5.10",
|
||||
"@storybook/addon-links": "^6.5.10",
|
||||
"@storybook/builder-webpack5": "^6.5.10",
|
||||
"@storybook/manager-webpack5": "^6.5.10",
|
||||
"@storybook/react": "^6.5.10",
|
||||
"@storybook/testing-library": "^0.0.13",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^12.1.5",
|
||||
"@testing-library/user-event": "^14.4.3",
|
||||
"@types/chai": "^4.1.7",
|
||||
"@types/chai-as-promised": "~7.1.2",
|
||||
"@types/child-process-promise": "^2.2.1",
|
||||
@@ -1246,6 +1364,7 @@
|
||||
"@types/gulp": "^4.0.9",
|
||||
"@types/gulp-replace": "^1.1.0",
|
||||
"@types/gulp-sourcemaps": "0.0.32",
|
||||
"@types/jest": "^29.0.2",
|
||||
"@types/js-yaml": "^3.12.5",
|
||||
"@types/jszip": "~3.1.6",
|
||||
"@types/mocha": "^9.0.0",
|
||||
@@ -1270,14 +1389,19 @@
|
||||
"@types/xml2js": "~0.4.4",
|
||||
"@typescript-eslint/eslint-plugin": "^4.26.0",
|
||||
"@typescript-eslint/parser": "^4.26.0",
|
||||
"@vscode/test-electron": "^2.2.0",
|
||||
"ansi-colors": "^4.1.1",
|
||||
"applicationinsights": "^1.8.7",
|
||||
"applicationinsights": "^2.3.5",
|
||||
"babel-loader": "^8.2.5",
|
||||
"chai": "^4.2.0",
|
||||
"chai-as-promised": "~7.1.1",
|
||||
"css-loader": "~3.1.0",
|
||||
"del": "^6.0.0",
|
||||
"eslint": "~6.8.0",
|
||||
"eslint-plugin-jest-dom": "^4.0.2",
|
||||
"eslint-plugin-react": "~7.19.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-storybook": "^0.6.4",
|
||||
"file-loader": "^6.2.0",
|
||||
"glob": "^7.1.4",
|
||||
"gulp": "^4.0.2",
|
||||
@@ -1285,6 +1409,8 @@
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-typescript": "^5.0.1",
|
||||
"husky": "~4.3.8",
|
||||
"jest": "^29.0.3",
|
||||
"jest-environment-jsdom": "^29.0.3",
|
||||
"lint-staged": "~10.2.2",
|
||||
"mini-css-extract-plugin": "^2.6.1",
|
||||
"mocha": "^10.0.0",
|
||||
@@ -1292,16 +1418,17 @@
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "~2.0.5",
|
||||
"proxyquire": "~2.1.3",
|
||||
"sinon": "~13.0.1",
|
||||
"sinon": "~14.0.0",
|
||||
"sinon-chai": "~3.5.0",
|
||||
"through2": "^4.0.2",
|
||||
"ts-jest": "^29.0.1",
|
||||
"ts-json-schema-generator": "^1.1.2",
|
||||
"ts-loader": "^8.1.0",
|
||||
"ts-node": "^10.7.0",
|
||||
"ts-protoc-gen": "^0.9.0",
|
||||
"typescript": "^4.5.5",
|
||||
"typescript-formatter": "^7.2.2",
|
||||
"vsce": "^2.7.0",
|
||||
"vscode-test": "^1.4.0",
|
||||
"webpack": "^5.62.2",
|
||||
"webpack-cli": "^4.6.0"
|
||||
},
|
||||
|
||||
128
extensions/ql-vscode/scripts/add-fields-to-scenarios.ts
Normal file
128
extensions/ql-vscode/scripts/add-fields-to-scenarios.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* This scripts helps after adding a new field in the GitHub API. You will
|
||||
* need to modify this script to add the new field to the scenarios. This
|
||||
* is just a template and should not be used as-is since it has already been
|
||||
* applied.
|
||||
*
|
||||
* Depending on the actual implementation of the script, you might run into
|
||||
* rate limits. If that happens, you can set a `GITHUB_TOKEN` environment
|
||||
* variable. For example, use: ``export GITHUB_TOKEN=`gh auth token```.
|
||||
*
|
||||
* Usage: npx ts-node scripts/add-fields-to-scenarios.ts
|
||||
*/
|
||||
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
|
||||
import { Octokit, type RestEndpointMethodTypes } from '@octokit/rest';
|
||||
import { throttling } from '@octokit/plugin-throttling';
|
||||
|
||||
import { getFiles } from './util/files';
|
||||
import type { GitHubApiRequest } from '../src/mocks/gh-api-request';
|
||||
import { isGetVariantAnalysisRequest } from '../src/mocks/gh-api-request';
|
||||
import { VariantAnalysis } from '../src/remote-queries/gh-api/variant-analysis';
|
||||
import { RepositoryWithMetadata } from '../src/remote-queries/gh-api/repository';
|
||||
|
||||
const extensionDirectory = path.resolve(__dirname, '..');
|
||||
const scenariosDirectory = path.resolve(extensionDirectory, 'src/mocks/scenarios');
|
||||
|
||||
// Make sure we don't run into rate limits by automatically waiting until we can
|
||||
// make another request.
|
||||
const MyOctokit = Octokit.plugin(throttling);
|
||||
|
||||
const auth = process.env.GITHUB_TOKEN;
|
||||
|
||||
const octokit = new MyOctokit({
|
||||
auth,
|
||||
throttle: {
|
||||
onRateLimit: (retryAfter: number, options: any, octokit: Octokit): boolean => {
|
||||
octokit.log.warn(
|
||||
`Request quota exhausted for request ${options.method} ${options.url}. Retrying after ${retryAfter} seconds!`
|
||||
);
|
||||
|
||||
return true;
|
||||
},
|
||||
onSecondaryRateLimit: (_retryAfter: number, options: any, octokit: Octokit): void => {
|
||||
octokit.log.warn(
|
||||
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
const repositories = new Map<number, RestEndpointMethodTypes['repos']['get']['response']['data']>();
|
||||
|
||||
async function addFieldsToRepository(repository: RepositoryWithMetadata) {
|
||||
if (!repositories.has(repository.id)) {
|
||||
const [owner, repo] = repository.full_name.split('/');
|
||||
|
||||
const apiRepository = await octokit.repos.get({
|
||||
owner,
|
||||
repo,
|
||||
});
|
||||
|
||||
repositories.set(repository.id, apiRepository.data);
|
||||
}
|
||||
|
||||
const apiRepository = repositories.get(repository.id)!;
|
||||
|
||||
repository.stargazers_count = apiRepository.stargazers_count;
|
||||
repository.updated_at = apiRepository.updated_at;
|
||||
}
|
||||
|
||||
async function addFieldsToScenarios() {
|
||||
if (!(await fs.pathExists(scenariosDirectory))) {
|
||||
console.error('Scenarios directory does not exist: ' + scenariosDirectory);
|
||||
return;
|
||||
}
|
||||
|
||||
for await (const file of getFiles(scenariosDirectory)) {
|
||||
if (!file.endsWith('.json')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const data: GitHubApiRequest = await fs.readJson(file);
|
||||
|
||||
if (!isGetVariantAnalysisRequest(data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!data.response.body || !('controller_repo' in data.response.body)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
console.log(`Adding fields to '${path.relative(scenariosDirectory, file)}'`);
|
||||
|
||||
const variantAnalysis = data.response.body as VariantAnalysis;
|
||||
|
||||
if (variantAnalysis.scanned_repositories) {
|
||||
for (const item of variantAnalysis.scanned_repositories) {
|
||||
await addFieldsToRepository(item.repository);
|
||||
}
|
||||
}
|
||||
|
||||
if (variantAnalysis.skipped_repositories?.access_mismatch_repos) {
|
||||
for (const item of variantAnalysis.skipped_repositories.access_mismatch_repos.repositories) {
|
||||
await addFieldsToRepository(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (variantAnalysis.skipped_repositories?.no_codeql_db_repos) {
|
||||
for (const item of variantAnalysis.skipped_repositories.no_codeql_db_repos.repositories) {
|
||||
await addFieldsToRepository(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (variantAnalysis.skipped_repositories?.over_limit_repos) {
|
||||
for (const item of variantAnalysis.skipped_repositories.over_limit_repos.repositories) {
|
||||
await addFieldsToRepository(item);
|
||||
}
|
||||
}
|
||||
|
||||
await fs.writeJson(file, data, { spaces: 2 });
|
||||
}
|
||||
}
|
||||
|
||||
addFieldsToScenarios().catch(e => {
|
||||
console.error(e);
|
||||
process.exit(2);
|
||||
});
|
||||
78
extensions/ql-vscode/scripts/fix-scenario-file-numbering.ts
Normal file
78
extensions/ql-vscode/scripts/fix-scenario-file-numbering.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* This scripts helps after recording a scenario to be used for replaying
|
||||
* with the mock GitHub API server.
|
||||
*
|
||||
* Once the scenario has been recorded, it's often useful to remove some of
|
||||
* the requests to speed up the replay, particularly ones that fetch the
|
||||
* variant analysis status. Once some of the requests have manually been
|
||||
* removed, this script can be used to update the numbering of the files.
|
||||
*
|
||||
* Usage: npx ts-node scripts/fix-scenario-file-numbering.ts <scenario-name>
|
||||
*/
|
||||
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
|
||||
if (process.argv.length !== 3) {
|
||||
console.error('Expected 1 argument - the scenario name');
|
||||
}
|
||||
|
||||
const scenarioName = process.argv[2];
|
||||
|
||||
const extensionDirectory = path.resolve(__dirname, '..');
|
||||
const scenariosDirectory = path.resolve(extensionDirectory, 'src/mocks/scenarios');
|
||||
const scenarioDirectory = path.resolve(scenariosDirectory, scenarioName);
|
||||
|
||||
async function fixScenarioFiles() {
|
||||
console.log(scenarioDirectory);
|
||||
if (!(await fs.pathExists(scenarioDirectory))) {
|
||||
console.error('Scenario directory does not exist: ' + scenarioDirectory);
|
||||
return;
|
||||
}
|
||||
|
||||
const files = await fs.readdir(scenarioDirectory);
|
||||
|
||||
const orderedFiles = files.sort((a, b) => {
|
||||
const aNum = parseInt(a.split('-')[0]);
|
||||
const bNum = parseInt(b.split('-')[0]);
|
||||
return aNum - bNum;
|
||||
});
|
||||
|
||||
let index = 0;
|
||||
for (const file of orderedFiles) {
|
||||
const ext = path.extname(file);
|
||||
if (ext === '.json') {
|
||||
const fileName = path.basename(file, ext);
|
||||
const fileCurrentIndex = parseInt(fileName.split('-')[0]);
|
||||
const fileNameWithoutIndex = fileName.split('-')[1];
|
||||
if (fileCurrentIndex !== index) {
|
||||
const newFileName = `${index}-${fileNameWithoutIndex}${ext}`;
|
||||
const oldFilePath = path.join(scenarioDirectory, file);
|
||||
const newFilePath = path.join(scenarioDirectory, newFileName);
|
||||
console.log(`Rename: ${oldFilePath} -> ${newFilePath}`);
|
||||
await fs.rename(oldFilePath, newFilePath);
|
||||
|
||||
if (fileNameWithoutIndex === 'getVariantAnalysisRepoResult') {
|
||||
const oldZipFileName = `${fileCurrentIndex}-getVariantAnalysisRepoResult.body.zip`;
|
||||
const newZipFileName = `${index}-getVariantAnalysisRepoResult.body.zip`;
|
||||
const oldZipFilePath = path.join(scenarioDirectory, oldZipFileName);
|
||||
const newZipFilePath = path.join(scenarioDirectory, newZipFileName);
|
||||
console.log(`Rename: ${oldZipFilePath} -> ${newZipFilePath}`);
|
||||
await fs.rename(oldZipFilePath, newZipFilePath);
|
||||
|
||||
const json = await fs.readJson(newFilePath);
|
||||
json.response.body = `file:${newZipFileName}`;
|
||||
console.log(`Response.body change to ${json.response.body}`);
|
||||
await fs.writeJSON(newFilePath, json);
|
||||
}
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixScenarioFiles().catch(e => {
|
||||
console.error(e);
|
||||
process.exit(2);
|
||||
});
|
||||
68
extensions/ql-vscode/scripts/lint-scenarios.ts
Normal file
68
extensions/ql-vscode/scripts/lint-scenarios.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
|
||||
import Ajv from 'ajv';
|
||||
import * as tsj from 'ts-json-schema-generator';
|
||||
|
||||
import { getFiles } from './util/files';
|
||||
|
||||
const extensionDirectory = path.resolve(__dirname, '..');
|
||||
const rootDirectory = path.resolve(extensionDirectory, '../..');
|
||||
const scenariosDirectory = path.resolve(extensionDirectory, 'src/mocks/scenarios');
|
||||
|
||||
const debug = process.env.RUNNER_DEBUG || process.argv.includes('--debug');
|
||||
|
||||
async function lintScenarios() {
|
||||
const schema = tsj.createGenerator({
|
||||
path: path.resolve(extensionDirectory, 'src/mocks/gh-api-request.ts'),
|
||||
tsconfig: path.resolve(extensionDirectory, 'tsconfig.json'),
|
||||
type: 'GitHubApiRequest',
|
||||
skipTypeCheck: true,
|
||||
topRef: true,
|
||||
additionalProperties: true,
|
||||
}).createSchema('GitHubApiRequest');
|
||||
|
||||
const ajv = new Ajv();
|
||||
|
||||
if (!ajv.validateSchema(schema)) {
|
||||
throw new Error('Invalid schema: ' + ajv.errorsText());
|
||||
}
|
||||
|
||||
const validate = await ajv.compile(schema);
|
||||
|
||||
let invalidFiles = 0;
|
||||
|
||||
if (!(await fs.pathExists(scenariosDirectory))) {
|
||||
console.error('Scenarios directory does not exist: ' + scenariosDirectory);
|
||||
// Do not exit with a non-zero status code, as this is not a fatal error.
|
||||
return;
|
||||
}
|
||||
|
||||
for await (const file of getFiles(scenariosDirectory)) {
|
||||
if (!file.endsWith('.json')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const contents = await fs.readFile(file, 'utf8');
|
||||
const data = JSON.parse(contents);
|
||||
|
||||
if (!validate(data)) {
|
||||
validate.errors?.forEach(error => {
|
||||
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message
|
||||
console.log(`::error file=${path.relative(rootDirectory, file)}::${error.instancePath}: ${error.message}`);
|
||||
});
|
||||
invalidFiles++;
|
||||
} else if (debug) {
|
||||
console.log(`File '${path.relative(rootDirectory, file)}' is valid`);
|
||||
}
|
||||
}
|
||||
|
||||
if (invalidFiles > 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
lintScenarios().catch(e => {
|
||||
console.error(e);
|
||||
process.exit(2);
|
||||
});
|
||||
10
extensions/ql-vscode/scripts/tsconfig.json
Normal file
10
extensions/ql-vscode/scripts/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "../tsconfig.json",
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": [],
|
||||
"compilerOptions": {
|
||||
"rootDir": "..",
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
15
extensions/ql-vscode/scripts/util/files.ts
Normal file
15
extensions/ql-vscode/scripts/util/files.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
|
||||
// https://stackoverflow.com/a/45130990
|
||||
export async function* getFiles(dir: string): AsyncGenerator<string> {
|
||||
const dirents = await fs.readdir(dir, { withFileTypes: true });
|
||||
for (const dirent of dirents) {
|
||||
const res = path.resolve(dir, dirent.name);
|
||||
if (dirent.isDirectory()) {
|
||||
yield* getFiles(res);
|
||||
} else {
|
||||
yield res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
import {
|
||||
WebviewPanel,
|
||||
ExtensionContext,
|
||||
window as Window,
|
||||
ViewColumn,
|
||||
Uri,
|
||||
WebviewPanelOptions,
|
||||
WebviewOptions
|
||||
} from 'vscode';
|
||||
import * as path from 'path';
|
||||
|
||||
import { DisposableObject } from './pure/disposable-object';
|
||||
import { tmpDir } from './helpers';
|
||||
import { getHtmlForWebview, WebviewMessage, WebviewView } from './interface-utils';
|
||||
|
||||
export type InterfacePanelConfig = {
|
||||
viewId: string;
|
||||
title: string;
|
||||
viewColumn: ViewColumn;
|
||||
view: WebviewView;
|
||||
preserveFocus?: boolean;
|
||||
additionalOptions?: WebviewPanelOptions & WebviewOptions;
|
||||
}
|
||||
|
||||
export abstract class AbstractInterfaceManager<ToMessage extends WebviewMessage, FromMessage extends WebviewMessage> extends DisposableObject {
|
||||
protected panel: WebviewPanel | undefined;
|
||||
protected panelLoaded = false;
|
||||
protected panelLoadedCallBacks: (() => void)[] = [];
|
||||
|
||||
constructor(
|
||||
protected readonly ctx: ExtensionContext
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected get isShowingPanel() {
|
||||
return !!this.panel;
|
||||
}
|
||||
|
||||
protected getPanel(): WebviewPanel {
|
||||
if (this.panel == undefined) {
|
||||
const { ctx } = this;
|
||||
|
||||
const config = this.getPanelConfig();
|
||||
|
||||
this.panel = Window.createWebviewPanel(
|
||||
config.viewId,
|
||||
config.title,
|
||||
{ viewColumn: ViewColumn.Active, preserveFocus: true },
|
||||
{
|
||||
enableScripts: true,
|
||||
enableFindWidget: true,
|
||||
retainContextWhenHidden: true,
|
||||
...config.additionalOptions,
|
||||
localResourceRoots: [
|
||||
...(config.additionalOptions?.localResourceRoots ?? []),
|
||||
Uri.file(tmpDir.name),
|
||||
Uri.file(path.join(ctx.extensionPath, 'out'))
|
||||
],
|
||||
}
|
||||
);
|
||||
this.push(
|
||||
this.panel.onDidDispose(
|
||||
() => {
|
||||
this.panel = undefined;
|
||||
this.panelLoaded = false;
|
||||
this.onPanelDispose();
|
||||
},
|
||||
null,
|
||||
ctx.subscriptions
|
||||
)
|
||||
);
|
||||
|
||||
this.panel.webview.html = getHtmlForWebview(
|
||||
ctx,
|
||||
this.panel.webview,
|
||||
config.view,
|
||||
{
|
||||
allowInlineStyles: true,
|
||||
}
|
||||
);
|
||||
this.push(
|
||||
this.panel.webview.onDidReceiveMessage(
|
||||
async (e) => this.onMessage(e),
|
||||
undefined,
|
||||
ctx.subscriptions
|
||||
)
|
||||
);
|
||||
}
|
||||
return this.panel;
|
||||
}
|
||||
|
||||
protected abstract getPanelConfig(): InterfacePanelConfig;
|
||||
|
||||
protected abstract onPanelDispose(): void;
|
||||
|
||||
protected abstract onMessage(msg: FromMessage): Promise<void>;
|
||||
|
||||
protected waitForPanelLoaded(): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
if (this.panelLoaded) {
|
||||
resolve();
|
||||
} else {
|
||||
this.panelLoadedCallBacks.push(resolve);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected onWebViewLoaded(): void {
|
||||
this.panelLoaded = true;
|
||||
this.panelLoadedCallBacks.forEach((cb) => cb());
|
||||
this.panelLoadedCallBacks = [];
|
||||
}
|
||||
|
||||
protected postMessage(msg: ToMessage): Thenable<boolean> {
|
||||
return this.getPanel().webview.postMessage(msg);
|
||||
}
|
||||
}
|
||||
156
extensions/ql-vscode/src/abstract-webview.ts
Normal file
156
extensions/ql-vscode/src/abstract-webview.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
import {
|
||||
WebviewPanel,
|
||||
ExtensionContext,
|
||||
window as Window,
|
||||
ViewColumn,
|
||||
Uri,
|
||||
WebviewPanelOptions,
|
||||
WebviewOptions,
|
||||
} from 'vscode';
|
||||
import * as path from 'path';
|
||||
|
||||
import { DisposableObject, DisposeHandler } from './pure/disposable-object';
|
||||
import { tmpDir } from './helpers';
|
||||
import { getHtmlForWebview, WebviewMessage, WebviewView } from './interface-utils';
|
||||
|
||||
export type WebviewPanelConfig = {
|
||||
viewId: string;
|
||||
title: string;
|
||||
viewColumn: ViewColumn;
|
||||
view: WebviewView;
|
||||
preserveFocus?: boolean;
|
||||
additionalOptions?: WebviewPanelOptions & WebviewOptions;
|
||||
}
|
||||
|
||||
export abstract class AbstractWebview<ToMessage extends WebviewMessage, FromMessage extends WebviewMessage> extends DisposableObject {
|
||||
protected panel: WebviewPanel | undefined;
|
||||
protected panelLoaded = false;
|
||||
protected panelLoadedCallBacks: (() => void)[] = [];
|
||||
|
||||
private panelResolves?: Array<(panel: WebviewPanel) => void>;
|
||||
|
||||
constructor(
|
||||
protected readonly ctx: ExtensionContext
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
public async restoreView(panel: WebviewPanel): Promise<void> {
|
||||
this.panel = panel;
|
||||
const config = await this.getPanelConfig();
|
||||
this.setupPanel(panel, config);
|
||||
}
|
||||
|
||||
protected get isShowingPanel() {
|
||||
return !!this.panel;
|
||||
}
|
||||
|
||||
protected async getPanel(): Promise<WebviewPanel> {
|
||||
if (this.panel == undefined) {
|
||||
const { ctx } = this;
|
||||
|
||||
// This is an async method, so in theory this method can be called concurrently. To ensure that we don't
|
||||
// create two panels, we use a promise that resolves when the panel is created. This way, if the panel is
|
||||
// being created, the promise will resolve when it is done.
|
||||
if (this.panelResolves !== undefined) {
|
||||
return new Promise((resolve) => {
|
||||
if (this.panel !== undefined) {
|
||||
resolve(this.panel);
|
||||
return;
|
||||
}
|
||||
|
||||
this.panelResolves?.push(resolve);
|
||||
});
|
||||
}
|
||||
this.panelResolves = [];
|
||||
|
||||
const config = await this.getPanelConfig();
|
||||
|
||||
const panel = Window.createWebviewPanel(
|
||||
config.viewId,
|
||||
config.title,
|
||||
{ viewColumn: config.viewColumn, preserveFocus: config.preserveFocus },
|
||||
{
|
||||
enableScripts: true,
|
||||
enableFindWidget: true,
|
||||
retainContextWhenHidden: true,
|
||||
...config.additionalOptions,
|
||||
localResourceRoots: [
|
||||
...(config.additionalOptions?.localResourceRoots ?? []),
|
||||
Uri.file(tmpDir.name),
|
||||
Uri.file(path.join(ctx.extensionPath, 'out'))
|
||||
],
|
||||
}
|
||||
);
|
||||
this.panel = panel;
|
||||
|
||||
this.setupPanel(panel, config);
|
||||
|
||||
this.panelResolves.forEach((resolve) => resolve(panel));
|
||||
this.panelResolves = undefined;
|
||||
}
|
||||
return this.panel;
|
||||
}
|
||||
|
||||
protected setupPanel(panel: WebviewPanel, config: WebviewPanelConfig): void {
|
||||
this.push(
|
||||
panel.onDidDispose(
|
||||
() => {
|
||||
this.panel = undefined;
|
||||
this.panelLoaded = false;
|
||||
this.onPanelDispose();
|
||||
},
|
||||
null,
|
||||
this.ctx.subscriptions
|
||||
)
|
||||
);
|
||||
|
||||
panel.webview.html = getHtmlForWebview(
|
||||
this.ctx,
|
||||
panel.webview,
|
||||
config.view,
|
||||
{
|
||||
allowInlineStyles: true,
|
||||
}
|
||||
);
|
||||
this.push(
|
||||
panel.webview.onDidReceiveMessage(
|
||||
async (e) => this.onMessage(e),
|
||||
undefined,
|
||||
this.ctx.subscriptions
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected abstract getPanelConfig(): WebviewPanelConfig | Promise<WebviewPanelConfig>;
|
||||
|
||||
protected abstract onPanelDispose(): void;
|
||||
|
||||
protected abstract onMessage(msg: FromMessage): Promise<void>;
|
||||
|
||||
protected waitForPanelLoaded(): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
if (this.panelLoaded) {
|
||||
resolve();
|
||||
} else {
|
||||
this.panelLoadedCallBacks.push(resolve);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected onWebViewLoaded(): void {
|
||||
this.panelLoaded = true;
|
||||
this.panelLoadedCallBacks.forEach((cb) => cb());
|
||||
this.panelLoadedCallBacks = [];
|
||||
}
|
||||
|
||||
protected async postMessage(msg: ToMessage): Promise<boolean> {
|
||||
const panel = await this.getPanel();
|
||||
return panel.webview.postMessage(msg);
|
||||
}
|
||||
|
||||
public dispose(disposeHandler?: DisposeHandler) {
|
||||
this.panel?.dispose();
|
||||
super.dispose(disposeHandler);
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,12 @@ import { promisify } from 'util';
|
||||
import { CancellationToken, commands, Disposable, Uri } from 'vscode';
|
||||
|
||||
import { BQRSInfo, DecodedBqrsChunk } from './pure/bqrs-cli-types';
|
||||
import { CliConfig } from './config';
|
||||
import { allowCanaryQueryServer, CliConfig } from './config';
|
||||
import { DistributionProvider, FindDistributionResultKind } from './distribution';
|
||||
import { assertNever, getErrorMessage, getErrorStack } from './pure/helpers-pure';
|
||||
import { QueryMetadata, SortDirection } from './pure/interface-types';
|
||||
import { Logger, ProgressReporter } from './logging';
|
||||
import { CompilationMessage } from './pure/messages';
|
||||
import { CompilationMessage } from './pure/legacy-messages';
|
||||
import { sarifParser } from './sarif-parser';
|
||||
import { dbSchemeToLanguage, walkDirectory } from './helpers';
|
||||
|
||||
@@ -944,16 +944,14 @@ export class CodeQLCliServer implements Disposable {
|
||||
return this.runJsonCodeQlCliCommand(['pack', 'install'], args, 'Installing pack dependencies');
|
||||
}
|
||||
|
||||
async packBundle(dir: string, workspaceFolders: string[], outputPath: string, precompile = true): Promise<void> {
|
||||
async packBundle(dir: string, workspaceFolders: string[], outputPath: string, moreOptions: string[]): Promise<void> {
|
||||
const args = [
|
||||
'-o',
|
||||
outputPath,
|
||||
dir,
|
||||
...moreOptions,
|
||||
...this.getAdditionalPacksArg(workspaceFolders)
|
||||
];
|
||||
if (!precompile && await this.cliConstraints.supportsNoPrecompile()) {
|
||||
args.push('--no-precompile');
|
||||
}
|
||||
|
||||
return this.runJsonCodeQlCliCommand(['pack', 'bundle'], args, 'Bundling pack');
|
||||
}
|
||||
@@ -972,6 +970,12 @@ export class CodeQLCliServer implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
async packResolveDependencies(dir: string): Promise<{ [pack: string]: string }> {
|
||||
// Uses the default `--mode use-lock`, which creates the lock file if it doesn't exist.
|
||||
const results: { [pack: string]: string } = await this.runJsonCodeQlCliCommand(['pack', 'resolve-dependencies'], [dir], 'Resolving pack dependencies');
|
||||
return results;
|
||||
}
|
||||
|
||||
async generateDil(qloFile: string, outFile: string): Promise<void> {
|
||||
const extraArgs = await this.cliConstraints.supportsDecompileDil()
|
||||
? ['--kind', 'dil', '-o', outFile, qloFile]
|
||||
@@ -1248,6 +1252,9 @@ export class CliVersionConstraint {
|
||||
*/
|
||||
public static CLI_VERSION_WITH_LANGUAGE = new SemVer('2.4.1');
|
||||
|
||||
|
||||
public static CLI_VERSION_WITH_NONDESTURCTIVE_UPGRADES = new SemVer('2.4.2');
|
||||
|
||||
/**
|
||||
* CLI version where `codeql resolve upgrades` supports
|
||||
* the `--allow-downgrades` flag
|
||||
@@ -1261,7 +1268,7 @@ export class CliVersionConstraint {
|
||||
|
||||
/**
|
||||
* CLI version where database registration was introduced
|
||||
*/
|
||||
*/
|
||||
public static CLI_VERSION_WITH_DB_REGISTRATION = new SemVer('2.4.1');
|
||||
|
||||
/**
|
||||
@@ -1285,6 +1292,13 @@ export class CliVersionConstraint {
|
||||
*/
|
||||
public static CLI_VERSION_REMOTE_QUERIES = new SemVer('2.6.3');
|
||||
|
||||
/**
|
||||
* CLI version where building QLX packs for remote queries is supported.
|
||||
* (The options were _accepted_ by a few earlier versions, but only from
|
||||
* 2.11.3 will it actually use the existing compilation cache correctly).
|
||||
*/
|
||||
public static CLI_VERSION_QLX_REMOTE = new SemVer('2.11.3');
|
||||
|
||||
/**
|
||||
* CLI version where the `resolve ml-models` subcommand was introduced.
|
||||
*/
|
||||
@@ -1327,6 +1341,11 @@ export class CliVersionConstraint {
|
||||
*/
|
||||
public static CLI_VERSION_WITH_SOURCEMAP = new SemVer('2.10.3');
|
||||
|
||||
/**
|
||||
* CLI version that supports the new query server.
|
||||
*/
|
||||
public static CLI_VERSION_WITH_NEW_QUERY_SERVER = new SemVer('2.11.1');
|
||||
|
||||
constructor(private readonly cli: CodeQLCliServer) {
|
||||
/**/
|
||||
}
|
||||
@@ -1343,6 +1362,10 @@ export class CliVersionConstraint {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_LANGUAGE);
|
||||
}
|
||||
|
||||
public async supportsNonDestructiveUpgrades() {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_NONDESTURCTIVE_UPGRADES);
|
||||
}
|
||||
|
||||
public async supportsDowngrades() {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_DOWNGRADES);
|
||||
}
|
||||
@@ -1371,6 +1394,10 @@ export class CliVersionConstraint {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_REMOTE_QUERIES);
|
||||
}
|
||||
|
||||
async supportsQlxRemote() {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_QLX_REMOTE);
|
||||
}
|
||||
|
||||
async supportsResolveMlModels() {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_RESOLVE_ML_MODELS);
|
||||
}
|
||||
@@ -1398,4 +1425,15 @@ export class CliVersionConstraint {
|
||||
async supportsSourceMap() {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_SOURCEMAP);
|
||||
}
|
||||
|
||||
async supportsNewQueryServer() {
|
||||
// TODO while under development, users _must_ opt-in to the new query server
|
||||
// by setting the `codeql.canaryQueryServer` setting to `true`.
|
||||
return allowCanaryQueryServer() &&
|
||||
this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_NEW_QUERY_SERVER);
|
||||
}
|
||||
|
||||
async supportsNewQueryServerForTests() {
|
||||
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_NEW_QUERY_SERVER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ import resultsDiff from './resultsDiff';
|
||||
import { CompletedLocalQueryInfo } from '../query-results';
|
||||
import { getErrorMessage } from '../pure/helpers-pure';
|
||||
import { HistoryItemLabelProvider } from '../history-item-label-provider';
|
||||
import { AbstractInterfaceManager, InterfacePanelConfig } from '../abstract-interface-manager';
|
||||
import { AbstractWebview, WebviewPanelConfig } from '../abstract-webview';
|
||||
|
||||
interface ComparePair {
|
||||
from: CompletedLocalQueryInfo;
|
||||
to: CompletedLocalQueryInfo;
|
||||
}
|
||||
|
||||
export class CompareInterfaceManager extends AbstractInterfaceManager<ToCompareViewMessage, FromCompareViewMessage> {
|
||||
export class CompareView extends AbstractWebview<ToCompareViewMessage, FromCompareViewMessage> {
|
||||
private comparePair: ComparePair | undefined;
|
||||
|
||||
constructor(
|
||||
@@ -46,7 +46,8 @@ export class CompareInterfaceManager extends AbstractInterfaceManager<ToCompareV
|
||||
selectedResultSetName?: string
|
||||
) {
|
||||
this.comparePair = { from, to };
|
||||
this.getPanel().reveal(undefined, true);
|
||||
const panel = await this.getPanel();
|
||||
panel.reveal(undefined, true);
|
||||
|
||||
await this.waitForPanelLoaded();
|
||||
const [
|
||||
@@ -95,7 +96,7 @@ export class CompareInterfaceManager extends AbstractInterfaceManager<ToCompareV
|
||||
}
|
||||
}
|
||||
|
||||
protected getPanelConfig(): InterfacePanelConfig {
|
||||
protected getPanelConfig(): WebviewPanelConfig {
|
||||
return {
|
||||
viewId: 'compareView',
|
||||
title: 'Compare CodeQL Query Results',
|
||||
@@ -111,7 +112,7 @@ export class CompareInterfaceManager extends AbstractInterfaceManager<ToCompareV
|
||||
|
||||
protected async onMessage(msg: FromCompareViewMessage): Promise<void> {
|
||||
switch (msg.t) {
|
||||
case 'compareViewLoaded':
|
||||
case 'viewLoaded':
|
||||
this.onWebViewLoaded();
|
||||
break;
|
||||
|
||||
@@ -4,14 +4,25 @@ import { DistributionManager } from './distribution';
|
||||
import { logger } from './logging';
|
||||
import { ONE_DAY_IN_MS } from './pure/time';
|
||||
|
||||
export const ALL_SETTINGS: Setting[] = [];
|
||||
|
||||
/** Helper class to look up a labelled (and possibly nested) setting. */
|
||||
export class Setting {
|
||||
name: string;
|
||||
parent?: Setting;
|
||||
private _hasChildren = false;
|
||||
|
||||
constructor(name: string, parent?: Setting) {
|
||||
this.name = name;
|
||||
this.parent = parent;
|
||||
if (parent !== undefined) {
|
||||
parent._hasChildren = true;
|
||||
}
|
||||
ALL_SETTINGS.push(this);
|
||||
}
|
||||
|
||||
get hasChildren() {
|
||||
return this._hasChildren;
|
||||
}
|
||||
|
||||
get qualifiedName(): string {
|
||||
@@ -36,6 +47,18 @@ export class Setting {
|
||||
return workspace.getConfiguration(this.parent.qualifiedName).update(this.name, value, target);
|
||||
}
|
||||
|
||||
inspect<T>(): InspectionResult<T> | undefined {
|
||||
if (this.parent === undefined) {
|
||||
throw new Error('Cannot update the value of a root setting.');
|
||||
}
|
||||
return workspace.getConfiguration(this.parent.qualifiedName).inspect(this.name);
|
||||
}
|
||||
}
|
||||
|
||||
export interface InspectionResult<T> {
|
||||
globalValue?: T;
|
||||
workspaceValue?: T,
|
||||
workspaceFolderValue?: T,
|
||||
}
|
||||
|
||||
const ROOT_SETTING = new Setting('codeQL');
|
||||
@@ -44,6 +67,7 @@ const ROOT_SETTING = new Setting('codeQL');
|
||||
const TELEMETRY_SETTING = new Setting('telemetry', ROOT_SETTING);
|
||||
const AST_VIEWER_SETTING = new Setting('astViewer', ROOT_SETTING);
|
||||
const GLOBAL_TELEMETRY_SETTING = new Setting('telemetry');
|
||||
const LOG_INSIGHTS_SETTING = new Setting('logInsights', ROOT_SETTING);
|
||||
|
||||
export const LOG_TELEMETRY = new Setting('logTelemetry', TELEMETRY_SETTING);
|
||||
export const ENABLE_TELEMETRY = new Setting('enableTelemetry', TELEMETRY_SETTING);
|
||||
@@ -317,6 +341,22 @@ export function isCanary() {
|
||||
return !!CANARY_FEATURES.getValue<boolean>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the experimental query server
|
||||
*/
|
||||
export const CANARY_QUERY_SERVER = new Setting('canaryQueryServer', ROOT_SETTING);
|
||||
|
||||
|
||||
export function allowCanaryQueryServer() {
|
||||
return !!CANARY_QUERY_SERVER.getValue<boolean>();
|
||||
}
|
||||
|
||||
export const JOIN_ORDER_WARNING_THRESHOLD = new Setting('joinOrderWarningThreshold', LOG_INSIGHTS_SETTING);
|
||||
|
||||
export function joinOrderWarningThreshold(): number {
|
||||
return JOIN_ORDER_WARNING_THRESHOLD.getValue<number>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Avoids caching in the AST viewer if the user is also a canary user.
|
||||
*/
|
||||
@@ -343,12 +383,12 @@ export async function setRemoteRepositoryLists(lists: Record<string, string[]> |
|
||||
}
|
||||
|
||||
/**
|
||||
* Path to a file that contains lists of GitHub repositories that you want to query remotely via
|
||||
* Path to a file that contains lists of GitHub repositories that you want to query remotely via
|
||||
* the "Run Variant Analysis" command.
|
||||
* Note: This command is only available for internal users.
|
||||
*
|
||||
*
|
||||
* This setting should be a path to a JSON file that contains a JSON object where each key is a
|
||||
* user-specified name (string), and the value is an array of GitHub repositories
|
||||
* user-specified name (string), and the value is an array of GitHub repositories
|
||||
* (of the form `<owner>/<repo>`).
|
||||
*/
|
||||
const REPO_LISTS_PATH = new Setting('repositoryListsPath', REMOTE_QUERIES_SETTING);
|
||||
@@ -387,3 +427,62 @@ export function getActionBranch(): string {
|
||||
export function isIntegrationTestMode() {
|
||||
return process.env.INTEGRATION_TEST_MODE === 'true';
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether to enable the experimental "live results" feature
|
||||
* for multi-repo variant analyses.
|
||||
*/
|
||||
const LIVE_RESULTS = new Setting('liveResults', REMOTE_QUERIES_SETTING);
|
||||
|
||||
export function isVariantAnalysisLiveResultsEnabled(): boolean {
|
||||
return !!LIVE_RESULTS.getValue<boolean>();
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether to use the new query run experience which involves
|
||||
* using a new database panel.
|
||||
*/
|
||||
const NEW_QUERY_RUN_EXPERIENCE = new Setting('newQueryRunExperience', ROOT_SETTING);
|
||||
|
||||
export function isNewQueryRunExperienceEnabled(): boolean {
|
||||
return !!NEW_QUERY_RUN_EXPERIENCE.getValue<boolean>();
|
||||
}
|
||||
|
||||
// Settings for mocking the GitHub API.
|
||||
const MOCK_GH_API_SERVER = new Setting('mockGitHubApiServer', ROOT_SETTING);
|
||||
|
||||
/**
|
||||
* A flag indicating whether to enable a mock GitHub API server.
|
||||
*/
|
||||
const MOCK_GH_API_SERVER_ENABLED = new Setting('enabled', MOCK_GH_API_SERVER);
|
||||
|
||||
/**
|
||||
* A path to a directory containing test scenarios. If this setting is not set,
|
||||
* the mock server will a default location for test scenarios in dev mode, and
|
||||
* will show a menu to select a directory in production mode.
|
||||
*/
|
||||
const MOCK_GH_API_SERVER_SCENARIOS_PATH = new Setting('scenariosPath', MOCK_GH_API_SERVER);
|
||||
|
||||
export interface MockGitHubApiConfig {
|
||||
mockServerEnabled: boolean;
|
||||
mockScenariosPath: string;
|
||||
onDidChangeConfiguration: Event<void>;
|
||||
}
|
||||
|
||||
export class MockGitHubApiConfigListener extends ConfigListener implements MockGitHubApiConfig {
|
||||
protected handleDidChangeConfiguration(e: ConfigurationChangeEvent): void {
|
||||
this.handleDidChangeConfigurationForRelevantSettings([MOCK_GH_API_SERVER], e);
|
||||
}
|
||||
|
||||
public get mockServerEnabled(): boolean {
|
||||
return !!MOCK_GH_API_SERVER_ENABLED.getValue<boolean>();
|
||||
}
|
||||
|
||||
public get mockScenariosPath(): string {
|
||||
return MOCK_GH_API_SERVER_SCENARIOS_PATH.getValue<string>();
|
||||
}
|
||||
}
|
||||
|
||||
export function getMockGitHubApiServerScenariosPath(): string | undefined {
|
||||
return MOCK_GH_API_SERVER_SCENARIOS_PATH.getValue<string>();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { QueryWithResults } from '../run-queries';
|
||||
import { CodeQLCliServer } from '../cli';
|
||||
import { DecodedBqrsChunk, BqrsId, EntityValue } from '../pure/bqrs-cli-types';
|
||||
import { DatabaseItem } from '../databases';
|
||||
import { ChildAstItem, AstItem } from '../astViewer';
|
||||
import fileRangeFromURI from './fileRangeFromURI';
|
||||
import { Uri } from 'vscode';
|
||||
import { QueryWithResults } from '../run-queries-shared';
|
||||
|
||||
/**
|
||||
* A class that wraps a tree of QL results from a query that
|
||||
|
||||
@@ -3,13 +3,12 @@ import { ColumnKindCode, EntityValue, getResultSetSchema, ResultSetSchema } from
|
||||
import { CodeQLCliServer } from '../cli';
|
||||
import { DatabaseManager, DatabaseItem } from '../databases';
|
||||
import fileRangeFromURI from './fileRangeFromURI';
|
||||
import * as messages from '../pure/messages';
|
||||
import { QueryServerClient } from '../queryserver-client';
|
||||
import { QueryWithResults, compileAndRunQueryAgainstDatabase, createInitialQueryInfo } from '../run-queries';
|
||||
import { ProgressCallback } from '../commandRunner';
|
||||
import { KeyType } from './keyType';
|
||||
import { qlpackOfDatabase, resolveQueries } from './queryResolver';
|
||||
import { qlpackOfDatabase, resolveQueries, runContextualQuery } from './queryResolver';
|
||||
import { CancellationToken, LocationLink, Uri } from 'vscode';
|
||||
import { QueryWithResults } from '../run-queries-shared';
|
||||
import { QueryRunner } from '../queryRunner';
|
||||
|
||||
export const SELECT_QUERY_NAME = '#select';
|
||||
export const TEMPLATE_NAME = 'selectedSourceFile';
|
||||
@@ -35,7 +34,7 @@ export interface FullLocationLink extends LocationLink {
|
||||
*/
|
||||
export async function getLocationsForUriString(
|
||||
cli: CodeQLCliServer,
|
||||
qs: QueryServerClient,
|
||||
qs: QueryRunner,
|
||||
dbm: DatabaseManager,
|
||||
uriString: string,
|
||||
keyType: KeyType,
|
||||
@@ -57,27 +56,8 @@ export async function getLocationsForUriString(
|
||||
|
||||
const links: FullLocationLink[] = [];
|
||||
for (const query of await resolveQueries(cli, qlpack, keyType)) {
|
||||
const initialInfo = await createInitialQueryInfo(
|
||||
Uri.file(query),
|
||||
{
|
||||
name: db.name,
|
||||
databaseUri: db.databaseUri.toString(),
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
const results = await compileAndRunQueryAgainstDatabase(
|
||||
cli,
|
||||
qs,
|
||||
db,
|
||||
initialInfo,
|
||||
queryStorageDir,
|
||||
progress,
|
||||
token,
|
||||
templates
|
||||
);
|
||||
|
||||
if (results.result.resultType == messages.QueryResultType.SUCCESS) {
|
||||
const results = await runContextualQuery(query, db, queryStorageDir, qs, cli, progress, token, templates);
|
||||
if (results.successful) {
|
||||
links.push(...await getLinksFromResults(results, cli, db, filter));
|
||||
}
|
||||
}
|
||||
@@ -114,15 +94,9 @@ async function getLinksFromResults(
|
||||
return localLinks;
|
||||
}
|
||||
|
||||
function createTemplates(path: string): messages.TemplateDefinitions {
|
||||
function createTemplates(path: string): Record<string, string> {
|
||||
return {
|
||||
[TEMPLATE_NAME]: {
|
||||
values: {
|
||||
tuples: [[{
|
||||
stringValue: path
|
||||
}]]
|
||||
}
|
||||
}
|
||||
[TEMPLATE_NAME]: path
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import * as yaml from 'js-yaml';
|
||||
import * as tmp from 'tmp-promise';
|
||||
import * as path from 'path';
|
||||
|
||||
import * as helpers from '../helpers';
|
||||
import {
|
||||
@@ -12,6 +13,11 @@ import {
|
||||
import { CodeQLCliServer } from '../cli';
|
||||
import { DatabaseItem } from '../databases';
|
||||
import { QlPacksForLanguage } from '../helpers';
|
||||
import { logger } from '../logging';
|
||||
import { createInitialQueryInfo } from '../run-queries-shared';
|
||||
import { CancellationToken, Uri } from 'vscode';
|
||||
import { ProgressCallback } from '../commandRunner';
|
||||
import { QueryRunner } from '../queryRunner';
|
||||
|
||||
export async function qlpackOfDatabase(cli: CodeQLCliServer, db: DatabaseItem): Promise<QlPacksForLanguage> {
|
||||
if (db.contents === undefined) {
|
||||
@@ -104,3 +110,69 @@ export async function resolveQueries(cli: CodeQLCliServer, qlpacks: QlPacksForLa
|
||||
void helpers.showAndLogErrorMessage(errorMessage);
|
||||
throw new Error(`Couldn't find any queries tagged ${tagOfKeyType(keyType)} in any of the following packs: ${packsToSearch.join(', ')}.`);
|
||||
}
|
||||
|
||||
async function resolveContextualQuery(cli: CodeQLCliServer, query: string): Promise<{ packPath: string, createdTempLockFile: boolean }> {
|
||||
// Contextual queries now live within the standard library packs.
|
||||
// This simplifies distribution (you don't need the standard query pack to use the AST viewer),
|
||||
// but if the library pack doesn't have a lockfile, we won't be able to find
|
||||
// other pack dependencies of the library pack.
|
||||
|
||||
// Work out the enclosing pack.
|
||||
const packContents = await cli.packPacklist(query, false);
|
||||
const packFilePath = packContents.find((p) => ['codeql-pack.yml', 'qlpack.yml'].includes(path.basename(p)));
|
||||
if (packFilePath === undefined) {
|
||||
// Should not happen; we already resolved this query.
|
||||
throw new Error(`Could not find a CodeQL pack file for the pack enclosing the contextual query ${query}`);
|
||||
}
|
||||
const packPath = path.dirname(packFilePath);
|
||||
const lockFilePath = packContents.find((p) => ['codeql-pack.lock.yml', 'qlpack.lock.yml'].includes(path.basename(p)));
|
||||
let createdTempLockFile = false;
|
||||
if (!lockFilePath) {
|
||||
// No lock file, likely because this library pack is in the package cache.
|
||||
// Create a lock file so that we can resolve dependencies and library path
|
||||
// for the contextual query.
|
||||
void logger.log(`Library pack ${packPath} is missing a lock file; creating a temporary lock file`);
|
||||
await cli.packResolveDependencies(packPath);
|
||||
createdTempLockFile = true;
|
||||
// Clear CLI server pack cache before installing dependencies,
|
||||
// so that it picks up the new lock file, not the previously cached pack.
|
||||
void logger.log('Clearing the CodeQL CLI server\'s pack cache');
|
||||
await cli.clearCache();
|
||||
// Install dependencies.
|
||||
void logger.log(`Installing package dependencies for library pack ${packPath}`);
|
||||
await cli.packInstall(packPath);
|
||||
}
|
||||
return { packPath, createdTempLockFile };
|
||||
}
|
||||
|
||||
async function removeTemporaryLockFile(packPath: string) {
|
||||
const tempLockFilePath = path.resolve(packPath, 'codeql-pack.lock.yml');
|
||||
void logger.log(`Deleting temporary package lock file at ${tempLockFilePath}`);
|
||||
// It's fine if the file doesn't exist.
|
||||
await fs.promises.rm(path.resolve(packPath, 'codeql-pack.lock.yml'), { force: true });
|
||||
}
|
||||
|
||||
export async function runContextualQuery(query: string, db: DatabaseItem, queryStorageDir: string, qs: QueryRunner, cli: CodeQLCliServer, progress: ProgressCallback, token: CancellationToken, templates: Record<string, string>) {
|
||||
const { packPath, createdTempLockFile } = await resolveContextualQuery(cli, query);
|
||||
const initialInfo = await createInitialQueryInfo(
|
||||
Uri.file(query),
|
||||
{
|
||||
name: db.name,
|
||||
databaseUri: db.databaseUri.toString(),
|
||||
},
|
||||
false
|
||||
);
|
||||
void logger.log(`Running contextual query ${query}; results will be stored in ${queryStorageDir}`);
|
||||
const queryResult = await qs.compileAndRunQueryAgainstDatabase(
|
||||
db,
|
||||
initialInfo,
|
||||
queryStorageDir,
|
||||
progress,
|
||||
token,
|
||||
templates
|
||||
);
|
||||
if (createdTempLockFile) {
|
||||
await removeTemporaryLockFile(packPath);
|
||||
}
|
||||
return queryResult;
|
||||
}
|
||||
|
||||
@@ -16,30 +16,28 @@ import { CodeQLCliServer } from '../cli';
|
||||
import { DatabaseManager } from '../databases';
|
||||
import { CachedOperation } from '../helpers';
|
||||
import { ProgressCallback, withProgress } from '../commandRunner';
|
||||
import * as messages from '../pure/messages';
|
||||
import { QueryServerClient } from '../queryserver-client';
|
||||
import { compileAndRunQueryAgainstDatabase, createInitialQueryInfo, QueryWithResults } from '../run-queries';
|
||||
import AstBuilder from './astBuilder';
|
||||
import {
|
||||
KeyType,
|
||||
} from './keyType';
|
||||
import { FullLocationLink, getLocationsForUriString, TEMPLATE_NAME } from './locationFinder';
|
||||
import { qlpackOfDatabase, resolveQueries } from './queryResolver';
|
||||
import { qlpackOfDatabase, resolveQueries, runContextualQuery } from './queryResolver';
|
||||
import { isCanary, NO_CACHE_AST_VIEWER } from '../config';
|
||||
import { QueryWithResults } from '../run-queries-shared';
|
||||
import { QueryRunner } from '../queryRunner';
|
||||
|
||||
/**
|
||||
* Run templated CodeQL queries to find definitions and references in
|
||||
* Runs templated CodeQL queries to find definitions in
|
||||
* source-language files. We may eventually want to find a way to
|
||||
* generalize this to other custom queries, e.g. showing dataflow to
|
||||
* or from a selected identifier.
|
||||
*/
|
||||
|
||||
export class TemplateQueryDefinitionProvider implements DefinitionProvider {
|
||||
private cache: CachedOperation<LocationLink[]>;
|
||||
|
||||
constructor(
|
||||
private cli: CodeQLCliServer,
|
||||
private qs: QueryServerClient,
|
||||
private qs: QueryRunner,
|
||||
private dbm: DatabaseManager,
|
||||
private queryStorageDir: string,
|
||||
) {
|
||||
@@ -78,12 +76,18 @@ export class TemplateQueryDefinitionProvider implements DefinitionProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs templated CodeQL queries to find references in
|
||||
* source-language files. We may eventually want to find a way to
|
||||
* generalize this to other custom queries, e.g. showing dataflow to
|
||||
* or from a selected identifier.
|
||||
*/
|
||||
export class TemplateQueryReferenceProvider implements ReferenceProvider {
|
||||
private cache: CachedOperation<FullLocationLink[]>;
|
||||
|
||||
constructor(
|
||||
private cli: CodeQLCliServer,
|
||||
private qs: QueryServerClient,
|
||||
private qs: QueryRunner,
|
||||
private dbm: DatabaseManager,
|
||||
private queryStorageDir: string,
|
||||
) {
|
||||
@@ -132,12 +136,16 @@ type QueryWithDb = {
|
||||
dbUri: Uri
|
||||
};
|
||||
|
||||
/**
|
||||
* Run templated CodeQL queries to produce AST information for
|
||||
* source-language files.
|
||||
*/
|
||||
export class TemplatePrintAstProvider {
|
||||
private cache: CachedOperation<QueryWithDb>;
|
||||
|
||||
constructor(
|
||||
private cli: CodeQLCliServer,
|
||||
private qs: QueryServerClient,
|
||||
private qs: QueryRunner,
|
||||
private dbm: DatabaseManager,
|
||||
private queryStorageDir: string,
|
||||
) {
|
||||
@@ -195,59 +203,41 @@ export class TemplatePrintAstProvider {
|
||||
}
|
||||
|
||||
const query = queries[0];
|
||||
const templates: messages.TemplateDefinitions = {
|
||||
[TEMPLATE_NAME]: {
|
||||
values: {
|
||||
tuples: [[{
|
||||
stringValue: zippedArchive.pathWithinSourceArchive
|
||||
}]]
|
||||
}
|
||||
}
|
||||
const templates: Record<string, string> = {
|
||||
[TEMPLATE_NAME]:
|
||||
zippedArchive.pathWithinSourceArchive
|
||||
};
|
||||
|
||||
const initialInfo = await createInitialQueryInfo(
|
||||
Uri.file(query),
|
||||
{
|
||||
name: db.name,
|
||||
databaseUri: db.databaseUri.toString(),
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
const queryResult = await runContextualQuery(query, db, this.queryStorageDir, this.qs, this.cli, progress, token, templates);
|
||||
return {
|
||||
query: await compileAndRunQueryAgainstDatabase(
|
||||
this.cli,
|
||||
this.qs,
|
||||
db,
|
||||
initialInfo,
|
||||
this.queryStorageDir,
|
||||
progress,
|
||||
token,
|
||||
templates
|
||||
),
|
||||
query: queryResult,
|
||||
dbUri: db.databaseUri
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run templated CodeQL queries to produce CFG information for
|
||||
* source-language files.
|
||||
*/
|
||||
export class TemplatePrintCfgProvider {
|
||||
private cache: CachedOperation<[Uri, messages.TemplateDefinitions] | undefined>;
|
||||
private cache: CachedOperation<[Uri, Record<string, string>] | undefined>;
|
||||
|
||||
constructor(
|
||||
private cli: CodeQLCliServer,
|
||||
private dbm: DatabaseManager,
|
||||
) {
|
||||
this.cache = new CachedOperation<[Uri, messages.TemplateDefinitions] | undefined>(this.getCfgUri.bind(this));
|
||||
this.cache = new CachedOperation<[Uri, Record<string, string>] | undefined>(this.getCfgUri.bind(this));
|
||||
}
|
||||
|
||||
async provideCfgUri(document?: TextDocument): Promise<[Uri, messages.TemplateDefinitions] | undefined> {
|
||||
async provideCfgUri(document?: TextDocument): Promise<[Uri, Record<string, string>] | undefined> {
|
||||
if (!document) {
|
||||
return;
|
||||
}
|
||||
return await this.cache.get(document.uri.toString());
|
||||
}
|
||||
|
||||
private async getCfgUri(uriString: string): Promise<[Uri, messages.TemplateDefinitions]> {
|
||||
private async getCfgUri(uriString: string): Promise<[Uri, Record<string, string>]> {
|
||||
const uri = Uri.parse(uriString, true);
|
||||
if (uri.scheme !== zipArchiveScheme) {
|
||||
throw new Error('CFG Viewing is only available for databases with zipped source archives.');
|
||||
@@ -275,14 +265,8 @@ export class TemplatePrintCfgProvider {
|
||||
|
||||
const queryUri = Uri.file(queries[0]);
|
||||
|
||||
const templates: messages.TemplateDefinitions = {
|
||||
[TEMPLATE_NAME]: {
|
||||
values: {
|
||||
tuples: [[{
|
||||
stringValue: zippedArchive.pathWithinSourceArchive
|
||||
}]]
|
||||
}
|
||||
}
|
||||
const templates: Record<string, string> = {
|
||||
[TEMPLATE_NAME]: zippedArchive.pathWithinSourceArchive
|
||||
};
|
||||
|
||||
return [queryUri, templates];
|
||||
|
||||
@@ -28,9 +28,6 @@ import {
|
||||
showAndLogErrorMessage
|
||||
} from './helpers';
|
||||
import { logger } from './logging';
|
||||
import { clearCacheInDatabase } from './run-queries';
|
||||
import * as qsClient from './queryserver-client';
|
||||
import { upgradeDatabaseExplicit } from './upgrades';
|
||||
import {
|
||||
importArchiveDatabase,
|
||||
promptImportGithubDatabase,
|
||||
@@ -40,6 +37,7 @@ import {
|
||||
import { CancellationToken } from 'vscode';
|
||||
import { asyncFilter, getErrorMessage } from './pure/helpers-pure';
|
||||
import { Credentials } from './authentication';
|
||||
import { QueryRunner } from './queryRunner';
|
||||
import { isCanary } from './config';
|
||||
|
||||
type ThemableIconPath = { light: string; dark: string } | string;
|
||||
@@ -220,7 +218,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
public constructor(
|
||||
private databaseManager: DatabaseManager,
|
||||
private readonly queryServer: qsClient.QueryServerClient | undefined,
|
||||
private readonly queryServer: QueryRunner | undefined,
|
||||
private readonly storagePath: string,
|
||||
readonly extensionPath: string,
|
||||
private readonly getCredentials: () => Promise<Credentials>
|
||||
@@ -390,12 +388,11 @@ export class DatabaseUI extends DisposableObject {
|
||||
handleChooseDatabaseFolder = async (
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken
|
||||
): Promise<DatabaseItem | undefined> => {
|
||||
): Promise<void> => {
|
||||
try {
|
||||
return await this.chooseAndSetDatabase(true, progress, token);
|
||||
await this.chooseAndSetDatabase(true, progress, token);
|
||||
} catch (e) {
|
||||
void showAndLogErrorMessage(getErrorMessage(e));
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -458,12 +455,11 @@ export class DatabaseUI extends DisposableObject {
|
||||
handleChooseDatabaseArchive = async (
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken
|
||||
): Promise<DatabaseItem | undefined> => {
|
||||
): Promise<void> => {
|
||||
try {
|
||||
return await this.chooseAndSetDatabase(false, progress, token);
|
||||
await this.chooseAndSetDatabase(false, progress, token);
|
||||
} catch (e) {
|
||||
void showAndLogErrorMessage(getErrorMessage(e));
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -576,8 +572,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
// Search for upgrade scripts in any workspace folders available
|
||||
|
||||
await upgradeDatabaseExplicit(
|
||||
this.queryServer,
|
||||
await this.queryServer.upgradeDatabaseExplicit(
|
||||
databaseItem,
|
||||
progress,
|
||||
token
|
||||
@@ -592,8 +587,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
this.queryServer !== undefined &&
|
||||
this.databaseManager.currentDatabaseItem !== undefined
|
||||
) {
|
||||
await clearCacheInDatabase(
|
||||
this.queryServer,
|
||||
await this.queryServer.clearCacheInDatabase(
|
||||
this.databaseManager.currentDatabaseItem,
|
||||
progress,
|
||||
token
|
||||
@@ -756,7 +750,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
* Perform some heuristics to ensure a proper database location is chosen.
|
||||
*
|
||||
* 1. If the selected URI to add is a file, choose the containing directory
|
||||
* 2. If the selected URI is a directory matching db-*, choose the containing directory
|
||||
* 2. If the selected URI appears to be a db language folder, choose the containing directory
|
||||
* 3. choose the current directory
|
||||
*
|
||||
* @param uri a URI that is a database folder or inside it
|
||||
@@ -769,7 +763,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
dbPath = path.dirname(dbPath);
|
||||
}
|
||||
|
||||
if (isLikelyDbLanguageFolder(dbPath)) {
|
||||
if (await isLikelyDbLanguageFolder(dbPath)) {
|
||||
dbPath = path.dirname(dbPath);
|
||||
}
|
||||
return Uri.file(dbPath);
|
||||
|
||||
@@ -17,9 +17,8 @@ import {
|
||||
import { zipArchiveScheme, encodeArchiveBasePath, decodeSourceArchiveUri, encodeSourceArchiveUri } from './archive-filesystem-provider';
|
||||
import { DisposableObject } from './pure/disposable-object';
|
||||
import { Logger, logger } from './logging';
|
||||
import { registerDatabases, Dataset, deregisterDatabases } from './pure/messages';
|
||||
import { QueryServerClient } from './queryserver-client';
|
||||
import { getErrorMessage } from './pure/helpers-pure';
|
||||
import { QueryRunner } from './queryRunner';
|
||||
|
||||
/**
|
||||
* databases.ts
|
||||
@@ -359,14 +358,12 @@ export class DatabaseItemImpl implements DatabaseItem {
|
||||
try {
|
||||
this._contents = await resolveDatabaseContents(this.databaseUri);
|
||||
this._error = undefined;
|
||||
}
|
||||
catch (e) {
|
||||
} catch (e) {
|
||||
this._contents = undefined;
|
||||
this._error = e instanceof Error ? e : new Error(String(e));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
this.onChanged({
|
||||
kind: DatabaseEventKind.Refresh,
|
||||
item: this
|
||||
@@ -555,16 +552,13 @@ export class DatabaseManager extends DisposableObject {
|
||||
|
||||
constructor(
|
||||
private readonly ctx: ExtensionContext,
|
||||
private readonly qs: QueryServerClient,
|
||||
private readonly qs: QueryRunner,
|
||||
private readonly cli: cli.CodeQLCliServer,
|
||||
public logger: Logger
|
||||
) {
|
||||
super();
|
||||
|
||||
qs.onDidStartQueryServer(this.reregisterDatabases.bind(this));
|
||||
|
||||
// Let this run async.
|
||||
void this.loadPersistedState();
|
||||
qs.onStart(this.reregisterDatabases.bind(this));
|
||||
}
|
||||
|
||||
public async openDatabase(
|
||||
@@ -690,11 +684,13 @@ export class DatabaseManager extends DisposableObject {
|
||||
this._onDidChangeDatabaseItem.fire(event);
|
||||
});
|
||||
|
||||
await this.addDatabaseItem(progress, token, item);
|
||||
// Avoid persisting the database state after adding since that should happen only after
|
||||
// all databases have been added.
|
||||
await this.addDatabaseItem(progress, token, item, false);
|
||||
return item;
|
||||
}
|
||||
|
||||
private async loadPersistedState(): Promise<void> {
|
||||
public async loadPersistedState(): Promise<void> {
|
||||
return withProgress({
|
||||
location: vscode.ProgressLocation.Notification
|
||||
},
|
||||
@@ -708,6 +704,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
step
|
||||
});
|
||||
try {
|
||||
void this.logger.log(`Found ${databases.length} persisted databases: ${databases.map(db => db.uri).join(', ')}`);
|
||||
for (const database of databases) {
|
||||
progress({
|
||||
maxStep: databases.length,
|
||||
@@ -722,16 +719,20 @@ export class DatabaseManager extends DisposableObject {
|
||||
if (currentDatabaseUri === database.uri) {
|
||||
await this.setCurrentDatabaseItem(databaseItem, true);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
void this.logger.log(`Loaded database ${databaseItem.name} at URI ${database.uri}.`);
|
||||
} catch (e) {
|
||||
// When loading from persisted state, leave invalid databases in the list. They will be
|
||||
// marked as invalid, and cannot be set as the current database.
|
||||
void this.logger.log(`Error loading database ${database.uri}: ${e}.`);
|
||||
}
|
||||
}
|
||||
await this.updatePersistedDatabaseList();
|
||||
} catch (e) {
|
||||
// database list had an unexpected type - nothing to be done?
|
||||
void showAndLogErrorMessage(`Database list loading failed: ${getErrorMessage(e)}`);
|
||||
}
|
||||
|
||||
void this.logger.log('Finished loading persisted databases.');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -786,10 +787,14 @@ export class DatabaseManager extends DisposableObject {
|
||||
private async addDatabaseItem(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
item: DatabaseItem
|
||||
item: DatabaseItem,
|
||||
updatePersistedState = true
|
||||
) {
|
||||
this._databaseItems.push(item);
|
||||
await this.updatePersistedDatabaseList();
|
||||
|
||||
if (updatePersistedState) {
|
||||
await this.updatePersistedDatabaseList();
|
||||
}
|
||||
|
||||
// Add this database item to the allow-list
|
||||
// Database items reconstituted from persisted state
|
||||
@@ -860,27 +865,14 @@ export class DatabaseManager extends DisposableObject {
|
||||
token: vscode.CancellationToken,
|
||||
dbItem: DatabaseItem,
|
||||
) {
|
||||
if (dbItem.contents && (await this.cli.cliConstraints.supportsDatabaseRegistration())) {
|
||||
const databases: Dataset[] = [{
|
||||
dbDir: dbItem.contents.datasetUri.fsPath,
|
||||
workingSet: 'default'
|
||||
}];
|
||||
await this.qs.sendRequest(deregisterDatabases, { databases }, token, progress);
|
||||
}
|
||||
await this.qs.deregisterDatabase(progress, token, dbItem);
|
||||
}
|
||||
|
||||
private async registerDatabase(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
dbItem: DatabaseItem,
|
||||
) {
|
||||
if (dbItem.contents && (await this.cli.cliConstraints.supportsDatabaseRegistration())) {
|
||||
const databases: Dataset[] = [{
|
||||
dbDir: dbItem.contents.datasetUri.fsPath,
|
||||
workingSet: 'default'
|
||||
}];
|
||||
await this.qs.sendRequest(registerDatabases, { databases }, token, progress);
|
||||
}
|
||||
await this.qs.registerDatabase(progress, token, dbItem);
|
||||
}
|
||||
|
||||
private updatePersistedCurrentDatabaseItem(): void {
|
||||
|
||||
3
extensions/ql-vscode/src/databases/README.md
Normal file
3
extensions/ql-vscode/src/databases/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Databases
|
||||
|
||||
This folder contains code for the new experimental databases panel and new query run experience.
|
||||
80
extensions/ql-vscode/src/databases/db-config-store.ts
Normal file
80
extensions/ql-vscode/src/databases/db-config-store.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import { cloneDbConfig, DbConfig } from './db-config';
|
||||
import * as chokidar from 'chokidar';
|
||||
import { DisposableObject } from '../pure/disposable-object';
|
||||
import { DbConfigValidator } from './db-config-validator';
|
||||
|
||||
export class DbConfigStore extends DisposableObject {
|
||||
private readonly configPath: string;
|
||||
private readonly configValidator: DbConfigValidator;
|
||||
|
||||
private config: DbConfig;
|
||||
private configWatcher: chokidar.FSWatcher | undefined;
|
||||
|
||||
public constructor(
|
||||
workspaceStoragePath: string,
|
||||
extensionPath: string) {
|
||||
super();
|
||||
|
||||
this.configPath = path.join(workspaceStoragePath, 'workspace-databases.json');
|
||||
|
||||
this.config = this.createEmptyConfig();
|
||||
this.configWatcher = undefined;
|
||||
this.configValidator = new DbConfigValidator(extensionPath);
|
||||
}
|
||||
|
||||
public async initialize(): Promise<void> {
|
||||
await this.loadConfig();
|
||||
this.watchConfig();
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.configWatcher?.unwatch(this.configPath);
|
||||
}
|
||||
|
||||
public getConfig(): DbConfig {
|
||||
// Clone the config so that it's not modified outside of this class.
|
||||
return cloneDbConfig(this.config);
|
||||
}
|
||||
|
||||
public getConfigPath(): string {
|
||||
return this.configPath;
|
||||
}
|
||||
|
||||
public validateConfig(): string[] {
|
||||
return this.configValidator.validate(this.config);
|
||||
}
|
||||
|
||||
private async loadConfig(): Promise<void> {
|
||||
if (!await fs.pathExists(this.configPath)) {
|
||||
await fs.writeJSON(this.configPath, this.createEmptyConfig(), { spaces: 2 });
|
||||
}
|
||||
|
||||
await this.readConfig();
|
||||
}
|
||||
|
||||
private async readConfig(): Promise<void> {
|
||||
this.config = await fs.readJSON(this.configPath);
|
||||
}
|
||||
|
||||
private readConfigSync(): void {
|
||||
this.config = fs.readJSONSync(this.configPath);
|
||||
}
|
||||
|
||||
private watchConfig(): void {
|
||||
this.configWatcher = chokidar.watch(this.configPath).on('change', () => {
|
||||
this.readConfigSync();
|
||||
});
|
||||
}
|
||||
|
||||
private createEmptyConfig(): DbConfig {
|
||||
return {
|
||||
remote: {
|
||||
repositoryLists: [],
|
||||
owners: [],
|
||||
repositories: [],
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
24
extensions/ql-vscode/src/databases/db-config-validator.ts
Normal file
24
extensions/ql-vscode/src/databases/db-config-validator.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import Ajv from 'ajv';
|
||||
import { DbConfig } from './db-config';
|
||||
|
||||
export class DbConfigValidator {
|
||||
private readonly schema: any;
|
||||
|
||||
constructor(extensionPath: string) {
|
||||
const schemaPath = path.resolve(extensionPath, 'workspace-databases-schema.json');
|
||||
this.schema = fs.readJsonSync(schemaPath);
|
||||
}
|
||||
|
||||
public validate(dbConfig: DbConfig): string[] {
|
||||
const ajv = new Ajv({ allErrors: true });
|
||||
ajv.validate(this.schema, dbConfig);
|
||||
|
||||
if (ajv.errors) {
|
||||
return ajv.errors.map((error) => `${error.instancePath} ${error.message}`);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
29
extensions/ql-vscode/src/databases/db-config.ts
Normal file
29
extensions/ql-vscode/src/databases/db-config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// Contains models for the data we want to store in the database config
|
||||
|
||||
export interface DbConfig {
|
||||
remote: RemoteDbConfig;
|
||||
}
|
||||
|
||||
export interface RemoteDbConfig {
|
||||
repositoryLists: RemoteRepositoryList[];
|
||||
owners: string[];
|
||||
repositories: string[];
|
||||
}
|
||||
|
||||
export interface RemoteRepositoryList {
|
||||
name: string;
|
||||
repositories: string[];
|
||||
}
|
||||
|
||||
export function cloneDbConfig(config: DbConfig): DbConfig {
|
||||
return {
|
||||
remote: {
|
||||
repositoryLists: config.remote.repositoryLists.map((list) => ({
|
||||
name: list.name,
|
||||
repositories: [...list.repositories],
|
||||
})),
|
||||
owners: [...config.remote.owners],
|
||||
repositories: [...config.remote.repositories],
|
||||
}
|
||||
};
|
||||
}
|
||||
53
extensions/ql-vscode/src/databases/db-item.ts
Normal file
53
extensions/ql-vscode/src/databases/db-item.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
// This file contains models that are used to represent the databases.
|
||||
|
||||
export enum DbItemKind {
|
||||
RootLocal = 'RootLocal',
|
||||
RootRemote = 'RootRemote',
|
||||
RemoteSystemDefinedList = 'RemoteSystemDefinedList',
|
||||
RemoteUserDefinedList = 'RemoteUserDefinedList',
|
||||
RemoteOwner = 'RemoteOwner',
|
||||
RemoteRepo = 'RemoteRepo'
|
||||
}
|
||||
|
||||
export interface RootLocalDbItem {
|
||||
kind: DbItemKind.RootLocal;
|
||||
}
|
||||
|
||||
export interface RootRemoteDbItem {
|
||||
kind: DbItemKind.RootRemote;
|
||||
children: RemoteDbItem[];
|
||||
}
|
||||
|
||||
export type DbItem =
|
||||
| RootLocalDbItem
|
||||
| RootRemoteDbItem
|
||||
| RemoteDbItem
|
||||
|
||||
export type RemoteDbItem =
|
||||
| RemoteSystemDefinedListDbItem
|
||||
| RemoteUserDefinedListDbItem
|
||||
| RemoteOwnerDbItem
|
||||
| RemoteRepoDbItem;
|
||||
|
||||
export interface RemoteSystemDefinedListDbItem {
|
||||
kind: DbItemKind.RemoteSystemDefinedList;
|
||||
listName: string;
|
||||
listDisplayName: string;
|
||||
listDescription: string;
|
||||
}
|
||||
|
||||
export interface RemoteUserDefinedListDbItem {
|
||||
kind: DbItemKind.RemoteUserDefinedList;
|
||||
listName: string;
|
||||
repos: RemoteRepoDbItem[];
|
||||
}
|
||||
|
||||
export interface RemoteOwnerDbItem {
|
||||
kind: DbItemKind.RemoteOwner;
|
||||
ownerName: string;
|
||||
}
|
||||
|
||||
export interface RemoteRepoDbItem {
|
||||
kind: DbItemKind.RemoteRepo;
|
||||
repoFullName: string;
|
||||
}
|
||||
23
extensions/ql-vscode/src/databases/db-manager.ts
Normal file
23
extensions/ql-vscode/src/databases/db-manager.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { DbConfigStore } from './db-config-store';
|
||||
import { DbItem } from './db-item';
|
||||
import { createLocalTree, createRemoteTree } from './db-tree-creator';
|
||||
|
||||
export class DbManager {
|
||||
constructor(
|
||||
private readonly dbConfigStore: DbConfigStore
|
||||
) {
|
||||
}
|
||||
|
||||
public getDbItems(): DbItem[] {
|
||||
const config = this.dbConfigStore.getConfig();
|
||||
|
||||
return [
|
||||
createRemoteTree(config),
|
||||
createLocalTree()
|
||||
];
|
||||
}
|
||||
|
||||
public getConfigPath(): string {
|
||||
return this.dbConfigStore.getConfigPath();
|
||||
}
|
||||
}
|
||||
45
extensions/ql-vscode/src/databases/db-module.ts
Normal file
45
extensions/ql-vscode/src/databases/db-module.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { isCanary, isNewQueryRunExperienceEnabled } from '../config';
|
||||
import { logger } from '../logging';
|
||||
import { DisposableObject } from '../pure/disposable-object';
|
||||
import { DbConfigStore } from './db-config-store';
|
||||
import { DbManager } from './db-manager';
|
||||
import { DbPanel } from './ui/db-panel';
|
||||
|
||||
export class DbModule extends DisposableObject {
|
||||
public async initialize(
|
||||
extensionContext: vscode.ExtensionContext
|
||||
): Promise<void> {
|
||||
if (extensionContext.extensionMode !== vscode.ExtensionMode.Development ||
|
||||
!isCanary() ||
|
||||
!isNewQueryRunExperienceEnabled()) {
|
||||
// Currently, we only want to expose the new database panel when we
|
||||
// are in development and canary mode and the developer has enabled the
|
||||
// new query run experience.
|
||||
return;
|
||||
}
|
||||
|
||||
void logger.log('Initializing database module');
|
||||
|
||||
const storagePath = extensionContext.storageUri?.fsPath || extensionContext.globalStorageUri.fsPath;
|
||||
const extensionPath = extensionContext.extensionPath;
|
||||
const dbConfigStore = new DbConfigStore(storagePath, extensionPath);
|
||||
await dbConfigStore.initialize();
|
||||
|
||||
const dbManager = new DbManager(dbConfigStore);
|
||||
const dbPanel = new DbPanel(dbManager);
|
||||
await dbPanel.initialize();
|
||||
extensionContext.subscriptions.push(dbPanel);
|
||||
|
||||
this.push(dbPanel);
|
||||
this.push(dbConfigStore);
|
||||
}
|
||||
}
|
||||
|
||||
export async function initializeDbModule(
|
||||
extensionContext: vscode.ExtensionContext
|
||||
): Promise<DbModule> {
|
||||
const dbModule = new DbModule();
|
||||
await dbModule.initialize(extensionContext);
|
||||
return dbModule;
|
||||
}
|
||||
70
extensions/ql-vscode/src/databases/db-tree-creator.ts
Normal file
70
extensions/ql-vscode/src/databases/db-tree-creator.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import { DbConfig, RemoteRepositoryList } from './db-config';
|
||||
import {
|
||||
DbItemKind,
|
||||
RemoteOwnerDbItem,
|
||||
RemoteRepoDbItem,
|
||||
RemoteSystemDefinedListDbItem,
|
||||
RemoteUserDefinedListDbItem,
|
||||
RootLocalDbItem,
|
||||
RootRemoteDbItem
|
||||
} from './db-item';
|
||||
|
||||
export function createRemoteTree(dbConfig: DbConfig): RootRemoteDbItem {
|
||||
const systemDefinedLists = [
|
||||
createSystemDefinedList(10),
|
||||
createSystemDefinedList(100),
|
||||
createSystemDefinedList(1000)
|
||||
];
|
||||
|
||||
const userDefinedRepoLists = dbConfig.remote.repositoryLists.map(createUserDefinedList);
|
||||
const owners = dbConfig.remote.owners.map(createOwnerItem);
|
||||
const repos = dbConfig.remote.repositories.map(createRepoItem);
|
||||
|
||||
return {
|
||||
kind: DbItemKind.RootRemote,
|
||||
children: [
|
||||
...systemDefinedLists,
|
||||
...owners,
|
||||
...userDefinedRepoLists,
|
||||
...repos
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
export function createLocalTree(): RootLocalDbItem {
|
||||
// This will be fleshed out further in the future.
|
||||
return {
|
||||
kind: DbItemKind.RootLocal
|
||||
};
|
||||
}
|
||||
|
||||
function createSystemDefinedList(n: number): RemoteSystemDefinedListDbItem {
|
||||
return {
|
||||
kind: DbItemKind.RemoteSystemDefinedList,
|
||||
listName: `top_${n}`,
|
||||
listDisplayName: `Top ${n} repositories`,
|
||||
listDescription: `Top ${n} repositories of a language`
|
||||
};
|
||||
}
|
||||
|
||||
function createUserDefinedList(list: RemoteRepositoryList): RemoteUserDefinedListDbItem {
|
||||
return {
|
||||
kind: DbItemKind.RemoteUserDefinedList,
|
||||
listName: list.name,
|
||||
repos: list.repositories.map((r) => createRepoItem(r))
|
||||
};
|
||||
}
|
||||
|
||||
function createOwnerItem(owner: string): RemoteOwnerDbItem {
|
||||
return {
|
||||
kind: DbItemKind.RemoteOwner,
|
||||
ownerName: owner
|
||||
};
|
||||
}
|
||||
|
||||
function createRepoItem(repo: string): RemoteRepoDbItem {
|
||||
return {
|
||||
kind: DbItemKind.RemoteRepo,
|
||||
repoFullName: repo
|
||||
};
|
||||
}
|
||||
49
extensions/ql-vscode/src/databases/ui/db-item-mapper.ts
Normal file
49
extensions/ql-vscode/src/databases/ui/db-item-mapper.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { DbItem, DbItemKind } from '../db-item';
|
||||
import {
|
||||
createDbTreeViewItemOwner,
|
||||
createDbTreeViewItemRepo,
|
||||
createDbTreeViewItemRoot,
|
||||
createDbTreeViewItemSystemDefinedList,
|
||||
createDbTreeViewItemUserDefinedList,
|
||||
DbTreeViewItem
|
||||
} from './db-tree-view-item';
|
||||
|
||||
export function mapDbItemToTreeViewItem(dbItem: DbItem): DbTreeViewItem {
|
||||
switch (dbItem.kind) {
|
||||
case DbItemKind.RootLocal:
|
||||
return createDbTreeViewItemRoot(
|
||||
dbItem,
|
||||
'local',
|
||||
'Local databases',
|
||||
[]);
|
||||
|
||||
case DbItemKind.RootRemote:
|
||||
return createDbTreeViewItemRoot(
|
||||
dbItem,
|
||||
'remote',
|
||||
'Remote databases',
|
||||
dbItem.children.map(c => mapDbItemToTreeViewItem(c)));
|
||||
|
||||
case DbItemKind.RemoteSystemDefinedList:
|
||||
return createDbTreeViewItemSystemDefinedList(
|
||||
dbItem,
|
||||
dbItem.listDisplayName,
|
||||
dbItem.listDescription);
|
||||
|
||||
case DbItemKind.RemoteUserDefinedList:
|
||||
return createDbTreeViewItemUserDefinedList(
|
||||
dbItem,
|
||||
dbItem.listName,
|
||||
dbItem.repos.map(mapDbItemToTreeViewItem));
|
||||
|
||||
case DbItemKind.RemoteOwner:
|
||||
return createDbTreeViewItemOwner(
|
||||
dbItem,
|
||||
dbItem.ownerName);
|
||||
|
||||
case DbItemKind.RemoteRepo:
|
||||
return createDbTreeViewItemRepo(
|
||||
dbItem,
|
||||
dbItem.repoFullName);
|
||||
}
|
||||
}
|
||||
39
extensions/ql-vscode/src/databases/ui/db-panel.ts
Normal file
39
extensions/ql-vscode/src/databases/ui/db-panel.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { commandRunner } from '../../commandRunner';
|
||||
import { DisposableObject } from '../../pure/disposable-object';
|
||||
import { DbManager } from '../db-manager';
|
||||
import { DbTreeDataProvider } from './db-tree-data-provider';
|
||||
|
||||
export class DbPanel extends DisposableObject {
|
||||
private readonly dataProvider: DbTreeDataProvider;
|
||||
|
||||
public constructor(
|
||||
private readonly dbManager: DbManager
|
||||
) {
|
||||
super();
|
||||
|
||||
this.dataProvider = new DbTreeDataProvider(dbManager);
|
||||
|
||||
const treeView = vscode.window.createTreeView('codeQLDatabasesExperimental', {
|
||||
treeDataProvider: this.dataProvider,
|
||||
canSelectMany: false
|
||||
});
|
||||
|
||||
this.push(treeView);
|
||||
}
|
||||
|
||||
public async initialize(): Promise<void> {
|
||||
this.push(
|
||||
commandRunner(
|
||||
'codeQLDatabasesExperimental.openConfigFile',
|
||||
() => this.openConfigFile(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private async openConfigFile(): Promise<void> {
|
||||
const configPath = this.dbManager.getConfigPath();
|
||||
const document = await vscode.workspace.openTextDocument(configPath);
|
||||
await vscode.window.showTextDocument(document);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { ProviderResult, TreeDataProvider, TreeItem } from 'vscode';
|
||||
import { createDbTreeViewItemWarning, DbTreeViewItem } from './db-tree-view-item';
|
||||
import { DbManager } from '../db-manager';
|
||||
import { mapDbItemToTreeViewItem } from './db-item-mapper';
|
||||
|
||||
export class DbTreeDataProvider implements TreeDataProvider<DbTreeViewItem> {
|
||||
private dbTreeItems: DbTreeViewItem[];
|
||||
|
||||
public constructor(
|
||||
private readonly dbManager: DbManager
|
||||
) {
|
||||
this.dbTreeItems = this.createTree();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when expanding a node (including the root node).
|
||||
* @param node The node to expand.
|
||||
* @returns The children of the node.
|
||||
*/
|
||||
public getChildren(node?: DbTreeViewItem): ProviderResult<DbTreeViewItem[]> {
|
||||
if (!node) {
|
||||
// We're at the root.
|
||||
return Promise.resolve(this.dbTreeItems);
|
||||
} else {
|
||||
return Promise.resolve(node.children);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the UI presentation of the element that gets displayed in the view.
|
||||
* @param node The node to represent.
|
||||
* @returns The UI presentation of the node.
|
||||
*/
|
||||
public getTreeItem(node: DbTreeViewItem): TreeItem | Thenable<TreeItem> {
|
||||
return node;
|
||||
}
|
||||
|
||||
private createTree(): DbTreeViewItem[] {
|
||||
const dbItems = this.dbManager.getDbItems();
|
||||
|
||||
// Add a sample warning as a proof of concept.
|
||||
const warningTreeViewItem = createDbTreeViewItemWarning(
|
||||
'There was an error',
|
||||
'Fix it'
|
||||
);
|
||||
|
||||
return [...dbItems.map(mapDbItemToTreeViewItem), warningTreeViewItem];
|
||||
}
|
||||
}
|
||||
107
extensions/ql-vscode/src/databases/ui/db-tree-view-item.ts
Normal file
107
extensions/ql-vscode/src/databases/ui/db-tree-view-item.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import * as vscode from 'vscode';
|
||||
import {
|
||||
DbItem,
|
||||
RemoteOwnerDbItem,
|
||||
RemoteRepoDbItem,
|
||||
RemoteSystemDefinedListDbItem,
|
||||
RemoteUserDefinedListDbItem,
|
||||
RootLocalDbItem,
|
||||
RootRemoteDbItem
|
||||
} from '../db-item';
|
||||
|
||||
/**
|
||||
* Represents an item in the database tree view. This item could be
|
||||
* representing an actual database item or a warning.
|
||||
*/
|
||||
export class DbTreeViewItem extends vscode.TreeItem {
|
||||
constructor(
|
||||
public readonly dbItem: DbItem | undefined,
|
||||
public readonly iconPath: vscode.ThemeIcon | undefined,
|
||||
public readonly label: string,
|
||||
public readonly tooltip: string | undefined,
|
||||
public readonly collapsibleState: vscode.TreeItemCollapsibleState,
|
||||
public readonly children: DbTreeViewItem[]
|
||||
) {
|
||||
super(label, collapsibleState);
|
||||
}
|
||||
}
|
||||
|
||||
export function createDbTreeViewItemWarning(label: string, tooltip: string): DbTreeViewItem {
|
||||
return new DbTreeViewItem(
|
||||
undefined,
|
||||
new vscode.ThemeIcon('warning', new vscode.ThemeColor('problemsWarningIcon.foreground')),
|
||||
label,
|
||||
tooltip,
|
||||
vscode.TreeItemCollapsibleState.None,
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
export function createDbTreeViewItemRoot(
|
||||
dbItem: RootLocalDbItem | RootRemoteDbItem,
|
||||
label: string,
|
||||
tooltip: string,
|
||||
children: DbTreeViewItem[]
|
||||
): DbTreeViewItem {
|
||||
return new DbTreeViewItem(
|
||||
dbItem,
|
||||
undefined,
|
||||
label,
|
||||
tooltip,
|
||||
vscode.TreeItemCollapsibleState.Collapsed,
|
||||
children);
|
||||
}
|
||||
|
||||
export function createDbTreeViewItemSystemDefinedList(
|
||||
dbItem: RemoteSystemDefinedListDbItem,
|
||||
label: string,
|
||||
tooltip: string
|
||||
): DbTreeViewItem {
|
||||
return new DbTreeViewItem(
|
||||
dbItem,
|
||||
new vscode.ThemeIcon('github'),
|
||||
label,
|
||||
tooltip,
|
||||
vscode.TreeItemCollapsibleState.None,
|
||||
[]);
|
||||
}
|
||||
|
||||
export function createDbTreeViewItemUserDefinedList(
|
||||
dbItem: RemoteUserDefinedListDbItem,
|
||||
listName: string,
|
||||
children: DbTreeViewItem[]
|
||||
): DbTreeViewItem {
|
||||
return new DbTreeViewItem(
|
||||
dbItem,
|
||||
undefined,
|
||||
listName,
|
||||
undefined,
|
||||
vscode.TreeItemCollapsibleState.Collapsed,
|
||||
children);
|
||||
}
|
||||
|
||||
export function createDbTreeViewItemOwner(
|
||||
dbItem: RemoteOwnerDbItem,
|
||||
ownerName: string,
|
||||
): DbTreeViewItem {
|
||||
return new DbTreeViewItem(
|
||||
dbItem,
|
||||
new vscode.ThemeIcon('organization'),
|
||||
ownerName,
|
||||
undefined,
|
||||
vscode.TreeItemCollapsibleState.None,
|
||||
[]);
|
||||
}
|
||||
|
||||
export function createDbTreeViewItemRepo(
|
||||
dbItem: RemoteRepoDbItem,
|
||||
repoName: string,
|
||||
): DbTreeViewItem {
|
||||
return new DbTreeViewItem(
|
||||
dbItem,
|
||||
new vscode.ThemeIcon('database'),
|
||||
repoName,
|
||||
undefined,
|
||||
vscode.TreeItemCollapsibleState.None,
|
||||
[]);
|
||||
}
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
CliConfigListener,
|
||||
DistributionConfigListener,
|
||||
isCanary,
|
||||
joinOrderWarningThreshold,
|
||||
MAX_QUERIES,
|
||||
QueryHistoryConfigListener,
|
||||
QueryServerConfigListener
|
||||
@@ -68,17 +69,17 @@ import {
|
||||
} from './helpers';
|
||||
import { asError, assertNever, getErrorMessage } from './pure/helpers-pure';
|
||||
import { spawnIdeServer } from './ide-server';
|
||||
import { InterfaceManager } from './interface';
|
||||
import { ResultsView } from './interface';
|
||||
import { WebviewReveal } from './interface-utils';
|
||||
import { ideServerLogger, logger, queryServerLogger } from './logging';
|
||||
import { ideServerLogger, logger, ProgressReporter, queryServerLogger } from './logging';
|
||||
import { QueryHistoryManager } from './query-history';
|
||||
import { CompletedLocalQueryInfo, LocalQueryInfo } from './query-results';
|
||||
import * as qsClient from './queryserver-client';
|
||||
import * as legacyQueryServer from './legacy-query-server/queryserver-client';
|
||||
import * as newQueryServer from './query-server/queryserver-client';
|
||||
import { displayQuickQuery } from './quick-query';
|
||||
import { compileAndRunQueryAgainstDatabase, createInitialQueryInfo } from './run-queries';
|
||||
import { QLTestAdapterFactory } from './test-adapter';
|
||||
import { TestUIService } from './test-ui';
|
||||
import { CompareInterfaceManager } from './compare/compare-interface';
|
||||
import { CompareView } from './compare/compare-view';
|
||||
import { gatherQlFiles } from './pure/files';
|
||||
import { initializeTelemetry } from './telemetry';
|
||||
import {
|
||||
@@ -102,6 +103,18 @@ import { EvalLogViewer } from './eval-log-viewer';
|
||||
import { SummaryLanguageSupport } from './log-insights/summary-language-support';
|
||||
import { JoinOrderScannerProvider } from './log-insights/join-order';
|
||||
import { LogScannerService } from './log-insights/log-scanner-service';
|
||||
import { createInitialQueryInfo } from './run-queries-shared';
|
||||
import { LegacyQueryRunner } from './legacy-query-server/legacyRunner';
|
||||
import { NewQueryRunner } from './query-server/query-runner';
|
||||
import { QueryRunner } from './queryRunner';
|
||||
import { VariantAnalysisView } from './remote-queries/variant-analysis-view';
|
||||
import { VariantAnalysisViewSerializer } from './remote-queries/variant-analysis-view-serializer';
|
||||
import { VariantAnalysis, VariantAnalysisScannedRepository } from './remote-queries/shared/variant-analysis';
|
||||
import { VariantAnalysisManager } from './remote-queries/variant-analysis-manager';
|
||||
import { createVariantAnalysisContentProvider } from './remote-queries/variant-analysis-content-provider';
|
||||
import { VSCodeMockGitHubApiServer } from './mocks/vscode-mock-gh-api-server';
|
||||
import { VariantAnalysisResultsManager } from './remote-queries/variant-analysis-results-manager';
|
||||
import { initializeDbModule } from './databases/db-module';
|
||||
|
||||
/**
|
||||
* extension.ts
|
||||
@@ -164,10 +177,11 @@ function registerErrorStubs(excludedCommands: string[], stubGenerator: (command:
|
||||
export interface CodeQLExtensionInterface {
|
||||
readonly ctx: ExtensionContext;
|
||||
readonly cliServer: CodeQLCliServer;
|
||||
readonly qs: qsClient.QueryServerClient;
|
||||
readonly qs: QueryRunner;
|
||||
readonly distributionManager: DistributionManager;
|
||||
readonly databaseManager: DatabaseManager;
|
||||
readonly databaseUI: DatabaseUI;
|
||||
readonly variantAnalysisManager: VariantAnalysisManager;
|
||||
readonly dispose: () => void;
|
||||
}
|
||||
|
||||
@@ -378,7 +392,10 @@ export async function activate(ctx: ExtensionContext): Promise<CodeQLExtensionIn
|
||||
allowAutoUpdating: true
|
||||
})));
|
||||
|
||||
return await installOrUpdateThenTryActivate({
|
||||
const variantAnalysisViewSerializer = new VariantAnalysisViewSerializer(ctx);
|
||||
Window.registerWebviewPanelSerializer(VariantAnalysisView.viewType, variantAnalysisViewSerializer);
|
||||
|
||||
const codeQlExtension = await installOrUpdateThenTryActivate({
|
||||
isUserInitiated: !!ctx.globalState.get(shouldUpdateOnNextActivationKey),
|
||||
shouldDisplayMessageWhenNoUpdates: false,
|
||||
|
||||
@@ -386,8 +403,14 @@ export async function activate(ctx: ExtensionContext): Promise<CodeQLExtensionIn
|
||||
// otherwise, ask user to accept the update
|
||||
allowAutoUpdating: !!ctx.globalState.get(shouldUpdateOnNextActivationKey)
|
||||
});
|
||||
|
||||
variantAnalysisViewSerializer.onExtensionLoaded(codeQlExtension.variantAnalysisManager);
|
||||
|
||||
return codeQlExtension;
|
||||
}
|
||||
|
||||
const PACK_GLOBS = ['**/codeql-pack.yml', '**/qlpack.yml', '**/queries.xml', '**/codeql-pack.lock.yml', '**/qlpack.lock.yml', '.codeqlmanifest.json', 'codeql-workspace.yml'];
|
||||
|
||||
async function activateWithInstalledDistribution(
|
||||
ctx: ExtensionContext,
|
||||
distributionManager: DistributionManager,
|
||||
@@ -416,24 +439,23 @@ async function activateWithInstalledDistribution(
|
||||
ctx.subscriptions.push(statusBar);
|
||||
|
||||
void logger.log('Initializing query server client.');
|
||||
const qs = new qsClient.QueryServerClient(
|
||||
qlConfigurationListener,
|
||||
cliServer,
|
||||
{
|
||||
logger: queryServerLogger,
|
||||
contextStoragePath: getContextStoragePath(ctx),
|
||||
},
|
||||
(task) =>
|
||||
Window.withProgress(
|
||||
{ title: 'CodeQL query server', location: ProgressLocation.Window },
|
||||
task
|
||||
)
|
||||
);
|
||||
ctx.subscriptions.push(qs);
|
||||
await qs.startQueryServer();
|
||||
const qs = await createQueryServer(qlConfigurationListener, cliServer, ctx);
|
||||
|
||||
|
||||
for (const glob of PACK_GLOBS) {
|
||||
const fsWatcher = workspace.createFileSystemWatcher(glob);
|
||||
ctx.subscriptions.push(fsWatcher);
|
||||
fsWatcher.onDidChange(async (_uri) => {
|
||||
await qs.clearPackCache();
|
||||
});
|
||||
}
|
||||
|
||||
void logger.log('Initializing database manager.');
|
||||
const dbm = new DatabaseManager(ctx, qs, cliServer, logger);
|
||||
|
||||
// Let this run async.
|
||||
void dbm.loadPersistedState();
|
||||
|
||||
ctx.subscriptions.push(dbm);
|
||||
void logger.log('Initializing database panel.');
|
||||
const databaseUI = new DatabaseUI(
|
||||
@@ -460,19 +482,29 @@ async function activateWithInstalledDistribution(
|
||||
const labelProvider = new HistoryItemLabelProvider(queryHistoryConfigurationListener);
|
||||
|
||||
void logger.log('Initializing results panel interface.');
|
||||
const intm = new InterfaceManager(ctx, dbm, cliServer, queryServerLogger, labelProvider);
|
||||
ctx.subscriptions.push(intm);
|
||||
const localQueryResultsView = new ResultsView(ctx, dbm, cliServer, queryServerLogger, labelProvider);
|
||||
ctx.subscriptions.push(localQueryResultsView);
|
||||
|
||||
void logger.log('Initializing variant analysis manager.');
|
||||
const rqm = new RemoteQueriesManager(ctx, cliServer, queryStorageDir, logger);
|
||||
const variantAnalysisStorageDir = path.join(ctx.globalStorageUri.fsPath, 'variant-analyses');
|
||||
await fs.ensureDir(variantAnalysisStorageDir);
|
||||
const variantAnalysisResultsManager = new VariantAnalysisResultsManager(cliServer, logger);
|
||||
const variantAnalysisManager = new VariantAnalysisManager(ctx, variantAnalysisStorageDir, variantAnalysisResultsManager);
|
||||
ctx.subscriptions.push(variantAnalysisManager);
|
||||
ctx.subscriptions.push(variantAnalysisResultsManager);
|
||||
ctx.subscriptions.push(workspace.registerTextDocumentContentProvider('codeql-variant-analysis', createVariantAnalysisContentProvider(variantAnalysisManager)));
|
||||
|
||||
void logger.log('Initializing remote queries manager.');
|
||||
const rqm = new RemoteQueriesManager(ctx, cliServer, queryStorageDir, logger, variantAnalysisManager);
|
||||
ctx.subscriptions.push(rqm);
|
||||
|
||||
void logger.log('Initializing query history.');
|
||||
const qhm = new QueryHistoryManager(
|
||||
qs,
|
||||
dbm,
|
||||
intm,
|
||||
localQueryResultsView,
|
||||
rqm,
|
||||
variantAnalysisManager,
|
||||
evalLogViewer,
|
||||
queryStorageDir,
|
||||
ctx,
|
||||
@@ -488,13 +520,10 @@ async function activateWithInstalledDistribution(
|
||||
void logger.log('Initializing evaluation log scanners.');
|
||||
const logScannerService = new LogScannerService(qhm);
|
||||
ctx.subscriptions.push(logScannerService);
|
||||
ctx.subscriptions.push(logScannerService.scanners.registerLogScannerProvider(new JoinOrderScannerProvider()));
|
||||
ctx.subscriptions.push(logScannerService.scanners.registerLogScannerProvider(new JoinOrderScannerProvider(() => joinOrderWarningThreshold())));
|
||||
|
||||
void logger.log('Reading query history');
|
||||
await qhm.readQueryHistory();
|
||||
|
||||
void logger.log('Initializing compare panel interface.');
|
||||
const cmpm = new CompareInterfaceManager(
|
||||
void logger.log('Initializing compare view.');
|
||||
const compareView = new CompareView(
|
||||
ctx,
|
||||
dbm,
|
||||
cliServer,
|
||||
@@ -502,7 +531,7 @@ async function activateWithInstalledDistribution(
|
||||
labelProvider,
|
||||
showResults
|
||||
);
|
||||
ctx.subscriptions.push(cmpm);
|
||||
ctx.subscriptions.push(compareView);
|
||||
|
||||
void logger.log('Initializing source archive filesystem provider.');
|
||||
archiveFilesystemProvider.activate(ctx);
|
||||
@@ -512,7 +541,7 @@ async function activateWithInstalledDistribution(
|
||||
to: CompletedLocalQueryInfo
|
||||
): Promise<void> {
|
||||
try {
|
||||
await cmpm.showResults(from, to);
|
||||
await compareView.showResults(from, to);
|
||||
} catch (e) {
|
||||
void showAndLogErrorMessage(getErrorMessage(e));
|
||||
}
|
||||
@@ -522,7 +551,7 @@ async function activateWithInstalledDistribution(
|
||||
query: CompletedLocalQueryInfo,
|
||||
forceReveal: WebviewReveal
|
||||
): Promise<void> {
|
||||
await intm.showResults(query, forceReveal, false);
|
||||
await localQueryResultsView.showResults(query, forceReveal, false);
|
||||
}
|
||||
|
||||
async function compileAndRunQuery(
|
||||
@@ -552,9 +581,7 @@ async function activateWithInstalledDistribution(
|
||||
const item = new LocalQueryInfo(initialInfo, source);
|
||||
qhm.addQuery(item);
|
||||
try {
|
||||
const completedQueryInfo = await compileAndRunQueryAgainstDatabase(
|
||||
cliServer,
|
||||
qs,
|
||||
const completedQueryInfo = await qs.compileAndRunQueryAgainstDatabase(
|
||||
databaseItem,
|
||||
initialInfo,
|
||||
queryStorageDir,
|
||||
@@ -564,7 +591,7 @@ async function activateWithInstalledDistribution(
|
||||
item,
|
||||
);
|
||||
qhm.completeQuery(item, completedQueryInfo);
|
||||
await showResultsForCompletedQuery(item as CompletedLocalQueryInfo, WebviewReveal.NotForced);
|
||||
await showResultsForCompletedQuery(item as CompletedLocalQueryInfo, WebviewReveal.Forced);
|
||||
// Note we must update the query history view after showing results as the
|
||||
// display and sorting might depend on the number of results
|
||||
} catch (e) {
|
||||
@@ -782,12 +809,13 @@ async function activateWithInstalledDistribution(
|
||||
});
|
||||
}
|
||||
|
||||
if (queryUris.length > 1) {
|
||||
if (queryUris.length > 1 && !await cliServer.cliConstraints.supportsNonDestructiveUpgrades()) {
|
||||
// Try to upgrade the current database before running any queries
|
||||
// so that the user isn't confronted with multiple upgrade
|
||||
// requests for each query to run.
|
||||
// Only do it if running multiple queries since this check is
|
||||
// performed on each query run anyway.
|
||||
// Don't do this with non destructive upgrades as the user won't see anything anyway.
|
||||
await databaseUI.tryUpgradeCurrentDatabase(progress, token);
|
||||
}
|
||||
|
||||
@@ -906,6 +934,39 @@ async function activateWithInstalledDistribution(
|
||||
})
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.monitorVariantAnalysis', async (
|
||||
variantAnalysis: VariantAnalysis,
|
||||
token: CancellationToken
|
||||
) => {
|
||||
await variantAnalysisManager.monitorVariantAnalysis(variantAnalysis, token);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.autoDownloadVariantAnalysisResult', async (
|
||||
scannedRepo: VariantAnalysisScannedRepository,
|
||||
variantAnalysisSummary: VariantAnalysis,
|
||||
token: CancellationToken
|
||||
) => {
|
||||
await variantAnalysisManager.enqueueDownload(scannedRepo, variantAnalysisSummary, token);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.cancelVariantAnalysis', async (
|
||||
variantAnalysisId: number,
|
||||
) => {
|
||||
await variantAnalysisManager.cancelVariantAnalysis(variantAnalysisId);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.openVariantAnalysis', async () => {
|
||||
await variantAnalysisManager.promptOpenVariantAnalysis();
|
||||
})
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.autoDownloadRemoteQueryResults', async (
|
||||
queryResult: RemoteQueryResult,
|
||||
@@ -914,8 +975,21 @@ async function activateWithInstalledDistribution(
|
||||
}));
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.exportVariantAnalysisResults', async () => {
|
||||
await exportRemoteQueryResults(qhm, rqm, ctx);
|
||||
commandRunner('codeQL.exportVariantAnalysisResults', async (queryId?: string) => {
|
||||
await exportRemoteQueryResults(qhm, rqm, ctx, queryId);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.loadVariantAnalysisRepoResults', async (variantAnalysisId: number, repositoryFullName: string) => {
|
||||
await variantAnalysisManager.loadResults(variantAnalysisId, repositoryFullName);
|
||||
})
|
||||
);
|
||||
|
||||
// The "openVariantAnalysisView" command is internal-only.
|
||||
ctx.subscriptions.push(
|
||||
commandRunner('codeQL.openVariantAnalysisView', async (variantAnalysisId: number) => {
|
||||
await variantAnalysisManager.showView(variantAnalysisId);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1122,8 +1196,47 @@ async function activateWithInstalledDistribution(
|
||||
)
|
||||
);
|
||||
|
||||
const mockServer = new VSCodeMockGitHubApiServer(ctx);
|
||||
ctx.subscriptions.push(mockServer);
|
||||
ctx.subscriptions.push(
|
||||
commandRunner(
|
||||
'codeQL.mockGitHubApiServer.startRecording',
|
||||
async () => await mockServer.startRecording(),
|
||||
)
|
||||
);
|
||||
ctx.subscriptions.push(
|
||||
commandRunner(
|
||||
'codeQL.mockGitHubApiServer.saveScenario',
|
||||
async () => await mockServer.saveScenario(),
|
||||
)
|
||||
);
|
||||
ctx.subscriptions.push(
|
||||
commandRunner(
|
||||
'codeQL.mockGitHubApiServer.cancelRecording',
|
||||
async () => await mockServer.cancelRecording(),
|
||||
)
|
||||
);
|
||||
ctx.subscriptions.push(
|
||||
commandRunner(
|
||||
'codeQL.mockGitHubApiServer.loadScenario',
|
||||
async () => await mockServer.loadScenario(),
|
||||
)
|
||||
);
|
||||
ctx.subscriptions.push(
|
||||
commandRunner(
|
||||
'codeQL.mockGitHubApiServer.unloadScenario',
|
||||
async () => await mockServer.unloadScenario(),
|
||||
)
|
||||
);
|
||||
|
||||
await commands.executeCommand('codeQLDatabases.removeOrphanedDatabases');
|
||||
|
||||
void logger.log('Reading query history');
|
||||
await qhm.readQueryHistory();
|
||||
|
||||
const dbModule = await initializeDbModule(ctx);
|
||||
ctx.subscriptions.push(dbModule);
|
||||
|
||||
void logger.log('Successfully finished extension initialization.');
|
||||
|
||||
return {
|
||||
@@ -1133,12 +1246,46 @@ async function activateWithInstalledDistribution(
|
||||
distributionManager,
|
||||
databaseManager: dbm,
|
||||
databaseUI,
|
||||
variantAnalysisManager,
|
||||
dispose: () => {
|
||||
ctx.subscriptions.forEach(d => d.dispose());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function createQueryServer(qlConfigurationListener: QueryServerConfigListener, cliServer: CodeQLCliServer, ctx: ExtensionContext): Promise<QueryRunner> {
|
||||
const qsOpts = {
|
||||
logger: queryServerLogger,
|
||||
contextStoragePath: getContextStoragePath(ctx),
|
||||
};
|
||||
const progressCallback = (task: (progress: ProgressReporter, token: CancellationToken) => Thenable<void>) => Window.withProgress(
|
||||
{ title: 'CodeQL query server', location: ProgressLocation.Window },
|
||||
task
|
||||
);
|
||||
if (await cliServer.cliConstraints.supportsNewQueryServer()) {
|
||||
const qs = new newQueryServer.QueryServerClient(
|
||||
qlConfigurationListener,
|
||||
cliServer,
|
||||
qsOpts,
|
||||
progressCallback
|
||||
);
|
||||
ctx.subscriptions.push(qs);
|
||||
await qs.startQueryServer();
|
||||
return new NewQueryRunner(qs);
|
||||
|
||||
} else {
|
||||
const qs = new legacyQueryServer.QueryServerClient(
|
||||
qlConfigurationListener,
|
||||
cliServer,
|
||||
qsOpts,
|
||||
progressCallback
|
||||
);
|
||||
ctx.subscriptions.push(qs);
|
||||
await qs.startQueryServer();
|
||||
return new LegacyQueryRunner(qs);
|
||||
}
|
||||
}
|
||||
|
||||
function getContextStoragePath(ctx: ExtensionContext) {
|
||||
return ctx.storageUri?.fsPath || ctx.globalStorageUri.fsPath;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,11 @@ fs.ensureDirSync(upgradesTmpDir);
|
||||
|
||||
export const tmpDirDisposal = {
|
||||
dispose: () => {
|
||||
tmpDir.removeCallback();
|
||||
try {
|
||||
tmpDir.removeCallback();
|
||||
} catch (e) {
|
||||
void logger.log(`Failed to remove temporary directory ${tmpDir.name}: ${e}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -470,9 +474,9 @@ export function getInitialQueryContents(language: string, dbscheme: string) {
|
||||
|
||||
/**
|
||||
* Heuristically determines if the directory passed in corresponds
|
||||
* to a database root.
|
||||
*
|
||||
* @param maybeRoot
|
||||
* to a database root. A database root is a directory that contains
|
||||
* a codeql-database.yml or (historically) a .dbinfo file. It also
|
||||
* contains a folder starting with `db-`.
|
||||
*/
|
||||
export async function isLikelyDatabaseRoot(maybeRoot: string) {
|
||||
const [a, b, c] = (await Promise.all([
|
||||
@@ -484,11 +488,14 @@ export async function isLikelyDatabaseRoot(maybeRoot: string) {
|
||||
glob('db-*/', { cwd: maybeRoot })
|
||||
]));
|
||||
|
||||
return !!((a || b) && c);
|
||||
return ((a || b) && c.length > 0);
|
||||
}
|
||||
|
||||
export function isLikelyDbLanguageFolder(dbPath: string) {
|
||||
return !!path.basename(dbPath).startsWith('db-');
|
||||
/**
|
||||
* A language folder is any folder starting with `db-` that is itself not a database root.
|
||||
*/
|
||||
export async function isLikelyDbLanguageFolder(dbPath: string) {
|
||||
return path.basename(dbPath).startsWith('db-') && !(await isLikelyDatabaseRoot(dbPath));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -581,11 +588,3 @@ export async function* walkDirectory(dir: string): AsyncIterableIterator<string>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pluralizes a word.
|
||||
* Example: Returns "N repository" if N is one, "N repositories" otherwise.
|
||||
*/
|
||||
export function pluralize(numItems: number | undefined, singular: string, plural: string): string {
|
||||
return numItems ? `${numItems} ${numItems === 1 ? singular : plural}` : '';
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { env } from 'vscode';
|
||||
import * as path from 'path';
|
||||
import { QueryHistoryConfig } from './config';
|
||||
import { LocalQueryInfo, QueryHistoryInfo } from './query-results';
|
||||
import { LocalQueryInfo } from './query-results';
|
||||
import { buildRepoLabel, getRawQueryName, QueryHistoryInfo } from './query-history-info';
|
||||
import { RemoteQueryHistoryItem } from './remote-queries/remote-query-history-item';
|
||||
import { pluralize } from './helpers';
|
||||
import { VariantAnalysisHistoryItem } from './remote-queries/variant-analysis-history-item';
|
||||
import { assertNever } from './pure/helpers-pure';
|
||||
import { pluralize } from './pure/word';
|
||||
import { humanizeQueryStatus } from './query-status';
|
||||
|
||||
interface InterpolateReplacements {
|
||||
t: string; // Start time
|
||||
@@ -21,9 +25,20 @@ export class HistoryItemLabelProvider {
|
||||
}
|
||||
|
||||
getLabel(item: QueryHistoryInfo) {
|
||||
const replacements = item.t === 'local'
|
||||
? this.getLocalInterpolateReplacements(item)
|
||||
: this.getRemoteInterpolateReplacements(item);
|
||||
let replacements: InterpolateReplacements;
|
||||
switch (item.t) {
|
||||
case 'local':
|
||||
replacements = this.getLocalInterpolateReplacements(item);
|
||||
break;
|
||||
case 'remote':
|
||||
replacements = this.getRemoteInterpolateReplacements(item);
|
||||
break;
|
||||
case 'variant-analysis':
|
||||
replacements = this.getVariantAnalysisInterpolateReplacements(item);
|
||||
break;
|
||||
default:
|
||||
assertNever(item);
|
||||
}
|
||||
|
||||
const rawLabel = item.userSpecifiedLabel ?? (this.config.format || '%q');
|
||||
|
||||
@@ -39,9 +54,7 @@ export class HistoryItemLabelProvider {
|
||||
getShortLabel(item: QueryHistoryInfo): string {
|
||||
return item.userSpecifiedLabel
|
||||
? this.getLabel(item)
|
||||
: item.t === 'local'
|
||||
? item.getQueryName()
|
||||
: item.remoteQuery.queryName;
|
||||
: getRawQueryName(item);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,27 +80,29 @@ export class HistoryItemLabelProvider {
|
||||
};
|
||||
}
|
||||
|
||||
// Return the number of repositories queried if available. Otherwise, use the controller repository name.
|
||||
private buildRepoLabel(item: RemoteQueryHistoryItem): string {
|
||||
const repositoryCount = item.remoteQuery.repositoryCount;
|
||||
|
||||
if (repositoryCount) {
|
||||
return pluralize(repositoryCount, 'repository', 'repositories');
|
||||
}
|
||||
|
||||
return `${item.remoteQuery.controllerRepository.owner}/${item.remoteQuery.controllerRepository.name}`;
|
||||
}
|
||||
|
||||
private getRemoteInterpolateReplacements(item: RemoteQueryHistoryItem): InterpolateReplacements {
|
||||
const resultCount = item.resultCount ? `(${pluralize(item.resultCount, 'result', 'results')})` : '';
|
||||
return {
|
||||
t: new Date(item.remoteQuery.executionStartTime).toLocaleString(env.language),
|
||||
q: `${item.remoteQuery.queryName} (${item.remoteQuery.language})`,
|
||||
d: this.buildRepoLabel(item),
|
||||
d: buildRepoLabel(item),
|
||||
r: resultCount,
|
||||
s: item.status,
|
||||
s: humanizeQueryStatus(item.status),
|
||||
f: path.basename(item.remoteQuery.queryFilePath),
|
||||
'%': '%'
|
||||
};
|
||||
}
|
||||
|
||||
private getVariantAnalysisInterpolateReplacements(item: VariantAnalysisHistoryItem): InterpolateReplacements {
|
||||
const resultCount = item.resultCount ? `(${pluralize(item.resultCount, 'result', 'results')})` : '';
|
||||
return {
|
||||
t: new Date(item.variantAnalysis.executionStartTime).toLocaleString(env.language),
|
||||
q: `${item.variantAnalysis.query.name} (${item.variantAnalysis.query.language})`,
|
||||
d: buildRepoLabel(item),
|
||||
r: resultCount,
|
||||
s: humanizeQueryStatus(item.status),
|
||||
f: path.basename(item.variantAnalysis.query.filePath),
|
||||
'%': '%',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ export function tryResolveLocation(
|
||||
}
|
||||
}
|
||||
|
||||
export type WebviewView = 'results' | 'compare' | 'remote-queries';
|
||||
export type WebviewView = 'results' | 'compare' | 'remote-queries' | 'variant-analysis';
|
||||
|
||||
export interface WebviewMessage {
|
||||
t: string;
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
languages,
|
||||
Uri,
|
||||
window as Window,
|
||||
env
|
||||
env, WebviewPanel
|
||||
} from 'vscode';
|
||||
import * as cli from './cli';
|
||||
import { CodeQLCliServer } from './cli';
|
||||
@@ -27,12 +27,12 @@ import {
|
||||
ALERTS_TABLE_NAME,
|
||||
GRAPH_TABLE_NAME,
|
||||
RawResultsSortState,
|
||||
NavigationDirection,
|
||||
} from './pure/interface-types';
|
||||
import { Logger } from './logging';
|
||||
import * as messages from './pure/messages';
|
||||
import { commandRunner } from './commandRunner';
|
||||
import { CompletedQueryInfo, interpretResultsSarif, interpretGraphResults } from './query-results';
|
||||
import { QueryEvaluationInfo } from './run-queries';
|
||||
import { QueryEvaluationInfo } from './run-queries-shared';
|
||||
import { parseSarifLocation, parseSarifPlainTextMessage } from './pure/sarif-utils';
|
||||
import {
|
||||
WebviewReveal,
|
||||
@@ -44,7 +44,7 @@ import {
|
||||
} from './interface-utils';
|
||||
import { getDefaultResultSetName, ParsedResultSets } from './pure/interface-types';
|
||||
import { RawResultSet, transformBqrsResultSet, ResultSetSchema } from './pure/bqrs-cli-types';
|
||||
import { AbstractInterfaceManager, InterfacePanelConfig } from './abstract-interface-manager';
|
||||
import { AbstractWebview, WebviewPanelConfig } from './abstract-webview';
|
||||
import { PAGE_SIZE } from './config';
|
||||
import { CompletedLocalQueryInfo } from './query-results';
|
||||
import { HistoryItemLabelProvider } from './history-item-label-provider';
|
||||
@@ -120,7 +120,7 @@ function numInterpretedPages(interpretation: Interpretation | undefined): number
|
||||
return Math.ceil(n / pageSize);
|
||||
}
|
||||
|
||||
export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMsg, FromResultsViewMsg> {
|
||||
export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResultsViewMsg> {
|
||||
private _displayedQuery?: CompletedLocalQueryInfo;
|
||||
private _interpretation?: Interpretation;
|
||||
|
||||
@@ -142,19 +142,24 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
this.handleSelectionChange.bind(this)
|
||||
)
|
||||
);
|
||||
void logger.log('Registering path-step navigation commands.');
|
||||
this.push(
|
||||
commandRunner(
|
||||
'codeQLQueryResults.nextPathStep',
|
||||
this.navigatePathStep.bind(this, 1)
|
||||
)
|
||||
);
|
||||
this.push(
|
||||
commandRunner(
|
||||
'codeQLQueryResults.previousPathStep',
|
||||
this.navigatePathStep.bind(this, -1)
|
||||
)
|
||||
);
|
||||
const navigationCommands = {
|
||||
'codeQLQueryResults.up': NavigationDirection.up,
|
||||
'codeQLQueryResults.down': NavigationDirection.down,
|
||||
'codeQLQueryResults.left': NavigationDirection.left,
|
||||
'codeQLQueryResults.right': NavigationDirection.right,
|
||||
// For backwards compatibility with keybindings set using an earlier version of the extension.
|
||||
'codeQLQueryResults.nextPathStep': NavigationDirection.down,
|
||||
'codeQLQueryResults.previousPathStep': NavigationDirection.up,
|
||||
};
|
||||
void logger.log('Registering result view navigation commands.');
|
||||
for (const [commandId, direction] of Object.entries(navigationCommands)) {
|
||||
this.push(
|
||||
commandRunner(
|
||||
commandId,
|
||||
this.navigateResultView.bind(this, direction)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
this.push(
|
||||
this.databaseManager.onDidChangeDatabaseItem(({ kind }) => {
|
||||
@@ -170,11 +175,16 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
);
|
||||
}
|
||||
|
||||
async navigatePathStep(direction: number): Promise<void> {
|
||||
await this.postMessage({ t: 'navigatePath', direction });
|
||||
async navigateResultView(direction: NavigationDirection): Promise<void> {
|
||||
if (!this.panel?.visible) {
|
||||
return;
|
||||
}
|
||||
// Reveal the panel now as the subsequent call to 'Window.showTextEditor' in 'showLocation' may destroy the webview otherwise.
|
||||
this.panel.reveal();
|
||||
await this.postMessage({ t: 'navigate', direction });
|
||||
}
|
||||
|
||||
protected getPanelConfig(): InterfacePanelConfig {
|
||||
protected getPanelConfig(): WebviewPanelConfig {
|
||||
return {
|
||||
viewId: 'resultsView',
|
||||
title: 'CodeQL Query Results',
|
||||
@@ -191,7 +201,7 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
protected async onMessage(msg: FromResultsViewMsg): Promise<void> {
|
||||
try {
|
||||
switch (msg.t) {
|
||||
case 'resultViewLoaded':
|
||||
case 'viewLoaded':
|
||||
this.onWebViewLoaded();
|
||||
break;
|
||||
case 'viewSourceFile': {
|
||||
@@ -327,10 +337,12 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
forceReveal: WebviewReveal,
|
||||
shouldKeepOldResultsWhileRendering = false
|
||||
): Promise<void> {
|
||||
if (fullQuery.completedQuery.result.resultType !== messages.QueryResultType.SUCCESS) {
|
||||
if (!fullQuery.completedQuery.successful) {
|
||||
return;
|
||||
}
|
||||
|
||||
const panel = await this.getPanel();
|
||||
|
||||
this._interpretation = undefined;
|
||||
const interpretationPage = await this.interpretResultsInfo(
|
||||
fullQuery.completedQuery.query,
|
||||
@@ -340,12 +352,11 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
const sortedResultsMap: SortedResultsMap = {};
|
||||
Object.entries(fullQuery.completedQuery.sortedResultsInfo).forEach(
|
||||
([k, v]) =>
|
||||
(sortedResultsMap[k] = this.convertPathPropertiesToWebviewUris(v))
|
||||
(sortedResultsMap[k] = this.convertPathPropertiesToWebviewUris(panel, v))
|
||||
);
|
||||
|
||||
this._displayedQuery = fullQuery;
|
||||
|
||||
const panel = this.getPanel();
|
||||
await this.waitForPanelLoaded();
|
||||
if (!panel.visible) {
|
||||
if (forceReveal === WebviewReveal.Forced) {
|
||||
@@ -416,6 +427,7 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
interpretation: interpretationPage,
|
||||
origResultsPaths: fullQuery.completedQuery.query.resultsPaths,
|
||||
resultsPath: this.convertPathToWebviewUri(
|
||||
panel,
|
||||
fullQuery.completedQuery.query.resultsPaths.resultsPath
|
||||
),
|
||||
parsedResultSets,
|
||||
@@ -488,10 +500,12 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
throw new Error('trying to view a page of a query that is not loaded');
|
||||
}
|
||||
|
||||
const panel = await this.getPanel();
|
||||
|
||||
const sortedResultsMap: SortedResultsMap = {};
|
||||
Object.entries(results.completedQuery.sortedResultsInfo).forEach(
|
||||
([k, v]) =>
|
||||
(sortedResultsMap[k] = this.convertPathPropertiesToWebviewUris(v))
|
||||
(sortedResultsMap[k] = this.convertPathPropertiesToWebviewUris(panel, v))
|
||||
);
|
||||
|
||||
const resultSetSchemas = await this.getResultSetSchemas(results.completedQuery, sorted ? selectedTable : '');
|
||||
@@ -534,6 +548,7 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
interpretation: this._interpretation,
|
||||
origResultsPaths: results.completedQuery.query.resultsPaths,
|
||||
resultsPath: this.convertPathToWebviewUri(
|
||||
panel,
|
||||
results.completedQuery.query.resultsPaths.resultsPath
|
||||
),
|
||||
parsedResultSets,
|
||||
@@ -802,15 +817,16 @@ export class InterfaceManager extends AbstractInterfaceManager<IntoResultsViewMs
|
||||
this._diagnosticCollection.set(diagnostics);
|
||||
}
|
||||
|
||||
private convertPathToWebviewUri(path: string): string {
|
||||
return fileUriToWebviewUri(this.getPanel(), Uri.file(path));
|
||||
private convertPathToWebviewUri(panel: WebviewPanel, path: string): string {
|
||||
return fileUriToWebviewUri(panel, Uri.file(path));
|
||||
}
|
||||
|
||||
private convertPathPropertiesToWebviewUris(
|
||||
panel: WebviewPanel,
|
||||
info: SortedResultSetInfo
|
||||
): SortedResultSetInfo {
|
||||
return {
|
||||
resultsPath: this.convertPathToWebviewUri(info.resultsPath),
|
||||
resultsPath: this.convertPathToWebviewUri(panel, info.resultsPath),
|
||||
sortState: info.sortState,
|
||||
};
|
||||
}
|
||||
|
||||
30
extensions/ql-vscode/src/json-rpc-server.ts
Normal file
30
extensions/ql-vscode/src/json-rpc-server.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Logger } from './logging';
|
||||
import * as cp from 'child_process';
|
||||
import { Disposable } from 'vscode';
|
||||
import { MessageConnection } from 'vscode-jsonrpc';
|
||||
|
||||
|
||||
/** A running query server process and its associated message connection. */
|
||||
export class ServerProcess implements Disposable {
|
||||
child: cp.ChildProcess;
|
||||
connection: MessageConnection;
|
||||
logger: Logger;
|
||||
|
||||
constructor(child: cp.ChildProcess, connection: MessageConnection, private name: string, logger: Logger) {
|
||||
this.child = child;
|
||||
this.connection = connection;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
void this.logger.log(`Stopping ${this.name}...`);
|
||||
this.connection.dispose();
|
||||
this.child.stdin!.end();
|
||||
this.child.stderr!.destroy();
|
||||
// TODO kill the process if it doesn't terminate after a certain time limit.
|
||||
|
||||
// On Windows, we usually have to terminate the process before closing its stdout.
|
||||
this.child.stdout!.destroy();
|
||||
void this.logger.log(`Stopped ${this.name}.`);
|
||||
}
|
||||
}
|
||||
65
extensions/ql-vscode/src/legacy-query-server/legacyRunner.ts
Normal file
65
extensions/ql-vscode/src/legacy-query-server/legacyRunner.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import { CancellationToken } from 'vscode';
|
||||
import { ProgressCallback } from '../commandRunner';
|
||||
import { DatabaseItem } from '../databases';
|
||||
import { Dataset, deregisterDatabases, registerDatabases } from '../pure/legacy-messages';
|
||||
import { InitialQueryInfo, LocalQueryInfo } from '../query-results';
|
||||
import { QueryRunner } from '../queryRunner';
|
||||
import { QueryWithResults } from '../run-queries-shared';
|
||||
import { QueryServerClient } from './queryserver-client';
|
||||
import { clearCacheInDatabase, compileAndRunQueryAgainstDatabase } from './run-queries';
|
||||
import { upgradeDatabaseExplicit } from './upgrades';
|
||||
|
||||
export class LegacyQueryRunner extends QueryRunner {
|
||||
|
||||
|
||||
constructor(public readonly qs: QueryServerClient) {
|
||||
super();
|
||||
}
|
||||
|
||||
get cliServer() {
|
||||
return this.qs.cliServer;
|
||||
}
|
||||
|
||||
async restartQueryServer(progress: ProgressCallback, token: CancellationToken): Promise<void> {
|
||||
await this.qs.restartQueryServer(progress, token);
|
||||
}
|
||||
|
||||
onStart(callBack: (progress: ProgressCallback, token: CancellationToken) => Promise<void>) {
|
||||
this.qs.onDidStartQueryServer(callBack);
|
||||
}
|
||||
async clearCacheInDatabase(dbItem: DatabaseItem, progress: ProgressCallback, token: CancellationToken): Promise<void> {
|
||||
await clearCacheInDatabase(this.qs, dbItem, progress, token);
|
||||
}
|
||||
async compileAndRunQueryAgainstDatabase(dbItem: DatabaseItem, initialInfo: InitialQueryInfo, queryStorageDir: string, progress: ProgressCallback, token: CancellationToken, templates?: Record<string, string>, queryInfo?: LocalQueryInfo): Promise<QueryWithResults> {
|
||||
return await compileAndRunQueryAgainstDatabase(this.qs.cliServer, this.qs, dbItem, initialInfo, queryStorageDir, progress, token, templates, queryInfo);
|
||||
}
|
||||
|
||||
async deregisterDatabase(progress: ProgressCallback, token: CancellationToken, dbItem: DatabaseItem): Promise<void> {
|
||||
if (dbItem.contents && (await this.qs.cliServer.cliConstraints.supportsDatabaseRegistration())) {
|
||||
const databases: Dataset[] = [{
|
||||
dbDir: dbItem.contents.datasetUri.fsPath,
|
||||
workingSet: 'default'
|
||||
}];
|
||||
await this.qs.sendRequest(deregisterDatabases, { databases }, token, progress);
|
||||
}
|
||||
}
|
||||
async registerDatabase(progress: ProgressCallback, token: CancellationToken, dbItem: DatabaseItem): Promise<void> {
|
||||
if (dbItem.contents && (await this.qs.cliServer.cliConstraints.supportsDatabaseRegistration())) {
|
||||
const databases: Dataset[] = [{
|
||||
dbDir: dbItem.contents.datasetUri.fsPath,
|
||||
workingSet: 'default'
|
||||
}];
|
||||
await this.qs.sendRequest(registerDatabases, { databases }, token, progress);
|
||||
}
|
||||
}
|
||||
|
||||
async upgradeDatabaseExplicit(dbItem: DatabaseItem, progress: ProgressCallback, token: CancellationToken): Promise<void> {
|
||||
await upgradeDatabaseExplicit(this.qs, dbItem, progress, token);
|
||||
}
|
||||
|
||||
async clearPackCache(): Promise<void> {
|
||||
/**
|
||||
* Nothing needs to be done
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,25 @@
|
||||
import * as cp from 'child_process';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
|
||||
import { DisposableObject } from './pure/disposable-object';
|
||||
import { Disposable, CancellationToken, commands } from 'vscode';
|
||||
import { createMessageConnection, MessageConnection, RequestType } from 'vscode-jsonrpc';
|
||||
import * as cli from './cli';
|
||||
import { QueryServerConfig } from './config';
|
||||
import { Logger, ProgressReporter } from './logging';
|
||||
import { completeQuery, EvaluationResult, progress, ProgressMessage, WithProgressId } from './pure/messages';
|
||||
import * as messages from './pure/messages';
|
||||
import { ProgressCallback, ProgressTask } from './commandRunner';
|
||||
import { DisposableObject } from '../pure/disposable-object';
|
||||
import { CancellationToken, commands } from 'vscode';
|
||||
import { createMessageConnection, RequestType } from 'vscode-jsonrpc';
|
||||
import * as cli from '../cli';
|
||||
import { QueryServerConfig } from '../config';
|
||||
import { Logger, ProgressReporter } from '../logging';
|
||||
import { completeQuery, EvaluationResult, progress, ProgressMessage, WithProgressId } from '../pure/legacy-messages';
|
||||
import * as messages from '../pure/legacy-messages';
|
||||
import { ProgressCallback, ProgressTask } from '../commandRunner';
|
||||
import { findQueryLogFile } from '../run-queries-shared';
|
||||
import { ServerProcess } from '../json-rpc-server';
|
||||
|
||||
type WithProgressReporting = (task: (progress: ProgressReporter, token: CancellationToken) => Thenable<void>) => Thenable<void>;
|
||||
|
||||
type ServerOpts = {
|
||||
logger: Logger;
|
||||
contextStoragePath: string;
|
||||
}
|
||||
|
||||
/** A running query server process and its associated message connection. */
|
||||
class ServerProcess implements Disposable {
|
||||
child: cp.ChildProcess;
|
||||
connection: MessageConnection;
|
||||
logger: Logger;
|
||||
|
||||
constructor(child: cp.ChildProcess, connection: MessageConnection, logger: Logger) {
|
||||
this.child = child;
|
||||
this.connection = connection;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
void this.logger.log('Stopping query server...');
|
||||
this.connection.dispose();
|
||||
this.child.stdin!.end();
|
||||
this.child.stderr!.destroy();
|
||||
// TODO kill the process if it doesn't terminate after a certain time limit.
|
||||
|
||||
// On Windows, we usually have to terminate the process before closing its stdout.
|
||||
this.child.stdout!.destroy();
|
||||
void this.logger.log('Stopped query server.');
|
||||
}
|
||||
}
|
||||
|
||||
type WithProgressReporting = (task: (progress: ProgressReporter, token: CancellationToken) => Thenable<void>) => Thenable<void>;
|
||||
|
||||
/**
|
||||
* Client that manages a query server process.
|
||||
* The server process is started upon initialization and tracked during its lifetime.
|
||||
@@ -200,7 +176,7 @@ export class QueryServerClient extends DisposableObject {
|
||||
callback(res);
|
||||
}
|
||||
});
|
||||
this.serverProcess = new ServerProcess(child, connection, this.logger);
|
||||
this.serverProcess = new ServerProcess(child, connection, 'Query server', this.logger);
|
||||
// Ensure the server process is disposed together with this client.
|
||||
this.track(this.serverProcess);
|
||||
connection.listen();
|
||||
@@ -254,27 +230,3 @@ export class QueryServerClient extends DisposableObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function findQueryLogFile(resultPath: string): string {
|
||||
return path.join(resultPath, 'query.log');
|
||||
}
|
||||
|
||||
export function findQueryEvalLogFile(resultPath: string): string {
|
||||
return path.join(resultPath, 'evaluator-log.jsonl');
|
||||
}
|
||||
|
||||
export function findQueryEvalLogSummaryFile(resultPath: string): string {
|
||||
return path.join(resultPath, 'evaluator-log.summary');
|
||||
}
|
||||
|
||||
export function findJsonQueryEvalLogSummaryFile(resultPath: string): string {
|
||||
return path.join(resultPath, 'evaluator-log.summary.jsonl');
|
||||
}
|
||||
|
||||
export function findQueryEvalLogSummarySymbolsFile(resultPath: string): string {
|
||||
return path.join(resultPath, 'evaluator-log.summary.symbols.json');
|
||||
}
|
||||
|
||||
export function findQueryEvalLogEndSummaryFile(resultPath: string): string {
|
||||
return path.join(resultPath, 'evaluator-log-end.summary');
|
||||
}
|
||||
526
extensions/ql-vscode/src/legacy-query-server/run-queries.ts
Normal file
526
extensions/ql-vscode/src/legacy-query-server/run-queries.ts
Normal file
@@ -0,0 +1,526 @@
|
||||
import * as crypto from 'crypto';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as tmp from 'tmp-promise';
|
||||
import * as path from 'path';
|
||||
import {
|
||||
CancellationToken,
|
||||
Uri,
|
||||
} from 'vscode';
|
||||
import { ErrorCodes, ResponseError } from 'vscode-languageclient';
|
||||
|
||||
import * as cli from '../cli';
|
||||
import { DatabaseItem, } from '../databases';
|
||||
import {
|
||||
getOnDiskWorkspaceFolders,
|
||||
showAndLogErrorMessage,
|
||||
showAndLogWarningMessage,
|
||||
tryGetQueryMetadata,
|
||||
upgradesTmpDir
|
||||
} from '../helpers';
|
||||
import { ProgressCallback } from '../commandRunner';
|
||||
import { QueryMetadata } from '../pure/interface-types';
|
||||
import { logger } from '../logging';
|
||||
import * as messages from '../pure/legacy-messages';
|
||||
import { InitialQueryInfo, LocalQueryInfo } from '../query-results';
|
||||
import * as qsClient from './queryserver-client';
|
||||
import { getErrorMessage } from '../pure/helpers-pure';
|
||||
import { compileDatabaseUpgradeSequence, upgradeDatabaseExplicit } from './upgrades';
|
||||
import { QueryEvaluationInfo, QueryWithResults } from '../run-queries-shared';
|
||||
|
||||
/**
|
||||
* A collection of evaluation-time information about a query,
|
||||
* including the query itself, and where we have decided to put
|
||||
* temporary files associated with it, such as the compiled query
|
||||
* output and results.
|
||||
*/
|
||||
export class QueryInProgress {
|
||||
|
||||
public queryEvalInfo: QueryEvaluationInfo;
|
||||
/**
|
||||
* Note that in the {@link slurpQueryHistory} method, we create a QueryEvaluationInfo instance
|
||||
* by explicitly setting the prototype in order to avoid calling this constructor.
|
||||
*/
|
||||
constructor(
|
||||
readonly querySaveDir: string,
|
||||
readonly dbItemPath: string,
|
||||
databaseHasMetadataFile: boolean,
|
||||
readonly queryDbscheme: string, // the dbscheme file the query expects, based on library path resolution
|
||||
readonly quickEvalPosition?: messages.Position,
|
||||
readonly metadata?: QueryMetadata,
|
||||
readonly templates?: Record<string, string>,
|
||||
) {
|
||||
this.queryEvalInfo = new QueryEvaluationInfo(querySaveDir, dbItemPath, databaseHasMetadataFile, quickEvalPosition, metadata);
|
||||
/**/
|
||||
}
|
||||
|
||||
get compiledQueryPath() {
|
||||
return this.queryEvalInfo.compileQueryPath;
|
||||
}
|
||||
|
||||
|
||||
async run(
|
||||
qs: qsClient.QueryServerClient,
|
||||
upgradeQlo: string | undefined,
|
||||
availableMlModels: cli.MlModelInfo[],
|
||||
dbItem: DatabaseItem,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
queryInfo?: LocalQueryInfo,
|
||||
): Promise<messages.EvaluationResult> {
|
||||
if (!dbItem.contents || dbItem.error) {
|
||||
throw new Error('Can\'t run query on invalid database.');
|
||||
}
|
||||
|
||||
let result: messages.EvaluationResult | null = null;
|
||||
|
||||
const callbackId = qs.registerCallback(res => {
|
||||
result = {
|
||||
...res,
|
||||
logFileLocation: this.queryEvalInfo.logPath
|
||||
};
|
||||
});
|
||||
|
||||
const availableMlModelUris: messages.MlModel[] = availableMlModels.map(model => ({ uri: Uri.file(model.path).toString(true) }));
|
||||
|
||||
const queryToRun: messages.QueryToRun = {
|
||||
resultsPath: this.queryEvalInfo.resultsPaths.resultsPath,
|
||||
qlo: Uri.file(this.compiledQueryPath).toString(),
|
||||
compiledUpgrade: upgradeQlo && Uri.file(upgradeQlo).toString(),
|
||||
allowUnknownTemplates: true,
|
||||
templateValues: createSimpleTemplates(this.templates),
|
||||
availableMlModels: availableMlModelUris,
|
||||
id: callbackId,
|
||||
timeoutSecs: qs.config.timeoutSecs,
|
||||
};
|
||||
|
||||
const dataset: messages.Dataset = {
|
||||
dbDir: dbItem.contents.datasetUri.fsPath,
|
||||
workingSet: 'default'
|
||||
};
|
||||
if (queryInfo && await qs.cliServer.cliConstraints.supportsPerQueryEvalLog()) {
|
||||
await qs.sendRequest(messages.startLog, {
|
||||
db: dataset,
|
||||
logPath: this.queryEvalInfo.evalLogPath,
|
||||
});
|
||||
|
||||
}
|
||||
const params: messages.EvaluateQueriesParams = {
|
||||
db: dataset,
|
||||
evaluateId: callbackId,
|
||||
queries: [queryToRun],
|
||||
stopOnError: false,
|
||||
useSequenceHint: false
|
||||
};
|
||||
try {
|
||||
await qs.sendRequest(messages.runQueries, params, token, progress);
|
||||
if (qs.config.customLogDirectory) {
|
||||
void showAndLogWarningMessage(
|
||||
`Custom log directories are no longer supported. The "codeQL.runningQueries.customLogDirectory" setting is deprecated. Unset the setting to stop seeing this message. Query logs saved to ${this.queryEvalInfo.logPath}.`
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
qs.unRegisterCallback(callbackId);
|
||||
if (queryInfo && await qs.cliServer.cliConstraints.supportsPerQueryEvalLog()) {
|
||||
await qs.sendRequest(messages.endLog, {
|
||||
db: dataset,
|
||||
logPath: this.queryEvalInfo.evalLogPath,
|
||||
});
|
||||
if (await this.queryEvalInfo.hasEvalLog()) {
|
||||
await this.queryEvalInfo.addQueryLogs(queryInfo, qs.cliServer, qs.logger);
|
||||
} else {
|
||||
void showAndLogWarningMessage(`Failed to write structured evaluator log to ${this.queryEvalInfo.evalLogPath}.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result || {
|
||||
evaluationTime: 0,
|
||||
message: 'No result from server',
|
||||
queryId: -1,
|
||||
runId: callbackId,
|
||||
resultType: messages.QueryResultType.OTHER_ERROR
|
||||
};
|
||||
}
|
||||
|
||||
async compile(
|
||||
qs: qsClient.QueryServerClient,
|
||||
program: messages.QlProgram,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
): Promise<messages.CompilationMessage[]> {
|
||||
let compiled: messages.CheckQueryResult | undefined;
|
||||
try {
|
||||
const target = this.quickEvalPosition ? {
|
||||
quickEval: { quickEvalPos: this.quickEvalPosition }
|
||||
} : { query: {} };
|
||||
const params: messages.CompileQueryParams = {
|
||||
compilationOptions: {
|
||||
computeNoLocationUrls: true,
|
||||
failOnWarnings: false,
|
||||
fastCompilation: false,
|
||||
includeDilInQlo: true,
|
||||
localChecking: false,
|
||||
noComputeGetUrl: false,
|
||||
noComputeToString: false,
|
||||
computeDefaultStrings: true,
|
||||
emitDebugInfo: true
|
||||
},
|
||||
extraOptions: {
|
||||
timeoutSecs: qs.config.timeoutSecs
|
||||
},
|
||||
queryToCheck: program,
|
||||
resultPath: this.compiledQueryPath,
|
||||
target,
|
||||
};
|
||||
|
||||
compiled = await qs.sendRequest(messages.compileQuery, params, token, progress);
|
||||
} finally {
|
||||
void qs.logger.log(' - - - COMPILATION DONE - - - ', { additionalLogLocation: this.queryEvalInfo.logPath });
|
||||
}
|
||||
return (compiled?.messages || []).filter(msg => msg.severity === messages.Severity.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
export async function clearCacheInDatabase(
|
||||
qs: qsClient.QueryServerClient,
|
||||
dbItem: DatabaseItem,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
): Promise<messages.ClearCacheResult> {
|
||||
if (dbItem.contents === undefined) {
|
||||
throw new Error('Can\'t clear the cache in an invalid database.');
|
||||
}
|
||||
|
||||
const db: messages.Dataset = {
|
||||
dbDir: dbItem.contents.datasetUri.fsPath,
|
||||
workingSet: 'default',
|
||||
};
|
||||
|
||||
const params: messages.ClearCacheParams = {
|
||||
dryRun: false,
|
||||
db,
|
||||
};
|
||||
|
||||
return qs.sendRequest(messages.clearCache, params, token, progress);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare the dbscheme implied by the query `query` and that of the current database.
|
||||
* - If they are compatible, do nothing.
|
||||
* - If they are incompatible but the database can be upgraded, suggest that upgrade.
|
||||
* - If they are incompatible and the database cannot be upgraded, throw an error.
|
||||
*/
|
||||
async function checkDbschemeCompatibility(
|
||||
cliServer: cli.CodeQLCliServer,
|
||||
qs: qsClient.QueryServerClient,
|
||||
query: QueryInProgress,
|
||||
qlProgram: messages.QlProgram,
|
||||
dbItem: DatabaseItem,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
): Promise<void> {
|
||||
const searchPath = getOnDiskWorkspaceFolders();
|
||||
|
||||
if (dbItem.contents?.dbSchemeUri !== undefined) {
|
||||
const { finalDbscheme } = await cliServer.resolveUpgrades(dbItem.contents.dbSchemeUri.fsPath, searchPath, false);
|
||||
const hash = async function(filename: string): Promise<string> {
|
||||
return crypto.createHash('sha256').update(await fs.readFile(filename)).digest('hex');
|
||||
};
|
||||
|
||||
// At this point, we have learned about three dbschemes:
|
||||
|
||||
// the dbscheme of the actual database we're querying.
|
||||
const dbschemeOfDb = await hash(dbItem.contents.dbSchemeUri.fsPath);
|
||||
|
||||
// the dbscheme of the query we're running, including the library we've resolved it to use.
|
||||
const dbschemeOfLib = await hash(query.queryDbscheme);
|
||||
|
||||
// the database we're able to upgrade to
|
||||
const upgradableTo = await hash(finalDbscheme);
|
||||
|
||||
if (upgradableTo != dbschemeOfLib) {
|
||||
reportNoUpgradePath(qlProgram, query);
|
||||
}
|
||||
|
||||
if (upgradableTo == dbschemeOfLib &&
|
||||
dbschemeOfDb != dbschemeOfLib) {
|
||||
// Try to upgrade the database
|
||||
await upgradeDatabaseExplicit(
|
||||
qs,
|
||||
dbItem,
|
||||
progress,
|
||||
token
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reportNoUpgradePath(qlProgram: messages.QlProgram, query: QueryInProgress): void {
|
||||
throw new Error(
|
||||
`Query ${qlProgram.queryPath} expects database scheme ${query.queryDbscheme}, but the current database has a different scheme, and no database upgrades are available. The current database scheme may be newer than the CodeQL query libraries in your workspace.\n\nPlease try using a newer version of the query libraries.`
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile a non-destructive upgrade.
|
||||
*/
|
||||
async function compileNonDestructiveUpgrade(
|
||||
qs: qsClient.QueryServerClient,
|
||||
upgradeTemp: tmp.DirectoryResult,
|
||||
query: QueryInProgress,
|
||||
qlProgram: messages.QlProgram,
|
||||
dbItem: DatabaseItem,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
): Promise<string> {
|
||||
|
||||
if (!dbItem?.contents?.dbSchemeUri) {
|
||||
throw new Error('Database is invalid, and cannot be upgraded.');
|
||||
}
|
||||
|
||||
// When packaging is used, dependencies may exist outside of the workspace and they are always on the resolved search path.
|
||||
// When packaging is not used, all dependencies are in the workspace.
|
||||
const upgradesPath = (await qs.cliServer.cliConstraints.supportsPackaging())
|
||||
? qlProgram.libraryPath
|
||||
: getOnDiskWorkspaceFolders();
|
||||
|
||||
const { scripts, matchesTarget } = await qs.cliServer.resolveUpgrades(
|
||||
dbItem.contents.dbSchemeUri.fsPath,
|
||||
upgradesPath,
|
||||
true,
|
||||
query.queryDbscheme
|
||||
);
|
||||
|
||||
if (!matchesTarget) {
|
||||
reportNoUpgradePath(qlProgram, query);
|
||||
}
|
||||
const result = await compileDatabaseUpgradeSequence(qs, dbItem, scripts, upgradeTemp, progress, token);
|
||||
if (result.compiledUpgrade === undefined) {
|
||||
const error = result.error || '[no error message available]';
|
||||
throw new Error(error);
|
||||
}
|
||||
// We can upgrade to the actual target
|
||||
qlProgram.dbschemePath = query.queryDbscheme;
|
||||
// We are new enough that we will always support single file upgrades.
|
||||
return result.compiledUpgrade;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function compileAndRunQueryAgainstDatabase(
|
||||
cliServer: cli.CodeQLCliServer,
|
||||
qs: qsClient.QueryServerClient,
|
||||
dbItem: DatabaseItem,
|
||||
initialInfo: InitialQueryInfo,
|
||||
queryStorageDir: string,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
templates?: Record<string, string>,
|
||||
queryInfo?: LocalQueryInfo, // May be omitted for queries not initiated by the user. If omitted we won't create a structured log for the query.
|
||||
): Promise<QueryWithResults> {
|
||||
if (!dbItem.contents || !dbItem.contents.dbSchemeUri) {
|
||||
throw new Error(`Database ${dbItem.databaseUri} does not have a CodeQL database scheme.`);
|
||||
}
|
||||
|
||||
// Get the workspace folder paths.
|
||||
const diskWorkspaceFolders = getOnDiskWorkspaceFolders();
|
||||
// Figure out the library path for the query.
|
||||
const packConfig = await cliServer.resolveLibraryPath(diskWorkspaceFolders, initialInfo.queryPath);
|
||||
|
||||
if (!packConfig.dbscheme) {
|
||||
throw new Error('Could not find a database scheme for this query. Please check that you have a valid qlpack.yml file for this query, which refers to a database scheme either in the `dbscheme` field or through one of its dependencies.');
|
||||
}
|
||||
|
||||
// Check whether the query has an entirely different schema from the
|
||||
// database. (Queries that merely need the database to be upgraded
|
||||
// won't trigger this check)
|
||||
// This test will produce confusing results if we ever change the name of the database schema files.
|
||||
const querySchemaName = path.basename(packConfig.dbscheme);
|
||||
const dbSchemaName = path.basename(dbItem.contents.dbSchemeUri.fsPath);
|
||||
if (querySchemaName != dbSchemaName) {
|
||||
void logger.log(`Query schema was ${querySchemaName}, but database schema was ${dbSchemaName}.`);
|
||||
throw new Error(`The query ${path.basename(initialInfo.queryPath)} cannot be run against the selected database (${dbItem.name}): their target languages are different. Please select a different database and try again.`);
|
||||
}
|
||||
|
||||
const qlProgram: messages.QlProgram = {
|
||||
// The project of the current document determines which library path
|
||||
// we use. The `libraryPath` field in this server message is relative
|
||||
// to the workspace root, not to the project root.
|
||||
libraryPath: packConfig.libraryPath,
|
||||
// Since we are compiling and running a query against a database,
|
||||
// we use the database's DB scheme here instead of the DB scheme
|
||||
// from the current document's project.
|
||||
dbschemePath: dbItem.contents.dbSchemeUri.fsPath,
|
||||
queryPath: initialInfo.queryPath
|
||||
};
|
||||
|
||||
// Read the query metadata if possible, to use in the UI.
|
||||
const metadata = await tryGetQueryMetadata(cliServer, qlProgram.queryPath);
|
||||
|
||||
let availableMlModels: cli.MlModelInfo[] = [];
|
||||
if (!await cliServer.cliConstraints.supportsResolveMlModels()) {
|
||||
void logger.log('Resolving ML models is unsupported by this version of the CLI. Running the query without any ML models.');
|
||||
} else {
|
||||
try {
|
||||
availableMlModels = (await cliServer.resolveMlModels(diskWorkspaceFolders, initialInfo.queryPath)).models;
|
||||
if (availableMlModels.length) {
|
||||
void logger.log(`Found available ML models at the following paths: ${availableMlModels.map(x => `'${x.path}'`).join(', ')}.`);
|
||||
} else {
|
||||
void logger.log('Did not find any available ML models.');
|
||||
}
|
||||
} catch (e) {
|
||||
const message = `Couldn't resolve available ML models for ${qlProgram.queryPath}. Running the ` +
|
||||
`query without any ML models: ${e}.`;
|
||||
void showAndLogErrorMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
const hasMetadataFile = (await dbItem.hasMetadataFile());
|
||||
const query = new QueryInProgress(
|
||||
path.join(queryStorageDir, initialInfo.id),
|
||||
dbItem.databaseUri.fsPath,
|
||||
hasMetadataFile,
|
||||
packConfig.dbscheme,
|
||||
initialInfo.quickEvalPosition,
|
||||
metadata,
|
||||
templates
|
||||
);
|
||||
await query.queryEvalInfo.createTimestampFile();
|
||||
|
||||
let upgradeDir: tmp.DirectoryResult | undefined;
|
||||
try {
|
||||
let upgradeQlo;
|
||||
if (await cliServer.cliConstraints.supportsNonDestructiveUpgrades()) {
|
||||
upgradeDir = await tmp.dir({ dir: upgradesTmpDir, unsafeCleanup: true });
|
||||
upgradeQlo = await compileNonDestructiveUpgrade(qs, upgradeDir, query, qlProgram, dbItem, progress, token);
|
||||
} else {
|
||||
await checkDbschemeCompatibility(cliServer, qs, query, qlProgram, dbItem, progress, token);
|
||||
}
|
||||
let errors;
|
||||
try {
|
||||
errors = await query.compile(qs, qlProgram, progress, token);
|
||||
} catch (e) {
|
||||
if (e instanceof ResponseError && e.code == ErrorCodes.RequestCancelled) {
|
||||
return createSyntheticResult(query, 'Query cancelled');
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
if (errors.length === 0) {
|
||||
const result = await query.run(qs, upgradeQlo, availableMlModels, dbItem, progress, token, queryInfo);
|
||||
if (result.resultType !== messages.QueryResultType.SUCCESS) {
|
||||
const message = result.message || 'Failed to run query';
|
||||
void logger.log(message);
|
||||
void showAndLogErrorMessage(message);
|
||||
}
|
||||
const message = formatLegacyMessage(result);
|
||||
|
||||
return {
|
||||
query: query.queryEvalInfo,
|
||||
message,
|
||||
result,
|
||||
successful: result.resultType == messages.QueryResultType.SUCCESS,
|
||||
logFileLocation: result.logFileLocation,
|
||||
dispose: () => {
|
||||
qs.logger.removeAdditionalLogLocation(result.logFileLocation);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
// Error dialogs are limited in size and scrollability,
|
||||
// so we include a general description of the problem,
|
||||
// and direct the user to the output window for the detailed compilation messages.
|
||||
// However we don't show quick eval errors there so we need to display them anyway.
|
||||
void qs.logger.log(
|
||||
`Failed to compile query ${initialInfo.queryPath} against database scheme ${qlProgram.dbschemePath}:`,
|
||||
{ additionalLogLocation: query.queryEvalInfo.logPath }
|
||||
);
|
||||
|
||||
const formattedMessages: string[] = [];
|
||||
|
||||
for (const error of errors) {
|
||||
const message = error.message || '[no error message available]';
|
||||
const formatted = `ERROR: ${message} (${error.position.fileName}:${error.position.line}:${error.position.column}:${error.position.endLine}:${error.position.endColumn})`;
|
||||
formattedMessages.push(formatted);
|
||||
void qs.logger.log(formatted, { additionalLogLocation: query.queryEvalInfo.logPath });
|
||||
}
|
||||
if (initialInfo.isQuickEval && formattedMessages.length <= 2) {
|
||||
// If there are more than 2 error messages, they will not be displayed well in a popup
|
||||
// and will be trimmed by the function displaying the error popup. Accordingly, we only
|
||||
// try to show the errors if there are 2 or less, otherwise we direct the user to the log.
|
||||
void showAndLogErrorMessage('Quick evaluation compilation failed: ' + formattedMessages.join('\n'));
|
||||
} else {
|
||||
void showAndLogErrorMessage((initialInfo.isQuickEval ? 'Quick evaluation' : 'Query') + compilationFailedErrorTail);
|
||||
}
|
||||
return createSyntheticResult(query, 'Query had compilation errors');
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
await upgradeDir?.cleanup();
|
||||
} catch (e) {
|
||||
void qs.logger.log(
|
||||
`Could not clean up the upgrades dir. Reason: ${getErrorMessage(e)}`,
|
||||
{ additionalLogLocation: query.queryEvalInfo.logPath }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const compilationFailedErrorTail = ' compilation failed. Please make sure there are no errors in the query, the database is up to date,' +
|
||||
' and the query and database use the same target language. For more details on the error, go to View > Output,' +
|
||||
' and choose CodeQL Query Server from the dropdown.';
|
||||
|
||||
export function formatLegacyMessage(result: messages.EvaluationResult) {
|
||||
switch (result.resultType) {
|
||||
case messages.QueryResultType.CANCELLATION:
|
||||
return `cancelled after ${Math.round(result.evaluationTime / 1000)} seconds`;
|
||||
case messages.QueryResultType.OOM:
|
||||
return 'out of memory';
|
||||
case messages.QueryResultType.SUCCESS:
|
||||
return `finished in ${Math.round(result.evaluationTime / 1000)} seconds`;
|
||||
case messages.QueryResultType.TIMEOUT:
|
||||
return `timed out after ${Math.round(result.evaluationTime / 1000)} seconds`;
|
||||
case messages.QueryResultType.OTHER_ERROR:
|
||||
default:
|
||||
return result.message ? `failed: ${result.message}` : 'failed';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a synthetic result for a query that failed to compile.
|
||||
*/
|
||||
function createSyntheticResult(
|
||||
query: QueryInProgress,
|
||||
message: string,
|
||||
): QueryWithResults {
|
||||
return {
|
||||
query: query.queryEvalInfo,
|
||||
message,
|
||||
result: {
|
||||
evaluationTime: 0,
|
||||
queryId: 0,
|
||||
resultType: messages.QueryResultType.OTHER_ERROR,
|
||||
message,
|
||||
runId: 0,
|
||||
},
|
||||
successful: false,
|
||||
dispose: () => { /**/ },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function createSimpleTemplates(templates: Record<string, string> | undefined): messages.TemplateDefinitions | undefined {
|
||||
if (!templates) {
|
||||
return undefined;
|
||||
}
|
||||
const result: messages.TemplateDefinitions = {};
|
||||
for (const key of Object.keys(templates)) {
|
||||
result[key] = {
|
||||
values: {
|
||||
tuples: [[{ stringValue: templates[key] }]]
|
||||
}
|
||||
};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { getOnDiskWorkspaceFolders, showAndLogErrorMessage, tmpDir } from './helpers';
|
||||
import { ProgressCallback, UserCancellationException } from './commandRunner';
|
||||
import { logger } from './logging';
|
||||
import * as messages from './pure/messages';
|
||||
import { getOnDiskWorkspaceFolders, showAndLogErrorMessage, tmpDir } from '../helpers';
|
||||
import { ProgressCallback, UserCancellationException } from '../commandRunner';
|
||||
import { logger } from '../logging';
|
||||
import * as messages from '../pure/legacy-messages';
|
||||
import * as qsClient from './queryserver-client';
|
||||
import * as tmp from 'tmp-promise';
|
||||
import * as path from 'path';
|
||||
import * as semver from 'semver';
|
||||
import { DatabaseItem } from './databases';
|
||||
import { DatabaseItem } from '../databases';
|
||||
|
||||
/**
|
||||
* Maximum number of lines to include from database upgrade message,
|
||||
@@ -16,17 +15,6 @@ import { DatabaseItem } from './databases';
|
||||
*/
|
||||
const MAX_UPGRADE_MESSAGE_LINES = 10;
|
||||
|
||||
/**
|
||||
* Check that we support non-destructive upgrades.
|
||||
*
|
||||
* This requires 3 features. The ability to compile an upgrade sequence; The ability to
|
||||
* run a non-destructive upgrades as a query; the ability to specify a target when
|
||||
* resolving upgrades. We check for a version of codeql that has all three features.
|
||||
*/
|
||||
export async function hasNondestructiveUpgradeCapabilities(qs: qsClient.QueryServerClient): Promise<boolean> {
|
||||
return semver.gte(await qs.cliServer.getVersion(), '2.4.2');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compile a database upgrade sequence.
|
||||
@@ -43,7 +31,7 @@ export async function compileDatabaseUpgradeSequence(
|
||||
if (dbItem.contents === undefined || dbItem.contents.dbSchemeUri === undefined) {
|
||||
throw new Error('Database is invalid, and cannot be upgraded.');
|
||||
}
|
||||
if (!await hasNondestructiveUpgradeCapabilities(qs)) {
|
||||
if (!await qs.cliServer.cliConstraints.supportsNonDestructiveUpgrades()) {
|
||||
throw new Error('The version of codeql is too old to run non-destructive upgrades.');
|
||||
}
|
||||
// If possible just compile the upgrade sequence
|
||||
@@ -205,7 +193,14 @@ export async function upgradeDatabaseExplicit(
|
||||
void qs.logger.log('Running the following database upgrade:');
|
||||
|
||||
getUpgradeDescriptions(compileUpgradeResult.compiledUpgrades).map(s => s.description).join('\n');
|
||||
return await runDatabaseUpgrade(qs, dbItem, compileUpgradeResult.compiledUpgrades, progress, token);
|
||||
const result = await runDatabaseUpgrade(qs, dbItem, compileUpgradeResult.compiledUpgrades, progress, token);
|
||||
|
||||
// TODO Can remove the next lines when https://github.com/github/codeql-team/issues/1241 is fixed
|
||||
// restart the query server to avoid a bug in the CLI where the upgrade is applied, but the old dbscheme
|
||||
// is still cached in memory.
|
||||
|
||||
await qs.restartQueryServer(progress, token);
|
||||
return result;
|
||||
}
|
||||
catch (e) {
|
||||
void showAndLogErrorMessage(`Database upgrade failed: ${e}`);
|
||||
@@ -2,13 +2,11 @@ import * as I from 'immutable';
|
||||
import { EvaluationLogProblemReporter, EvaluationLogScanner, EvaluationLogScannerProvider } from './log-scanner';
|
||||
import { InLayer, ComputeRecursive, SummaryEvent, PipelineRun, ComputeSimple } from './log-summary';
|
||||
|
||||
const DEFAULT_WARNING_THRESHOLD = 50;
|
||||
|
||||
/**
|
||||
* Like `max`, but returns 0 if no meaningful maximum can be computed.
|
||||
*/
|
||||
function safeMax(it: Iterable<number>) {
|
||||
const m = Math.max(...it);
|
||||
function safeMax(it?: Iterable<number>) {
|
||||
const m = Math.max(...(it || []));
|
||||
return Number.isFinite(m) ? m : 0;
|
||||
}
|
||||
|
||||
@@ -454,7 +452,11 @@ class JoinOrderScanner implements EvaluationLogScanner {
|
||||
}
|
||||
|
||||
export class JoinOrderScannerProvider implements EvaluationLogScannerProvider {
|
||||
constructor(private readonly getThreshdold: () => number) {
|
||||
}
|
||||
|
||||
public createScanner(problemReporter: EvaluationLogProblemReporter): EvaluationLogScanner {
|
||||
return new JoinOrderScanner(problemReporter, DEFAULT_WARNING_THRESHOLD);
|
||||
const threshold = this.getThreshdold();
|
||||
return new JoinOrderScanner(problemReporter, threshold);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Diagnostic, DiagnosticSeverity, languages, Range, Uri } from 'vscode';
|
||||
import { DisposableObject } from '../pure/disposable-object';
|
||||
import { QueryHistoryManager } from '../query-history';
|
||||
import { QueryHistoryInfo } from '../query-results';
|
||||
import { QueryHistoryInfo } from '../query-history-info';
|
||||
import { EvaluationLogProblemReporter, EvaluationLogScannerSet } from './log-scanner';
|
||||
import { PipelineInfo, SummarySymbols } from './summary-parser';
|
||||
import * as fs from 'fs-extra';
|
||||
|
||||
102
extensions/ql-vscode/src/mocks/gh-api-request.ts
Normal file
102
extensions/ql-vscode/src/mocks/gh-api-request.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import { Repository } from '../remote-queries/gh-api/repository';
|
||||
import { VariantAnalysis, VariantAnalysisRepoTask } from '../remote-queries/gh-api/variant-analysis';
|
||||
|
||||
// Types that represent requests/responses from the GitHub API
|
||||
// that we need to mock.
|
||||
|
||||
export enum RequestKind {
|
||||
GetRepo = 'getRepo',
|
||||
SubmitVariantAnalysis = 'submitVariantAnalysis',
|
||||
GetVariantAnalysis = 'getVariantAnalysis',
|
||||
GetVariantAnalysisRepo = 'getVariantAnalysisRepo',
|
||||
GetVariantAnalysisRepoResult = 'getVariantAnalysisRepoResult',
|
||||
}
|
||||
|
||||
export interface BasicErorResponse {
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface GetRepoRequest {
|
||||
request: {
|
||||
kind: RequestKind.GetRepo
|
||||
},
|
||||
response: {
|
||||
status: number,
|
||||
body: Repository | BasicErorResponse | undefined
|
||||
}
|
||||
}
|
||||
|
||||
export interface SubmitVariantAnalysisRequest {
|
||||
request: {
|
||||
kind: RequestKind.SubmitVariantAnalysis
|
||||
},
|
||||
response: {
|
||||
status: number,
|
||||
body?: VariantAnalysis | BasicErorResponse
|
||||
}
|
||||
}
|
||||
|
||||
export interface GetVariantAnalysisRequest {
|
||||
request: {
|
||||
kind: RequestKind.GetVariantAnalysis
|
||||
},
|
||||
response: {
|
||||
status: number,
|
||||
body?: VariantAnalysis | BasicErorResponse
|
||||
}
|
||||
}
|
||||
|
||||
export interface GetVariantAnalysisRepoRequest {
|
||||
request: {
|
||||
kind: RequestKind.GetVariantAnalysisRepo,
|
||||
repositoryId: number
|
||||
},
|
||||
response: {
|
||||
status: number,
|
||||
body?: VariantAnalysisRepoTask | BasicErorResponse
|
||||
}
|
||||
}
|
||||
|
||||
export interface GetVariantAnalysisRepoResultRequest {
|
||||
request: {
|
||||
kind: RequestKind.GetVariantAnalysisRepoResult,
|
||||
repositoryId: number
|
||||
},
|
||||
response: {
|
||||
status: number,
|
||||
body?: Buffer | string,
|
||||
contentType: string,
|
||||
}
|
||||
}
|
||||
|
||||
export type GitHubApiRequest =
|
||||
| GetRepoRequest
|
||||
| SubmitVariantAnalysisRequest
|
||||
| GetVariantAnalysisRequest
|
||||
| GetVariantAnalysisRepoRequest
|
||||
| GetVariantAnalysisRepoResultRequest;
|
||||
|
||||
export const isGetRepoRequest = (
|
||||
request: GitHubApiRequest
|
||||
): request is GetRepoRequest =>
|
||||
request.request.kind === RequestKind.GetRepo;
|
||||
|
||||
export const isSubmitVariantAnalysisRequest = (
|
||||
request: GitHubApiRequest
|
||||
): request is SubmitVariantAnalysisRequest =>
|
||||
request.request.kind === RequestKind.SubmitVariantAnalysis;
|
||||
|
||||
export const isGetVariantAnalysisRequest = (
|
||||
request: GitHubApiRequest
|
||||
): request is GetVariantAnalysisRequest =>
|
||||
request.request.kind === RequestKind.GetVariantAnalysis;
|
||||
|
||||
export const isGetVariantAnalysisRepoRequest = (
|
||||
request: GitHubApiRequest
|
||||
): request is GetVariantAnalysisRepoRequest =>
|
||||
request.request.kind === RequestKind.GetVariantAnalysisRepo;
|
||||
|
||||
export const isGetVariantAnalysisRepoResultRequest = (
|
||||
request: GitHubApiRequest
|
||||
): request is GetVariantAnalysisRepoResultRequest =>
|
||||
request.request.kind === RequestKind.GetVariantAnalysisRepoResult;
|
||||
139
extensions/ql-vscode/src/mocks/mock-gh-api-server.ts
Normal file
139
extensions/ql-vscode/src/mocks/mock-gh-api-server.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import { setupServer, SetupServerApi } from 'msw/node';
|
||||
|
||||
import { DisposableObject } from '../pure/disposable-object';
|
||||
|
||||
import { Recorder } from './recorder';
|
||||
import { createRequestHandlers } from './request-handlers';
|
||||
import { getDirectoryNamesInsidePath } from '../pure/files';
|
||||
|
||||
/**
|
||||
* Enables mocking of the GitHub API server via HTTP interception, using msw.
|
||||
*/
|
||||
export class MockGitHubApiServer extends DisposableObject {
|
||||
private _isListening: boolean;
|
||||
|
||||
private readonly server: SetupServerApi;
|
||||
private readonly recorder: Recorder;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this._isListening = false;
|
||||
|
||||
this.server = setupServer();
|
||||
this.recorder = this.push(new Recorder(this.server));
|
||||
}
|
||||
|
||||
public startServer(): void {
|
||||
if (this._isListening) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.server.listen();
|
||||
this._isListening = true;
|
||||
}
|
||||
|
||||
public stopServer(): void {
|
||||
this.server.close();
|
||||
this._isListening = false;
|
||||
}
|
||||
|
||||
public async loadScenario(scenarioName: string, scenariosPath?: string): Promise<void> {
|
||||
if (!scenariosPath) {
|
||||
scenariosPath = await this.getDefaultScenariosPath();
|
||||
if (!scenariosPath) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const scenarioPath = path.join(scenariosPath, scenarioName);
|
||||
|
||||
const handlers = await createRequestHandlers(scenarioPath);
|
||||
this.server.resetHandlers();
|
||||
this.server.use(...handlers);
|
||||
}
|
||||
|
||||
public async saveScenario(scenarioName: string, scenariosPath?: string): Promise<string> {
|
||||
if (!scenariosPath) {
|
||||
scenariosPath = await this.getDefaultScenariosPath();
|
||||
if (!scenariosPath) {
|
||||
throw new Error('Could not find scenarios path');
|
||||
}
|
||||
}
|
||||
|
||||
const filePath = await this.recorder.save(scenariosPath, scenarioName);
|
||||
|
||||
await this.stopRecording();
|
||||
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public async unloadScenario(): Promise<void> {
|
||||
if (!this.isScenarioLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.unloadAllScenarios();
|
||||
}
|
||||
|
||||
public async startRecording(): Promise<void> {
|
||||
if (this.recorder.isRecording) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isScenarioLoaded) {
|
||||
await this.unloadAllScenarios();
|
||||
}
|
||||
|
||||
this.recorder.start();
|
||||
}
|
||||
|
||||
public async stopRecording(): Promise<void> {
|
||||
await this.recorder.stop();
|
||||
await this.recorder.clear();
|
||||
}
|
||||
|
||||
public async getScenarioNames(scenariosPath?: string): Promise<string[]> {
|
||||
if (!scenariosPath) {
|
||||
scenariosPath = await this.getDefaultScenariosPath();
|
||||
if (!scenariosPath) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
return await getDirectoryNamesInsidePath(scenariosPath);
|
||||
}
|
||||
|
||||
public get isListening(): boolean {
|
||||
return this._isListening;
|
||||
}
|
||||
|
||||
public get isRecording(): boolean {
|
||||
return this.recorder.isRecording;
|
||||
}
|
||||
|
||||
public get anyRequestsRecorded(): boolean {
|
||||
return this.recorder.anyRequestsRecorded;
|
||||
}
|
||||
|
||||
public get isScenarioLoaded(): boolean {
|
||||
return this.server.listHandlers().length > 0;
|
||||
}
|
||||
|
||||
public async getDefaultScenariosPath(): Promise<string | undefined> {
|
||||
// This should be the directory where package.json is located
|
||||
const rootDirectory = path.resolve(__dirname, '../..');
|
||||
|
||||
const scenariosPath = path.resolve(rootDirectory, 'src/mocks/scenarios');
|
||||
if (await fs.pathExists(scenariosPath)) {
|
||||
return scenariosPath;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private async unloadAllScenarios(): Promise<void> {
|
||||
this.server.resetHandlers();
|
||||
}
|
||||
}
|
||||
220
extensions/ql-vscode/src/mocks/recorder.ts
Normal file
220
extensions/ql-vscode/src/mocks/recorder.ts
Normal file
@@ -0,0 +1,220 @@
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
|
||||
import { MockedRequest } from 'msw';
|
||||
import { SetupServerApi } from 'msw/node';
|
||||
import { IsomorphicResponse } from '@mswjs/interceptors';
|
||||
|
||||
import { Headers } from 'headers-polyfill';
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
import { DisposableObject } from '../pure/disposable-object';
|
||||
|
||||
import { GetVariantAnalysisRepoResultRequest, GitHubApiRequest, RequestKind } from './gh-api-request';
|
||||
|
||||
export class Recorder extends DisposableObject {
|
||||
private readonly allRequests = new Map<string, MockedRequest>();
|
||||
private currentRecordedScenario: GitHubApiRequest[] = [];
|
||||
|
||||
private _isRecording = false;
|
||||
|
||||
constructor(
|
||||
private readonly server: SetupServerApi,
|
||||
) {
|
||||
super();
|
||||
this.onRequestStart = this.onRequestStart.bind(this);
|
||||
this.onResponseBypass = this.onResponseBypass.bind(this);
|
||||
}
|
||||
|
||||
public get isRecording(): boolean {
|
||||
return this._isRecording;
|
||||
}
|
||||
|
||||
public get anyRequestsRecorded(): boolean {
|
||||
return this.currentRecordedScenario.length > 0;
|
||||
}
|
||||
|
||||
public start(): void {
|
||||
if (this._isRecording) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._isRecording = true;
|
||||
|
||||
this.clear();
|
||||
|
||||
this.server.events.on('request:start', this.onRequestStart);
|
||||
this.server.events.on('response:bypass', this.onResponseBypass);
|
||||
}
|
||||
|
||||
public stop(): void {
|
||||
if (!this._isRecording) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._isRecording = false;
|
||||
|
||||
this.server.events.removeListener('request:start', this.onRequestStart);
|
||||
this.server.events.removeListener('response:bypass', this.onResponseBypass);
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this.currentRecordedScenario = [];
|
||||
this.allRequests.clear();
|
||||
}
|
||||
|
||||
public async save(scenariosPath: string, name: string): Promise<string> {
|
||||
const scenarioDirectory = path.join(scenariosPath, name);
|
||||
|
||||
await fs.ensureDir(scenarioDirectory);
|
||||
|
||||
for (let i = 0; i < this.currentRecordedScenario.length; i++) {
|
||||
const request = this.currentRecordedScenario[i];
|
||||
|
||||
const fileName = `${i}-${request.request.kind}.json`;
|
||||
const filePath = path.join(scenarioDirectory, fileName);
|
||||
|
||||
let writtenRequest = {
|
||||
...request
|
||||
};
|
||||
|
||||
if (shouldWriteBodyToFile(writtenRequest)) {
|
||||
const extension = writtenRequest.response.contentType === 'application/zip' ? 'zip' : 'bin';
|
||||
|
||||
const bodyFileName = `${i}-${writtenRequest.request.kind}.body.${extension}`;
|
||||
const bodyFilePath = path.join(scenarioDirectory, bodyFileName);
|
||||
await fs.writeFile(bodyFilePath, writtenRequest.response.body);
|
||||
|
||||
writtenRequest = {
|
||||
...writtenRequest,
|
||||
response: {
|
||||
...writtenRequest.response,
|
||||
body: `file:${bodyFileName}`,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
await fs.writeFile(filePath, JSON.stringify(writtenRequest, null, 2));
|
||||
}
|
||||
|
||||
this.stop();
|
||||
|
||||
return scenarioDirectory;
|
||||
}
|
||||
|
||||
private onRequestStart(request: MockedRequest): void {
|
||||
if (request.headers.has('x-vscode-codeql-msw-bypass')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.allRequests.set(request.id, request);
|
||||
}
|
||||
|
||||
private async onResponseBypass(response: IsomorphicResponse, requestId: string): Promise<void> {
|
||||
const request = this.allRequests.get(requestId);
|
||||
this.allRequests.delete(requestId);
|
||||
if (!request) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.body === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
const gitHubApiRequest = await createGitHubApiRequest(request.url.toString(), response.status, response.body, response.headers);
|
||||
if (!gitHubApiRequest) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.currentRecordedScenario.push(gitHubApiRequest);
|
||||
}
|
||||
}
|
||||
|
||||
async function createGitHubApiRequest(url: string, status: number, body: string, headers: Headers): Promise<GitHubApiRequest | undefined> {
|
||||
if (!url) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (url.match(/\/repos\/[a-zA-Z0-9-_.]+\/[a-zA-Z0-9-_.]+$/)) {
|
||||
return {
|
||||
request: {
|
||||
kind: RequestKind.GetRepo,
|
||||
},
|
||||
response: {
|
||||
status,
|
||||
body: JSON.parse(body),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (url.match(/\/repositories\/\d+\/code-scanning\/codeql\/variant-analyses$/)) {
|
||||
return {
|
||||
request: {
|
||||
kind: RequestKind.SubmitVariantAnalysis,
|
||||
},
|
||||
response: {
|
||||
status,
|
||||
body: JSON.parse(body),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (url.match(/\/repositories\/\d+\/code-scanning\/codeql\/variant-analyses\/\d+$/)) {
|
||||
return {
|
||||
request: {
|
||||
kind: RequestKind.GetVariantAnalysis,
|
||||
},
|
||||
response: {
|
||||
status,
|
||||
body: JSON.parse(body),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const repoTaskMatch = url.match(/\/repositories\/\d+\/code-scanning\/codeql\/variant-analyses\/\d+\/repositories\/(?<repositoryId>\d+)$/);
|
||||
if (repoTaskMatch?.groups?.repositoryId) {
|
||||
return {
|
||||
request: {
|
||||
kind: RequestKind.GetVariantAnalysisRepo,
|
||||
repositoryId: parseInt(repoTaskMatch.groups.repositoryId, 10),
|
||||
},
|
||||
response: {
|
||||
status,
|
||||
body: JSON.parse(body),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// if url is a download URL for a variant analysis result, then it's a get-variant-analysis-repoResult.
|
||||
const repoDownloadMatch = url.match(/objects-origin\.githubusercontent\.com\/codeql-query-console\/codeql-variant-analysis-repo-tasks\/\d+\/(?<repositoryId>\d+)/);
|
||||
if (repoDownloadMatch?.groups?.repositoryId) {
|
||||
// msw currently doesn't support binary response bodies, so we need to download this separately
|
||||
// see https://github.com/mswjs/interceptors/blob/15eafa6215a328219999403e3ff110e71699b016/src/interceptors/ClientRequest/utils/getIncomingMessageBody.ts#L24-L33
|
||||
// Essentially, mws is trying to decode a ZIP file as UTF-8 which changes the bytes and corrupts the file.
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
// We need to ensure we don't end up in an infinite loop, since this request will also be intercepted
|
||||
'x-vscode-codeql-msw-bypass': 'true',
|
||||
},
|
||||
});
|
||||
const responseBuffer = await response.buffer();
|
||||
|
||||
return {
|
||||
request: {
|
||||
kind: RequestKind.GetVariantAnalysisRepoResult,
|
||||
repositoryId: parseInt(repoDownloadMatch.groups.repositoryId, 10),
|
||||
},
|
||||
response: {
|
||||
status,
|
||||
body: responseBuffer,
|
||||
contentType: headers.get('content-type') ?? 'application/octet-stream',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function shouldWriteBodyToFile(request: GitHubApiRequest): request is GetVariantAnalysisRepoResultRequest {
|
||||
return request.response.body instanceof Buffer;
|
||||
}
|
||||
156
extensions/ql-vscode/src/mocks/request-handlers.ts
Normal file
156
extensions/ql-vscode/src/mocks/request-handlers.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import { DefaultBodyType, MockedRequest, rest, RestHandler } from 'msw';
|
||||
import {
|
||||
GitHubApiRequest,
|
||||
isGetRepoRequest,
|
||||
isGetVariantAnalysisRepoRequest,
|
||||
isGetVariantAnalysisRepoResultRequest,
|
||||
isGetVariantAnalysisRequest,
|
||||
isSubmitVariantAnalysisRequest
|
||||
} from './gh-api-request';
|
||||
|
||||
const baseUrl = 'https://api.github.com';
|
||||
|
||||
export type RequestHandler = RestHandler<MockedRequest<DefaultBodyType>>;
|
||||
|
||||
export async function createRequestHandlers(scenarioDirPath: string): Promise<RequestHandler[]> {
|
||||
const requests = await readRequestFiles(scenarioDirPath);
|
||||
|
||||
const handlers = [
|
||||
createGetRepoRequestHandler(requests),
|
||||
createSubmitVariantAnalysisRequestHandler(requests),
|
||||
createGetVariantAnalysisRequestHandler(requests),
|
||||
createGetVariantAnalysisRepoRequestHandler(requests),
|
||||
createGetVariantAnalysisRepoResultRequestHandler(requests),
|
||||
];
|
||||
|
||||
return handlers;
|
||||
}
|
||||
|
||||
async function readRequestFiles(scenarioDirPath: string): Promise<GitHubApiRequest[]> {
|
||||
const files = await fs.readdir(scenarioDirPath);
|
||||
|
||||
const orderedFiles = files.sort((a, b) => {
|
||||
const aNum = parseInt(a.split('-')[0]);
|
||||
const bNum = parseInt(b.split('-')[0]);
|
||||
return aNum - bNum;
|
||||
});
|
||||
|
||||
const requests: GitHubApiRequest[] = [];
|
||||
for (const file of orderedFiles) {
|
||||
if (!file.endsWith('.json')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const filePath = path.join(scenarioDirPath, file);
|
||||
const request: GitHubApiRequest = await fs.readJson(filePath, { encoding: 'utf8' });
|
||||
|
||||
if (typeof request.response.body === 'string' && request.response.body.startsWith('file:')) {
|
||||
request.response.body = await fs.readFile(path.join(scenarioDirPath, request.response.body.substring(5)));
|
||||
}
|
||||
|
||||
requests.push(request);
|
||||
}
|
||||
|
||||
return requests;
|
||||
}
|
||||
|
||||
function createGetRepoRequestHandler(requests: GitHubApiRequest[]): RequestHandler {
|
||||
const getRepoRequests = requests.filter(isGetRepoRequest);
|
||||
|
||||
if (getRepoRequests.length > 1) {
|
||||
throw Error('More than one get repo request found');
|
||||
}
|
||||
|
||||
const getRepoRequest = getRepoRequests[0];
|
||||
|
||||
return rest.get(`${baseUrl}/repos/:owner/:name`, (_req, res, ctx) => {
|
||||
return res(
|
||||
ctx.status(getRepoRequest.response.status),
|
||||
ctx.json(getRepoRequest.response.body),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function createSubmitVariantAnalysisRequestHandler(requests: GitHubApiRequest[]): RequestHandler {
|
||||
const submitVariantAnalysisRequests = requests.filter(isSubmitVariantAnalysisRequest);
|
||||
|
||||
if (submitVariantAnalysisRequests.length > 1) {
|
||||
throw Error('More than one submit variant analysis request found');
|
||||
}
|
||||
|
||||
const getRepoRequest = submitVariantAnalysisRequests[0];
|
||||
|
||||
return rest.post(`${baseUrl}/repositories/:controllerRepoId/code-scanning/codeql/variant-analyses`, (_req, res, ctx) => {
|
||||
return res(
|
||||
ctx.status(getRepoRequest.response.status),
|
||||
ctx.json(getRepoRequest.response.body),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function createGetVariantAnalysisRequestHandler(requests: GitHubApiRequest[]): RequestHandler {
|
||||
const getVariantAnalysisRequests = requests.filter(isGetVariantAnalysisRequest);
|
||||
let requestIndex = 0;
|
||||
|
||||
// During the lifetime of a variant analysis run, there are multiple requests
|
||||
// to get the variant analysis. We need to return different responses for each
|
||||
// request, so keep an index of the request and return the appropriate response.
|
||||
return rest.get(`${baseUrl}/repositories/:controllerRepoId/code-scanning/codeql/variant-analyses/:variantAnalysisId`, (_req, res, ctx) => {
|
||||
const request = getVariantAnalysisRequests[requestIndex];
|
||||
|
||||
if (requestIndex < getVariantAnalysisRequests.length - 1) {
|
||||
// If there are more requests to come, increment the index.
|
||||
requestIndex++;
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.status(request.response.status),
|
||||
ctx.json(request.response.body),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function createGetVariantAnalysisRepoRequestHandler(requests: GitHubApiRequest[]): RequestHandler {
|
||||
const getVariantAnalysisRepoRequests = requests.filter(isGetVariantAnalysisRepoRequest);
|
||||
|
||||
return rest.get(
|
||||
`${baseUrl}/repositories/:controllerRepoId/code-scanning/codeql/variant-analyses/:variantAnalysisId/repositories/:repoId`,
|
||||
(req, res, ctx) => {
|
||||
const scenarioRequest = getVariantAnalysisRepoRequests.find(r => r.request.repositoryId.toString() === req.params.repoId);
|
||||
if (!scenarioRequest) {
|
||||
throw Error(`No scenario request found for ${req.url}`);
|
||||
}
|
||||
|
||||
return res(
|
||||
ctx.status(scenarioRequest.response.status),
|
||||
ctx.json(scenarioRequest.response.body),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function createGetVariantAnalysisRepoResultRequestHandler(requests: GitHubApiRequest[]): RequestHandler {
|
||||
const getVariantAnalysisRepoResultRequests = requests.filter(isGetVariantAnalysisRepoResultRequest);
|
||||
|
||||
return rest.get(
|
||||
'https://objects-origin.githubusercontent.com/codeql-query-console/codeql-variant-analysis-repo-tasks/:variantAnalysisId/:repoId/*',
|
||||
(req, res, ctx) => {
|
||||
const scenarioRequest = getVariantAnalysisRepoResultRequests.find(r => r.request.repositoryId.toString() === req.params.repoId);
|
||||
if (!scenarioRequest) {
|
||||
throw Error(`No scenario request found for ${req.url}`);
|
||||
}
|
||||
|
||||
if (scenarioRequest.response.body) {
|
||||
return res(
|
||||
ctx.status(scenarioRequest.response.status),
|
||||
ctx.set('Content-Type', scenarioRequest.response.contentType),
|
||||
ctx.body(scenarioRequest.response.body),
|
||||
);
|
||||
} else {
|
||||
return res(
|
||||
ctx.status(scenarioRequest.response.status),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getRepo"
|
||||
},
|
||||
"response": {
|
||||
"status": 404,
|
||||
"body": {
|
||||
"message": "Repository not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getRepo"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments",
|
||||
"created_at": "2022-10-26T10:37:59Z",
|
||||
"updated_at": "2022-10-26T10:37:59Z",
|
||||
"pushed_at": "2022-10-26T10:38:02Z",
|
||||
"git_url": "git://github.com/github/mrva-demo-controller-repo.git",
|
||||
"ssh_url": "git@github.com:github/mrva-demo-controller-repo.git",
|
||||
"clone_url": "https://github.com/github/mrva-demo-controller-repo.git",
|
||||
"svn_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"homepage": null,
|
||||
"size": 0,
|
||||
"stargazers_count": 0,
|
||||
"watchers_count": 0,
|
||||
"language": null,
|
||||
"has_issues": true,
|
||||
"has_projects": true,
|
||||
"has_downloads": true,
|
||||
"has_wiki": true,
|
||||
"has_pages": false,
|
||||
"forks_count": 0,
|
||||
"mirror_url": null,
|
||||
"archived": false,
|
||||
"disabled": false,
|
||||
"open_issues_count": 0,
|
||||
"license": null,
|
||||
"allow_forking": false,
|
||||
"is_template": false,
|
||||
"web_commit_signoff_required": false,
|
||||
"topics": [],
|
||||
"visibility": "private",
|
||||
"forks": 0,
|
||||
"open_issues": 0,
|
||||
"watchers": 0,
|
||||
"default_branch": "main",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"maintain": true,
|
||||
"push": true,
|
||||
"triage": true,
|
||||
"pull": true
|
||||
},
|
||||
"temp_clone_token": "AACMDDJSXFX6QQXTSB4YQCDDLEWP4",
|
||||
"allow_squash_merge": true,
|
||||
"allow_merge_commit": true,
|
||||
"allow_rebase_merge": true,
|
||||
"allow_auto_merge": false,
|
||||
"delete_branch_on_merge": false,
|
||||
"allow_update_branch": false,
|
||||
"use_squash_pr_title_as_default": false,
|
||||
"squash_merge_commit_message": "COMMIT_MESSAGES",
|
||||
"squash_merge_commit_title": "COMMIT_OR_PR_TITLE",
|
||||
"merge_commit_message": "PR_TITLE",
|
||||
"merge_commit_title": "MERGE_MESSAGE",
|
||||
"organization": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"security_and_analysis": {
|
||||
"advanced_security": {
|
||||
"status": "enabled"
|
||||
},
|
||||
"secret_scanning": {
|
||||
"status": "enabled"
|
||||
},
|
||||
"secret_scanning_push_protection": {
|
||||
"status": "enabled"
|
||||
}
|
||||
},
|
||||
"network_count": 0,
|
||||
"subscribers_count": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "submitVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 201,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124513Z&X-Amz-Expires=3600&X-Amz-Signature=0f5f84090c84c1b915e47960bcbc6f66433cd345cdc81cc08669920b48f6b622&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:13Z",
|
||||
"status": "in_progress",
|
||||
"skipped_repositories": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepoResult",
|
||||
"repositoryId": 206444
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": "file:17-getVariantAnalysisRepoResult.body.zip",
|
||||
"contentType": "application/zip"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124653Z&X-Amz-Expires=3600&X-Amz-Signature=2147ea8461603acdb32fc38544dffb62e74db12fbbe5a32f269420d4945841a1&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepo",
|
||||
"repositoryId": 23418517
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyMzQxODUxNw==",
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"owner": {
|
||||
"login": "apache",
|
||||
"id": 47359,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjQ3MzU5",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/47359?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/apache",
|
||||
"html_url": "https://github.com/apache",
|
||||
"followers_url": "https://api.github.com/users/apache/followers",
|
||||
"following_url": "https://api.github.com/users/apache/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/apache/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/apache/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/apache/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/apache/orgs",
|
||||
"repos_url": "https://api.github.com/users/apache/repos",
|
||||
"events_url": "https://api.github.com/users/apache/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/apache/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/apache/hadoop",
|
||||
"description": "Apache Hadoop",
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/apache/hadoop",
|
||||
"forks_url": "https://api.github.com/repos/apache/hadoop/forks",
|
||||
"keys_url": "https://api.github.com/repos/apache/hadoop/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/apache/hadoop/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/apache/hadoop/teams",
|
||||
"hooks_url": "https://api.github.com/repos/apache/hadoop/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/apache/hadoop/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/apache/hadoop/events",
|
||||
"assignees_url": "https://api.github.com/repos/apache/hadoop/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/apache/hadoop/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/apache/hadoop/tags",
|
||||
"blobs_url": "https://api.github.com/repos/apache/hadoop/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/apache/hadoop/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/apache/hadoop/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/apache/hadoop/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/apache/hadoop/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/apache/hadoop/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/apache/hadoop/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/apache/hadoop/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/apache/hadoop/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/apache/hadoop/subscription",
|
||||
"commits_url": "https://api.github.com/repos/apache/hadoop/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/apache/hadoop/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/apache/hadoop/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/apache/hadoop/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/apache/hadoop/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/apache/hadoop/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/apache/hadoop/merges",
|
||||
"archive_url": "https://api.github.com/repos/apache/hadoop/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/apache/hadoop/downloads",
|
||||
"issues_url": "https://api.github.com/repos/apache/hadoop/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/apache/hadoop/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/apache/hadoop/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/apache/hadoop/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/apache/hadoop/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/apache/hadoop/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/apache/hadoop/deployments"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3,
|
||||
"database_commit_sha": "aac87ffe76451c2fd535350b7aefb384e2be6241",
|
||||
"source_location_prefix": "/home/runner/work/bulk-builder/bulk-builder",
|
||||
"artifact_url": "https://objects-origin.githubusercontent.com/codeql-query-console/codeql-variant-analysis-repo-tasks/146/23418517/425ed1e9-c214-4f71-832d-798da3ed7452?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124654Z&X-Amz-Expires=300&X-Amz-Signature=98dc5dfcc4c70c4cc40fb62fb87a21671b1ee26266e8ade3109d6f39cfceef5a&X-Amz-SignedHeaders=host&actor_id=311693&key_id=0&repo_id=557804416"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepoResult",
|
||||
"repositoryId": 23418517
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": "file:13-getVariantAnalysisRepoResult.body.zip",
|
||||
"contentType": "application/zip"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepo",
|
||||
"repositoryId": 257485422
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyNTc0ODU0MjI=",
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"owner": {
|
||||
"login": "vitejs",
|
||||
"id": 65625612,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjY1NjI1NjEy",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/65625612?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/vitejs",
|
||||
"html_url": "https://github.com/vitejs",
|
||||
"followers_url": "https://api.github.com/users/vitejs/followers",
|
||||
"following_url": "https://api.github.com/users/vitejs/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/vitejs/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/vitejs/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/vitejs/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/vitejs/orgs",
|
||||
"repos_url": "https://api.github.com/users/vitejs/repos",
|
||||
"events_url": "https://api.github.com/users/vitejs/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/vitejs/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/vitejs/vite",
|
||||
"description": "Next generation frontend tooling. It's fast!",
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/vitejs/vite",
|
||||
"forks_url": "https://api.github.com/repos/vitejs/vite/forks",
|
||||
"keys_url": "https://api.github.com/repos/vitejs/vite/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/vitejs/vite/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/vitejs/vite/teams",
|
||||
"hooks_url": "https://api.github.com/repos/vitejs/vite/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/vitejs/vite/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/vitejs/vite/events",
|
||||
"assignees_url": "https://api.github.com/repos/vitejs/vite/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/vitejs/vite/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/vitejs/vite/tags",
|
||||
"blobs_url": "https://api.github.com/repos/vitejs/vite/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/vitejs/vite/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/vitejs/vite/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/vitejs/vite/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/vitejs/vite/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/vitejs/vite/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/vitejs/vite/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/vitejs/vite/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/vitejs/vite/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/vitejs/vite/subscription",
|
||||
"commits_url": "https://api.github.com/repos/vitejs/vite/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/vitejs/vite/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/vitejs/vite/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/vitejs/vite/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/vitejs/vite/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/vitejs/vite/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/vitejs/vite/merges",
|
||||
"archive_url": "https://api.github.com/repos/vitejs/vite/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/vitejs/vite/downloads",
|
||||
"issues_url": "https://api.github.com/repos/vitejs/vite/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/vitejs/vite/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/vitejs/vite/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/vitejs/vite/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/vitejs/vite/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/vitejs/vite/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/vitejs/vite/deployments"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0,
|
||||
"database_commit_sha": "de6323f460dd3e7e3edf97443ece2acce6187ea0",
|
||||
"source_location_prefix": "/home/runner/work/bulk-builder/bulk-builder",
|
||||
"artifact_url": "https://objects-origin.githubusercontent.com/codeql-query-console/codeql-variant-analysis-repo-tasks/146/257485422/862ee5f1-0e34-4997-a60e-b97cea3eadc9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124658Z&X-Amz-Expires=300&X-Amz-Signature=df0ac0f0f8f746ad977ad859bc6b43e4cdc74ff285a33cba489b16bf9c161490&X-Amz-SignedHeaders=host&actor_id=311693&key_id=0&repo_id=557804416"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepoResult",
|
||||
"repositoryId": 257485422
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": "file:15-getVariantAnalysisRepoResult.body.zip",
|
||||
"contentType": "application/zip"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124659Z&X-Amz-Expires=3600&X-Amz-Signature=b791ede467cd1783d31d7ee148763d0d4f9eb7abad7506ef9c25017c94aaa1df&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124705Z&X-Amz-Expires=3600&X-Amz-Signature=dae9aa87c393b62ad6f84fd280c731fcd8e4551917920bf978eac5dd6102caec&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,183 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124726Z&X-Amz-Expires=3600&X-Amz-Signature=6698289315bd8d8378a17784ba0be9955e6e9161497137c4ccb29b1d2a3f3587&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 156706,
|
||||
"result_count": 8
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepo",
|
||||
"repositoryId": 20753500
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyMDc1MzUwMA==",
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"owner": {
|
||||
"login": "angular-cn",
|
||||
"id": 6211039,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjYyMTEwMzk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/6211039?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/angular-cn",
|
||||
"html_url": "https://github.com/angular-cn",
|
||||
"followers_url": "https://api.github.com/users/angular-cn/followers",
|
||||
"following_url": "https://api.github.com/users/angular-cn/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/angular-cn/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/angular-cn/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/angular-cn/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/angular-cn/orgs",
|
||||
"repos_url": "https://api.github.com/users/angular-cn/repos",
|
||||
"events_url": "https://api.github.com/users/angular-cn/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/angular-cn/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/angular-cn/ng-nice",
|
||||
"description": "NgNice Web Site http://ngnice.com",
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/angular-cn/ng-nice",
|
||||
"forks_url": "https://api.github.com/repos/angular-cn/ng-nice/forks",
|
||||
"keys_url": "https://api.github.com/repos/angular-cn/ng-nice/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/angular-cn/ng-nice/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/angular-cn/ng-nice/teams",
|
||||
"hooks_url": "https://api.github.com/repos/angular-cn/ng-nice/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/angular-cn/ng-nice/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/angular-cn/ng-nice/events",
|
||||
"assignees_url": "https://api.github.com/repos/angular-cn/ng-nice/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/angular-cn/ng-nice/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/angular-cn/ng-nice/tags",
|
||||
"blobs_url": "https://api.github.com/repos/angular-cn/ng-nice/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/angular-cn/ng-nice/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/angular-cn/ng-nice/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/angular-cn/ng-nice/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/angular-cn/ng-nice/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/angular-cn/ng-nice/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/angular-cn/ng-nice/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/angular-cn/ng-nice/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/angular-cn/ng-nice/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/angular-cn/ng-nice/subscription",
|
||||
"commits_url": "https://api.github.com/repos/angular-cn/ng-nice/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/angular-cn/ng-nice/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/angular-cn/ng-nice/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/angular-cn/ng-nice/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/angular-cn/ng-nice/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/angular-cn/ng-nice/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/angular-cn/ng-nice/merges",
|
||||
"archive_url": "https://api.github.com/repos/angular-cn/ng-nice/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/angular-cn/ng-nice/downloads",
|
||||
"issues_url": "https://api.github.com/repos/angular-cn/ng-nice/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/angular-cn/ng-nice/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/angular-cn/ng-nice/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/angular-cn/ng-nice/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/angular-cn/ng-nice/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/angular-cn/ng-nice/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/angular-cn/ng-nice/deployments"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 156706,
|
||||
"result_count": 8,
|
||||
"database_commit_sha": "85f9118fa7c10395eb01b019ba57680805897efa",
|
||||
"source_location_prefix": "/home/runner/work/bulk-builder/bulk-builder",
|
||||
"artifact_url": "https://objects-origin.githubusercontent.com/codeql-query-console/codeql-variant-analysis-repo-tasks/146/20753500/7cb3d923-6312-4453-8df2-e98382437ddd?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124729Z&X-Amz-Expires=300&X-Amz-Signature=d8e403e6ed13e7ce8b305d07be139e3ffac8a26f2e010acdbeaf9365588ab17f&X-Amz-SignedHeaders=host&actor_id=311693&key_id=0&repo_id=557804416"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124518Z&X-Amz-Expires=3600&X-Amz-Signature=5fbb5b3fa99984d065d3229c83f19cb9741218e6e1ba5b7bb81a7d6df88cb66b&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "pending"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "pending"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "pending"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "pending"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "pending"
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepoResult",
|
||||
"repositoryId": 20753500
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": "file:20-getVariantAnalysisRepoResult.body.zip",
|
||||
"contentType": "application/zip"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124732Z&X-Amz-Expires=3600&X-Amz-Signature=ad791eb1a754f473a50454616e9bd04663dfed60a5c84f2c61f27ced47ee25d0&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 156706,
|
||||
"result_count": 8
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124759Z&X-Amz-Expires=3600&X-Amz-Signature=5b0be34c426152c37e3d4c761bf576a07c9d4bb6222f32c438e02605600f0394&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 156706,
|
||||
"result_count": 8
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124805Z&X-Amz-Expires=3600&X-Amz-Signature=73b43f47ee53938b91fa7d23c33e750c466fff777ea94ceb052771ee8dc25b6c&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 156706,
|
||||
"result_count": 8
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "in_progress"
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysis"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"id": 146,
|
||||
"controller_repo": {
|
||||
"id": 557804416,
|
||||
"node_id": "R_kgDOIT9rgA",
|
||||
"name": "mrva-demo-controller-repo",
|
||||
"full_name": "github/mrva-demo-controller-repo",
|
||||
"private": true,
|
||||
"owner": {
|
||||
"login": "github",
|
||||
"id": 9919,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/github",
|
||||
"html_url": "https://github.com/github",
|
||||
"followers_url": "https://api.github.com/users/github/followers",
|
||||
"following_url": "https://api.github.com/users/github/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/github/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/github/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/github/orgs",
|
||||
"repos_url": "https://api.github.com/users/github/repos",
|
||||
"events_url": "https://api.github.com/users/github/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/github/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/github/mrva-demo-controller-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/github/mrva-demo-controller-repo",
|
||||
"forks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/github/mrva-demo-controller-repo/deployments"
|
||||
},
|
||||
"actor": {
|
||||
"login": "charisk",
|
||||
"id": 311693,
|
||||
"node_id": "MDQ6VXNlcjMxMTY5Mw==",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/311693?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/charisk",
|
||||
"html_url": "https://github.com/charisk",
|
||||
"followers_url": "https://api.github.com/users/charisk/followers",
|
||||
"following_url": "https://api.github.com/users/charisk/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/charisk/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/charisk/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/charisk/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/charisk/orgs",
|
||||
"repos_url": "https://api.github.com/users/charisk/repos",
|
||||
"events_url": "https://api.github.com/users/charisk/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/charisk/received_events",
|
||||
"type": "User",
|
||||
"site_admin": true
|
||||
},
|
||||
"query_language": "javascript",
|
||||
"query_pack_url": "https://objects-origin.githubusercontent.com/codeql-query-console/variant_analyses/146/query_pack?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124815Z&X-Amz-Expires=3600&X-Amz-Signature=0f42201f27ad08ac1fa9caccf5005d9dac7bdcae33e88e33d62e2fc337194164&X-Amz-SignedHeaders=host",
|
||||
"created_at": "2022-10-26T12:45:12Z",
|
||||
"updated_at": "2022-10-26T12:45:15Z",
|
||||
"actions_workflow_run_id": 3329095282,
|
||||
"status": "in_progress",
|
||||
"scanned_repositories": [
|
||||
{
|
||||
"repository": {
|
||||
"id": 206444,
|
||||
"name": "hive",
|
||||
"full_name": "apache/hive",
|
||||
"private": false,
|
||||
"stargazers_count": 4523,
|
||||
"updated_at": "2022-11-02T10:04:02Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 81841,
|
||||
"result_count": 4
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 20753500,
|
||||
"name": "ng-nice",
|
||||
"full_name": "angular-cn/ng-nice",
|
||||
"private": false,
|
||||
"stargazers_count": 192,
|
||||
"updated_at": "2022-03-17T08:34:30Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 156706,
|
||||
"result_count": 8
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 23418517,
|
||||
"name": "hadoop",
|
||||
"full_name": "apache/hadoop",
|
||||
"private": false,
|
||||
"stargazers_count": 13030,
|
||||
"updated_at": "2022-11-02T08:23:58Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 66895,
|
||||
"result_count": 3
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"stargazers_count": 19033,
|
||||
"updated_at": "2022-11-02T10:25:24Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 710,
|
||||
"result_count": 0
|
||||
},
|
||||
{
|
||||
"repository": {
|
||||
"id": 257485422,
|
||||
"name": "vite",
|
||||
"full_name": "vitejs/vite",
|
||||
"private": false,
|
||||
"stargazers_count": 49064,
|
||||
"updated_at": "2022-11-02T11:29:22Z"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 702,
|
||||
"result_count": 0
|
||||
}
|
||||
],
|
||||
"skipped_repositories": {
|
||||
"access_mismatch_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"no_codeql_db_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
},
|
||||
"over_limit_repos": {
|
||||
"repository_count": 0,
|
||||
"repositories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"request": {
|
||||
"kind": "getVariantAnalysisRepo",
|
||||
"repositoryId": 236095576
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"repository": {
|
||||
"id": 236095576,
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyMzYwOTU1NzY=",
|
||||
"name": "backstage",
|
||||
"full_name": "backstage/backstage",
|
||||
"private": false,
|
||||
"owner": {
|
||||
"login": "backstage",
|
||||
"id": 72526453,
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjcyNTI2NDUz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/72526453?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/backstage",
|
||||
"html_url": "https://github.com/backstage",
|
||||
"followers_url": "https://api.github.com/users/backstage/followers",
|
||||
"following_url": "https://api.github.com/users/backstage/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/backstage/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/backstage/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/backstage/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/backstage/orgs",
|
||||
"repos_url": "https://api.github.com/users/backstage/repos",
|
||||
"events_url": "https://api.github.com/users/backstage/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/backstage/received_events",
|
||||
"type": "Organization",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/backstage/backstage",
|
||||
"description": "Backstage is an open platform for building developer portals",
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/backstage/backstage",
|
||||
"forks_url": "https://api.github.com/repos/backstage/backstage/forks",
|
||||
"keys_url": "https://api.github.com/repos/backstage/backstage/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/backstage/backstage/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/backstage/backstage/teams",
|
||||
"hooks_url": "https://api.github.com/repos/backstage/backstage/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/backstage/backstage/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/backstage/backstage/events",
|
||||
"assignees_url": "https://api.github.com/repos/backstage/backstage/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/backstage/backstage/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/backstage/backstage/tags",
|
||||
"blobs_url": "https://api.github.com/repos/backstage/backstage/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/backstage/backstage/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/backstage/backstage/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/backstage/backstage/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/backstage/backstage/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/backstage/backstage/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/backstage/backstage/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/backstage/backstage/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/backstage/backstage/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/backstage/backstage/subscription",
|
||||
"commits_url": "https://api.github.com/repos/backstage/backstage/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/backstage/backstage/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/backstage/backstage/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/backstage/backstage/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/backstage/backstage/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/backstage/backstage/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/backstage/backstage/merges",
|
||||
"archive_url": "https://api.github.com/repos/backstage/backstage/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/backstage/backstage/downloads",
|
||||
"issues_url": "https://api.github.com/repos/backstage/backstage/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/backstage/backstage/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/backstage/backstage/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/backstage/backstage/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/backstage/backstage/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/backstage/backstage/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/backstage/backstage/deployments"
|
||||
},
|
||||
"analysis_status": "succeeded",
|
||||
"artifact_size_in_bytes": 710,
|
||||
"result_count": 0,
|
||||
"database_commit_sha": "18536a76c5efb0f0706c309f3295ed7f11f80491",
|
||||
"source_location_prefix": "/home/runner/work/backstage/backstage",
|
||||
"artifact_url": "https://objects-origin.githubusercontent.com/codeql-query-console/codeql-variant-analysis-repo-tasks/146/236095576/b4e1e158-d7ce-45e8-8fac-dad3524f2d54?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=queryconsoleprod%2F20221026%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221026T124816Z&X-Amz-Expires=300&X-Amz-Signature=c215823eebb9d0ca92045e1c99591dfd28005562815b46d68cbfad25621375ea&X-Amz-SignedHeaders=host&actor_id=311693&key_id=0&repo_id=557804416"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user