Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52620d638c | ||
|
|
a6a238f113 | ||
|
|
d6b46dc91f | ||
|
|
6d9308229e | ||
|
|
5855d98e55 | ||
|
|
2bc677df47 | ||
|
|
5f7fad11e4 | ||
|
|
81568ea16f | ||
|
|
31f8ee8814 | ||
|
|
7ba7e07586 | ||
|
|
e4a9ddb261 | ||
|
|
b454c98a40 | ||
|
|
73162a59aa | ||
|
|
212fc37050 | ||
|
|
15dac4338c | ||
|
|
1e19dd9f8d | ||
|
|
c101b677c4 | ||
|
|
2f0efe9055 | ||
|
|
9f4077452f | ||
|
|
d7d5aaf84d | ||
|
|
0bd5350af6 | ||
|
|
17a1b3199a | ||
|
|
d0e089cd71 | ||
|
|
293e77a863 | ||
|
|
c77712b1f4 | ||
|
|
1ed7c869aa | ||
|
|
854fecf0ea | ||
|
|
968332d3c1 | ||
|
|
9f04a5e905 | ||
|
|
6479acdb78 | ||
|
|
eb6d6abf86 | ||
|
|
72f7192e9b | ||
|
|
b1ed550820 | ||
|
|
322b16ef24 | ||
|
|
0d6853ce6c | ||
|
|
667f09c360 | ||
|
|
49aa6d7543 | ||
|
|
d9af43b95c | ||
|
|
33d169f0fa | ||
|
|
eabe5007db | ||
|
|
51615a38c6 | ||
|
|
c6c2208c0e | ||
|
|
1760cdd4c4 | ||
|
|
c4aac33c13 | ||
|
|
a32255425d | ||
|
|
43a786ea6c | ||
|
|
84abc3ad32 | ||
|
|
bcb0bc476b | ||
|
|
59c08fba3e | ||
|
|
7ccb51eead | ||
|
|
1f3963e9ef | ||
|
|
b65fc9f1cb | ||
|
|
6ab5092971 | ||
|
|
e340d858e7 | ||
|
|
7c4bc0772b | ||
|
|
2eb2c422d1 | ||
|
|
f94a744108 | ||
|
|
809e064075 | ||
|
|
5974720601 | ||
|
|
83ba41606c | ||
|
|
33bdfeb2e1 | ||
|
|
19e68d1f8d | ||
|
|
79fe240863 | ||
|
|
a637321374 | ||
|
|
d8636d9057 | ||
|
|
a9ec333842 | ||
|
|
507ddfc2cc | ||
|
|
712d3e552b | ||
|
|
79c6f7fb0a | ||
|
|
3bdc8c52de | ||
|
|
c8c5b67f18 | ||
|
|
df70e44d45 | ||
|
|
f9199c761a | ||
|
|
ef21f09501 | ||
|
|
80c73b36a9 | ||
|
|
ff14ee60ee | ||
|
|
9bd3250477 | ||
|
|
9d0fc56fc4 | ||
|
|
5f7306357a | ||
|
|
fb903f6a1b | ||
|
|
bd97021284 | ||
|
|
ad8c3d8947 | ||
|
|
3d0ef7e6bf | ||
|
|
3fc041daf6 | ||
|
|
fb8688a7d7 | ||
|
|
cd8dbf8e44 | ||
|
|
845205407d | ||
|
|
ca78565dd0 | ||
|
|
266f2d7f88 | ||
|
|
eedc0a26cc | ||
|
|
8ca1c45fc8 | ||
|
|
ae056fd205 | ||
|
|
07de41e937 | ||
|
|
598411c6b8 | ||
|
|
50da8efb51 | ||
|
|
d14eb4ec1d | ||
|
|
b815f8c8d7 | ||
|
|
87fbb56d6d | ||
|
|
a96375bf50 | ||
|
|
ef8a971814 | ||
|
|
d059b38253 | ||
|
|
a5018fbdb5 | ||
|
|
3c5e0f208e | ||
|
|
51e5328d24 | ||
|
|
58819c9d22 | ||
|
|
4645163b02 | ||
|
|
7e013ab0da | ||
|
|
ec85902bd4 | ||
|
|
f461208ffc | ||
|
|
56576c8bec | ||
|
|
42a9eba703 | ||
|
|
48c961aedc | ||
|
|
ff55c59e19 | ||
|
|
73c95bef48 | ||
|
|
fd57bfd074 | ||
|
|
4fc36fa25d | ||
|
|
68f7e902a5 | ||
|
|
35e5376235 | ||
|
|
9cf7cda837 | ||
|
|
4639ac6049 | ||
|
|
9eb37abe16 | ||
|
|
248788d4f6 | ||
|
|
92a34d51b1 | ||
|
|
964bc5b6bd | ||
|
|
ab79eedf6f | ||
|
|
c21a214fc4 | ||
|
|
97ef1aa99d | ||
|
|
799d09f41f | ||
|
|
04bc6c8294 | ||
|
|
735d74175c | ||
|
|
ce67c4c146 | ||
|
|
7522617143 | ||
|
|
1b2285c7ed | ||
|
|
d03af2d389 | ||
|
|
4355f92dd8 | ||
|
|
a204903ff2 | ||
|
|
1709999bb7 | ||
|
|
86332db0ed | ||
|
|
44d32aa807 | ||
|
|
bcdd61859b | ||
|
|
4e6f2f8172 | ||
|
|
a71cbadb21 | ||
|
|
17f149d57d | ||
|
|
2ca08b061f | ||
|
|
6b8b999059 | ||
|
|
1b7efea691 | ||
|
|
3f9ca1577a | ||
|
|
c617c38829 | ||
|
|
b73353fc9e | ||
|
|
799f0b39c5 | ||
|
|
93d5c1fbcf | ||
|
|
7020960ec3 | ||
|
|
d515544750 | ||
|
|
569bf64378 | ||
|
|
ee2fb39cb8 | ||
|
|
5bd0f9be77 | ||
|
|
8b8e9451d7 | ||
|
|
3b92649ea7 | ||
|
|
7d58a314d9 | ||
|
|
acc2a84940 | ||
|
|
05fec365d2 | ||
|
|
31ada4a296 | ||
|
|
625ee33af0 | ||
|
|
2100587df1 | ||
|
|
e2f90ba353 | ||
|
|
00f0915b78 | ||
|
|
225143f1f1 | ||
|
|
bd805090d5 | ||
|
|
56968c5617 | ||
|
|
0681d82936 | ||
|
|
2acdea1cc9 | ||
|
|
700432c7eb | ||
|
|
d24f781721 | ||
|
|
a807d5717b | ||
|
|
1c5e46bdc5 | ||
|
|
e43157f952 | ||
|
|
3ffd98fdbe | ||
|
|
3196778f63 | ||
|
|
301f9a6a9d | ||
|
|
4412f2083e | ||
|
|
fcda971f1b | ||
|
|
669e830649 | ||
|
|
53f3a144af | ||
|
|
6cc1bd787e | ||
|
|
72f68c01f2 | ||
|
|
3a837ecdea | ||
|
|
9afc2954f1 | ||
|
|
399d558522 | ||
|
|
f7e2cafaad | ||
|
|
5697dcce61 | ||
|
|
5ebe93c628 | ||
|
|
db16246990 | ||
|
|
8cc85356ae | ||
|
|
db1cfda601 | ||
|
|
60c443418e | ||
|
|
1813c82eb4 | ||
|
|
a2b7383c97 | ||
|
|
388a81c19b | ||
|
|
9a9ac3aa51 | ||
|
|
879202e785 | ||
|
|
c6e635542c | ||
|
|
74aa385373 | ||
|
|
127166df23 | ||
|
|
7fbe9b160a | ||
|
|
907b225b47 | ||
|
|
a6e06dc921 | ||
|
|
72e28d9b67 | ||
|
|
0fd436f3ef | ||
|
|
44406cea7c | ||
|
|
20d1f424a6 | ||
|
|
b6e18b00a9 | ||
|
|
69393c4567 | ||
|
|
1518d0ee6f | ||
|
|
cb3964f78e | ||
|
|
db82927d27 | ||
|
|
50b4cd3bd5 | ||
|
|
59677cfad7 | ||
|
|
53412d70f7 | ||
|
|
161f02dc49 | ||
|
|
c48729b0e4 | ||
|
|
0f8dd275a1 | ||
|
|
60e998b590 | ||
|
|
e1d824f6c1 | ||
|
|
ebce162542 | ||
|
|
94758afea0 | ||
|
|
e5e176b68b | ||
|
|
64c00a92f5 | ||
|
|
0a64b77ba0 | ||
|
|
c3f8d0c2cd | ||
|
|
e3bb8a778d | ||
|
|
99864b0fd7 | ||
|
|
77f30faf00 | ||
|
|
3614cab5ac | ||
|
|
d7f5c28c85 | ||
|
|
cdf1e6b4f2 | ||
|
|
e7dff799fd | ||
|
|
ec41c3e481 | ||
|
|
1aa24fe51f | ||
|
|
71cf89ce70 | ||
|
|
1b82daf079 | ||
|
|
33a205bf19 | ||
|
|
f7863066f3 | ||
|
|
0c2862c379 | ||
|
|
ce0435b55a | ||
|
|
5d32121787 | ||
|
|
6026c84c6f | ||
|
|
9e96d6383c | ||
|
|
31969c8df2 | ||
|
|
e4091ab3b5 | ||
|
|
e3ee2ee76a | ||
|
|
c4d9f11386 | ||
|
|
6f9ddbf52a | ||
|
|
fed7a82d36 | ||
|
|
ff1cd88466 | ||
|
|
941aa608f4 | ||
|
|
205ae065f5 | ||
|
|
8e5bbf1320 | ||
|
|
200f0934bf | ||
|
|
4c6f319304 | ||
|
|
6e3e0748e0 | ||
|
|
d70d063698 | ||
|
|
fa0e1c0376 | ||
|
|
d2626e0ad8 | ||
|
|
42c6d99012 | ||
|
|
2bff033a27 | ||
|
|
0aaae1fabf | ||
|
|
a172a425ad | ||
|
|
5c684a87d0 | ||
|
|
b96d82a1a7 | ||
|
|
73f4442d27 | ||
|
|
b11f390d4a | ||
|
|
84b92dcae5 | ||
|
|
afb208dabb | ||
|
|
fbf81359df | ||
|
|
d7ee24158f | ||
|
|
ab7bebfd7c | ||
|
|
cd5aaaa489 | ||
|
|
d04d53e9a6 | ||
|
|
fa80d4477e | ||
|
|
98696368f4 | ||
|
|
ee71e1f82c | ||
|
|
05d43dc2f7 | ||
|
|
99d98afcec | ||
|
|
44b736e84a | ||
|
|
052bcffe37 | ||
|
|
74d691f431 | ||
|
|
9efde543c5 | ||
|
|
a6089eaa6c | ||
|
|
21a44d9be6 | ||
|
|
bfa3c7544e | ||
|
|
64e9106cb3 | ||
|
|
05fbc0eae7 | ||
|
|
9646722501 | ||
|
|
911c39d054 | ||
|
|
784f1450c0 | ||
|
|
c9cae0b8c0 | ||
|
|
7d26dd1c4f | ||
|
|
1b21b69422 | ||
|
|
390046ccf4 | ||
|
|
fcd0b0c25f | ||
|
|
dc8140199b | ||
|
|
1462b0dacb | ||
|
|
e45dbcec9b | ||
|
|
f51404d9db | ||
|
|
381d69646b | ||
|
|
d56740e498 | ||
|
|
4138750b3b | ||
|
|
bfa36bc662 | ||
|
|
8cb1deff76 | ||
|
|
5416e79622 | ||
|
|
5cbe83ec44 | ||
|
|
e58e96369f | ||
|
|
1f7f2f77ad | ||
|
|
a248d107da | ||
|
|
ddb7a5502d | ||
|
|
a61c55ca8c | ||
|
|
ad12ca63b0 | ||
|
|
456af8c7af | ||
|
|
4ed9e22ef2 | ||
|
|
401f91f3ab | ||
|
|
9df3a17b11 | ||
|
|
038a5ee5e7 | ||
|
|
a4998ed84a | ||
|
|
05c9176fb8 | ||
|
|
f09715ff6b | ||
|
|
c1de7373e6 | ||
|
|
d41ccfd497 | ||
|
|
292d84f55a | ||
|
|
c2badddf6f | ||
|
|
3324ea8c86 | ||
|
|
34f0dd673c | ||
|
|
23c9fb5a9f | ||
|
|
4b2dac32aa | ||
|
|
0364ab04ce | ||
|
|
c8b7f13c1a | ||
|
|
911c04b96c | ||
|
|
4c0a9ea3be | ||
|
|
a5a748166b | ||
|
|
1ec1c9bb94 | ||
|
|
b70f1562c1 | ||
|
|
c65b11bfb5 | ||
|
|
8d0d3601a7 | ||
|
|
24314254db | ||
|
|
5c588fba0c | ||
|
|
e9613ae7ad | ||
|
|
1e89750b0b | ||
|
|
4079b1e516 | ||
|
|
cc653f8685 | ||
|
|
b92dbb40c1 | ||
|
|
1f83dd7715 | ||
|
|
8d7668ea88 | ||
|
|
3570705b5c | ||
|
|
478765f1fc | ||
|
|
096b1463a6 | ||
|
|
1f263c50b7 | ||
|
|
812318163d | ||
|
|
0efda4b1c2 | ||
|
|
ca12b97c37 | ||
|
|
225b776d99 | ||
|
|
e4ae0b7fdf | ||
|
|
458ef304e8 | ||
|
|
970f95bfea | ||
|
|
cd4ef2329f | ||
|
|
ccc07f5adb | ||
|
|
50e0f8685a | ||
|
|
12d95f4708 | ||
|
|
fc5a084781 | ||
|
|
44671aa6b7 | ||
|
|
731cccd8e3 | ||
|
|
8718b9686b | ||
|
|
8111083f6a | ||
|
|
7006e18ea4 | ||
|
|
f077665994 | ||
|
|
93a20bc2de | ||
|
|
317df57496 | ||
|
|
86b698b503 | ||
|
|
b7f76c507c | ||
|
|
fcdccd4dff | ||
|
|
f63c3652f8 | ||
|
|
f222a97849 | ||
|
|
1f426edd13 | ||
|
|
994e7b9201 | ||
|
|
5d62607760 | ||
|
|
3dc7067c30 | ||
|
|
49d987d747 | ||
|
|
c81120e7c4 | ||
|
|
e5ce40bfe1 | ||
|
|
d3cd4fcfd7 | ||
|
|
d8a6a98f4b | ||
|
|
326f7d93b9 | ||
|
|
fbfddd2158 | ||
|
|
26d0932972 | ||
|
|
d7bfae6ed1 | ||
|
|
66b934c6df | ||
|
|
7dcd5a48c0 | ||
|
|
a0f863c560 | ||
|
|
818f7c6899 | ||
|
|
cb50bb1b34 | ||
|
|
632454923c | ||
|
|
06ed83878c | ||
|
|
4a7fe28adc | ||
|
|
0ffdc003fa | ||
|
|
d2bd3e035c | ||
|
|
d4c46c725d | ||
|
|
631c522737 | ||
|
|
571f2d57ef | ||
|
|
5cec9b93b8 | ||
|
|
da2fcbc88c | ||
|
|
3cf9a99864 | ||
|
|
99af8d886e | ||
|
|
b768a5440a | ||
|
|
570862bf64 | ||
|
|
4e09135edc | ||
|
|
15c6bdd613 | ||
|
|
7078f4b0bd | ||
|
|
626bb6e388 | ||
|
|
01829f8b81 | ||
|
|
9f2e50b2ef | ||
|
|
825033f768 | ||
|
|
6fc05290e6 | ||
|
|
c976dba2dd | ||
|
|
d5077a2575 | ||
|
|
3d01238ef9 | ||
|
|
0f7faae67f | ||
|
|
36dd0b874b | ||
|
|
14bd2e7f8e | ||
|
|
9d321ce412 | ||
|
|
7a1785d783 | ||
|
|
b5057a1d02 | ||
|
|
2d22b1493c | ||
|
|
3933174c29 | ||
|
|
d8426caacc | ||
|
|
0061da69af | ||
|
|
8942530744 | ||
|
|
fced3fbd17 | ||
|
|
e663939e56 | ||
|
|
1fb5b63ab7 | ||
|
|
15c96e28da | ||
|
|
2327499cdb | ||
|
|
9061b79f2b | ||
|
|
cf35bbcd0e | ||
|
|
a096f06683 | ||
|
|
1cfd34ca23 | ||
|
|
923ecfa1cd | ||
|
|
db61a690be | ||
|
|
9a5f24fafb | ||
|
|
cf2ea08800 | ||
|
|
3182eed2ac | ||
|
|
054e826e2c | ||
|
|
fd482d2169 | ||
|
|
2fafd831e5 | ||
|
|
b3af47fd03 | ||
|
|
fbea8eb211 | ||
|
|
1ceae9d4ed | ||
|
|
d4d5d4551f | ||
|
|
0ef77b5616 | ||
|
|
79c4412287 | ||
|
|
7c24091cc8 | ||
|
|
efa93d8b59 | ||
|
|
efdc8e90f6 | ||
|
|
9f020e9258 | ||
|
|
c058568767 | ||
|
|
8809e69e91 | ||
|
|
7af5c40dd0 | ||
|
|
a1baeac6f7 | ||
|
|
3b68eab6ca | ||
|
|
997a042ebf | ||
|
|
aacc06ed27 | ||
|
|
1ae5303cf0 | ||
|
|
7baeb52329 | ||
|
|
0e5ee3a4d4 | ||
|
|
1d2bd10691 | ||
|
|
21ef2e36d6 | ||
|
|
dac96fe852 | ||
|
|
b955eeb013 | ||
|
|
3e6b99925b | ||
|
|
f06f689488 | ||
|
|
fec0d8854e | ||
|
|
a1487e5e79 | ||
|
|
4650cfeeb9 | ||
|
|
35cda7ebb0 | ||
|
|
92a0494796 | ||
|
|
d2bd18acf1 | ||
|
|
f3cbf1237d | ||
|
|
76509d6a0c | ||
|
|
6f19496172 | ||
|
|
32ead756bb | ||
|
|
976a1ba8e8 | ||
|
|
1c4292d8f5 | ||
|
|
1ab766bc5c | ||
|
|
127588ba57 | ||
|
|
ccd80fedb1 | ||
|
|
1fc8731c2b | ||
|
|
b6deaf9fa0 | ||
|
|
a6eff82854 | ||
|
|
751fd74113 | ||
|
|
3dfa607685 | ||
|
|
b2c06a57c9 | ||
|
|
a97a334eb0 | ||
|
|
3d8180141f | ||
|
|
74ab0e7ba5 | ||
|
|
8dfeccd935 | ||
|
|
c144fe2408 | ||
|
|
3bbc6716ad | ||
|
|
75ed1b5ec3 | ||
|
|
699b3d52c5 | ||
|
|
ae8c4aca58 | ||
|
|
79d0c06951 | ||
|
|
a877c6f1ae | ||
|
|
6ccc588d69 | ||
|
|
81071ba4f5 | ||
|
|
e12c7c28d1 | ||
|
|
724b47922e | ||
|
|
b3911bf88a | ||
|
|
802f94560d | ||
|
|
5573667b95 | ||
|
|
dd5d161991 | ||
|
|
a005307a60 | ||
|
|
dcb4b8501d | ||
|
|
1e65cbf65d | ||
|
|
cdc9dd8584 | ||
|
|
93f4337576 | ||
|
|
69338b814b | ||
|
|
af6287f1ca | ||
|
|
1868f99cad | ||
|
|
ef3472d8f5 | ||
|
|
347a1fac67 | ||
|
|
239d6a036b | ||
|
|
d1da368537 | ||
|
|
38c16a5888 | ||
|
|
8b9960c603 | ||
|
|
0c937511c7 | ||
|
|
36ea516731 | ||
|
|
54314feab5 | ||
|
|
286a5c590a | ||
|
|
ce202f3549 | ||
|
|
76ccb791ff | ||
|
|
c7882e941c | ||
|
|
c5da16771a | ||
|
|
98c6222154 | ||
|
|
a5a5735089 | ||
|
|
33dce288dd | ||
|
|
406f1d62df | ||
|
|
674148fb07 | ||
|
|
aa5601041c | ||
|
|
62d167aeb3 | ||
|
|
b742a191ee | ||
|
|
9229952cd9 | ||
|
|
389cfdd583 | ||
|
|
5077edf585 | ||
|
|
3f1e851152 | ||
|
|
6b1fe63294 | ||
|
|
821fbb3566 | ||
|
|
3670564712 | ||
|
|
f38926f8b1 | ||
|
|
ced402ad5d | ||
|
|
5f8d072b86 | ||
|
|
f84f285db3 | ||
|
|
44194c000d | ||
|
|
c61bd07bb5 | ||
|
|
3df0a0f796 | ||
|
|
f16dfc92b2 | ||
|
|
96faf18d96 | ||
|
|
6393210a31 | ||
|
|
7151847d1f | ||
|
|
d5ffbd86f3 | ||
|
|
ab8b90b187 | ||
|
|
8d42c49b77 | ||
|
|
0e24296f67 | ||
|
|
7f87dc49f8 | ||
|
|
30de9bcc27 | ||
|
|
cc4177b096 | ||
|
|
100e2e0828 | ||
|
|
a25b309ac7 | ||
|
|
e7cb0a7c6a | ||
|
|
b6f48cd1fe | ||
|
|
ea391a3a17 | ||
|
|
4ba260c486 | ||
|
|
7cb9f88f6c | ||
|
|
203823a6af | ||
|
|
10564f909a | ||
|
|
383579dba3 | ||
|
|
e896231d88 | ||
|
|
5325b379c5 | ||
|
|
1af06e1dd5 | ||
|
|
23fcef6dd8 | ||
|
|
c68caae1e7 | ||
|
|
3dc4b8f626 | ||
|
|
df5c16bddf | ||
|
|
b008f1a1cc | ||
|
|
3a3a31b9b8 | ||
|
|
5504bdf63d | ||
|
|
e3b41771c6 | ||
|
|
7d051394e6 | ||
|
|
3f7f3090f6 | ||
|
|
468149a9ad | ||
|
|
6ec1d81ef0 | ||
|
|
6b5d3ee985 | ||
|
|
5b3c4c70b5 | ||
|
|
6d5e4c4114 | ||
|
|
4149493f2c | ||
|
|
c26054a1a6 | ||
|
|
a20a3f2781 | ||
|
|
e7f5d1731d | ||
|
|
16f6cf91c7 | ||
|
|
45addfddb3 | ||
|
|
6f80226e88 | ||
|
|
8fbc56a688 | ||
|
|
fecfc08451 | ||
|
|
43aad3f65c | ||
|
|
62a03c2b21 | ||
|
|
bedcacb0a1 | ||
|
|
7273d6112b | ||
|
|
74bddb82e5 | ||
|
|
4af6ca9db0 | ||
|
|
7e4ee25c48 | ||
|
|
6da9a49652 | ||
|
|
51d88dbb24 | ||
|
|
cd8ecf9060 | ||
|
|
847ea0b73c | ||
|
|
68c7be9d9e | ||
|
|
1bde544458 | ||
|
|
f62cad6a2f | ||
|
|
eec372a186 | ||
|
|
b98bb40a89 | ||
|
|
4d1a2a0e90 | ||
|
|
dec50598bc | ||
|
|
c5c64ad831 | ||
|
|
27153190e2 | ||
|
|
2cc55ea6eb | ||
|
|
121a657acb | ||
|
|
6a54986b3f | ||
|
|
b4a70dfc0a | ||
|
|
efa5c2244b | ||
|
|
4199155228 | ||
|
|
d949d93924 | ||
|
|
44e2a0ec4c | ||
|
|
0cd369c603 | ||
|
|
76fce67276 | ||
|
|
f3e0f0bb05 | ||
|
|
628301be37 | ||
|
|
6efaafef60 | ||
|
|
f387815749 | ||
|
|
ef04f022d2 | ||
|
|
1efac2736a | ||
|
|
c873aa18bd | ||
|
|
9299e8df95 | ||
|
|
97363a3e57 | ||
|
|
78a8ff3bb3 | ||
|
|
3033657a19 | ||
|
|
ac118f453b | ||
|
|
28d5715dd5 | ||
|
|
8466888bc8 | ||
|
|
741e1ed78a | ||
|
|
e02b0a33a6 | ||
|
|
9e10a71ffb | ||
|
|
4525bd0ed5 | ||
|
|
89d0a7a01f | ||
|
|
27cd52a1b9 | ||
|
|
47785c4f98 | ||
|
|
e020a75bb7 | ||
|
|
c8a7776222 | ||
|
|
3934ef89ea | ||
|
|
d60499f793 | ||
|
|
9b359ff73b | ||
|
|
fc9c45c34f | ||
|
|
212fff2828 | ||
|
|
a5f8f84b43 | ||
|
|
44e3bbe773 | ||
|
|
90f922d651 | ||
|
|
408051429d | ||
|
|
ae904ec330 | ||
|
|
3bde088a06 | ||
|
|
9d28ba1e06 | ||
|
|
514e60863d | ||
|
|
98af6a4888 | ||
|
|
b740f603ec | ||
|
|
6b2099471d | ||
|
|
c76105e28e | ||
|
|
70ff2a296a | ||
|
|
c3e3bd306f | ||
|
|
e53b190380 | ||
|
|
4f805c4263 | ||
|
|
a7870fc1b2 | ||
|
|
1846fd4001 | ||
|
|
d48fd4343b | ||
|
|
62e09945e3 | ||
|
|
9ce7b5a87c | ||
|
|
460aee5971 | ||
|
|
0e309a7e7f | ||
|
|
27f9fafc73 | ||
|
|
c9b0db02fd | ||
|
|
72ea4d5eb9 | ||
|
|
3c63457e38 | ||
|
|
477eb06f2b | ||
|
|
62b27eadce | ||
|
|
668499169e | ||
|
|
2133b871be | ||
|
|
d6370f3dcf | ||
|
|
4589c6a731 | ||
|
|
c4ea718dd5 | ||
|
|
f26308c09f | ||
|
|
420b479896 | ||
|
|
2dfbeb16b2 | ||
|
|
f293e59478 | ||
|
|
b747b98cde | ||
|
|
094596961a | ||
|
|
503f95b085 | ||
|
|
3612c02d07 | ||
|
|
93cc277311 | ||
|
|
9d84cad54b | ||
|
|
ddbc92a990 | ||
|
|
ce587c6f06 | ||
|
|
82671ea293 | ||
|
|
605015c8af | ||
|
|
baa93534f0 | ||
|
|
e5f74bc638 | ||
|
|
68777f9873 | ||
|
|
4037db9783 | ||
|
|
67565fe0a7 | ||
|
|
a67c6610a7 | ||
|
|
4f5ec73173 | ||
|
|
79f4e8ded0 | ||
|
|
51da619eec | ||
|
|
7544de0b47 | ||
|
|
491456e8de | ||
|
|
5b51db1999 | ||
|
|
46eaddc411 | ||
|
|
71c6cb6c6c | ||
|
|
0452f0aad9 | ||
|
|
478ccb6abd | ||
|
|
7504532e58 | ||
|
|
9621430533 | ||
|
|
3ef10f294e | ||
|
|
e394edb630 | ||
|
|
3eb50568e9 | ||
|
|
e65e602bab | ||
|
|
866b145645 | ||
|
|
65ec5abb72 | ||
|
|
fc909f88ba | ||
|
|
c22d13af30 | ||
|
|
290a53e934 | ||
|
|
4b20f32c39 | ||
|
|
5ce976f322 | ||
|
|
352e0bf2ff | ||
|
|
684404f29c | ||
|
|
478fb3c245 | ||
|
|
c3cfd55762 | ||
|
|
b2d989f85f | ||
|
|
bb3d290d6b | ||
|
|
33bdb7f425 | ||
|
|
0c9d89787c | ||
|
|
94c12812e0 | ||
|
|
3144d82fb4 | ||
|
|
dc7651af75 | ||
|
|
9215fbe9b0 | ||
|
|
5a56dfc749 | ||
|
|
bddb1ba342 | ||
|
|
cafce7c050 | ||
|
|
324cd1bd59 | ||
|
|
ad5fe867c5 | ||
|
|
cc862b039e | ||
|
|
446eb16e7a | ||
|
|
e09702e5dc | ||
|
|
48000bdbda | ||
|
|
f8b8e094f9 | ||
|
|
9762fe5397 | ||
|
|
5780e18487 | ||
|
|
3c6f603aea | ||
|
|
35ab3eb26d | ||
|
|
302f4226cf | ||
|
|
377896c30a | ||
|
|
13893fbfb2 | ||
|
|
d603786a13 | ||
|
|
407342f482 | ||
|
|
5c8b812075 | ||
|
|
2a2d928075 | ||
|
|
e160229500 | ||
|
|
60cfb9998d | ||
|
|
6ec8c14a98 | ||
|
|
a395b8492a | ||
|
|
17e337c874 | ||
|
|
98f13a6f11 | ||
|
|
7b3ac0a22e | ||
|
|
0d85aea687 | ||
|
|
04b0be0452 | ||
|
|
25d2b76514 | ||
|
|
b0e7500bcb | ||
|
|
296bee8000 | ||
|
|
ec4977971e | ||
|
|
71684e0f90 | ||
|
|
7a99678e6f | ||
|
|
8bf5d6e9aa | ||
|
|
6fbf4df21d | ||
|
|
5cc9930813 | ||
|
|
5aa8b56cb7 | ||
|
|
4dfb2a39a6 | ||
|
|
cc11b68e20 | ||
|
|
5e327771ef | ||
|
|
0ec40d9000 | ||
|
|
dbfa0c5ed5 | ||
|
|
9b20549cef | ||
|
|
ce2fcf0c62 | ||
|
|
605c8032f8 | ||
|
|
bfdcba4449 | ||
|
|
fc9209f55a | ||
|
|
5a337901a6 | ||
|
|
6cabb390fd | ||
|
|
4efc47f955 | ||
|
|
8334b15f4e | ||
|
|
84343d04d3 | ||
|
|
e2c0f014dd | ||
|
|
e2bddc1901 | ||
|
|
c417da6ed4 | ||
|
|
2ad0a95bd4 | ||
|
|
e5b80da312 | ||
|
|
42dfef3f6b | ||
|
|
10125dfb08 | ||
|
|
6f4403cf05 | ||
|
|
3b7755a4d2 | ||
|
|
f0bef8dca6 | ||
|
|
1ce1e9cd71 | ||
|
|
fec8a4e07f | ||
|
|
65163966d5 | ||
|
|
e201d7905e | ||
|
|
32b9947b57 | ||
|
|
7b03e025a7 | ||
|
|
a81c4645c0 | ||
|
|
675720d466 | ||
|
|
646d9cfd6a | ||
|
|
d1e7326f4d | ||
|
|
0fd0adad84 | ||
|
|
aef2fa974e | ||
|
|
001b3a5721 | ||
|
|
350c1c3890 | ||
|
|
64c1327716 | ||
|
|
ec47886d72 | ||
|
|
40fe35c8e2 | ||
|
|
532eee96fe | ||
|
|
febcf11215 | ||
|
|
7a76ee1ec5 | ||
|
|
81a026435d | ||
|
|
9f2d17d40c | ||
|
|
2e66dc794b | ||
|
|
3644b94ee9 | ||
|
|
cf2a1112f4 | ||
|
|
bcc7d61266 | ||
|
|
3c5e7e260e | ||
|
|
b137b7c3ed | ||
|
|
67118593b8 | ||
|
|
85514f21bc | ||
|
|
fa774544ea | ||
|
|
a45c8f8670 | ||
|
|
a014fe80bd | ||
|
|
b9bd78e64e | ||
|
|
21bc17ac6e | ||
|
|
d03f2d48fa | ||
|
|
edf8e0a155 | ||
|
|
82b8f261a8 | ||
|
|
1e779a5a3c | ||
|
|
4083075476 | ||
|
|
e4696c5dec | ||
|
|
9bf1c1d5a5 | ||
|
|
34745e0b10 | ||
|
|
5e96765467 | ||
|
|
9b49182355 | ||
|
|
88f419fc11 | ||
|
|
fc4fc00803 | ||
|
|
4b9ca430ba | ||
|
|
885b4c0a61 | ||
|
|
79a78ba994 | ||
|
|
982c4fb9cf | ||
|
|
9b7f7deb4d | ||
|
|
a6f535fd54 | ||
|
|
edb810aa3d | ||
|
|
42b3c28ab1 | ||
|
|
b745ebc218 | ||
|
|
6b6c16e378 | ||
|
|
8f55a2e8d2 | ||
|
|
5f68e6a868 | ||
|
|
93dc3737fb | ||
|
|
6f2714bfbb | ||
|
|
fafca55335 | ||
|
|
2605cac2a9 | ||
|
|
98a9b0cabe | ||
|
|
dc0a7af0aa | ||
|
|
3adcec81a4 | ||
|
|
b96737a919 | ||
|
|
c4d68fd859 | ||
|
|
2d3cac0dea | ||
|
|
0fcc415231 | ||
|
|
8431b37201 | ||
|
|
23f3b47e6f | ||
|
|
7d73a3124d | ||
|
|
b69d17a0f5 | ||
|
|
be8b6fb693 | ||
|
|
2041315910 | ||
|
|
04f822ab92 | ||
|
|
5a486fc8cd | ||
|
|
62fb757bb3 | ||
|
|
b79a965613 | ||
|
|
148a709e0e | ||
|
|
4916b2f361 | ||
|
|
f7c2cc869a | ||
|
|
79c8d1d64a | ||
|
|
54c73eaade | ||
|
|
a397a4731a | ||
|
|
4dfea3b68c | ||
|
|
384b33386b | ||
|
|
1a3afd10fc | ||
|
|
a2a0297ae9 | ||
|
|
8cf332baba | ||
|
|
77af87e92e | ||
|
|
01a747ad35 | ||
|
|
c8cbf6c0ba | ||
|
|
edaf6dce78 | ||
|
|
58e184fdc0 | ||
|
|
07efeb4c6c | ||
|
|
3555e2f1ab | ||
|
|
cf2ebd75fe | ||
|
|
ac74b5b6a3 | ||
|
|
c22c28d0c6 | ||
|
|
399daf9b27 | ||
|
|
b3a337aad0 | ||
|
|
ed1a1ca57e | ||
|
|
cae6c42928 | ||
|
|
4abec441f9 | ||
|
|
8e23df99d8 | ||
|
|
abe65b5879 | ||
|
|
20e220354d | ||
|
|
bc6bfac71a | ||
|
|
f40e9bc569 | ||
|
|
fa3e927011 | ||
|
|
9f9bfddd47 | ||
|
|
7fec8ba15f | ||
|
|
24f5fdd122 | ||
|
|
6a063be33f | ||
|
|
150c7aaf84 | ||
|
|
bbf2832356 | ||
|
|
e2e6662bae | ||
|
|
da3a4382dd | ||
|
|
eca31aa8a1 | ||
|
|
186ace28e0 | ||
|
|
c549c07fa6 | ||
|
|
340c00dc92 | ||
|
|
53b6bb29ec | ||
|
|
ed51a08388 | ||
|
|
140eb83f73 | ||
|
|
f1d9211b92 | ||
|
|
64b429c9a0 | ||
|
|
8a81837bd4 | ||
|
|
716979e1e3 | ||
|
|
117ec80611 | ||
|
|
6379d6e799 | ||
|
|
373e7face5 | ||
|
|
50eb6f94dd | ||
|
|
801c8dd5d4 | ||
|
|
27abc63d1c | ||
|
|
0a23125ae5 | ||
|
|
e8a33ff410 | ||
|
|
25162597e1 | ||
|
|
6502f27963 | ||
|
|
13e0bd2cff | ||
|
|
591242ab5f | ||
|
|
93e633490a | ||
|
|
250b5ca064 | ||
|
|
f0ae9b3a12 | ||
|
|
edb0af19c4 | ||
|
|
6329ba4091 | ||
|
|
ef48323a9b | ||
|
|
87a1e507ac | ||
|
|
0e3114a252 | ||
|
|
21f6ea640f | ||
|
|
03ebaf8783 | ||
|
|
d575335ade | ||
|
|
31abc1847f | ||
|
|
0b08fc9bac | ||
|
|
2bb1462f10 | ||
|
|
0ab9f770ea | ||
|
|
4416479d1c | ||
|
|
6231202374 | ||
|
|
6542b63660 | ||
|
|
fcab84cf6a | ||
|
|
e2e350883e | ||
|
|
47353932a1 | ||
|
|
850c61dc76 | ||
|
|
84bacd7edc | ||
|
|
773e60e31e | ||
|
|
9bce9d7a5d | ||
|
|
f1457ecffc | ||
|
|
8c284037c9 | ||
|
|
f2311d7dba | ||
|
|
3b4092f1ac | ||
|
|
2608f1a47c | ||
|
|
656018a440 | ||
|
|
70637aeb69 | ||
|
|
543aa5e3bb | ||
|
|
119a06f807 | ||
|
|
cb5b588711 | ||
|
|
adb9a4112c | ||
|
|
48653c0854 | ||
|
|
49e5dfdc24 | ||
|
|
35ebdb302a | ||
|
|
58f15d95d4 | ||
|
|
17db1d5970 | ||
|
|
0b97bea982 | ||
|
|
f054ffe9c8 | ||
|
|
2855600b5b | ||
|
|
ebb24763bd | ||
|
|
0c0f78d915 | ||
|
|
b0182fdd9a | ||
|
|
378e37adc9 | ||
|
|
3612c22adf | ||
|
|
230bce9864 | ||
|
|
f611df293f | ||
|
|
46944da663 | ||
|
|
518ea5bc31 | ||
|
|
3ee264015a | ||
|
|
65fcb15c09 | ||
|
|
304a336b57 | ||
|
|
28762c4be2 | ||
|
|
c2ca699e39 | ||
|
|
a8694b59a0 | ||
|
|
f0ecdd4862 | ||
|
|
98bfb54efc | ||
|
|
3a8e920a0d | ||
|
|
ba0cc65530 | ||
|
|
320d355e5d | ||
|
|
feae362cc3 | ||
|
|
66b0dbb945 | ||
|
|
14f2cc2bf4 | ||
|
|
c2fdf75c8c | ||
|
|
281d04feaf | ||
|
|
3526f5092c | ||
|
|
2be467ed68 | ||
|
|
38ed24f6a0 | ||
|
|
b56711ff6c | ||
|
|
379d1c8472 | ||
|
|
03b3995e19 | ||
|
|
466fb3b6bc | ||
|
|
08fd6214c9 | ||
|
|
feb70a3680 | ||
|
|
093757d182 | ||
|
|
a51209e051 | ||
|
|
4f86df6fa2 | ||
|
|
479368da95 | ||
|
|
9e9430e9b4 | ||
|
|
b38e9ef00a | ||
|
|
58cce1a996 | ||
|
|
ddc3857e36 | ||
|
|
0806b5774c | ||
|
|
3ff67ac89a | ||
|
|
5d358dc8de | ||
|
|
2832e546e0 | ||
|
|
5669aeb26a | ||
|
|
c846e8106d | ||
|
|
35c55c2555 | ||
|
|
065454194a | ||
|
|
9e5237fa99 | ||
|
|
7d7ff29911 | ||
|
|
5e019a77da | ||
|
|
68c9cb9236 | ||
|
|
36f04f0fce | ||
|
|
168eba4e28 | ||
|
|
39366406c5 | ||
|
|
9b1bf3b238 | ||
|
|
8eb5e9cd0e | ||
|
|
effd140a87 | ||
|
|
2afbce5b28 | ||
|
|
0c2b40b22f | ||
|
|
b590e097dc | ||
|
|
2f3f444b17 | ||
|
|
d04085e017 | ||
|
|
3eff13967a | ||
|
|
cba220883b | ||
|
|
423f838ce8 | ||
|
|
20f9990784 | ||
|
|
d6574c6d3f | ||
|
|
f5d711bd0b | ||
|
|
bd3102ad91 | ||
|
|
9005aca568 | ||
|
|
54c6227d89 | ||
|
|
41303ed8cc | ||
|
|
b885e2c39a | ||
|
|
853a4f3582 | ||
|
|
6ee27f5716 | ||
|
|
d8c3426058 | ||
|
|
886d3c58e9 | ||
|
|
ae17dab804 | ||
|
|
9fd2438d4c | ||
|
|
1ac61ed3b6 | ||
|
|
6bd2bb5fdb | ||
|
|
ac1e3274ec | ||
|
|
14be9092a1 | ||
|
|
5dfb14f86e | ||
|
|
b42091e660 | ||
|
|
646f40b8b5 | ||
|
|
c357584ec0 | ||
|
|
5d736cc6c8 | ||
|
|
304858c0cb | ||
|
|
fa32357231 | ||
|
|
8879e4e399 | ||
|
|
f1712ca20b | ||
|
|
0445fc4207 | ||
|
|
34c3835151 | ||
|
|
f38f551cda | ||
|
|
93fcc05944 | ||
|
|
12dbf2cd68 | ||
|
|
6a97dd8c93 | ||
|
|
fe9cfe318a | ||
|
|
2080e28813 | ||
|
|
79e846844f | ||
|
|
3a74d10317 | ||
|
|
ef637af801 | ||
|
|
833795da79 | ||
|
|
68bc9642f4 | ||
|
|
a8bae9e3a6 | ||
|
|
fe2c5ef04b | ||
|
|
83521bc682 | ||
|
|
3263fab54f | ||
|
|
3254d7db33 | ||
|
|
77bdf4b028 | ||
|
|
ca16d85890 | ||
|
|
74f12d8071 | ||
|
|
dc6b33eda2 | ||
|
|
bde931bc3a | ||
|
|
872c86ad20 | ||
|
|
6736b6771f | ||
|
|
4b4ea51138 | ||
|
|
380dcbbb58 | ||
|
|
0a002db1e5 | ||
|
|
b5b1c2b9df | ||
|
|
dd8f358076 | ||
|
|
34cd49174e | ||
|
|
2874fd2600 |
@@ -0,0 +1,79 @@
|
||||
name: Bug Report - Language Service
|
||||
description: Create a bug report for IntelliSense, code editing, code navigation, code completion, code formatting, semantic colorization, etc.
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
### Is there an existing issue for this?
|
||||
Please search our [existing issues](https://github.com/microsoft/vscode-cpptools/issues) to see if an issue already exists for the bug you encountered.
|
||||
|
||||
Please also review our [documentation](https://code.visualstudio.com/docs/languages/cpp) and [FAQs](https://code.visualstudio.com/docs/cpp/faq-cpp).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Environment
|
||||
description: |
|
||||
Please provide the information for the following:
|
||||
- OS and Version
|
||||
- VS Code Version
|
||||
- C/C++ Extension Version
|
||||
- If using SSH remote, specify OS of remote machine
|
||||
value: |
|
||||
- OS and Version:
|
||||
- VS Code Version:
|
||||
- C/C++ Extension Version:
|
||||
- If using SSH remote, specify OS of remote machine:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Bug Summary and Steps to Reproduce
|
||||
description: |
|
||||
Please describe the language service issue or language service feature that is not working as expected. Include information about the actual workspace project (for example, is the workspace a single project or multiple projects, size of the project, etc).
|
||||
|
||||
Include clear steps on how to reproduce the issue and a description of what you expected to happen.
|
||||
value: |
|
||||
Bug Summary:
|
||||
|
||||
|
||||
Steps to reproduce:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
Expected behavior:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Configuration and Logs
|
||||
description: |
|
||||
Please provide your c_cpp_properties.json and logs:
|
||||
- Configurations in `c_cpp_properties.json`
|
||||
- Logs from running `C/C++: Log Diagnostics` from the VS Code command palette
|
||||
- Logs from [the language server logging](https://code.visualstudio.com/docs/cpp/enable-logging-cpp#_enable-logging-for-the-language-server)
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Other Extensions
|
||||
description: If applicable, please list other extensions installed and if the issue persists after disabling other extensions.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: |
|
||||
Optionally provide other information that will give us more context about the issue you are encountering, such as code sample, screenshots, screen recording of the issue, call stacks, etc.
|
||||
|
||||
Providing call stacks:
|
||||
For bugs like crashes, deadlocks, infinite loops, etc. that we are not able to repro and for which the call stack may be useful, please attach a debugger and/or create a dmp and provide the call stacks. Windows binaries have symbols available in VS Code by setting your "symbolSearchPath" to "https://msdl.microsoft.com/download/symbols".
|
||||
|
||||
Instructions for attaching debugger to language service process:
|
||||
https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv.
|
||||
|
||||
Performance analysis:
|
||||
For a performance issue see instructions at https://github.com/microsoft/vscode-cpptools/wiki/Troubleshooting-Performance-Issues.
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,59 +0,0 @@
|
||||
name: Bug Report - General Extension
|
||||
description: Create a bug report for downloading, installing, or building the extension.
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
### Is there an existing issue for this?
|
||||
Please search our [existing issues](https://github.com/microsoft/vscode-cpptools/issues) to see if an issue already exists for the bug you encountered.
|
||||
|
||||
Please also review our [documentation](https://code.visualstudio.com/docs/languages/cpp) and [FAQs](https://code.visualstudio.com/docs/cpp/faq-cpp).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Environment
|
||||
description: |
|
||||
Please provide the information for the following:
|
||||
- OS and version
|
||||
- VS Code version
|
||||
- C/C++ extension version
|
||||
- OS and version of remote machine (if applicable)
|
||||
value: |
|
||||
- OS and version:
|
||||
- VS Code:
|
||||
- C/C++ extension:
|
||||
- OS and version of remote machine (if applicable):
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Bug Summary and Steps to Reproduce
|
||||
description: |
|
||||
Please give a description of the issue you are encountering and what you expected to happen.
|
||||
|
||||
Include clear steps on how to reproduce the issue.
|
||||
value: |
|
||||
Bug Summary:
|
||||
|
||||
|
||||
Steps to reproduce:
|
||||
1. In this environment...
|
||||
2. With this config...
|
||||
3. Do '...'
|
||||
4. See error...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Other Extensions
|
||||
description: If applicable, please list other extensions installed and if the issue persists after disabling other extensions.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Information
|
||||
description: |
|
||||
Optionally provide other information that will give us more context about the issue you are encountering.
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
name: Bug Report - Language Service
|
||||
about: 'Create a bug report for IntelliSense, autocomplete, code editing, code navigation, etc.'
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Bug type: Language Service
|
||||
|
||||
<!-- Prior to creating a bug report, please review:
|
||||
📝 Existing issues at https://github.com/Microsoft/vscode-cpptools/issues
|
||||
📜 Our documentation at https://code.visualstudio.com/docs/languages/cpp
|
||||
📙 FAQs at https://code.visualstudio.com/docs/cpp/faq-cpp
|
||||
-->
|
||||
|
||||
|
||||
**Describe the bug**
|
||||
- OS and Version:
|
||||
- VS Code Version:
|
||||
- C/C++ Extension Version:
|
||||
- Other extensions you installed (and if the issue persists after disabling them):
|
||||
- If using SSH remote, specify OS of remote machine:
|
||||
- A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).
|
||||
|
||||
|
||||
**Steps to reproduce**
|
||||
<!-- Provide clear steps to reproduce the bug: -->
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
|
||||
**Code sample and logs**
|
||||
<!-- Please provide code sample, your c_cpp_properties.json and logs. -->
|
||||
- Code sample
|
||||
|
||||
- Configurations in `c_cpp_properties.json`
|
||||
|
||||
- Logs from running `C/C++: Log Diagnostics` from the VS Code command palette
|
||||
|
||||
- Logs from [the language server logging](https://code.visualstudio.com/docs/cpp/enable-logging-cpp#_enable-logging-for-the-language-server)
|
||||
|
||||
|
||||
**Screenshots**
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
|
||||
**Additional context**
|
||||
<!--
|
||||
Providing call stacks:
|
||||
For bugs like crashes, deadlocks, infinite loops, etc. that we are not able to repro and for which the call stack may be useful, please attach a debugger and/or create a dmp and provide the call stacks. Windows binaries have symbols available in VS Code by setting your "symbolSearchPath" to "https://msdl.microsoft.com/download/symbols".
|
||||
|
||||
Instructions for attaching debugger to language service process:
|
||||
https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv.
|
||||
|
||||
Performance analysis:
|
||||
For a performance issue see instructions at https://github.com/microsoft/vscode-cpptools/wiki/Troubleshooting-Performance-Issues.
|
||||
-->
|
||||
@@ -0,0 +1,2 @@
|
||||
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
|
||||
always-auth=true
|
||||
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AddComment = void 0;
|
||||
const ActionBase_1 = require("../common/ActionBase");
|
||||
const utils_1 = require("../common/utils");
|
||||
class AddComment extends ActionBase_1.ActionBase {
|
||||
constructor(github, createdAfter, afterDays, labels, addComment, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
this.github = github;
|
||||
this.createdAfter = createdAfter;
|
||||
this.afterDays = afterDays;
|
||||
this.addComment = addComment;
|
||||
this.addLabels = addLabels;
|
||||
this.removeLabels = removeLabels;
|
||||
this.setMilestoneId = setMilestoneId;
|
||||
}
|
||||
async run() {
|
||||
const updatedTimestamp = this.afterDays ? (0, utils_1.daysAgoToHumanReadbleDate)(this.afterDays) : undefined;
|
||||
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") +
|
||||
(this.createdAfter ? `created:>${this.createdAfter} ` : "") +
|
||||
"is:open is:unlocked");
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
// Don't add a comment if already commented on by an action.
|
||||
let foundActionComment = false;
|
||||
for await (const commentBatch of issue.getComments()) {
|
||||
for (const comment of commentBatch) {
|
||||
if (comment.author.isGitHubApp) {
|
||||
foundActionComment = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundActionComment)
|
||||
break;
|
||||
}
|
||||
if (foundActionComment) {
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
|
||||
continue;
|
||||
}
|
||||
if (this.addComment) {
|
||||
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.addComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.setMilestoneId != undefined) {
|
||||
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
(0, utils_1.safeLog)(`Processing issue ${hydrated.number}.`);
|
||||
}
|
||||
else {
|
||||
if (!hydrated.open) {
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.AddComment = AddComment;
|
||||
//# sourceMappingURL=AddComment.js.map
|
||||
@@ -0,0 +1,98 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { GitHub } from '../api/api';
|
||||
import { ActionBase } from '../common/ActionBase';
|
||||
import { daysAgoToHumanReadbleDate, daysAgoToTimestamp, safeLog } from '../common/utils';
|
||||
|
||||
export class AddComment extends ActionBase {
|
||||
constructor(
|
||||
private github: GitHub,
|
||||
private createdAfter: string | undefined,
|
||||
private afterDays: number,
|
||||
labels: string,
|
||||
private addComment: string,
|
||||
private addLabels?: string,
|
||||
private removeLabels?: string,
|
||||
private setMilestoneId?: string,
|
||||
milestoneName?: string,
|
||||
milestoneId?: string,
|
||||
ignoreLabels?: string,
|
||||
ignoreMilestoneNames?: string,
|
||||
ignoreMilestoneIds?: string,
|
||||
minimumVotes?: number,
|
||||
maximumVotes?: number,
|
||||
involves?: string
|
||||
) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
}
|
||||
|
||||
async run() {
|
||||
const updatedTimestamp = this.afterDays ? daysAgoToHumanReadbleDate(this.afterDays) : undefined;
|
||||
const query = this.buildQuery(
|
||||
(updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") +
|
||||
(this.createdAfter ? `created:>${this.createdAfter} ` : "") +
|
||||
"is:open is:unlocked");
|
||||
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
// Don't add a comment if already commented on by an action.
|
||||
let foundActionComment = false;
|
||||
for await (const commentBatch of issue.getComments()) {
|
||||
for (const comment of commentBatch) {
|
||||
if (comment.author.isGitHubApp) {
|
||||
foundActionComment = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundActionComment)
|
||||
break;
|
||||
}
|
||||
if (foundActionComment) {
|
||||
safeLog(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.addComment) {
|
||||
safeLog(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.addComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
safeLog(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
safeLog(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.setMilestoneId != undefined) {
|
||||
safeLog(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
safeLog(`Processing issue ${hydrated.number}.`);
|
||||
} else {
|
||||
if (!hydrated.open) {
|
||||
safeLog(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
name: Add Comment and Label
|
||||
description: Add comment (etc) to issues that are marked with a specified label (etc)
|
||||
inputs:
|
||||
token:
|
||||
description: GitHub token with issue, comment, and label read/write permissions
|
||||
default: ${{ github.token }}
|
||||
createdAfter:
|
||||
description: Creation date after which to be considered.
|
||||
required: false
|
||||
afterDays:
|
||||
description: Days to wait before performing this action (may be 0).
|
||||
required: false
|
||||
addComment:
|
||||
description: Comment to add
|
||||
labels:
|
||||
description: items with these labels will be considered. May be "*".
|
||||
required: true
|
||||
milestoneName:
|
||||
description: items with these milestones will be considered (name only, must match ID)
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
ignoreLabels:
|
||||
description: items with these labels will not be considered
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
ignoreMilestoneIds:
|
||||
description: items with these milestones will not be considered (IDs only, must match names)
|
||||
addLabels:
|
||||
description: Labels to add to issue.
|
||||
removeLabels:
|
||||
description: Labels to remove from issue.
|
||||
minimumVotes:
|
||||
descriptions: Only issues with at least this many votes will be considered.
|
||||
maximumVotes:
|
||||
descriptions: Only issues fewer or equal to this many votes will be considered.
|
||||
involves:
|
||||
descriptions: Qualifier to find issues that in some way involve a certain user either as an author, assignee, or mentions.
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node20'
|
||||
main: 'index.js'
|
||||
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils_1 = require("../common/utils");
|
||||
const AddComment_1 = require("./AddComment");
|
||||
const Action_1 = require("../common/Action");
|
||||
class AddCommentAction extends Action_1.Action {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.id = 'AddComment';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
await new AddComment_1.AddComment(github, (0, utils_1.getInput)('createdAfter') || undefined, +((0, utils_1.getInput)('afterDays') || 0), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('addComment') || '', (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
|
||||
}
|
||||
}
|
||||
new AddCommentAction().run(); // eslint-disable-line
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { OctoKit } from '../api/octokit'
|
||||
import { getInput, getRequiredInput } from '../common/utils'
|
||||
import { AddComment } from './AddComment'
|
||||
import { Action } from '../common/Action'
|
||||
|
||||
class AddCommentAction extends Action {
|
||||
id = 'AddComment';
|
||||
|
||||
async onTriggered(github: OctoKit) {
|
||||
await new AddComment(
|
||||
github,
|
||||
getInput('createdAfter') || undefined,
|
||||
+(getInput('afterDays') || 0),
|
||||
getRequiredInput('labels'),
|
||||
getInput('addComment') || '',
|
||||
getInput('addLabels') || undefined,
|
||||
getInput('removeLabels') || undefined,
|
||||
getInput('setMilestoneId') || undefined,
|
||||
getInput('milestoneName') || undefined,
|
||||
getInput('milestoneId') || undefined,
|
||||
getInput('ignoreLabels') || undefined,
|
||||
getInput('ignoreMilestoneNames') || undefined,
|
||||
getInput('ignoreMilestoneIds') || undefined,
|
||||
+(getInput('minimumVotes') || 0),
|
||||
+(getInput('maximumVotes') || 9999999),
|
||||
getInput('involves') || undefined
|
||||
).run();
|
||||
}
|
||||
}
|
||||
|
||||
new AddCommentAction().run(); // eslint-disable-line
|
||||
@@ -15,8 +15,8 @@ class Locker extends ActionBase_1.ActionBase {
|
||||
this.daysSinceUpdate = daysSinceUpdate;
|
||||
}
|
||||
async run() {
|
||||
const closedTimestamp = utils_1.daysAgoToHumanReadbleDate(this.daysSinceClose);
|
||||
const updatedTimestamp = utils_1.daysAgoToHumanReadbleDate(this.daysSinceUpdate);
|
||||
const closedTimestamp = (0, utils_1.daysAgoToHumanReadbleDate)(this.daysSinceClose);
|
||||
const updatedTimestamp = (0, utils_1.daysAgoToHumanReadbleDate)(this.daysSinceUpdate);
|
||||
const query = this.buildQuery((this.daysSinceClose ? `closed:<${closedTimestamp} ` : "") + (this.daysSinceUpdate ? `updated:<${updatedTimestamp} ` : "") + "is:closed is:unlocked");
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
await Promise.all(page.map(async (issue) => {
|
||||
@@ -24,15 +24,15 @@ class Locker extends ActionBase_1.ActionBase {
|
||||
if (!hydrated.locked && hydrated.open === false && this.validateIssue(hydrated)
|
||||
// TODO: Verify closed and updated timestamps
|
||||
) {
|
||||
console.log(`Locking issue ${hydrated.number}`);
|
||||
(0, utils_1.safeLog)(`Locking issue ${hydrated.number}`);
|
||||
await issue.lockIssue();
|
||||
}
|
||||
else {
|
||||
if (hydrated.locked) {
|
||||
console.log(`Issue ${hydrated.number} is already locked. Ignoring`);
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is already locked. Ignoring`);
|
||||
}
|
||||
else if (hydrated.open) {
|
||||
console.log(`Issue ${hydrated.number} is open. Ignoring`);
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { GitHub, Issue } from '../api/api'
|
||||
import { daysAgoToHumanReadbleDate } from '../common/utils'
|
||||
import { ActionBase } from '../common/ActionBase'
|
||||
import { GitHub, Issue } from '../api/api';
|
||||
import { daysAgoToHumanReadbleDate, safeLog } from '../common/utils';
|
||||
import { ActionBase } from '../common/ActionBase';
|
||||
|
||||
export class Locker extends ActionBase {
|
||||
constructor(
|
||||
@@ -26,26 +26,26 @@ export class Locker extends ActionBase {
|
||||
}
|
||||
|
||||
async run() {
|
||||
const closedTimestamp = daysAgoToHumanReadbleDate(this.daysSinceClose)
|
||||
const updatedTimestamp = daysAgoToHumanReadbleDate(this.daysSinceUpdate)
|
||||
const closedTimestamp = daysAgoToHumanReadbleDate(this.daysSinceClose);
|
||||
const updatedTimestamp = daysAgoToHumanReadbleDate(this.daysSinceUpdate);
|
||||
|
||||
const query = this.buildQuery((this.daysSinceClose ? `closed:<${closedTimestamp} ` : "") + (this.daysSinceUpdate ? `updated:<${updatedTimestamp} ` : "") + "is:closed is:unlocked");
|
||||
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
await Promise.all(
|
||||
page.map(async (issue) => {
|
||||
const hydrated = await issue.getIssue()
|
||||
const hydrated = await issue.getIssue();
|
||||
|
||||
if (!hydrated.locked && hydrated.open === false && this.validateIssue(hydrated)
|
||||
// TODO: Verify closed and updated timestamps
|
||||
) {
|
||||
console.log(`Locking issue ${hydrated.number}`)
|
||||
await issue.lockIssue()
|
||||
safeLog(`Locking issue ${hydrated.number}`);
|
||||
await issue.lockIssue();
|
||||
} else {
|
||||
if (hydrated.locked) {
|
||||
console.log(`Issue ${hydrated.number} is already locked. Ignoring`)
|
||||
safeLog(`Issue ${hydrated.number} is already locked. Ignoring`);
|
||||
} else if (hydrated.open) {
|
||||
console.log(`Issue ${hydrated.number} is open. Ignoring`)
|
||||
safeLog(`Issue ${hydrated.number} is open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -15,7 +15,7 @@ inputs:
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
labels:
|
||||
description: items with these labels will not be considered. May be "*".
|
||||
description: items with these labels will be considered. May be "*".
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
ignoreMilestoneIds:
|
||||
@@ -29,5 +29,5 @@ inputs:
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node20'
|
||||
main: 'index.js'
|
||||
|
||||
@@ -13,7 +13,7 @@ class LockerAction extends Action_1.Action {
|
||||
this.id = 'Locker';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
await new Locker_1.Locker(github, +utils_1.getRequiredInput('daysSinceClose'), +utils_1.getRequiredInput('daysSinceUpdate'), utils_1.getInput('labels') || undefined, utils_1.getInput('milestoneName') || undefined, utils_1.getInput('milestoneId') || undefined, utils_1.getInput('ignoreLabels') || undefined, utils_1.getInput('ignoreMilestoneNames') || undefined, utils_1.getInput('ignoreMilestoneIds') || undefined, +(utils_1.getInput('minimumVotes') || 0), +(utils_1.getInput('maximumVotes') || 9999999)).run();
|
||||
await new Locker_1.Locker(github, +(0, utils_1.getRequiredInput)('daysSinceClose'), +(0, utils_1.getRequiredInput)('daysSinceUpdate'), (0, utils_1.getInput)('labels') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999)).run();
|
||||
}
|
||||
}
|
||||
new LockerAction().run(); // eslint-disable-line
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { OctoKit } from '../api/octokit'
|
||||
import { getInput, getRequiredInput } from '../common/utils'
|
||||
import { Locker } from './Locker'
|
||||
import { Action } from '../common/Action'
|
||||
import { OctoKit } from '../api/octokit';
|
||||
import { getInput, getRequiredInput } from '../common/utils';
|
||||
import { Locker } from './Locker';
|
||||
import { Action } from '../common/Action';
|
||||
|
||||
class LockerAction extends Action {
|
||||
id = 'Locker'
|
||||
id = 'Locker';
|
||||
|
||||
async onTriggered(github: OctoKit) {
|
||||
await new Locker(
|
||||
@@ -24,8 +24,8 @@ class LockerAction extends Action {
|
||||
getInput('ignoreMilestoneIds') || undefined,
|
||||
+(getInput('minimumVotes') || 0),
|
||||
+(getInput('maximumVotes') || 9999999)
|
||||
).run()
|
||||
).run();
|
||||
}
|
||||
}
|
||||
|
||||
new LockerAction().run() // eslint-disable-line
|
||||
new LockerAction().run(); // eslint-disable-line
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Reopener = void 0;
|
||||
const utils_1 = require("../common/utils");
|
||||
const ActionBase_1 = require("../common/ActionBase");
|
||||
class Reopener extends ActionBase_1.ActionBase {
|
||||
constructor(github, alsoApplyToOpenIssues, addLabels, removeLabels, reopenComment, setMilestoneId, labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes) {
|
||||
@@ -19,7 +20,7 @@ class Reopener extends ActionBase_1.ActionBase {
|
||||
async run() {
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
console.log(`alsoApplyToOpenIssues: ${this.alsoApplyToOpenIssues}`);
|
||||
(0, utils_1.safeLog)(`alsoApplyToOpenIssues: ${this.alsoApplyToOpenIssues}`);
|
||||
const query = this.buildQuery((this.alsoApplyToOpenIssues ? "" : "is:closed ") + "is:unlocked");
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
await Promise.all(page.map(async (issue) => {
|
||||
@@ -28,17 +29,17 @@ class Reopener extends ActionBase_1.ActionBase {
|
||||
// TODO: Verify closed and updated timestamps
|
||||
) {
|
||||
if (hydrated.open === false) {
|
||||
console.log(`Reopening issue ${hydrated.number}`);
|
||||
(0, utils_1.safeLog)(`Reopening issue ${hydrated.number}`);
|
||||
await issue.reopenIssue();
|
||||
}
|
||||
if (this.setMilestoneId != undefined) {
|
||||
console.log(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
console.log(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
@@ -46,22 +47,22 @@ class Reopener extends ActionBase_1.ActionBase {
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
console.log(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.reopenComment) {
|
||||
console.log(`Posting comment to issue ${hydrated.number}.`);
|
||||
(0, utils_1.safeLog)(`Posting comment to issue ${hydrated.number}.`);
|
||||
await issue.postComment(this.reopenComment);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (hydrated.locked) {
|
||||
console.log(`Issue ${hydrated.number} is locked. Ignoring`);
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is locked. Ignoring`);
|
||||
}
|
||||
else if (!this.alsoApplyToOpenIssues && hydrated.open) {
|
||||
console.log(`Issue ${hydrated.number} is open. Ignoring`);
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { GitHub, Issue } from '../api/api'
|
||||
import { ActionBase } from '../common/ActionBase'
|
||||
import { GitHub, Issue } from '../api/api';
|
||||
import { daysAgoToHumanReadbleDate, safeLog } from '../common/utils';
|
||||
import { ActionBase } from '../common/ActionBase';
|
||||
|
||||
export class Reopener extends ActionBase {
|
||||
constructor(
|
||||
@@ -31,50 +32,50 @@ export class Reopener extends ActionBase {
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
|
||||
console.log(`alsoApplyToOpenIssues: ${this.alsoApplyToOpenIssues}`);
|
||||
safeLog(`alsoApplyToOpenIssues: ${this.alsoApplyToOpenIssues}`);
|
||||
|
||||
const query = this.buildQuery((this.alsoApplyToOpenIssues ? "": "is:closed ") + "is:unlocked");
|
||||
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
await Promise.all(
|
||||
page.map(async (issue) => {
|
||||
const hydrated = await issue.getIssue()
|
||||
const hydrated = await issue.getIssue();
|
||||
if (!hydrated.locked && (this.alsoApplyToOpenIssues || hydrated.open === false) && this.validateIssue(hydrated)
|
||||
// TODO: Verify closed and updated timestamps
|
||||
) {
|
||||
if (hydrated.open === false) {
|
||||
console.log(`Reopening issue ${hydrated.number}`)
|
||||
await issue.reopenIssue()
|
||||
safeLog(`Reopening issue ${hydrated.number}`);
|
||||
await issue.reopenIssue();
|
||||
}
|
||||
if (this.setMilestoneId != undefined) {
|
||||
console.log(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`)
|
||||
await issue.setMilestone(+this.setMilestoneId)
|
||||
safeLog(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
console.log(`Removing label on issue ${hydrated.number}: ${removeLabel}`)
|
||||
await issue.removeLabel(removeLabel)
|
||||
safeLog(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
console.log(`Adding label on issue ${hydrated.number}: ${addLabel}`)
|
||||
await issue.addLabel(addLabel)
|
||||
safeLog(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.reopenComment) {
|
||||
console.log(`Posting comment to issue ${hydrated.number}.`)
|
||||
await issue.postComment(this.reopenComment)
|
||||
safeLog(`Posting comment to issue ${hydrated.number}.`);
|
||||
await issue.postComment(this.reopenComment);
|
||||
}
|
||||
} else {
|
||||
if (hydrated.locked) {
|
||||
console.log(`Issue ${hydrated.number} is locked. Ignoring`)
|
||||
safeLog(`Issue ${hydrated.number} is locked. Ignoring`);
|
||||
} else if (!this.alsoApplyToOpenIssues && hydrated.open) {
|
||||
console.log(`Issue ${hydrated.number} is open. Ignoring`)
|
||||
safeLog(`Issue ${hydrated.number} is open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -19,7 +19,7 @@ inputs:
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
labels:
|
||||
description: items with these labels will not be considered. May be "*".
|
||||
description: items with these labels will be considered. May be "*".
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
ignoreMilestoneIds:
|
||||
@@ -33,5 +33,5 @@ inputs:
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node20'
|
||||
main: 'index.js'
|
||||
|
||||
@@ -10,11 +10,11 @@ const Action_1 = require("../common/Action");
|
||||
class ReopenerAction extends Action_1.Action {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.id = 'Locker';
|
||||
this.id = 'Reopener';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
const alsoApplyToOpenIssues = utils_1.getInput('alsoApplyToOpenIssues');
|
||||
await new Reopener_1.Reopener(github, alsoApplyToOpenIssues != undefined && alsoApplyToOpenIssues.toLowerCase() == 'true', utils_1.getInput('addLabels') || undefined, utils_1.getInput('removeLabels') || undefined, utils_1.getInput('reopenComment') || '', utils_1.getInput('setMilestoneId') || undefined, utils_1.getInput('labels') || undefined, utils_1.getInput('milestoneName') || undefined, utils_1.getInput('milestoneId') || undefined, utils_1.getInput('ignoreLabels') || undefined, utils_1.getInput('ignoreMilestoneNames') || undefined, utils_1.getInput('ignoreMilestoneIds') || undefined, +(utils_1.getInput('minimumVotes') || 0), +(utils_1.getInput('maximumVotes') || 9999999)).run();
|
||||
const alsoApplyToOpenIssues = (0, utils_1.getInput)('alsoApplyToOpenIssues');
|
||||
await new Reopener_1.Reopener(github, alsoApplyToOpenIssues != undefined && alsoApplyToOpenIssues.toLowerCase() == 'true', (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('reopenComment') || '', (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('labels') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999)).run();
|
||||
}
|
||||
}
|
||||
new ReopenerAction().run(); // eslint-disable-line
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { OctoKit } from '../api/octokit'
|
||||
import { getInput, getRequiredInput } from '../common/utils'
|
||||
import { Reopener } from './Reopener'
|
||||
import { Action } from '../common/Action'
|
||||
import { OctoKit } from '../api/octokit';
|
||||
import { getInput, getRequiredInput } from '../common/utils';
|
||||
import { Reopener } from './Reopener';
|
||||
import { Action } from '../common/Action';
|
||||
|
||||
class ReopenerAction extends Action {
|
||||
id = 'Locker'
|
||||
id = 'Reopener';
|
||||
|
||||
async onTriggered(github: OctoKit) {
|
||||
const alsoApplyToOpenIssues: string | undefined = getInput('alsoApplyToOpenIssues');
|
||||
@@ -28,8 +28,8 @@ class ReopenerAction extends Action {
|
||||
getInput('ignoreMilestoneIds') || undefined,
|
||||
+(getInput('minimumVotes') || 0),
|
||||
+(getInput('maximumVotes') || 9999999)
|
||||
).run()
|
||||
).run();
|
||||
}
|
||||
}
|
||||
|
||||
new ReopenerAction().run() // eslint-disable-line
|
||||
new ReopenerAction().run(); // eslint-disable-line
|
||||
|
||||
@@ -1,106 +1,106 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StaleCloser = void 0;
|
||||
const ActionBase_1 = require("../common/ActionBase");
|
||||
const utils_1 = require("../common/utils");
|
||||
class StaleCloser extends ActionBase_1.ActionBase {
|
||||
constructor(github, closeDays, labels, closeComment, pingDays, pingComment, additionalTeam, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
this.github = github;
|
||||
this.closeDays = closeDays;
|
||||
this.closeComment = closeComment;
|
||||
this.pingDays = pingDays;
|
||||
this.pingComment = pingComment;
|
||||
this.additionalTeam = additionalTeam;
|
||||
this.addLabels = addLabels;
|
||||
this.removeLabels = removeLabels;
|
||||
this.setMilestoneId = setMilestoneId;
|
||||
}
|
||||
async run() {
|
||||
const updatedTimestamp = utils_1.daysAgoToHumanReadbleDate(this.closeDays);
|
||||
const pingTimestamp = this.pingDays ? utils_1.daysAgoToTimestamp(this.pingDays) : undefined;
|
||||
const query = this.buildQuery((this.closeDays ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
const lastCommentIterator = await issue.getComments(true).next();
|
||||
if (lastCommentIterator.done) {
|
||||
throw Error('Unexpected comment data');
|
||||
}
|
||||
const lastComment = lastCommentIterator.value[0];
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
if (!lastComment ||
|
||||
lastComment.author.isGitHubApp ||
|
||||
pingTimestamp == undefined ||
|
||||
// TODO: List the collaborators once per go rather than checking a single user each issue
|
||||
this.additionalTeam.includes(lastComment.author.name) ||
|
||||
await issue.hasWriteAccess(lastComment.author)) {
|
||||
if (pingTimestamp != undefined) {
|
||||
if (lastComment) {
|
||||
console.log(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`);
|
||||
}
|
||||
else {
|
||||
console.log(`No comments on issue ${hydrated.number}. Closing.`);
|
||||
}
|
||||
}
|
||||
if (this.closeComment) {
|
||||
console.log(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.closeComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
console.log(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
console.log(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
await issue.closeIssue();
|
||||
if (this.setMilestoneId != undefined) {
|
||||
console.log(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
console.log(`Closing issue ${hydrated.number}.`);
|
||||
}
|
||||
else {
|
||||
// Ping
|
||||
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
|
||||
console.log(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Pinging @${hydrated.assignee}`);
|
||||
if (this.pingComment) {
|
||||
await issue.postComment(this.pingComment
|
||||
.replace('${assignee}', hydrated.assignee)
|
||||
.replace('${author}', hydrated.author.name));
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Skipping.${hydrated.assignee ? ' cc @' + hydrated.assignee : ''}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!hydrated.open) {
|
||||
console.log(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.StaleCloser = StaleCloser;
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StaleCloser = void 0;
|
||||
const ActionBase_1 = require("../common/ActionBase");
|
||||
const utils_1 = require("../common/utils");
|
||||
class StaleCloser extends ActionBase_1.ActionBase {
|
||||
constructor(github, closeDays, labels, closeComment, pingDays, pingComment, additionalTeam, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
this.github = github;
|
||||
this.closeDays = closeDays;
|
||||
this.closeComment = closeComment;
|
||||
this.pingDays = pingDays;
|
||||
this.pingComment = pingComment;
|
||||
this.additionalTeam = additionalTeam;
|
||||
this.addLabels = addLabels;
|
||||
this.removeLabels = removeLabels;
|
||||
this.setMilestoneId = setMilestoneId;
|
||||
}
|
||||
async run() {
|
||||
const updatedTimestamp = this.closeDays ? (0, utils_1.daysAgoToHumanReadbleDate)(this.closeDays) : undefined;
|
||||
const pingTimestamp = this.pingDays ? (0, utils_1.daysAgoToTimestamp)(this.pingDays) : undefined;
|
||||
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
const lastCommentIterator = await issue.getComments(true).next();
|
||||
if (lastCommentIterator.done) {
|
||||
throw Error('Unexpected comment data');
|
||||
}
|
||||
const lastComment = lastCommentIterator.value[0];
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
if (!lastComment ||
|
||||
lastComment.author.isGitHubApp ||
|
||||
pingTimestamp == undefined ||
|
||||
// TODO: List the collaborators once per go rather than checking a single user each issue
|
||||
this.additionalTeam.includes(lastComment.author.name) ||
|
||||
await issue.hasWriteAccess(lastComment.author)) {
|
||||
if (pingTimestamp != undefined) {
|
||||
if (lastComment) {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`);
|
||||
}
|
||||
else {
|
||||
(0, utils_1.safeLog)(`No comments on issue ${hydrated.number}. Closing.`);
|
||||
}
|
||||
}
|
||||
if (this.closeComment) {
|
||||
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.closeComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
await issue.closeIssue("not_planned");
|
||||
if (this.setMilestoneId != undefined) {
|
||||
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
(0, utils_1.safeLog)(`Closing issue ${hydrated.number}.`);
|
||||
}
|
||||
else {
|
||||
// Ping
|
||||
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Pinging @${hydrated.assignee}`);
|
||||
if (this.pingComment) {
|
||||
await issue.postComment(this.pingComment
|
||||
.replace('${assignee}', hydrated.assignee)
|
||||
.replace('${author}', hydrated.author.name));
|
||||
}
|
||||
}
|
||||
else {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Skipping.${hydrated.assignee ? ' cc @' + hydrated.assignee : ''}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!hydrated.open) {
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.StaleCloser = StaleCloser;
|
||||
//# sourceMappingURL=StaleCloser.js.map
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { GitHub } from '../api/api'
|
||||
import { ActionBase } from '../common/ActionBase'
|
||||
import { daysAgoToHumanReadbleDate, daysAgoToTimestamp } from '../common/utils'
|
||||
import { GitHub } from '../api/api';
|
||||
import { ActionBase } from '../common/ActionBase';
|
||||
import { daysAgoToHumanReadbleDate, daysAgoToTimestamp, safeLog } from '../common/utils';
|
||||
|
||||
export class StaleCloser extends ActionBase {
|
||||
constructor(
|
||||
@@ -33,22 +33,22 @@ export class StaleCloser extends ActionBase {
|
||||
}
|
||||
|
||||
async run() {
|
||||
const updatedTimestamp = daysAgoToHumanReadbleDate(this.closeDays)
|
||||
const updatedTimestamp = this.closeDays ? daysAgoToHumanReadbleDate(this.closeDays) : undefined;
|
||||
const pingTimestamp = this.pingDays ? daysAgoToTimestamp(this.pingDays) : undefined;
|
||||
|
||||
const query = this.buildQuery((this.closeDays ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue()
|
||||
const lastCommentIterator = await issue.getComments(true).next()
|
||||
const hydrated = await issue.getIssue();
|
||||
const lastCommentIterator = await issue.getComments(true).next();
|
||||
if (lastCommentIterator.done) {
|
||||
throw Error('Unexpected comment data')
|
||||
throw Error('Unexpected comment data');
|
||||
}
|
||||
const lastComment = lastCommentIterator.value[0]
|
||||
const lastComment = lastCommentIterator.value[0];
|
||||
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
@@ -63,63 +63,63 @@ export class StaleCloser extends ActionBase {
|
||||
) {
|
||||
if (pingTimestamp != undefined) {
|
||||
if (lastComment) {
|
||||
console.log(
|
||||
safeLog(
|
||||
`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
console.log(`No comments on issue ${hydrated.number}. Closing.`)
|
||||
safeLog(`No comments on issue ${hydrated.number}. Closing.`);
|
||||
}
|
||||
}
|
||||
if (this.closeComment) {
|
||||
console.log(`Posting comment on issue ${hydrated.number}`)
|
||||
await issue.postComment(this.closeComment)
|
||||
safeLog(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.closeComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
console.log(`Removing label on issue ${hydrated.number}: ${removeLabel}`)
|
||||
await issue.removeLabel(removeLabel)
|
||||
safeLog(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
console.log(`Adding label on issue ${hydrated.number}: ${addLabel}`)
|
||||
await issue.addLabel(addLabel)
|
||||
safeLog(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
await issue.closeIssue()
|
||||
await issue.closeIssue("not_planned");
|
||||
if (this.setMilestoneId != undefined) {
|
||||
console.log(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`)
|
||||
await issue.setMilestone(+this.setMilestoneId)
|
||||
safeLog(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
console.log(`Closing issue ${hydrated.number}.`)
|
||||
safeLog(`Closing issue ${hydrated.number}.`);
|
||||
} else {
|
||||
// Ping
|
||||
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
|
||||
console.log(
|
||||
safeLog(
|
||||
`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Pinging @${hydrated.assignee}`,
|
||||
)
|
||||
);
|
||||
if (this.pingComment) {
|
||||
await issue.postComment(
|
||||
this.pingComment
|
||||
.replace('${assignee}', hydrated.assignee)
|
||||
.replace('${author}', hydrated.author.name),
|
||||
)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
console.log(
|
||||
safeLog(
|
||||
`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Skipping.${
|
||||
hydrated.assignee ? ' cc @' + hydrated.assignee : ''
|
||||
}`,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!hydrated.open) {
|
||||
console.log(`Issue ${hydrated.number} is not open. Ignoring`)
|
||||
safeLog(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ inputs:
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
labels:
|
||||
description: items with these labels will not be considered. May be "*".
|
||||
description: items with these labels will be considered. May be "*".
|
||||
required: true
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
@@ -43,5 +43,5 @@ inputs:
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node20'
|
||||
main: 'index.js'
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils_1 = require("../common/utils");
|
||||
const StaleCloser_1 = require("./StaleCloser");
|
||||
const Action_1 = require("../common/Action");
|
||||
class StaleCloserAction extends Action_1.Action {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.id = 'StaleCloser';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
var _a;
|
||||
await new StaleCloser_1.StaleCloser(github, +utils_1.getRequiredInput('closeDays'), utils_1.getRequiredInput('labels'), utils_1.getInput('closeComment') || '', +(utils_1.getInput('pingDays') || 0), utils_1.getInput('pingComment') || '', ((_a = utils_1.getInput('additionalTeam')) !== null && _a !== void 0 ? _a : '').split(','), utils_1.getInput('addLabels') || undefined, utils_1.getInput('removeLabels') || undefined, utils_1.getInput('setMilestoneId') || undefined, utils_1.getInput('milestoneName') || undefined, utils_1.getInput('milestoneId') || undefined, utils_1.getInput('ignoreLabels') || undefined, utils_1.getInput('ignoreMilestoneNames') || undefined, utils_1.getInput('ignoreMilestoneIds') || undefined, +(utils_1.getInput('minimumVotes') || 0), +(utils_1.getInput('maximumVotes') || 9999999), utils_1.getInput('involves') || undefined).run();
|
||||
}
|
||||
}
|
||||
new StaleCloserAction().run(); // eslint-disable-line
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils_1 = require("../common/utils");
|
||||
const StaleCloser_1 = require("./StaleCloser");
|
||||
const Action_1 = require("../common/Action");
|
||||
class StaleCloserAction extends Action_1.Action {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.id = 'StaleCloser';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
var _a;
|
||||
await new StaleCloser_1.StaleCloser(github, +(0, utils_1.getRequiredInput)('closeDays'), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('closeComment') || '', +((0, utils_1.getInput)('pingDays') || 0), (0, utils_1.getInput)('pingComment') || '', ((_a = (0, utils_1.getInput)('additionalTeam')) !== null && _a !== void 0 ? _a : '').split(','), (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
|
||||
}
|
||||
}
|
||||
new StaleCloserAction().run(); // eslint-disable-line
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -9,7 +9,7 @@ import { StaleCloser } from './StaleCloser'
|
||||
import { Action } from '../common/Action'
|
||||
|
||||
class StaleCloserAction extends Action {
|
||||
id = 'StaleCloser'
|
||||
id = 'StaleCloser';
|
||||
|
||||
async onTriggered(github: OctoKit) {
|
||||
await new StaleCloser(
|
||||
@@ -31,8 +31,8 @@ class StaleCloserAction extends Action {
|
||||
+(getInput('minimumVotes') || 0),
|
||||
+(getInput('maximumVotes') || 9999999),
|
||||
getInput('involves') || undefined
|
||||
).run()
|
||||
).run();
|
||||
}
|
||||
}
|
||||
|
||||
new StaleCloserAction().run() // eslint-disable-line
|
||||
new StaleCloserAction().run(); // eslint-disable-line
|
||||
|
||||
+79
-56
@@ -4,43 +4,53 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export interface GitHub {
|
||||
query(query: Query): AsyncIterableIterator<GitHubIssue[]>
|
||||
repoOwner: string;
|
||||
repoName: string;
|
||||
|
||||
hasWriteAccess(user: User): Promise<boolean>
|
||||
query(query: Query): AsyncIterableIterator<GitHubIssue[]>;
|
||||
|
||||
repoHasLabel(label: string): Promise<boolean>
|
||||
createLabel(label: string, color: string, description: string): Promise<void>
|
||||
deleteLabel(label: string): Promise<void>
|
||||
hasWriteAccess(user: User): Promise<boolean>;
|
||||
|
||||
readConfig(path: string): Promise<any>
|
||||
repoHasLabel(label: string): Promise<boolean>;
|
||||
createLabel(label: string, color: string, description: string): Promise<void>;
|
||||
deleteLabel(label: string): Promise<void>;
|
||||
|
||||
dispatch(title: string): Promise<void>
|
||||
readConfig(path: string): Promise<any>;
|
||||
|
||||
createIssue(owner: string, repo: string, title: string, body: string): Promise<void>
|
||||
dispatch(title: string): Promise<void>;
|
||||
|
||||
releaseContainsCommit(release: string, commit: string): Promise<'yes' | 'no' | 'unknown'>
|
||||
createIssue(owner: string, repo: string, title: string, body: string): Promise<void>;
|
||||
|
||||
releaseContainsCommit(release: string, commit: string): Promise<'yes' | 'no' | 'unknown'>;
|
||||
|
||||
/**
|
||||
* Returns what we think the current milestone for the repo is based on the due on date.
|
||||
* @returns The milestone id if one is found, else undefined
|
||||
*/
|
||||
getCurrentRepoMilestone(): Promise<number | undefined>;
|
||||
}
|
||||
|
||||
export interface GitHubIssue extends GitHub {
|
||||
getIssue(): Promise<Issue>
|
||||
getIssue(): Promise<Issue>;
|
||||
|
||||
postComment(body: string): Promise<void>
|
||||
deleteComment(id: number): Promise<void>
|
||||
getComments(last?: boolean): AsyncIterableIterator<Comment[]>
|
||||
postComment(body: string): Promise<void>;
|
||||
deleteComment(id: number): Promise<void>;
|
||||
getComments(last?: boolean): AsyncIterableIterator<Comment[]>;
|
||||
|
||||
closeIssue(): Promise<void>
|
||||
lockIssue(): Promise<void>
|
||||
reopenIssue(): Promise<void>
|
||||
closeIssue(reason: 'completed' | 'not_planned'): Promise<void>;
|
||||
lockIssue(): Promise<void>;
|
||||
unlockIssue(): Promise<void>;
|
||||
reopenIssue(): Promise<void>;
|
||||
|
||||
setMilestone(milestoneId: number): Promise<void>
|
||||
setMilestone(milestoneId: number): Promise<void>;
|
||||
|
||||
addLabel(label: string): Promise<void>
|
||||
removeLabel(label: string): Promise<void>
|
||||
addLabel(label: string): Promise<void>;
|
||||
removeLabel(label: string): Promise<void>;
|
||||
|
||||
addAssignee(assignee: string): Promise<void>
|
||||
removeAssignee(assignee: string): Promise<void>
|
||||
addAssignee(assignee: string): Promise<void>;
|
||||
removeAssignee(assignee: string): Promise<void>;
|
||||
|
||||
getClosingInfo(): Promise<{ hash: string | undefined; timestamp: number } | undefined>
|
||||
getClosingInfo(): Promise<{ hash: string | undefined; timestamp: number } | undefined>;
|
||||
}
|
||||
|
||||
type SortVar =
|
||||
@@ -54,47 +64,60 @@ type SortVar =
|
||||
| 'reactions-tada'
|
||||
| 'interactions'
|
||||
| 'created'
|
||||
| 'updated'
|
||||
type SortOrder = 'asc' | 'desc'
|
||||
| 'updated';
|
||||
type SortOrder = 'asc' | 'desc';
|
||||
export type Reactions = {
|
||||
'+1': number
|
||||
'-1': number
|
||||
laugh: number
|
||||
hooray: number
|
||||
confused: number
|
||||
heart: number
|
||||
rocket: number
|
||||
eyes: number
|
||||
}
|
||||
'+1': number;
|
||||
'-1': number;
|
||||
laugh: number;
|
||||
hooray: number;
|
||||
confused: number;
|
||||
heart: number;
|
||||
rocket: number;
|
||||
eyes: number;
|
||||
};
|
||||
|
||||
export interface User {
|
||||
name: string
|
||||
isGitHubApp?: boolean
|
||||
name: string;
|
||||
isGitHubApp?: boolean;
|
||||
}
|
||||
export interface Comment {
|
||||
author: User
|
||||
body: string
|
||||
id: number
|
||||
timestamp: number
|
||||
author: User;
|
||||
body: string;
|
||||
id: number;
|
||||
timestamp: number;
|
||||
}
|
||||
export interface Issue {
|
||||
author: User
|
||||
body: string
|
||||
title: string
|
||||
labels: string[]
|
||||
open: boolean
|
||||
locked: boolean
|
||||
number: number
|
||||
numComments: number
|
||||
reactions: Reactions
|
||||
milestoneId: number | null
|
||||
assignee?: string
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
closedAt?: number
|
||||
author: User;
|
||||
body: string;
|
||||
title: string;
|
||||
labels: string[];
|
||||
open: boolean;
|
||||
locked: boolean;
|
||||
number: number;
|
||||
isPr: boolean;
|
||||
numComments: number;
|
||||
reactions: Reactions;
|
||||
milestone: Milestone | null;
|
||||
assignee?: string;
|
||||
assignees: string[];
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
closedAt?: number;
|
||||
}
|
||||
export interface Milestone {
|
||||
milestoneId: number;
|
||||
title: string;
|
||||
description: string;
|
||||
numClosedIssues: number;
|
||||
numOpenIssues: number;
|
||||
dueOn: Date | null;
|
||||
createdAt: Date | null;
|
||||
closedAt: Date | null;
|
||||
state: 'open' | 'closed';
|
||||
}
|
||||
export interface Query {
|
||||
q: string
|
||||
sort?: SortVar
|
||||
order?: SortOrder
|
||||
q: string;
|
||||
sort?: SortVar;
|
||||
order?: SortOrder;
|
||||
}
|
||||
|
||||
+172
-93
@@ -5,12 +5,17 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OctoKitIssue = exports.OctoKit = exports.getNumRequests = void 0;
|
||||
const core_1 = require("@actions/core");
|
||||
const github_1 = require("@actions/github");
|
||||
const child_process_1 = require("child_process");
|
||||
const utils_1 = require("../common/utils");
|
||||
let numRequests = 0;
|
||||
exports.getNumRequests = () => numRequests;
|
||||
const getNumRequests = () => numRequests;
|
||||
exports.getNumRequests = getNumRequests;
|
||||
class OctoKit {
|
||||
get octokit() {
|
||||
numRequests++;
|
||||
return this._octokit;
|
||||
}
|
||||
constructor(token, params, options = { readonly: false }) {
|
||||
this.token = token;
|
||||
this.params = params;
|
||||
@@ -18,73 +23,93 @@ class OctoKit {
|
||||
// when in readonly mode, record labels just-created so at to not throw unneccesary errors
|
||||
this.mockLabels = new Set();
|
||||
this.writeAccessCache = {};
|
||||
this._octokit = new github_1.GitHub(token);
|
||||
this._octokit = (0, github_1.getOctokit)(token);
|
||||
this.repoName = params.repo;
|
||||
this.repoOwner = params.owner;
|
||||
}
|
||||
get octokit() {
|
||||
numRequests++;
|
||||
return this._octokit;
|
||||
getIssueByNumber(number) {
|
||||
return new OctoKitIssue(this.token, this.params, { number: number });
|
||||
}
|
||||
// TODO: just iterate over the issues in a page here instead of making caller do it
|
||||
async *query(query) {
|
||||
const q = query.q + ` repo:${this.params.owner}/${this.params.repo}`;
|
||||
console.log(`Querying for ${q}:`);
|
||||
const options = this.octokit.search.issuesAndPullRequests.endpoint.merge({
|
||||
const options = {
|
||||
...query,
|
||||
q,
|
||||
per_page: 100,
|
||||
headers: { Accept: 'application/vnd.github.squirrel-girl-preview+json' },
|
||||
});
|
||||
};
|
||||
let pageNum = 0;
|
||||
const timeout = async () => {
|
||||
if (pageNum < 2) {
|
||||
/* pass */
|
||||
}
|
||||
else if (pageNum < 4) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000));
|
||||
}
|
||||
else {
|
||||
await new Promise((resolve) => setTimeout(resolve, 30000));
|
||||
}
|
||||
};
|
||||
for await (const pageResponse of this.octokit.paginate.iterator(options)) {
|
||||
for await (const pageResponse of this.octokit.paginate.iterator(this.octokit.rest.search.issuesAndPullRequests, options)) {
|
||||
await timeout();
|
||||
numRequests++;
|
||||
const page = pageResponse.data;
|
||||
console.log(`Page ${++pageNum}: ${page.map(({ number }) => number).join(' ')}`);
|
||||
(0, utils_1.safeLog)(`Page ${++pageNum}: ${page.map(({ number }) => number).join(' ')}`);
|
||||
yield page.map((issue) => new OctoKitIssue(this.token, this.params, this.octokitIssueToIssue(issue), this.options));
|
||||
}
|
||||
}
|
||||
async createIssue(owner, repo, title, body) {
|
||||
core_1.debug(`Creating issue \`${title}\` on ${owner}/${repo}`);
|
||||
(0, utils_1.safeLog)(`Creating issue \`${title}\` on ${owner}/${repo}`);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.create({ owner, repo, title, body });
|
||||
await this.octokit.rest.issues.create({ owner, repo, title, body });
|
||||
}
|
||||
octokitIssueToIssue(issue) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
||||
return {
|
||||
author: { name: issue.user.login, isGitHubApp: issue.user.type === 'Bot' },
|
||||
body: issue.body,
|
||||
author: { name: (_b = (_a = issue.user) === null || _a === void 0 ? void 0 : _a.login) !== null && _b !== void 0 ? _b : 'unkown', isGitHubApp: ((_c = issue.user) === null || _c === void 0 ? void 0 : _c.type) === 'Bot' },
|
||||
body: (_d = issue.body) !== null && _d !== void 0 ? _d : '',
|
||||
number: issue.number,
|
||||
title: issue.title,
|
||||
labels: issue.labels.map((label) => label.name),
|
||||
isPr: !!((_e = issue.pull_request) === null || _e === void 0 ? void 0 : _e.html_url),
|
||||
labels: issue.labels.map((label) => { var _a; return (typeof label === 'string' ? label : (_a = label.name) !== null && _a !== void 0 ? _a : ''); }),
|
||||
open: issue.state === 'open',
|
||||
locked: issue.locked,
|
||||
numComments: issue.comments,
|
||||
reactions: issue.reactions,
|
||||
assignee: (_b = (_a = issue.assignee) === null || _a === void 0 ? void 0 : _a.login) !== null && _b !== void 0 ? _b : (_d = (_c = issue.assignees) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.login,
|
||||
milestoneId: (_f = (_e = issue.milestone) === null || _e === void 0 ? void 0 : _e.number) !== null && _f !== void 0 ? _f : null,
|
||||
assignee: (_g = (_f = issue.assignee) === null || _f === void 0 ? void 0 : _f.login) !== null && _g !== void 0 ? _g : (_j = (_h = issue.assignees) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.login,
|
||||
assignees: (_l = (_k = issue.assignees) === null || _k === void 0 ? void 0 : _k.map((assignee) => assignee.login)) !== null && _l !== void 0 ? _l : [],
|
||||
milestone: issue.milestone ? this.octokitMilestoneToMilestone(issue.milestone) : null,
|
||||
createdAt: +new Date(issue.created_at),
|
||||
updatedAt: +new Date(issue.updated_at),
|
||||
closedAt: issue.closed_at ? +new Date(issue.closed_at) : undefined,
|
||||
};
|
||||
}
|
||||
octokitMilestoneToMilestone(milestone) {
|
||||
var _a;
|
||||
if ((milestone === null || milestone === void 0 ? void 0 : milestone.number) === undefined) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
title: milestone.title,
|
||||
milestoneId: milestone.number,
|
||||
// Remove the time portions of the dates as they're not important
|
||||
createdAt: milestone.created_at !== null ? new Date(milestone.created_at.split('T')[0]) : null,
|
||||
dueOn: milestone.due_on !== null ? new Date(milestone.due_on.split('T')[0]) : null,
|
||||
closedAt: milestone.closed_at !== null ? new Date(milestone.closed_at.split('T')[0]) : null,
|
||||
description: (_a = milestone.description) !== null && _a !== void 0 ? _a : '',
|
||||
numClosedIssues: milestone.closed_issues,
|
||||
numOpenIssues: milestone.open_issues,
|
||||
state: milestone.state === 'open' ? 'open' : 'closed',
|
||||
};
|
||||
}
|
||||
async hasWriteAccess(user) {
|
||||
if (user.name in this.writeAccessCache) {
|
||||
core_1.debug('Got permissions from cache for ' + user);
|
||||
(0, utils_1.safeLog)('Got permissions from cache for ' + user);
|
||||
return this.writeAccessCache[user.name];
|
||||
}
|
||||
core_1.debug('Fetching permissions for ' + user);
|
||||
const permissions = (await this.octokit.repos.getCollaboratorPermissionLevel({
|
||||
(0, utils_1.safeLog)('Fetching permissions for ' + user.name);
|
||||
const permissions = (await this.octokit.rest.repos.getCollaboratorPermissionLevel({
|
||||
...this.params,
|
||||
username: user.name,
|
||||
})).data.permission;
|
||||
@@ -92,42 +117,44 @@ class OctoKit {
|
||||
}
|
||||
async repoHasLabel(name) {
|
||||
try {
|
||||
await this.octokit.issues.getLabel({ ...this.params, name });
|
||||
await this.octokit.rest.issues.getLabel({ ...this.params, name });
|
||||
return true;
|
||||
}
|
||||
catch (err) {
|
||||
if (err.status === 404) {
|
||||
const statusErorr = err;
|
||||
if (statusErorr.status === 404) {
|
||||
return this.options.readonly && this.mockLabels.has(name);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
async createLabel(name, color, description) {
|
||||
core_1.debug('Creating label ' + name);
|
||||
(0, utils_1.safeLog)('Creating label ' + name);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.createLabel({ ...this.params, color, description, name });
|
||||
await this.octokit.rest.issues.createLabel({ ...this.params, color, description, name });
|
||||
else
|
||||
this.mockLabels.add(name);
|
||||
}
|
||||
async deleteLabel(name) {
|
||||
core_1.debug('Deleting label ' + name);
|
||||
(0, utils_1.safeLog)('Deleting label ' + name);
|
||||
try {
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.deleteLabel({ ...this.params, name });
|
||||
await this.octokit.rest.issues.deleteLabel({ ...this.params, name });
|
||||
}
|
||||
catch (err) {
|
||||
if (err.status === 404) {
|
||||
const statusErorr = err;
|
||||
if (statusErorr.status === 404) {
|
||||
return;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
async readConfig(path) {
|
||||
core_1.debug('Reading config at ' + path);
|
||||
(0, utils_1.safeLog)('Reading config at ' + path);
|
||||
const repoPath = `.github/${path}.json`;
|
||||
try {
|
||||
const data = (await this.octokit.repos.getContents({ ...this.params, path: repoPath })).data;
|
||||
if ('type' in data && data.type === 'file') {
|
||||
const data = (await this.octokit.rest.repos.getContent({ ...this.params, path: repoPath })).data;
|
||||
if ('type' in data && data.type === 'file' && 'content' in data) {
|
||||
if (data.encoding === 'base64' && data.content) {
|
||||
return JSON.parse(Buffer.from(data.content, 'base64').toString('utf-8'));
|
||||
}
|
||||
@@ -140,7 +167,10 @@ class OctoKit {
|
||||
}
|
||||
}
|
||||
async releaseContainsCommit(release, commit) {
|
||||
return new Promise((resolve, reject) => child_process_1.exec(`git -C ./repo merge-base --is-ancestor ${commit} ${release}`, (err) => {
|
||||
const isHash = (s) => /^[a-fA-F0-9]*$/.test(s);
|
||||
if (!isHash(release) || !isHash(commit))
|
||||
return 'unknown';
|
||||
return new Promise((resolve, reject) => (0, child_process_1.exec)(`git -C ./repo merge-base --is-ancestor ${commit} ${release}`, (err) => {
|
||||
if (!err || err.code === 1) {
|
||||
resolve(!err ? 'yes' : 'no');
|
||||
}
|
||||
@@ -157,10 +187,31 @@ class OctoKit {
|
||||
}
|
||||
}));
|
||||
}
|
||||
async getCurrentRepoMilestone() {
|
||||
(0, utils_1.safeLog)(`Getting repo milestone for ${this.params.owner}/${this.params.repo}`);
|
||||
// Fetch all milestones open for this repo
|
||||
const allMilestones = (await this.octokit.rest.issues.listMilestones({
|
||||
owner: this.params.owner,
|
||||
repo: this.params.repo,
|
||||
state: 'open',
|
||||
sort: 'due_on',
|
||||
direction: 'asc',
|
||||
})).data;
|
||||
const currentDate = new Date();
|
||||
const possibleMilestones = allMilestones
|
||||
.filter((milestone) => new Date(milestone.due_on === null ? currentDate : milestone.due_on) > currentDate &&
|
||||
currentDate > new Date(milestone.created_at) &&
|
||||
!milestone.title.includes('Recovery'))
|
||||
.sort((a, b) => { var _a, _b; return +new Date((_a = a.due_on) !== null && _a !== void 0 ? _a : currentDate) - +new Date((_b = b.due_on) !== null && _b !== void 0 ? _b : currentDate); });
|
||||
if (possibleMilestones.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
return possibleMilestones[0].number;
|
||||
}
|
||||
async dispatch(title) {
|
||||
core_1.debug('Dispatching ' + title);
|
||||
(0, utils_1.safeLog)('Dispatching ' + title);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.repos.createDispatchEvent({ ...this.params, event_type: title });
|
||||
await this.octokit.rest.repos.createDispatchEvent({ ...this.params, event_type: title });
|
||||
}
|
||||
}
|
||||
exports.OctoKit = OctoKit;
|
||||
@@ -169,12 +220,12 @@ class OctoKitIssue extends OctoKit {
|
||||
super(token, params, options);
|
||||
this.params = params;
|
||||
this.issueData = issueData;
|
||||
console.log('running bot on issue', issueData.number);
|
||||
(0, utils_1.safeLog)('running bot on issue', issueData.number);
|
||||
}
|
||||
async addAssignee(assignee) {
|
||||
core_1.debug('Adding assignee ' + assignee + ' to ' + this.issueData.number);
|
||||
(0, utils_1.safeLog)('Adding assignee ' + assignee + ' to ' + this.issueData.number);
|
||||
if (!this.options.readonly) {
|
||||
await this.octokit.issues.addAssignees({
|
||||
await this.octokit.rest.issues.addAssignees({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
assignees: [assignee],
|
||||
@@ -182,45 +233,64 @@ class OctoKitIssue extends OctoKit {
|
||||
}
|
||||
}
|
||||
async removeAssignee(assignee) {
|
||||
core_1.debug('Removing assignee ' + assignee + ' to ' + this.issueData.number);
|
||||
(0, utils_1.safeLog)('Removing assignee ' + assignee + ' to ' + this.issueData.number);
|
||||
if (!this.options.readonly) {
|
||||
await this.octokit.issues.removeAssignees({
|
||||
await this.octokit.rest.issues.removeAssignees({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
assignees: [assignee],
|
||||
});
|
||||
}
|
||||
}
|
||||
async closeIssue() {
|
||||
core_1.debug('Closing issue ' + this.issueData.number);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.update({
|
||||
async closeIssue(reason) {
|
||||
(0, utils_1.safeLog)('Closing issue ' + this.issueData.number);
|
||||
if (!this.options.readonly) {
|
||||
const issue = await this.octokit.rest.issues.get({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
});
|
||||
// Don't close already closed issues even if it means changing the state
|
||||
if (issue.data.state === 'closed') {
|
||||
return;
|
||||
}
|
||||
await this.octokit.rest.issues
|
||||
.update({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
state: 'closed',
|
||||
state_reason: reason,
|
||||
})
|
||||
.catch((e) => {
|
||||
(0, utils_1.safeLog)('error closing issue:', e);
|
||||
});
|
||||
}
|
||||
}
|
||||
async reopenIssue() {
|
||||
core_1.debug('Reopening issue ' + this.issueData.number);
|
||||
(0, utils_1.safeLog)('Reopening issue ' + this.issueData.number);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.update({
|
||||
await this.octokit.rest.issues.update({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
state: 'open',
|
||||
});
|
||||
}
|
||||
async lockIssue() {
|
||||
core_1.debug('Locking issue ' + this.issueData.number);
|
||||
(0, utils_1.safeLog)('Locking issue ' + this.issueData.number);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.lock({ ...this.params, issue_number: this.issueData.number });
|
||||
await this.octokit.rest.issues.lock({ ...this.params, issue_number: this.issueData.number });
|
||||
}
|
||||
async unlockIssue() {
|
||||
(0, utils_1.safeLog)('Unlocking issue ' + this.issueData.number);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.rest.issues.unlock({ ...this.params, issue_number: this.issueData.number });
|
||||
}
|
||||
async getIssue() {
|
||||
if (isIssue(this.issueData)) {
|
||||
core_1.debug('Got issue data from query result ' + this.issueData.number);
|
||||
(0, utils_1.safeLog)('Got issue data from query result ' + this.issueData.number);
|
||||
return this.issueData;
|
||||
}
|
||||
console.log('Fetching issue ' + this.issueData.number);
|
||||
const issue = (await this.octokit.issues.get({
|
||||
(0, utils_1.safeLog)('Fetching issue ' + this.issueData.number);
|
||||
const issue = (await this.octokit.rest.issues.get({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
mediaType: { previews: ['squirrel-girl'] },
|
||||
@@ -228,77 +298,83 @@ class OctoKitIssue extends OctoKit {
|
||||
return (this.issueData = this.octokitIssueToIssue(issue));
|
||||
}
|
||||
async postComment(body) {
|
||||
core_1.debug(`Posting comment ${body} on ${this.issueData.number}`);
|
||||
(0, utils_1.safeLog)(`Posting comment on ${this.issueData.number}`);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.createComment({
|
||||
await this.octokit.rest.issues.createComment({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
body,
|
||||
});
|
||||
}
|
||||
async deleteComment(id) {
|
||||
core_1.debug(`Deleting comment ${id} on ${this.issueData.number}`);
|
||||
(0, utils_1.safeLog)(`Deleting comment ${id} on ${this.issueData.number}`);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.deleteComment({
|
||||
await this.octokit.rest.issues.deleteComment({
|
||||
owner: this.params.owner,
|
||||
repo: this.params.repo,
|
||||
comment_id: id,
|
||||
});
|
||||
}
|
||||
async setMilestone(milestoneId) {
|
||||
core_1.debug(`Setting milestone for ${this.issueData.number} to ${milestoneId}`);
|
||||
(0, utils_1.safeLog)(`Setting milestone for ${this.issueData.number} to ${milestoneId}`);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.update({
|
||||
await this.octokit.rest.issues.update({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
milestone: milestoneId,
|
||||
});
|
||||
}
|
||||
async *getComments(last) {
|
||||
core_1.debug('Fetching comments for ' + this.issueData.number);
|
||||
const response = this.octokit.paginate.iterator(this.octokit.issues.listComments.endpoint.merge({
|
||||
(0, utils_1.safeLog)('Fetching comments for ' + this.issueData.number);
|
||||
const response = this.octokit.paginate.iterator(this.octokit.rest.issues.listComments, {
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
per_page: 100,
|
||||
...(last ? { per_page: 1, page: (await this.getIssue()).numComments } : {}),
|
||||
}));
|
||||
});
|
||||
for await (const page of response) {
|
||||
numRequests++;
|
||||
yield page.data.map((comment) => ({
|
||||
author: { name: comment.user.login, isGitHubApp: comment.user.type === 'Bot' },
|
||||
body: comment.body,
|
||||
id: comment.id,
|
||||
timestamp: +new Date(comment.created_at),
|
||||
}));
|
||||
yield page.data.map((comment) => {
|
||||
var _a, _b, _c, _d;
|
||||
return ({
|
||||
author: { name: (_b = (_a = comment.user) === null || _a === void 0 ? void 0 : _a.login) !== null && _b !== void 0 ? _b : '', isGitHubApp: ((_c = comment.user) === null || _c === void 0 ? void 0 : _c.type) === 'Bot' },
|
||||
body: (_d = comment.body) !== null && _d !== void 0 ? _d : '',
|
||||
id: comment.id,
|
||||
timestamp: +new Date(comment.created_at),
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
async addLabel(name) {
|
||||
core_1.debug(`Adding label ${name} to ${this.issueData.number}`);
|
||||
(0, utils_1.safeLog)(`Adding label ${name} to ${this.issueData.number}`);
|
||||
if (!(await this.repoHasLabel(name))) {
|
||||
throw Error(`Action could not execute becuase label ${name} is not defined.`);
|
||||
}
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.addLabels({
|
||||
await this.octokit.rest.issues.addLabels({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
labels: [name],
|
||||
});
|
||||
}
|
||||
async getAssigner(assignee) {
|
||||
const options = this.octokit.issues.listEventsForTimeline.endpoint.merge({
|
||||
var _a, _b;
|
||||
const options = {
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
});
|
||||
};
|
||||
let assigner;
|
||||
for await (const event of this.octokit.paginate.iterator(options)) {
|
||||
for await (const event of this.octokit.paginate.iterator(this.octokit.rest.issues.listEventsForTimeline, options)) {
|
||||
numRequests++;
|
||||
const timelineEvents = event.data;
|
||||
for (const timelineEvent of timelineEvents) {
|
||||
if (timelineEvent.event === 'assigned' &&
|
||||
timelineEvent.assignee.login === assignee) {
|
||||
assigner = timelineEvent.actor.login;
|
||||
if (timelineEvent.event === 'assigned' && ((_a = timelineEvent.assignee) === null || _a === void 0 ? void 0 : _a.login) === assignee) {
|
||||
assigner = (_b = timelineEvent.actor) === null || _b === void 0 ? void 0 : _b.login;
|
||||
}
|
||||
}
|
||||
if (assigner) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!assigner) {
|
||||
throw Error('Expected to find ' + assignee + ' in issue timeline but did not.');
|
||||
@@ -306,25 +382,26 @@ class OctoKitIssue extends OctoKit {
|
||||
return assigner;
|
||||
}
|
||||
async removeLabel(name) {
|
||||
core_1.debug(`Removing label ${name} from ${this.issueData.number}`);
|
||||
(0, utils_1.safeLog)(`Removing label ${name} from ${this.issueData.number}`);
|
||||
try {
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.removeLabel({
|
||||
await this.octokit.rest.issues.removeLabel({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
name,
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
if (err.status === 404) {
|
||||
console.log(`Label ${name} not found on issue`);
|
||||
const statusErorr = err;
|
||||
if (statusErorr.status === 404) {
|
||||
(0, utils_1.safeLog)(`Label ${name} not found on issue`);
|
||||
return;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
async getClosingInfo(alreadyChecked = []) {
|
||||
var _a, _b, _c, _d, _e, _f, _g;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
if (alreadyChecked.includes(this.issueData.number)) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -332,22 +409,21 @@ class OctoKitIssue extends OctoKit {
|
||||
if ((await this.getIssue()).open) {
|
||||
return;
|
||||
}
|
||||
const closingHashComment = /(?:\\|\/)closedWith (\S*)/;
|
||||
const options = this.octokit.issues.listEventsForTimeline.endpoint.merge({
|
||||
const closingHashComment = /(?:\\|\/)closedWith (?:https:\/\/github\.com\/microsoft\/vscode\/commit\/)?([a-fA-F0-9]{7,40})/;
|
||||
const options = {
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
});
|
||||
};
|
||||
let closingCommit;
|
||||
const crossReferencing = [];
|
||||
for await (const event of this.octokit.paginate.iterator(options)) {
|
||||
for await (const event of this.octokit.paginate.iterator(this.octokit.rest.issues.listEventsForTimeline, options)) {
|
||||
numRequests++;
|
||||
const timelineEvents = event.data;
|
||||
for (const timelineEvent of timelineEvents) {
|
||||
if ((timelineEvent.event === 'closed' || timelineEvent.event === 'merged') &&
|
||||
timelineEvent.created_at &&
|
||||
timelineEvent.commit_id &&
|
||||
timelineEvent.commit_url
|
||||
.toLowerCase()
|
||||
.includes(`/${this.params.owner}/${this.params.repo}/`.toLowerCase())) {
|
||||
((_a = timelineEvent.commit_url) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(`/${this.params.owner}/${this.params.repo}/`.toLowerCase()))) {
|
||||
closingCommit = {
|
||||
hash: timelineEvent.commit_id,
|
||||
timestamp: +new Date(timelineEvent.created_at),
|
||||
@@ -356,15 +432,18 @@ class OctoKitIssue extends OctoKit {
|
||||
if (timelineEvent.event === 'reopened') {
|
||||
closingCommit = undefined;
|
||||
}
|
||||
if (timelineEvent.event === 'commented' &&
|
||||
!((_a = timelineEvent.body) === null || _a === void 0 ? void 0 : _a.includes('UNABLE_TO_LOCATE_COMMIT_MESSAGE')) &&
|
||||
if (timelineEvent.created_at &&
|
||||
timelineEvent.event === 'commented' &&
|
||||
!((_b = timelineEvent.body) === null || _b === void 0 ? void 0 : _b.includes('UNABLE_TO_LOCATE_COMMIT_MESSAGE')) &&
|
||||
closingHashComment.test(timelineEvent.body)) {
|
||||
closingCommit = {
|
||||
hash: closingHashComment.exec(timelineEvent.body)[1],
|
||||
timestamp: +new Date(timelineEvent.created_at),
|
||||
};
|
||||
}
|
||||
if (timelineEvent.event === 'cross-referenced' && ((_c = (_b = timelineEvent.source) === null || _b === void 0 ? void 0 : _b.issue) === null || _c === void 0 ? void 0 : _c.number) && ((_f = (_e = (_d = timelineEvent.source) === null || _d === void 0 ? void 0 : _d.issue) === null || _e === void 0 ? void 0 : _e.pull_request) === null || _f === void 0 ? void 0 : _f.url.includes(`/${this.params.owner}/${this.params.repo}/`.toLowerCase()))) {
|
||||
if (timelineEvent.event === 'cross-referenced' &&
|
||||
((_d = (_c = timelineEvent.source) === null || _c === void 0 ? void 0 : _c.issue) === null || _d === void 0 ? void 0 : _d.number) &&
|
||||
((_g = (_f = (_e = timelineEvent.source) === null || _e === void 0 ? void 0 : _e.issue) === null || _f === void 0 ? void 0 : _f.pull_request) === null || _g === void 0 ? void 0 : _g.url.includes(`/${this.params.owner}/${this.params.repo}/`.toLowerCase()))) {
|
||||
crossReferencing.push(timelineEvent.source.issue.number);
|
||||
}
|
||||
}
|
||||
@@ -375,16 +454,16 @@ class OctoKitIssue extends OctoKit {
|
||||
for (const id of crossReferencing.reverse()) {
|
||||
const closed = await new OctoKitIssue(this.token, this.params, {
|
||||
number: id,
|
||||
}, this.options).getClosingInfo(alreadyChecked);
|
||||
}).getClosingInfo(alreadyChecked);
|
||||
if (closed) {
|
||||
if (Math.abs(closed.timestamp - ((_g = (await this.getIssue()).closedAt) !== null && _g !== void 0 ? _g : 0)) < 5000) {
|
||||
if (Math.abs(closed.timestamp - ((_h = (await this.getIssue()).closedAt) !== null && _h !== void 0 ? _h : 0)) < 5000) {
|
||||
closingCommit = closed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(`Got ${JSON.stringify(closingCommit)} as closing commit of ${this.issueData.number}`);
|
||||
(0, utils_1.safeLog)(`Got ${JSON.stringify(closingCommit)} as closing commit of ${this.issueData.number}`);
|
||||
return closingCommit;
|
||||
}
|
||||
}
|
||||
|
||||
+260
-171
@@ -3,181 +3,242 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { debug } from '@actions/core'
|
||||
import { GitHub as GitHubAPI } from '@actions/github'
|
||||
import { Octokit } from '@octokit/rest'
|
||||
import { exec } from 'child_process'
|
||||
import { Comment, GitHub, GitHubIssue, Issue, Query, User } from './api'
|
||||
import { getOctokit } from '@actions/github';
|
||||
import type { RequestError } from '@octokit/request-error';
|
||||
import { exec } from 'child_process';
|
||||
import { IssueGetResponse, IssuesGetResponseMilestone } from '../common/OctokitTypings';
|
||||
import { safeLog } from '../common/utils';
|
||||
import { Comment, GitHub, GitHubIssue, Issue, Milestone, Query, User } from './api';
|
||||
|
||||
let numRequests = 0
|
||||
export const getNumRequests = () => numRequests
|
||||
let numRequests = 0;
|
||||
export const getNumRequests = () => numRequests;
|
||||
|
||||
export class OctoKit implements GitHub {
|
||||
private _octokit: GitHubAPI
|
||||
protected get octokit(): GitHubAPI {
|
||||
numRequests++
|
||||
return this._octokit
|
||||
private _octokit: ReturnType<typeof getOctokit>;
|
||||
protected get octokit(): ReturnType<typeof getOctokit> {
|
||||
numRequests++;
|
||||
return this._octokit;
|
||||
}
|
||||
|
||||
// when in readonly mode, record labels just-created so at to not throw unneccesary errors
|
||||
protected mockLabels: Set<string> = new Set()
|
||||
protected mockLabels: Set<string> = new Set();
|
||||
|
||||
public readonly repoName: string;
|
||||
public readonly repoOwner: string;
|
||||
|
||||
constructor(
|
||||
protected token: string,
|
||||
protected params: { repo: string; owner: string },
|
||||
protected options: { readonly: boolean } = { readonly: false },
|
||||
) {
|
||||
this._octokit = new GitHubAPI(token)
|
||||
this._octokit = getOctokit(token);
|
||||
this.repoName = params.repo;
|
||||
this.repoOwner = params.owner;
|
||||
}
|
||||
|
||||
getIssueByNumber(number: number) {
|
||||
return new OctoKitIssue(this.token, this.params, { number: number });
|
||||
}
|
||||
|
||||
// TODO: just iterate over the issues in a page here instead of making caller do it
|
||||
async *query(query: Query): AsyncIterableIterator<GitHubIssue[]> {
|
||||
const q = query.q + ` repo:${this.params.owner}/${this.params.repo}`
|
||||
console.log(`Querying for ${q}:`)
|
||||
const q = query.q + ` repo:${this.params.owner}/${this.params.repo}`;
|
||||
|
||||
const options = this.octokit.search.issuesAndPullRequests.endpoint.merge({
|
||||
const options = {
|
||||
...query,
|
||||
q,
|
||||
per_page: 100,
|
||||
headers: { Accept: 'application/vnd.github.squirrel-girl-preview+json' },
|
||||
})
|
||||
};
|
||||
|
||||
let pageNum = 0
|
||||
let pageNum = 0;
|
||||
|
||||
const timeout = async () => {
|
||||
if (pageNum < 2) {
|
||||
/* pass */
|
||||
} else if (pageNum < 4) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 3000))
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000));
|
||||
} else {
|
||||
await new Promise((resolve) => setTimeout(resolve, 30000))
|
||||
await new Promise((resolve) => setTimeout(resolve, 30000));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for await (const pageResponse of this.octokit.paginate.iterator(options)) {
|
||||
await timeout()
|
||||
numRequests++
|
||||
const page: Array<Octokit.SearchIssuesAndPullRequestsResponseItemsItem> = pageResponse.data
|
||||
console.log(`Page ${++pageNum}: ${page.map(({ number }) => number).join(' ')}`)
|
||||
for await (const pageResponse of this.octokit.paginate.iterator(
|
||||
this.octokit.rest.search.issuesAndPullRequests,
|
||||
options,
|
||||
)) {
|
||||
await timeout();
|
||||
numRequests++;
|
||||
const page = pageResponse.data;
|
||||
safeLog(`Page ${++pageNum}: ${page.map(({ number }) => number).join(' ')}`);
|
||||
yield page.map(
|
||||
(issue) => new OctoKitIssue(this.token, this.params, this.octokitIssueToIssue(issue), this.options),
|
||||
)
|
||||
(issue) =>
|
||||
new OctoKitIssue(this.token, this.params, this.octokitIssueToIssue(issue), this.options),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async createIssue(owner: string, repo: string, title: string, body: string): Promise<void> {
|
||||
debug(`Creating issue \`${title}\` on ${owner}/${repo}`)
|
||||
if (!this.options.readonly) await this.octokit.issues.create({ owner, repo, title, body })
|
||||
safeLog(`Creating issue \`${title}\` on ${owner}/${repo}`);
|
||||
if (!this.options.readonly) await this.octokit.rest.issues.create({ owner, repo, title, body });
|
||||
}
|
||||
|
||||
protected octokitIssueToIssue(
|
||||
issue: Octokit.IssuesGetResponse | Octokit.SearchIssuesAndPullRequestsResponseItemsItem,
|
||||
): Issue {
|
||||
protected octokitIssueToIssue(issue: IssueGetResponse): Issue {
|
||||
return {
|
||||
author: { name: issue.user.login, isGitHubApp: issue.user.type === 'Bot' },
|
||||
body: issue.body,
|
||||
author: { name: issue.user?.login ?? 'unkown', isGitHubApp: issue.user?.type === 'Bot' },
|
||||
body: issue.body ?? '',
|
||||
number: issue.number,
|
||||
title: issue.title,
|
||||
labels: (issue.labels as Octokit.IssuesGetLabelResponse[]).map((label) => label.name),
|
||||
isPr: !!issue.pull_request?.html_url,
|
||||
labels: issue.labels.map((label) => (typeof label === 'string' ? label : label.name ?? '')),
|
||||
open: issue.state === 'open',
|
||||
locked: (issue as any).locked,
|
||||
numComments: issue.comments,
|
||||
reactions: (issue as any).reactions,
|
||||
assignee: issue.assignee?.login ?? (issue as any).assignees?.[0]?.login,
|
||||
milestoneId: issue.milestone?.number ?? null,
|
||||
assignee: issue.assignee?.login ?? (issue as IssueGetResponse).assignees?.[0]?.login,
|
||||
assignees: (issue as IssueGetResponse).assignees?.map((assignee) => assignee.login) ?? [],
|
||||
milestone: issue.milestone ? this.octokitMilestoneToMilestone(issue.milestone) : null,
|
||||
createdAt: +new Date(issue.created_at),
|
||||
updatedAt: +new Date(issue.updated_at),
|
||||
closedAt: issue.closed_at ? +new Date((issue.closed_at as unknown) as string) : undefined,
|
||||
}
|
||||
closedAt: issue.closed_at ? +new Date(issue.closed_at as unknown as string) : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
private writeAccessCache: Record<string, boolean> = {}
|
||||
protected octokitMilestoneToMilestone(milestone: IssuesGetResponseMilestone): Milestone | null {
|
||||
if (milestone?.number === undefined) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
title: milestone.title,
|
||||
milestoneId: milestone.number,
|
||||
// Remove the time portions of the dates as they're not important
|
||||
createdAt: milestone.created_at !== null ? new Date(milestone.created_at.split('T')[0]) : null,
|
||||
dueOn: milestone.due_on !== null ? new Date(milestone.due_on.split('T')[0]) : null,
|
||||
closedAt: milestone.closed_at !== null ? new Date(milestone.closed_at.split('T')[0]) : null,
|
||||
description: milestone.description ?? '',
|
||||
numClosedIssues: milestone.closed_issues,
|
||||
numOpenIssues: milestone.open_issues,
|
||||
state: milestone.state === 'open' ? 'open' : 'closed',
|
||||
};
|
||||
}
|
||||
|
||||
private writeAccessCache: Record<string, boolean> = {};
|
||||
async hasWriteAccess(user: User): Promise<boolean> {
|
||||
if (user.name in this.writeAccessCache) {
|
||||
debug('Got permissions from cache for ' + user)
|
||||
return this.writeAccessCache[user.name]
|
||||
safeLog('Got permissions from cache for ' + user);
|
||||
return this.writeAccessCache[user.name];
|
||||
}
|
||||
debug('Fetching permissions for ' + user)
|
||||
safeLog('Fetching permissions for ' + user.name);
|
||||
const permissions = (
|
||||
await this.octokit.repos.getCollaboratorPermissionLevel({
|
||||
await this.octokit.rest.repos.getCollaboratorPermissionLevel({
|
||||
...this.params,
|
||||
username: user.name,
|
||||
})
|
||||
).data.permission
|
||||
return (this.writeAccessCache[user.name] = permissions === 'admin' || permissions === 'write')
|
||||
).data.permission;
|
||||
return (this.writeAccessCache[user.name] = permissions === 'admin' || permissions === 'write');
|
||||
}
|
||||
|
||||
async repoHasLabel(name: string): Promise<boolean> {
|
||||
try {
|
||||
await this.octokit.issues.getLabel({ ...this.params, name })
|
||||
return true
|
||||
await this.octokit.rest.issues.getLabel({ ...this.params, name });
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (err.status === 404) {
|
||||
return this.options.readonly && this.mockLabels.has(name)
|
||||
const statusErorr = err as RequestError;
|
||||
if (statusErorr.status === 404) {
|
||||
return this.options.readonly && this.mockLabels.has(name);
|
||||
}
|
||||
throw err
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async createLabel(name: string, color: string, description: string): Promise<void> {
|
||||
debug('Creating label ' + name)
|
||||
safeLog('Creating label ' + name);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.createLabel({ ...this.params, color, description, name })
|
||||
else this.mockLabels.add(name)
|
||||
await this.octokit.rest.issues.createLabel({ ...this.params, color, description, name });
|
||||
else this.mockLabels.add(name);
|
||||
}
|
||||
|
||||
async deleteLabel(name: string): Promise<void> {
|
||||
debug('Deleting label ' + name)
|
||||
safeLog('Deleting label ' + name);
|
||||
try {
|
||||
if (!this.options.readonly) await this.octokit.issues.deleteLabel({ ...this.params, name })
|
||||
if (!this.options.readonly) await this.octokit.rest.issues.deleteLabel({ ...this.params, name });
|
||||
} catch (err) {
|
||||
if (err.status === 404) {
|
||||
return
|
||||
const statusErorr = err as RequestError;
|
||||
if (statusErorr.status === 404) {
|
||||
return;
|
||||
}
|
||||
throw err
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async readConfig(path: string): Promise<any> {
|
||||
debug('Reading config at ' + path)
|
||||
const repoPath = `.github/${path}.json`
|
||||
safeLog('Reading config at ' + path);
|
||||
const repoPath = `.github/${path}.json`;
|
||||
try {
|
||||
const data = (await this.octokit.repos.getContents({ ...this.params, path: repoPath })).data
|
||||
|
||||
if ('type' in data && data.type === 'file') {
|
||||
const data = (await this.octokit.rest.repos.getContent({ ...this.params, path: repoPath })).data;
|
||||
if ('type' in data && data.type === 'file' && 'content' in data) {
|
||||
if (data.encoding === 'base64' && data.content) {
|
||||
return JSON.parse(Buffer.from(data.content, 'base64').toString('utf-8'))
|
||||
return JSON.parse(Buffer.from(data.content, 'base64').toString('utf-8'));
|
||||
}
|
||||
throw Error(`Could not read contents "${data.content}" in encoding "${data.encoding}"`)
|
||||
throw Error(`Could not read contents "${data.content}" in encoding "${data.encoding}"`);
|
||||
}
|
||||
throw Error('Found directory at config path when expecting file' + JSON.stringify(data))
|
||||
throw Error('Found directory at config path when expecting file' + JSON.stringify(data));
|
||||
} catch (e) {
|
||||
throw Error('Error with config file at ' + repoPath + ': ' + JSON.stringify(e))
|
||||
throw Error('Error with config file at ' + repoPath + ': ' + JSON.stringify(e));
|
||||
}
|
||||
}
|
||||
|
||||
async releaseContainsCommit(release: string, commit: string): Promise<'yes' | 'no' | 'unknown'> {
|
||||
const isHash = (s: string) => /^[a-fA-F0-9]*$/.test(s);
|
||||
if (!isHash(release) || !isHash(commit)) return 'unknown';
|
||||
return new Promise((resolve, reject) =>
|
||||
exec(`git -C ./repo merge-base --is-ancestor ${commit} ${release}`, (err) => {
|
||||
if (!err || err.code === 1) {
|
||||
resolve(!err ? 'yes' : 'no')
|
||||
resolve(!err ? 'yes' : 'no');
|
||||
} else if (err.message.includes(`Not a valid commit name ${release}`)) {
|
||||
// release branch is forked. Probably in endgame. Not released.
|
||||
resolve('no')
|
||||
resolve('no');
|
||||
} else if (err.message.includes(`Not a valid commit name ${commit}`)) {
|
||||
// commit is probably in a different repo.
|
||||
resolve('unknown')
|
||||
resolve('unknown');
|
||||
} else {
|
||||
reject(err)
|
||||
reject(err);
|
||||
}
|
||||
}),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
async getCurrentRepoMilestone(): Promise<number | undefined> {
|
||||
safeLog(`Getting repo milestone for ${this.params.owner}/${this.params.repo}`);
|
||||
// Fetch all milestones open for this repo
|
||||
const allMilestones = (
|
||||
await this.octokit.rest.issues.listMilestones({
|
||||
owner: this.params.owner,
|
||||
repo: this.params.repo,
|
||||
state: 'open',
|
||||
sort: 'due_on',
|
||||
direction: 'asc',
|
||||
})
|
||||
).data;
|
||||
const currentDate = new Date();
|
||||
const possibleMilestones = allMilestones
|
||||
.filter(
|
||||
(milestone) =>
|
||||
new Date(milestone.due_on === null ? currentDate : milestone.due_on) > currentDate &&
|
||||
currentDate > new Date(milestone.created_at) &&
|
||||
!milestone.title.includes('Recovery'),
|
||||
)
|
||||
.sort((a, b) => +new Date(a.due_on ?? currentDate) - +new Date(b.due_on ?? currentDate));
|
||||
if (possibleMilestones.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
return possibleMilestones[0].number;
|
||||
}
|
||||
|
||||
async dispatch(title: string): Promise<void> {
|
||||
debug('Dispatching ' + title)
|
||||
safeLog('Dispatching ' + title);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.repos.createDispatchEvent({ ...this.params, event_type: title })
|
||||
await this.octokit.rest.repos.createDispatchEvent({ ...this.params, event_type: title });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,184 +249,206 @@ export class OctoKitIssue extends OctoKit implements GitHubIssue {
|
||||
private issueData: { number: number } | Issue,
|
||||
options: { readonly: boolean } = { readonly: false },
|
||||
) {
|
||||
super(token, params, options)
|
||||
console.log('running bot on issue', issueData.number)
|
||||
super(token, params, options);
|
||||
safeLog('running bot on issue', issueData.number);
|
||||
}
|
||||
|
||||
async addAssignee(assignee: string): Promise<void> {
|
||||
debug('Adding assignee ' + assignee + ' to ' + this.issueData.number)
|
||||
safeLog('Adding assignee ' + assignee + ' to ' + this.issueData.number);
|
||||
if (!this.options.readonly) {
|
||||
await this.octokit.issues.addAssignees({
|
||||
await this.octokit.rest.issues.addAssignees({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
assignees: [assignee],
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async removeAssignee(assignee: string): Promise<void> {
|
||||
debug('Removing assignee ' + assignee + ' to ' + this.issueData.number)
|
||||
safeLog('Removing assignee ' + assignee + ' to ' + this.issueData.number);
|
||||
if (!this.options.readonly) {
|
||||
await this.octokit.issues.removeAssignees({
|
||||
await this.octokit.rest.issues.removeAssignees({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
assignees: [assignee],
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async closeIssue(): Promise<void> {
|
||||
debug('Closing issue ' + this.issueData.number)
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.update({
|
||||
async closeIssue(reason: 'completed' | 'not_planned'): Promise<void> {
|
||||
safeLog('Closing issue ' + this.issueData.number);
|
||||
if (!this.options.readonly) {
|
||||
const issue = await this.octokit.rest.issues.get({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
state: 'closed',
|
||||
})
|
||||
});
|
||||
// Don't close already closed issues even if it means changing the state
|
||||
if (issue.data.state === 'closed') {
|
||||
return;
|
||||
}
|
||||
await this.octokit.rest.issues
|
||||
.update({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
state: 'closed',
|
||||
state_reason: reason,
|
||||
})
|
||||
.catch((e) => {
|
||||
safeLog('error closing issue:', e);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async reopenIssue(): Promise<void> {
|
||||
debug('Reopening issue ' + this.issueData.number)
|
||||
safeLog('Reopening issue ' + this.issueData.number);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.update({
|
||||
await this.octokit.rest.issues.update({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
state: 'open',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async lockIssue(): Promise<void> {
|
||||
debug('Locking issue ' + this.issueData.number)
|
||||
safeLog('Locking issue ' + this.issueData.number);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.lock({ ...this.params, issue_number: this.issueData.number })
|
||||
await this.octokit.rest.issues.lock({ ...this.params, issue_number: this.issueData.number });
|
||||
}
|
||||
|
||||
async unlockIssue(): Promise<void> {
|
||||
safeLog('Unlocking issue ' + this.issueData.number);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.rest.issues.unlock({ ...this.params, issue_number: this.issueData.number });
|
||||
}
|
||||
|
||||
async getIssue(): Promise<Issue> {
|
||||
if (isIssue(this.issueData)) {
|
||||
debug('Got issue data from query result ' + this.issueData.number)
|
||||
return this.issueData
|
||||
safeLog('Got issue data from query result ' + this.issueData.number);
|
||||
return this.issueData;
|
||||
}
|
||||
|
||||
console.log('Fetching issue ' + this.issueData.number)
|
||||
safeLog('Fetching issue ' + this.issueData.number);
|
||||
const issue = (
|
||||
await this.octokit.issues.get({
|
||||
await this.octokit.rest.issues.get({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
mediaType: { previews: ['squirrel-girl'] },
|
||||
})
|
||||
).data
|
||||
return (this.issueData = this.octokitIssueToIssue(issue))
|
||||
).data;
|
||||
return (this.issueData = this.octokitIssueToIssue(issue));
|
||||
}
|
||||
|
||||
async postComment(body: string): Promise<void> {
|
||||
debug(`Posting comment ${body} on ${this.issueData.number}`)
|
||||
safeLog(`Posting comment on ${this.issueData.number}`);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.createComment({
|
||||
await this.octokit.rest.issues.createComment({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
body,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async deleteComment(id: number): Promise<void> {
|
||||
debug(`Deleting comment ${id} on ${this.issueData.number}`)
|
||||
safeLog(`Deleting comment ${id} on ${this.issueData.number}`);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.deleteComment({
|
||||
await this.octokit.rest.issues.deleteComment({
|
||||
owner: this.params.owner,
|
||||
repo: this.params.repo,
|
||||
comment_id: id,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async setMilestone(milestoneId: number) {
|
||||
debug(`Setting milestone for ${this.issueData.number} to ${milestoneId}`)
|
||||
safeLog(`Setting milestone for ${this.issueData.number} to ${milestoneId}`);
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.update({
|
||||
await this.octokit.rest.issues.update({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
milestone: milestoneId,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async *getComments(last?: boolean): AsyncIterableIterator<Comment[]> {
|
||||
debug('Fetching comments for ' + this.issueData.number)
|
||||
safeLog('Fetching comments for ' + this.issueData.number);
|
||||
|
||||
const response = this.octokit.paginate.iterator(
|
||||
this.octokit.issues.listComments.endpoint.merge({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
per_page: 100,
|
||||
...(last ? { per_page: 1, page: (await this.getIssue()).numComments } : {}),
|
||||
}),
|
||||
)
|
||||
const response = this.octokit.paginate.iterator(this.octokit.rest.issues.listComments, {
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
per_page: 100,
|
||||
...(last ? { per_page: 1, page: (await this.getIssue()).numComments } : {}),
|
||||
});
|
||||
|
||||
for await (const page of response) {
|
||||
numRequests++
|
||||
yield (page.data as Octokit.IssuesListCommentsResponseItem[]).map((comment) => ({
|
||||
author: { name: comment.user.login, isGitHubApp: comment.user.type === 'Bot' },
|
||||
body: comment.body,
|
||||
numRequests++;
|
||||
yield page.data.map((comment) => ({
|
||||
author: { name: comment.user?.login ?? '', isGitHubApp: comment.user?.type === 'Bot' },
|
||||
body: comment.body ?? '',
|
||||
id: comment.id,
|
||||
timestamp: +new Date(comment.created_at),
|
||||
}))
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
async addLabel(name: string): Promise<void> {
|
||||
debug(`Adding label ${name} to ${this.issueData.number}`)
|
||||
safeLog(`Adding label ${name} to ${this.issueData.number}`);
|
||||
if (!(await this.repoHasLabel(name))) {
|
||||
throw Error(`Action could not execute becuase label ${name} is not defined.`)
|
||||
throw Error(`Action could not execute becuase label ${name} is not defined.`);
|
||||
}
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.addLabels({
|
||||
await this.octokit.rest.issues.addLabels({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
labels: [name],
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async getAssigner(assignee: string): Promise<string> {
|
||||
const options = this.octokit.issues.listEventsForTimeline.endpoint.merge({
|
||||
const options = {
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
})
|
||||
};
|
||||
|
||||
let assigner: string | undefined
|
||||
let assigner: string | undefined;
|
||||
|
||||
for await (const event of this.octokit.paginate.iterator(options)) {
|
||||
numRequests++
|
||||
const timelineEvents = event.data as Octokit.IssuesListEventsForTimelineResponseItem[]
|
||||
for await (const event of this.octokit.paginate.iterator(
|
||||
this.octokit.rest.issues.listEventsForTimeline,
|
||||
options,
|
||||
)) {
|
||||
numRequests++;
|
||||
const timelineEvents = event.data;
|
||||
for (const timelineEvent of timelineEvents) {
|
||||
if (
|
||||
timelineEvent.event === 'assigned' &&
|
||||
(timelineEvent as any).assignee.login === assignee
|
||||
) {
|
||||
assigner = timelineEvent.actor.login
|
||||
if (timelineEvent.event === 'assigned' && timelineEvent.assignee?.login === assignee) {
|
||||
assigner = timelineEvent.actor?.login;
|
||||
}
|
||||
}
|
||||
if (assigner) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!assigner) {
|
||||
throw Error('Expected to find ' + assignee + ' in issue timeline but did not.')
|
||||
throw Error('Expected to find ' + assignee + ' in issue timeline but did not.');
|
||||
}
|
||||
|
||||
return assigner
|
||||
return assigner;
|
||||
}
|
||||
|
||||
async removeLabel(name: string): Promise<void> {
|
||||
debug(`Removing label ${name} from ${this.issueData.number}`)
|
||||
safeLog(`Removing label ${name} from ${this.issueData.number}`);
|
||||
try {
|
||||
if (!this.options.readonly)
|
||||
await this.octokit.issues.removeLabel({
|
||||
await this.octokit.rest.issues.removeLabel({
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
name,
|
||||
})
|
||||
});
|
||||
} catch (err) {
|
||||
if (err.status === 404) {
|
||||
console.log(`Label ${name} not found on issue`)
|
||||
return
|
||||
const statusErorr = err as RequestError;
|
||||
if (statusErorr.status === 404) {
|
||||
safeLog(`Label ${name} not found on issue`);
|
||||
return;
|
||||
}
|
||||
throw err
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,43 +456,49 @@ export class OctoKitIssue extends OctoKit implements GitHubIssue {
|
||||
alreadyChecked: number[] = [],
|
||||
): Promise<{ hash: string | undefined; timestamp: number } | undefined> {
|
||||
if (alreadyChecked.includes(this.issueData.number)) {
|
||||
return undefined
|
||||
return undefined;
|
||||
}
|
||||
alreadyChecked.push(this.issueData.number)
|
||||
alreadyChecked.push(this.issueData.number);
|
||||
|
||||
if ((await this.getIssue()).open) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
const closingHashComment = /(?:\\|\/)closedWith (\S*)/
|
||||
const closingHashComment =
|
||||
/(?:\\|\/)closedWith (?:https:\/\/github\.com\/microsoft\/vscode\/commit\/)?([a-fA-F0-9]{7,40})/;
|
||||
|
||||
const options = this.octokit.issues.listEventsForTimeline.endpoint.merge({
|
||||
const options = {
|
||||
...this.params,
|
||||
issue_number: this.issueData.number,
|
||||
})
|
||||
let closingCommit: { hash: string | undefined; timestamp: number } | undefined
|
||||
const crossReferencing: number[] = []
|
||||
for await (const event of this.octokit.paginate.iterator(options)) {
|
||||
numRequests++
|
||||
};
|
||||
let closingCommit: { hash: string | undefined; timestamp: number } | undefined;
|
||||
const crossReferencing: number[] = [];
|
||||
for await (const event of this.octokit.paginate.iterator(
|
||||
this.octokit.rest.issues.listEventsForTimeline,
|
||||
options,
|
||||
)) {
|
||||
numRequests++;
|
||||
|
||||
const timelineEvents = event.data as Octokit.IssuesListEventsForTimelineResponseItem[]
|
||||
const timelineEvents = event.data;
|
||||
for (const timelineEvent of timelineEvents) {
|
||||
if (
|
||||
(timelineEvent.event === 'closed' || timelineEvent.event === 'merged') &&
|
||||
timelineEvent.created_at &&
|
||||
timelineEvent.commit_id &&
|
||||
timelineEvent.commit_url
|
||||
.toLowerCase()
|
||||
?.toLowerCase()
|
||||
.includes(`/${this.params.owner}/${this.params.repo}/`.toLowerCase())
|
||||
) {
|
||||
closingCommit = {
|
||||
hash: timelineEvent.commit_id,
|
||||
timestamp: +new Date(timelineEvent.created_at),
|
||||
}
|
||||
};
|
||||
}
|
||||
if (timelineEvent.event === 'reopened') {
|
||||
closingCommit = undefined
|
||||
closingCommit = undefined;
|
||||
}
|
||||
if (
|
||||
timelineEvent.created_at &&
|
||||
timelineEvent.event === 'commented' &&
|
||||
!((timelineEvent as any).body as string)?.includes('UNABLE_TO_LOCATE_COMMIT_MESSAGE') &&
|
||||
closingHashComment.test((timelineEvent as any).body)
|
||||
@@ -417,7 +506,7 @@ export class OctoKitIssue extends OctoKit implements GitHubIssue {
|
||||
closingCommit = {
|
||||
hash: closingHashComment.exec((timelineEvent as any).body)![1],
|
||||
timestamp: +new Date(timelineEvent.created_at),
|
||||
}
|
||||
};
|
||||
}
|
||||
if (
|
||||
timelineEvent.event === 'cross-referenced' &&
|
||||
@@ -426,7 +515,7 @@ export class OctoKitIssue extends OctoKit implements GitHubIssue {
|
||||
`/${this.params.owner}/${this.params.repo}/`.toLowerCase(),
|
||||
)
|
||||
) {
|
||||
crossReferencing.push((timelineEvent as any).source.issue.number)
|
||||
crossReferencing.push((timelineEvent as any).source.issue.number);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -437,19 +526,19 @@ export class OctoKitIssue extends OctoKit implements GitHubIssue {
|
||||
for (const id of crossReferencing.reverse()) {
|
||||
const closed = await new OctoKitIssue(this.token, this.params, {
|
||||
number: id,
|
||||
}, this.options).getClosingInfo(alreadyChecked)
|
||||
}).getClosingInfo(alreadyChecked);
|
||||
|
||||
if (closed) {
|
||||
if (Math.abs(closed.timestamp - ((await this.getIssue()).closedAt ?? 0)) < 5000) {
|
||||
closingCommit = closed
|
||||
break
|
||||
closingCommit = closed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Got ${JSON.stringify(closingCommit)} as closing commit of ${this.issueData.number}`)
|
||||
return closingCommit
|
||||
safeLog(`Got ${JSON.stringify(closingCommit)} as closing commit of ${this.issueData.number}`);
|
||||
return closingCommit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,7 +553,7 @@ function isIssue(object: any): object is Issue {
|
||||
'number' in object &&
|
||||
'numComments' in object &&
|
||||
'reactions' in object &&
|
||||
'milestoneId' in object
|
||||
'milestoneId' in object;
|
||||
|
||||
return isIssue
|
||||
return isIssue;
|
||||
}
|
||||
|
||||
@@ -11,51 +11,50 @@ const utils_1 = require("./utils");
|
||||
const core_1 = require("@actions/core");
|
||||
class Action {
|
||||
constructor() {
|
||||
this.token = utils_1.getRequiredInput('token');
|
||||
this.username = new github_1.GitHub(this.token).users.getAuthenticated().then((v) => v.data.name);
|
||||
this.token = (0, utils_1.getRequiredInput)('token');
|
||||
this.username = (0, github_1.getOctokit)(this.token)
|
||||
.rest.users.getAuthenticated()
|
||||
.then((v) => { var _a; return (_a = v.data.name) !== null && _a !== void 0 ? _a : 'unknown'; }, () => 'unknown');
|
||||
}
|
||||
async run() {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
||||
console.log('running ', this.id, 'with context', {
|
||||
...github_1.context,
|
||||
payload: {
|
||||
issue: (_b = (_a = github_1.context.payload) === null || _a === void 0 ? void 0 : _a.issue) === null || _b === void 0 ? void 0 : _b.number,
|
||||
label: (_d = (_c = github_1.context.payload) === null || _c === void 0 ? void 0 : _c.label) === null || _d === void 0 ? void 0 : _d.name,
|
||||
repository: (_f = (_e = github_1.context.payload) === null || _e === void 0 ? void 0 : _e.repository) === null || _f === void 0 ? void 0 : _f.html_url,
|
||||
sender: (_j = (_h = (_g = github_1.context.payload) === null || _g === void 0 ? void 0 : _g.sender) === null || _h === void 0 ? void 0 : _h.login) !== null && _j !== void 0 ? _j : (_l = (_k = github_1.context.payload) === null || _k === void 0 ? void 0 : _k.sender) === null || _l === void 0 ? void 0 : _l.type,
|
||||
},
|
||||
});
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
if (utils_1.errorLoggingIssue) {
|
||||
const { repo, issue, owner } = utils_1.errorLoggingIssue;
|
||||
if (github_1.context.repo.repo === repo &&
|
||||
github_1.context.repo.owner === owner &&
|
||||
((_m = github_1.context.payload.issue) === null || _m === void 0 ? void 0 : _m.number) === issue) {
|
||||
return console.log('refusing to run on error logging issue to prevent cascading errors');
|
||||
((_a = github_1.context.payload.issue) === null || _a === void 0 ? void 0 : _a.number) === issue) {
|
||||
return (0, utils_1.safeLog)('refusing to run on error logging issue to prevent cascading errors');
|
||||
}
|
||||
}
|
||||
try {
|
||||
const token = utils_1.getRequiredInput('token');
|
||||
const readonly = !!core_1.getInput('readonly');
|
||||
const issue = (_o = github_1.context === null || github_1.context === void 0 ? void 0 : github_1.context.issue) === null || _o === void 0 ? void 0 : _o.number;
|
||||
const token = (0, utils_1.getRequiredInput)('token');
|
||||
const readonly = !!(0, core_1.getInput)('readonly');
|
||||
const issue = (_b = github_1.context === null || github_1.context === void 0 ? void 0 : github_1.context.issue) === null || _b === void 0 ? void 0 : _b.number;
|
||||
if (issue) {
|
||||
const octokit = new octokit_1.OctoKitIssue(token, github_1.context.repo, { number: issue }, { readonly });
|
||||
if (github_1.context.eventName === 'issue_comment') {
|
||||
await this.onCommented(octokit, github_1.context.payload.comment.body, github_1.context.actor);
|
||||
await this.onCommented(octokit, (_c = github_1.context.payload.comment) === null || _c === void 0 ? void 0 : _c.body, github_1.context.actor);
|
||||
}
|
||||
else if (github_1.context.eventName === 'issues') {
|
||||
else if (github_1.context.eventName === 'issues' ||
|
||||
github_1.context.eventName === 'pull_request' ||
|
||||
github_1.context.eventName === 'pull_request_target') {
|
||||
switch (github_1.context.payload.action) {
|
||||
case 'opened':
|
||||
await this.onOpened(octokit);
|
||||
case 'ready_for_review':
|
||||
await this.onOpened(octokit, github_1.context.payload);
|
||||
break;
|
||||
case 'reopened':
|
||||
await this.onReopened(octokit);
|
||||
break;
|
||||
case 'closed':
|
||||
await this.onClosed(octokit);
|
||||
await this.onClosed(octokit, github_1.context.payload);
|
||||
break;
|
||||
case 'labeled':
|
||||
await this.onLabeled(octokit, github_1.context.payload.label.name);
|
||||
break;
|
||||
case 'assigned':
|
||||
await this.onAssigned(octokit, github_1.context.payload.assignee.login);
|
||||
break;
|
||||
case 'unassigned':
|
||||
await this.onUnassigned(octokit, github_1.context.payload.assignee.login);
|
||||
break;
|
||||
@@ -70,22 +69,32 @@ class Action {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (github_1.context.eventName === 'create') {
|
||||
await this.onCreated(new octokit_1.OctoKit(token, github_1.context.repo, { readonly }), (_d = github_1.context === null || github_1.context === void 0 ? void 0 : github_1.context.payload) === null || _d === void 0 ? void 0 : _d.ref, (_f = (_e = github_1.context === null || github_1.context === void 0 ? void 0 : github_1.context.payload) === null || _e === void 0 ? void 0 : _e.sender) === null || _f === void 0 ? void 0 : _f.login);
|
||||
}
|
||||
else {
|
||||
await this.onTriggered(new octokit_1.OctoKit(token, github_1.context.repo, { readonly }));
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
await this.error(e);
|
||||
const err = e;
|
||||
try {
|
||||
await this.error(err);
|
||||
}
|
||||
catch {
|
||||
(0, utils_1.safeLog)((err === null || err === void 0 ? void 0 : err.stack) || (err === null || err === void 0 ? void 0 : err.message) || String(e));
|
||||
}
|
||||
}
|
||||
const usage = await utils_1.getRateLimit(this.token);
|
||||
const usage = await (0, utils_1.getRateLimit)(this.token);
|
||||
}
|
||||
async error(error) {
|
||||
var _a;
|
||||
const details = {
|
||||
message: `${error.message}\n${error.stack}`,
|
||||
id: this.id,
|
||||
user: await this.username,
|
||||
};
|
||||
if (github_1.context.issue.number)
|
||||
if ((_a = github_1.context.issue) === null || _a === void 0 ? void 0 : _a.number)
|
||||
details.issue = github_1.context.issue.number;
|
||||
const rendered = `
|
||||
Message: ${details.message}
|
||||
@@ -94,28 +103,34 @@ Actor: ${details.user}
|
||||
|
||||
ID: ${details.id}
|
||||
`;
|
||||
await utils_1.logErrorToIssue(rendered, true, this.token);
|
||||
core_1.setFailed(error.message);
|
||||
await (0, utils_1.logErrorToIssue)(rendered, true, this.token);
|
||||
(0, core_1.setFailed)(error.message);
|
||||
}
|
||||
async onTriggered(_octokit) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onCreated(_octokit, _ref, _creator) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onEdited(_issue) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onLabeled(_issue, _label) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onUnassigned(_issue, _label) {
|
||||
async onAssigned(_issue, _assignee) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onOpened(_issue) {
|
||||
async onUnassigned(_issue, _assignee) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onOpened(_issue, _payload) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onReopened(_issue) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onClosed(_issue) {
|
||||
async onClosed(_issue, _payload) {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
async onMilestoned(_issue) {
|
||||
|
||||
@@ -3,87 +3,102 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { OctoKit, OctoKitIssue, getNumRequests } from '../api/octokit'
|
||||
import { context, GitHub } from '@actions/github'
|
||||
import { getRequiredInput, logErrorToIssue, getRateLimit, errorLoggingIssue } from './utils'
|
||||
import { getInput, setFailed } from '@actions/core'
|
||||
import { OctoKit, OctoKitIssue, getNumRequests } from '../api/octokit';
|
||||
import { context, getOctokit } from '@actions/github';
|
||||
import { getRequiredInput, logErrorToIssue, getRateLimit, errorLoggingIssue, safeLog } from './utils';
|
||||
import { getInput, setFailed } from '@actions/core';
|
||||
import { WebhookPayload } from '@actions/github/lib/interfaces';
|
||||
|
||||
export abstract class Action {
|
||||
abstract id: string
|
||||
abstract id: string;
|
||||
|
||||
private username: Promise<string>
|
||||
private token = getRequiredInput('token')
|
||||
private username: Promise<string>;
|
||||
private token = getRequiredInput('token');
|
||||
|
||||
constructor() {
|
||||
this.username = new GitHub(this.token).users.getAuthenticated().then((v) => v.data.name)
|
||||
this.username = getOctokit(this.token)
|
||||
.rest.users.getAuthenticated()
|
||||
.then(
|
||||
(v) => v.data.name ?? 'unknown',
|
||||
() => 'unknown',
|
||||
);
|
||||
}
|
||||
|
||||
public async run() {
|
||||
console.log('running ', this.id, 'with context', {
|
||||
...context,
|
||||
payload: {
|
||||
issue: context.payload?.issue?.number,
|
||||
label: context.payload?.label?.name,
|
||||
repository: context.payload?.repository?.html_url,
|
||||
sender: context.payload?.sender?.login ?? context.payload?.sender?.type,
|
||||
},
|
||||
})
|
||||
|
||||
if (errorLoggingIssue) {
|
||||
const { repo, issue, owner } = errorLoggingIssue
|
||||
const { repo, issue, owner } = errorLoggingIssue;
|
||||
if (
|
||||
context.repo.repo === repo &&
|
||||
context.repo.owner === owner &&
|
||||
context.payload.issue?.number === issue
|
||||
) {
|
||||
return console.log('refusing to run on error logging issue to prevent cascading errors')
|
||||
return safeLog('refusing to run on error logging issue to prevent cascading errors');
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const token = getRequiredInput('token')
|
||||
const readonly = !!getInput('readonly')
|
||||
const token = getRequiredInput('token');
|
||||
const readonly = !!getInput('readonly');
|
||||
|
||||
const issue = context?.issue?.number
|
||||
const issue = context?.issue?.number;
|
||||
if (issue) {
|
||||
const octokit = new OctoKitIssue(token, context.repo, { number: issue }, { readonly })
|
||||
const octokit = new OctoKitIssue(token, context.repo, { number: issue }, { readonly });
|
||||
if (context.eventName === 'issue_comment') {
|
||||
await this.onCommented(octokit, context.payload.comment.body, context.actor)
|
||||
} else if (context.eventName === 'issues') {
|
||||
await this.onCommented(octokit, context.payload.comment?.body, context.actor);
|
||||
} else if (
|
||||
context.eventName === 'issues' ||
|
||||
context.eventName === 'pull_request' ||
|
||||
context.eventName === 'pull_request_target'
|
||||
) {
|
||||
switch (context.payload.action) {
|
||||
case 'opened':
|
||||
await this.onOpened(octokit)
|
||||
break
|
||||
case 'ready_for_review':
|
||||
await this.onOpened(octokit, context.payload);
|
||||
break;
|
||||
case 'reopened':
|
||||
await this.onReopened(octokit)
|
||||
break
|
||||
await this.onReopened(octokit);
|
||||
break;
|
||||
case 'closed':
|
||||
await this.onClosed(octokit)
|
||||
break
|
||||
await this.onClosed(octokit, context.payload);
|
||||
break;
|
||||
case 'labeled':
|
||||
await this.onLabeled(octokit, context.payload.label.name)
|
||||
break
|
||||
await this.onLabeled(octokit, context.payload.label.name);
|
||||
break;
|
||||
case 'assigned':
|
||||
await this.onAssigned(octokit, context.payload.assignee.login);
|
||||
break;
|
||||
case 'unassigned':
|
||||
await this.onUnassigned(octokit, context.payload.assignee.login)
|
||||
break
|
||||
await this.onUnassigned(octokit, context.payload.assignee.login);
|
||||
break;
|
||||
case 'edited':
|
||||
await this.onEdited(octokit)
|
||||
break
|
||||
await this.onEdited(octokit);
|
||||
break;
|
||||
case 'milestoned':
|
||||
await this.onMilestoned(octokit)
|
||||
break
|
||||
await this.onMilestoned(octokit);
|
||||
break;
|
||||
default:
|
||||
throw Error('Unexpected action: ' + context.payload.action)
|
||||
throw Error('Unexpected action: ' + context.payload.action);
|
||||
}
|
||||
}
|
||||
} else if (context.eventName === 'create') {
|
||||
await this.onCreated(
|
||||
new OctoKit(token, context.repo, { readonly }),
|
||||
context?.payload?.ref,
|
||||
context?.payload?.sender?.login,
|
||||
);
|
||||
} else {
|
||||
await this.onTriggered(new OctoKit(token, context.repo, { readonly }))
|
||||
await this.onTriggered(new OctoKit(token, context.repo, { readonly }));
|
||||
}
|
||||
} catch (e) {
|
||||
await this.error(e)
|
||||
const err = e as Error;
|
||||
try {
|
||||
await this.error(err);
|
||||
} catch {
|
||||
safeLog(err?.stack || err?.message || String(e));
|
||||
}
|
||||
}
|
||||
|
||||
const usage = await getRateLimit(this.token)
|
||||
const usage = await getRateLimit(this.token);
|
||||
}
|
||||
|
||||
private async error(error: Error) {
|
||||
@@ -91,9 +106,9 @@ export abstract class Action {
|
||||
message: `${error.message}\n${error.stack}`,
|
||||
id: this.id,
|
||||
user: await this.username,
|
||||
}
|
||||
};
|
||||
|
||||
if (context.issue.number) details.issue = context.issue.number
|
||||
if (context.issue?.number) details.issue = context.issue.number;
|
||||
|
||||
const rendered = `
|
||||
Message: ${details.message}
|
||||
@@ -101,37 +116,43 @@ Message: ${details.message}
|
||||
Actor: ${details.user}
|
||||
|
||||
ID: ${details.id}
|
||||
`
|
||||
await logErrorToIssue(rendered, true, this.token)
|
||||
`;
|
||||
await logErrorToIssue(rendered, true, this.token);
|
||||
|
||||
setFailed(error.message)
|
||||
setFailed(error.message);
|
||||
}
|
||||
|
||||
protected async onTriggered(_octokit: OctoKit): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onCreated(_octokit: OctoKit, _ref: string, _creator: string): Promise<void> {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onEdited(_issue: OctoKitIssue): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onLabeled(_issue: OctoKitIssue, _label: string): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onUnassigned(_issue: OctoKitIssue, _label: string): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
protected async onAssigned(_issue: OctoKitIssue, _assignee: string): Promise<void> {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onOpened(_issue: OctoKitIssue): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
protected async onUnassigned(_issue: OctoKitIssue, _assignee: string): Promise<void> {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onOpened(_issue: OctoKitIssue, _payload: WebhookPayload): Promise<void> {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onReopened(_issue: OctoKitIssue): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onClosed(_issue: OctoKitIssue): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
protected async onClosed(_issue: OctoKitIssue, _payload: WebhookPayload): Promise<void> {
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onMilestoned(_issue: OctoKitIssue): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
throw Error('not implemented');
|
||||
}
|
||||
protected async onCommented(_issue: OctoKitIssue, _comment: string, _actor: string): Promise<void> {
|
||||
throw Error('not implemented')
|
||||
throw Error('not implemented');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,181 +1,183 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionBase = void 0;
|
||||
class ActionBase {
|
||||
constructor(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
this.labels = labels;
|
||||
this.milestoneName = milestoneName;
|
||||
this.milestoneId = milestoneId;
|
||||
this.ignoreLabels = ignoreLabels;
|
||||
this.ignoreMilestoneNames = ignoreMilestoneNames;
|
||||
this.ignoreMilestoneIds = ignoreMilestoneIds;
|
||||
this.minimumVotes = minimumVotes;
|
||||
this.maximumVotes = maximumVotes;
|
||||
this.involves = involves;
|
||||
this.labelsSet = [];
|
||||
this.ignoreLabelsSet = [];
|
||||
this.ignoreMilestoneNamesSet = [];
|
||||
this.ignoreMilestoneIdsSet = [];
|
||||
this.ignoreAllWithLabels = false;
|
||||
this.ignoreAllWithMilestones = false;
|
||||
this.involvesSet = [];
|
||||
}
|
||||
buildQuery(baseQuery) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
let query = baseQuery;
|
||||
console.log(`labels: ${this.labels}`);
|
||||
console.log(`milestoneName: ${this.milestoneName}`);
|
||||
console.log(`milestoneId: ${this.milestoneId}`);
|
||||
console.log(`ignoreLabels: ${this.ignoreLabels}`);
|
||||
console.log(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
|
||||
console.log(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
|
||||
console.log(`minimumVotes: ${this.minimumVotes}`);
|
||||
console.log(`maximumVotes: ${this.maximumVotes}`);
|
||||
console.log(`involves: ${this.involves}`);
|
||||
// Both milestone name and milestone Id must be provided and must match.
|
||||
// The name is used to construct the query, which does not accept ID.
|
||||
// The ID is used for comparisons with issue data, which does not include the name.
|
||||
// TODO: Figure out a way to convert either from milestone name to ID, or vice versa.
|
||||
// If label inclusion and exclusion are mixed, exclusion will take precedence.
|
||||
// For example, an issue with both labels A and B will not match if B is excluded, even if A is included.
|
||||
// If a milestoneName/milestoneId are set, ignoreMilenameName/ignoreMilestoneIds are ignored.
|
||||
// GitHub does not appear to support searching for all issues with milestones (not lacking a milestone). "-no:milestone" does not work.
|
||||
// GitHub does not appear to support searching for all issues with labels (not lacking a label). "-no:label" does not work.
|
||||
// All indicated labels must be present
|
||||
if (this.labels) {
|
||||
if (((_a = this.labels) === null || _a === void 0 ? void 0 : _a.length) > 2 && ((_b = this.labels) === null || _b === void 0 ? void 0 : _b.startsWith('"')) && ((_c = this.labels) === null || _c === void 0 ? void 0 : _c.endsWith('"'))) {
|
||||
this.labels = this.labels.substring(1, this.labels.length - 2);
|
||||
}
|
||||
this.labelsSet = (_d = this.labels) === null || _d === void 0 ? void 0 : _d.split(',');
|
||||
for (const str of this.labelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// The "involves" qualifier to find issues that in some way involve a certain user.
|
||||
// It is a logical OR between the author, assignee, and mentions.
|
||||
if (this.involves) {
|
||||
this.involvesSet = (_e = this.involves) === null || _e === void 0 ? void 0 : _e.split(',');
|
||||
for (const str of this.involvesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` involves:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreLabels) {
|
||||
if (this.ignoreLabels == "*" && !this.labels) { // only if unlabeled
|
||||
query = query.concat(` no:label`);
|
||||
this.ignoreAllWithLabels = true;
|
||||
}
|
||||
else {
|
||||
this.ignoreLabelsSet = (_f = this.ignoreLabels) === null || _f === void 0 ? void 0 : _f.split(',');
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.milestoneName) {
|
||||
query = query.concat(` milestone:"${this.milestoneName}"`);
|
||||
}
|
||||
else if (this.ignoreMilestoneNames) {
|
||||
if (this.ignoreMilestoneNames == "*") {
|
||||
query = query.concat(` no:milestone`);
|
||||
this.ignoreAllWithMilestones = true;
|
||||
}
|
||||
else if (this.ignoreMilestoneIds) {
|
||||
this.ignoreMilestoneNamesSet = this.ignoreMilestoneNames.split(',');
|
||||
this.ignoreMilestoneIdsSet = this.ignoreMilestoneIds.split(',');
|
||||
for (const str of this.ignoreMilestoneNamesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -milestone:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return query;
|
||||
}
|
||||
// This is necessary because GitHub sometimes returns incorrect results,
|
||||
// and because issues may get modified while we are processing them.
|
||||
validateIssue(issue) {
|
||||
if (this.ignoreAllWithLabels) {
|
||||
// Validate that the issue does not have labels
|
||||
if (issue.labels && issue.labels.length !== 0) {
|
||||
console.log(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure all labels we wanted are present.
|
||||
if ((!issue.labels || issue.labels.length == 0) && this.labelsSet.length > 0) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
|
||||
return false;
|
||||
}
|
||||
for (const str of this.labelsSet) {
|
||||
if (!issue.labels.includes(str)) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having a required label set.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Make sure no labels we wanted to ignore are present.
|
||||
if (issue.labels && issue.labels.length > 0) {
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (issue.labels.includes(str)) {
|
||||
console.log(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreAllWithMilestones) {
|
||||
// Validate that the issue does not have a milestone.
|
||||
if (issue.milestoneId != null) {
|
||||
console.log(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure milestone is present, if required.
|
||||
if (this.milestoneId != undefined && issue.milestoneId != +this.milestoneId) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${issue.milestoneId}`);
|
||||
return false;
|
||||
}
|
||||
// Make sure a milestones we wanted to ignore is not present.
|
||||
if (issue.milestoneId != null) {
|
||||
for (const str of this.ignoreMilestoneIdsSet) {
|
||||
if (issue.milestoneId == +str) {
|
||||
console.log(`Issue ${issue.number} skipped due to milestone ${issue.milestoneId} found in list of ignored milestone IDs.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Verify the issue has a sufficient number of upvotes
|
||||
let upvotes = 0;
|
||||
if (issue.reactions) {
|
||||
upvotes = issue.reactions['+1'];
|
||||
}
|
||||
if (this.minimumVotes != undefined) {
|
||||
if (upvotes < this.minimumVotes) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Verify the issue does not have too many upvotes
|
||||
if (this.maximumVotes != undefined) {
|
||||
if (upvotes > this.maximumVotes) {
|
||||
console.log(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.ActionBase = ActionBase;
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionBase = void 0;
|
||||
const utils_1 = require("./utils");
|
||||
class ActionBase {
|
||||
constructor(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
this.labels = labels;
|
||||
this.milestoneName = milestoneName;
|
||||
this.milestoneId = milestoneId;
|
||||
this.ignoreLabels = ignoreLabels;
|
||||
this.ignoreMilestoneNames = ignoreMilestoneNames;
|
||||
this.ignoreMilestoneIds = ignoreMilestoneIds;
|
||||
this.minimumVotes = minimumVotes;
|
||||
this.maximumVotes = maximumVotes;
|
||||
this.involves = involves;
|
||||
this.labelsSet = [];
|
||||
this.ignoreLabelsSet = [];
|
||||
this.ignoreMilestoneNamesSet = [];
|
||||
this.ignoreMilestoneIdsSet = [];
|
||||
this.ignoreAllWithLabels = false;
|
||||
this.ignoreAllWithMilestones = false;
|
||||
this.involvesSet = [];
|
||||
}
|
||||
buildQuery(baseQuery) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
let query = baseQuery;
|
||||
(0, utils_1.safeLog)(`labels: ${this.labels}`);
|
||||
(0, utils_1.safeLog)(`milestoneName: ${this.milestoneName}`);
|
||||
(0, utils_1.safeLog)(`milestoneId: ${this.milestoneId}`);
|
||||
(0, utils_1.safeLog)(`ignoreLabels: ${this.ignoreLabels}`);
|
||||
(0, utils_1.safeLog)(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
|
||||
(0, utils_1.safeLog)(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
|
||||
(0, utils_1.safeLog)(`minimumVotes: ${this.minimumVotes}`);
|
||||
(0, utils_1.safeLog)(`maximumVotes: ${this.maximumVotes}`);
|
||||
(0, utils_1.safeLog)(`involves: ${this.involves}`);
|
||||
// Both milestone name and milestone Id must be provided and must match.
|
||||
// The name is used to construct the query, which does not accept ID.
|
||||
// The ID is used for comparisons with issue data, which does not include the name.
|
||||
// TODO: Figure out a way to convert either from milestone name to ID, or vice versa.
|
||||
// If label inclusion and exclusion are mixed, exclusion will take precedence.
|
||||
// For example, an issue with both labels A and B will not match if B is excluded, even if A is included.
|
||||
// If a milestoneName/milestoneId are set, ignoreMilenameName/ignoreMilestoneIds are ignored.
|
||||
// GitHub does not appear to support searching for all issues with milestones (not lacking a milestone). "-no:milestone" does not work.
|
||||
// GitHub does not appear to support searching for all issues with labels (not lacking a label). "-no:label" does not work.
|
||||
// All indicated labels must be present
|
||||
if (this.labels) {
|
||||
if (((_a = this.labels) === null || _a === void 0 ? void 0 : _a.length) > 2 && ((_b = this.labels) === null || _b === void 0 ? void 0 : _b.startsWith('"')) && ((_c = this.labels) === null || _c === void 0 ? void 0 : _c.endsWith('"'))) {
|
||||
this.labels = this.labels.substring(1, this.labels.length - 2);
|
||||
}
|
||||
this.labelsSet = (_d = this.labels) === null || _d === void 0 ? void 0 : _d.split(',');
|
||||
for (const str of this.labelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// The "involves" qualifier to find issues that in some way involve a certain user.
|
||||
// It is a logical OR between the author, assignee, and mentions.
|
||||
if (this.involves) {
|
||||
this.involvesSet = (_e = this.involves) === null || _e === void 0 ? void 0 : _e.split(',');
|
||||
for (const str of this.involvesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` involves:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreLabels) {
|
||||
if (this.ignoreLabels == "*" && !this.labels) { // only if unlabeled
|
||||
query = query.concat(` no:label`);
|
||||
this.ignoreAllWithLabels = true;
|
||||
}
|
||||
else {
|
||||
this.ignoreLabelsSet = (_f = this.ignoreLabels) === null || _f === void 0 ? void 0 : _f.split(',');
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.milestoneName) {
|
||||
query = query.concat(` milestone:"${this.milestoneName}"`);
|
||||
}
|
||||
else if (this.ignoreMilestoneNames) {
|
||||
if (this.ignoreMilestoneNames == "*") {
|
||||
query = query.concat(` no:milestone`);
|
||||
this.ignoreAllWithMilestones = true;
|
||||
}
|
||||
else if (this.ignoreMilestoneIds) {
|
||||
this.ignoreMilestoneNamesSet = this.ignoreMilestoneNames.split(',');
|
||||
this.ignoreMilestoneIdsSet = this.ignoreMilestoneIds.split(',');
|
||||
for (const str of this.ignoreMilestoneNamesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -milestone:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return query;
|
||||
}
|
||||
// This is necessary because GitHub sometimes returns incorrect results,
|
||||
// and because issues may get modified while we are processing them.
|
||||
validateIssue(issue) {
|
||||
var _a, _b;
|
||||
if (this.ignoreAllWithLabels) {
|
||||
// Validate that the issue does not have labels
|
||||
if (issue.labels && issue.labels.length !== 0) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure all labels we wanted are present.
|
||||
if ((!issue.labels || issue.labels.length == 0) && this.labelsSet.length > 0) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
|
||||
return false;
|
||||
}
|
||||
for (const str of this.labelsSet) {
|
||||
if (!issue.labels.includes(str)) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Make sure no labels we wanted to ignore are present.
|
||||
if (issue.labels && issue.labels.length > 0) {
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (issue.labels.includes(str)) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreAllWithMilestones) {
|
||||
// Validate that the issue does not have a milestone.
|
||||
if (issue.milestone) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure milestone is present, if required.
|
||||
if (this.milestoneId != null && ((_a = issue.milestone) === null || _a === void 0 ? void 0 : _a.milestoneId) != +this.milestoneId) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${(_b = issue.milestone) === null || _b === void 0 ? void 0 : _b.milestoneId}`);
|
||||
return false;
|
||||
}
|
||||
// Make sure a milestones we wanted to ignore is not present.
|
||||
if (issue.milestone && issue.milestone.milestoneId != null) {
|
||||
for (const str of this.ignoreMilestoneIdsSet) {
|
||||
if (issue.milestone.milestoneId == +str) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone ${issue.milestone.milestoneId} found in list of ignored milestone IDs.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Verify the issue has a sufficient number of upvotes
|
||||
let upvotes = 0;
|
||||
if (issue.reactions) {
|
||||
upvotes = issue.reactions['+1'];
|
||||
}
|
||||
if (this.minimumVotes != undefined) {
|
||||
if (upvotes < this.minimumVotes) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Verify the issue does not have too many upvotes
|
||||
if (this.maximumVotes != undefined) {
|
||||
if (upvotes > this.maximumVotes) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.ActionBase = ActionBase;
|
||||
//# sourceMappingURL=ActionBase.js.map
|
||||
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Issue } from '../api/api'
|
||||
import { safeLog } from './utils';
|
||||
|
||||
export class ActionBase {
|
||||
constructor(
|
||||
@@ -29,15 +30,15 @@ export class ActionBase {
|
||||
buildQuery(baseQuery: string): string {
|
||||
let query = baseQuery;
|
||||
|
||||
console.log(`labels: ${this.labels}`);
|
||||
console.log(`milestoneName: ${this.milestoneName}`);
|
||||
console.log(`milestoneId: ${this.milestoneId}`);
|
||||
console.log(`ignoreLabels: ${this.ignoreLabels}`);
|
||||
console.log(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
|
||||
console.log(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
|
||||
console.log(`minimumVotes: ${this.minimumVotes}`);
|
||||
console.log(`maximumVotes: ${this.maximumVotes}`);
|
||||
console.log(`involves: ${this.involves}`);
|
||||
safeLog(`labels: ${this.labels}`);
|
||||
safeLog(`milestoneName: ${this.milestoneName}`);
|
||||
safeLog(`milestoneId: ${this.milestoneId}`);
|
||||
safeLog(`ignoreLabels: ${this.ignoreLabels}`);
|
||||
safeLog(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
|
||||
safeLog(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
|
||||
safeLog(`minimumVotes: ${this.minimumVotes}`);
|
||||
safeLog(`maximumVotes: ${this.maximumVotes}`);
|
||||
safeLog(`involves: ${this.involves}`);
|
||||
|
||||
// Both milestone name and milestone Id must be provided and must match.
|
||||
// The name is used to construct the query, which does not accept ID.
|
||||
@@ -117,18 +118,18 @@ export class ActionBase {
|
||||
if (this.ignoreAllWithLabels) {
|
||||
// Validate that the issue does not have labels
|
||||
if (issue.labels && issue.labels.length !== 0) {
|
||||
console.log(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
|
||||
safeLog(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// Make sure all labels we wanted are present.
|
||||
if ((!issue.labels || issue.labels.length == 0) && this.labelsSet.length > 0) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
|
||||
safeLog(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
|
||||
return false;
|
||||
}
|
||||
for (const str of this.labelsSet) {
|
||||
if (!issue.labels.includes(str)) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having a required label set.`);
|
||||
safeLog(`Issue ${issue.number} skipped due to not having a required label set.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -136,7 +137,7 @@ export class ActionBase {
|
||||
if (issue.labels && issue.labels.length > 0) {
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (issue.labels.includes(str)) {
|
||||
console.log(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
|
||||
safeLog(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -144,21 +145,21 @@ export class ActionBase {
|
||||
}
|
||||
if (this.ignoreAllWithMilestones) {
|
||||
// Validate that the issue does not have a milestone.
|
||||
if (issue.milestoneId != null) {
|
||||
console.log(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
|
||||
if (issue.milestone) {
|
||||
safeLog(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// Make sure milestone is present, if required.
|
||||
if (this.milestoneId != undefined && issue.milestoneId != +this.milestoneId) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${issue.milestoneId}`);
|
||||
if (this.milestoneId != null && issue.milestone?.milestoneId != +this.milestoneId) {
|
||||
safeLog(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${issue.milestone?.milestoneId}`);
|
||||
return false;
|
||||
}
|
||||
// Make sure a milestones we wanted to ignore is not present.
|
||||
if (issue.milestoneId != null) {
|
||||
if (issue.milestone && issue.milestone.milestoneId != null) {
|
||||
for (const str of this.ignoreMilestoneIdsSet) {
|
||||
if (issue.milestoneId == +str) {
|
||||
console.log(`Issue ${issue.number} skipped due to milestone ${issue.milestoneId} found in list of ignored milestone IDs.`);
|
||||
if (issue.milestone.milestoneId == +str) {
|
||||
safeLog(`Issue ${issue.number} skipped due to milestone ${issue.milestone.milestoneId} found in list of ignored milestone IDs.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -171,14 +172,14 @@ export class ActionBase {
|
||||
}
|
||||
if (this.minimumVotes != undefined) {
|
||||
if (upvotes < this.minimumVotes) {
|
||||
console.log(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
|
||||
safeLog(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Verify the issue does not have too many upvotes
|
||||
if (this.maximumVotes != undefined) {
|
||||
if (upvotes > this.maximumVotes) {
|
||||
console.log(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
|
||||
safeLog(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=OctokitTypings.js.map
|
||||
@@ -0,0 +1,16 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import type { RestEndpointMethodTypes } from '@octokit/rest';
|
||||
|
||||
// This file is just to re-export some octokit types as nicer names
|
||||
|
||||
export type ActionsListWorkflowRunsResponseWorkflowRunsItem =
|
||||
RestEndpointMethodTypes['actions']['listWorkflowRuns']['response']['data']['workflow_runs'][0];
|
||||
|
||||
export type IssueGetResponse = RestEndpointMethodTypes['issues']['get']['response']['data'];
|
||||
|
||||
export type IssuesGetResponseMilestone =
|
||||
RestEndpointMethodTypes['issues']['get']['response']['data']['milestone'];
|
||||
@@ -4,14 +4,16 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.logErrorToIssue = exports.errorLoggingIssue = exports.getRateLimit = exports.daysAgoToHumanReadbleDate = exports.daysAgoToTimestamp = exports.loadLatestRelease = exports.normalizeIssue = exports.getRequiredInput = exports.getInput = void 0;
|
||||
exports.safeLog = exports.logErrorToIssue = exports.errorLoggingIssue = exports.getRateLimit = exports.daysAgoToHumanReadbleDate = exports.daysAgoToTimestamp = exports.loadLatestRelease = exports.normalizeIssue = exports.getRequiredInput = exports.getInput = void 0;
|
||||
const core = require("@actions/core");
|
||||
const github_1 = require("@actions/github");
|
||||
const axios_1 = require("axios");
|
||||
const octokit_1 = require("../api/octokit");
|
||||
exports.getInput = (name) => core.getInput(name) || undefined;
|
||||
exports.getRequiredInput = (name) => core.getInput(name, { required: true });
|
||||
exports.normalizeIssue = (issue) => {
|
||||
const getInput = (name) => core.getInput(name) || undefined;
|
||||
exports.getInput = getInput;
|
||||
const getRequiredInput = (name) => core.getInput(name, { required: true });
|
||||
exports.getRequiredInput = getRequiredInput;
|
||||
const normalizeIssue = (issue) => {
|
||||
let { body, title } = issue;
|
||||
body = body !== null && body !== void 0 ? body : '';
|
||||
title = title !== null && title !== void 0 ? title : '';
|
||||
@@ -43,25 +45,36 @@ exports.normalizeIssue = (issue) => {
|
||||
issueType: isBug ? 'bug' : isFeatureRequest ? 'feature_request' : 'unknown',
|
||||
};
|
||||
};
|
||||
exports.loadLatestRelease = async (quality) => (await axios_1.default.get(`https://vscode-update.azurewebsites.net/api/update/darwin/${quality}/latest`)).data;
|
||||
exports.daysAgoToTimestamp = (days) => +new Date(Date.now() - days * 24 * 60 * 60 * 1000);
|
||||
exports.daysAgoToHumanReadbleDate = (days) => new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString().replace(/\.\d{3}\w$/, '');
|
||||
exports.getRateLimit = async (token) => {
|
||||
const usageData = (await new github_1.GitHub(token).rateLimit.get()).data.resources;
|
||||
exports.normalizeIssue = normalizeIssue;
|
||||
const loadLatestRelease = async (quality) => (await axios_1.default.get(`https://update.code.visualstudio.com/api/update/darwin/${quality}/latest`)).data;
|
||||
exports.loadLatestRelease = loadLatestRelease;
|
||||
const daysAgoToTimestamp = (days) => +new Date(Date.now() - days * 24 * 60 * 60 * 1000);
|
||||
exports.daysAgoToTimestamp = daysAgoToTimestamp;
|
||||
const daysAgoToHumanReadbleDate = (days) => new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString().replace(/\.\d{3}\w$/, '');
|
||||
exports.daysAgoToHumanReadbleDate = daysAgoToHumanReadbleDate;
|
||||
const getRateLimit = async (token) => {
|
||||
const usageData = (await (0, github_1.getOctokit)(token).rest.rateLimit.get()).data.resources;
|
||||
const usage = {};
|
||||
['core', 'graphql', 'search'].forEach(async (category) => {
|
||||
usage[category] = 1 - usageData[category].remaining / usageData[category].limit;
|
||||
var _a, _b, _c, _d;
|
||||
if (usageData[category]) {
|
||||
usage[category] = 1 - ((_b = (_a = usageData[category]) === null || _a === void 0 ? void 0 : _a.remaining) !== null && _b !== void 0 ? _b : 0) / ((_d = (_c = usageData[category]) === null || _c === void 0 ? void 0 : _c.limit) !== null && _d !== void 0 ? _d : 1);
|
||||
}
|
||||
});
|
||||
return usage;
|
||||
};
|
||||
exports.getRateLimit = getRateLimit;
|
||||
exports.errorLoggingIssue = (() => {
|
||||
try {
|
||||
const repo = github_1.context.repo.owner.toLowerCase() + '/' + github_1.context.repo.repo.toLowerCase();
|
||||
if (repo === 'microsoft/vscode-cpptools') {
|
||||
return { repo: 'vscode-cpptools', owner: 'Microsoft', issue: 6282 };
|
||||
if (repo === 'microsoft/vscode' || repo === 'microsoft/vscode-remote-release') {
|
||||
return { repo: 'vscode', owner: 'Microsoft', issue: 93814 };
|
||||
}
|
||||
else if (exports.getInput('errorLogIssueNumber')) {
|
||||
return { ...github_1.context.repo, issue: +exports.getRequiredInput('errorLogIssueNumber') };
|
||||
else if (/microsoft\//.test(repo)) {
|
||||
return { repo: 'vscode-internalbacklog', owner: 'Microsoft', issue: 974 };
|
||||
}
|
||||
else if ((0, exports.getInput)('errorLogIssueNumber')) {
|
||||
return { ...github_1.context.repo, issue: +(0, exports.getRequiredInput)('errorLogIssueNumber') };
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
@@ -72,19 +85,20 @@ exports.errorLoggingIssue = (() => {
|
||||
return undefined;
|
||||
}
|
||||
})();
|
||||
exports.logErrorToIssue = async (message, ping, token) => {
|
||||
const logErrorToIssue = async (message, ping, token) => {
|
||||
var _a;
|
||||
// Attempt to wait out abuse detection timeout if present
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000));
|
||||
const dest = exports.errorLoggingIssue;
|
||||
if (!dest)
|
||||
return console.log('no error logging repo defined. swallowing error:', message);
|
||||
return new octokit_1.OctoKitIssue(token, { owner: dest.owner, repo: dest.repo }, { number: dest.issue }, { readonly: !!exports.getInput('readonly') })
|
||||
return console.log('no error logging repo defined. swallowing error.');
|
||||
return new octokit_1.OctoKitIssue(token, { owner: dest.owner, repo: dest.repo }, { number: dest.issue })
|
||||
.postComment(`
|
||||
Workflow: ${github_1.context.workflow}
|
||||
|
||||
Error: ${message}
|
||||
|
||||
Issue: ${ping ? `${github_1.context.repo.owner}/${github_1.context.repo.repo}#` : ''}${github_1.context.issue.number}
|
||||
Issue: ${ping ? `${github_1.context.repo.owner}/${github_1.context.repo.repo}#` : ''}${(_a = github_1.context.issue) === null || _a === void 0 ? void 0 : _a.number}
|
||||
|
||||
Repo: ${github_1.context.repo.owner}/${github_1.context.repo.repo}
|
||||
|
||||
@@ -96,4 +110,10 @@ ${JSON.stringify(github_1.context, null, 2)
|
||||
-->
|
||||
`);
|
||||
};
|
||||
exports.logErrorToIssue = logErrorToIssue;
|
||||
const safeLog = (message, ...args) => {
|
||||
const clean = (val) => ('' + val).replace(/:|#/g, '');
|
||||
console.log(clean(message), ...args.map(clean));
|
||||
};
|
||||
exports.safeLog = safeLog;
|
||||
//# sourceMappingURL=utils.js.map
|
||||
@@ -3,24 +3,24 @@
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as core from '@actions/core'
|
||||
import { context, GitHub } from '@actions/github'
|
||||
import axios from 'axios'
|
||||
import { OctoKitIssue } from '../api/octokit'
|
||||
import * as core from '@actions/core';
|
||||
import { context, getOctokit } from '@actions/github';
|
||||
import axios from 'axios';
|
||||
import { OctoKitIssue } from '../api/octokit';
|
||||
|
||||
export const getInput = (name: string) => core.getInput(name) || undefined
|
||||
export const getRequiredInput = (name: string) => core.getInput(name, { required: true })
|
||||
export const getInput = (name: string) => core.getInput(name) || undefined;
|
||||
export const getRequiredInput = (name: string) => core.getInput(name, { required: true });
|
||||
|
||||
export const normalizeIssue = (issue: {
|
||||
body: string
|
||||
title: string
|
||||
body: string;
|
||||
title: string;
|
||||
}): { body: string; title: string; issueType: 'bug' | 'feature_request' | 'unknown' } => {
|
||||
let { body, title } = issue
|
||||
body = body ?? ''
|
||||
title = title ?? ''
|
||||
const isBug = body.includes('bug_report_template') || /Issue Type:.*Bug.*/.test(body)
|
||||
let { body, title } = issue;
|
||||
body = body ?? '';
|
||||
title = title ?? '';
|
||||
const isBug = body.includes('bug_report_template') || /Issue Type:.*Bug.*/.test(body);
|
||||
const isFeatureRequest =
|
||||
body.includes('feature_request_template') || /Issue Type:.*Feature Request.*/.test(body)
|
||||
body.includes('feature_request_template') || /Issue Type:.*Feature Request.*/.test(body);
|
||||
|
||||
const cleanse = (str: string) => {
|
||||
let out = str
|
||||
@@ -34,78 +34,83 @@ export const normalizeIssue = (issue: {
|
||||
.replace(/does this issue occur when all extensions are disabled.*/gu, '')
|
||||
.replace(/!?\[[^\]]*\]\([^)]*\)/gu, '')
|
||||
.replace(/\s+/gu, ' ')
|
||||
.replace(/```[^`]*?```/gu, '')
|
||||
.replace(/```[^`]*?```/gu, '');
|
||||
|
||||
while (
|
||||
out.includes(`<details>`) &&
|
||||
out.includes('</details>') &&
|
||||
out.indexOf(`</details>`) > out.indexOf(`<details>`)
|
||||
) {
|
||||
out = out.slice(0, out.indexOf('<details>')) + out.slice(out.indexOf(`</details>`) + 10)
|
||||
out = out.slice(0, out.indexOf('<details>')) + out.slice(out.indexOf(`</details>`) + 10);
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
return out;
|
||||
};
|
||||
|
||||
return {
|
||||
body: cleanse(body),
|
||||
title: cleanse(title),
|
||||
issueType: isBug ? 'bug' : isFeatureRequest ? 'feature_request' : 'unknown',
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export interface Release {
|
||||
productVersion: string
|
||||
timestamp: number
|
||||
version: string
|
||||
productVersion: string;
|
||||
timestamp: number;
|
||||
version: string;
|
||||
}
|
||||
|
||||
export const loadLatestRelease = async (quality: 'stable' | 'insider'): Promise<Release | undefined> =>
|
||||
(await axios.get(`https://vscode-update.azurewebsites.net/api/update/darwin/${quality}/latest`)).data
|
||||
(await axios.get(`https://update.code.visualstudio.com/api/update/darwin/${quality}/latest`)).data;
|
||||
|
||||
export const daysAgoToTimestamp = (days: number): number => +new Date(Date.now() - days * 24 * 60 * 60 * 1000)
|
||||
export const daysAgoToTimestamp = (days: number): number =>
|
||||
+new Date(Date.now() - days * 24 * 60 * 60 * 1000);
|
||||
|
||||
export const daysAgoToHumanReadbleDate = (days: number) =>
|
||||
new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString().replace(/\.\d{3}\w$/, '')
|
||||
new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString().replace(/\.\d{3}\w$/, '');
|
||||
|
||||
export const getRateLimit = async (token: string) => {
|
||||
const usageData = (await new GitHub(token).rateLimit.get()).data.resources
|
||||
const usage = {} as { core: number; graphql: number; search: number }
|
||||
;(['core', 'graphql', 'search'] as const).forEach(async (category) => {
|
||||
usage[category] = 1 - usageData[category].remaining / usageData[category].limit
|
||||
})
|
||||
return usage
|
||||
}
|
||||
const usageData = (await getOctokit(token).rest.rateLimit.get()).data.resources;
|
||||
const usage = {} as { core: number; graphql: number; search: number };
|
||||
(['core', 'graphql', 'search'] as const).forEach(async (category) => {
|
||||
if (usageData[category]) {
|
||||
usage[category] = 1 - (usageData[category]?.remaining ?? 0) / (usageData[category]?.limit ?? 1);
|
||||
}
|
||||
});
|
||||
return usage;
|
||||
};
|
||||
|
||||
export const errorLoggingIssue = (() => {
|
||||
try {
|
||||
const repo = context.repo.owner.toLowerCase() + '/' + context.repo.repo.toLowerCase()
|
||||
if (repo === 'microsoft/vscode-cpptools') {
|
||||
return { repo: 'vscode-cpptools', owner: 'Microsoft', issue: 6282 }
|
||||
const repo = context.repo.owner.toLowerCase() + '/' + context.repo.repo.toLowerCase();
|
||||
if (repo === 'microsoft/vscode' || repo === 'microsoft/vscode-remote-release') {
|
||||
return { repo: 'vscode', owner: 'Microsoft', issue: 93814 };
|
||||
} else if (/microsoft\//.test(repo)) {
|
||||
return { repo: 'vscode-internalbacklog', owner: 'Microsoft', issue: 974 };
|
||||
} else if (getInput('errorLogIssueNumber')) {
|
||||
return { ...context.repo, issue: +getRequiredInput('errorLogIssueNumber') }
|
||||
return { ...context.repo, issue: +getRequiredInput('errorLogIssueNumber') };
|
||||
} else {
|
||||
return undefined
|
||||
return undefined;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return undefined
|
||||
console.error(e);
|
||||
return undefined;
|
||||
}
|
||||
})()
|
||||
})();
|
||||
|
||||
export const logErrorToIssue = async (message: string, ping: boolean, token: string): Promise<void> => {
|
||||
// Attempt to wait out abuse detection timeout if present
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000))
|
||||
const dest = errorLoggingIssue
|
||||
if (!dest) return console.log('no error logging repo defined. swallowing error:', message)
|
||||
await new Promise((resolve) => setTimeout(resolve, 10000));
|
||||
const dest = errorLoggingIssue;
|
||||
if (!dest) return console.log('no error logging repo defined. swallowing error.');
|
||||
|
||||
return new OctoKitIssue(token, { owner: dest.owner, repo: dest.repo }, { number: dest.issue }, { readonly: !!getInput('readonly') })
|
||||
return new OctoKitIssue(token, { owner: dest.owner, repo: dest.repo }, { number: dest.issue })
|
||||
.postComment(`
|
||||
Workflow: ${context.workflow}
|
||||
|
||||
Error: ${message}
|
||||
|
||||
Issue: ${ping ? `${context.repo.owner}/${context.repo.repo}#` : ''}${context.issue.number}
|
||||
Issue: ${ping ? `${context.repo.owner}/${context.repo.repo}#` : ''}${context.issue?.number}
|
||||
|
||||
Repo: ${context.repo.owner}/${context.repo.repo}
|
||||
|
||||
@@ -115,5 +120,10 @@ ${JSON.stringify(context, null, 2)
|
||||
.replace(/-->/gu, '--@>')
|
||||
.replace(/\/|\\/gu, 'slash-')}
|
||||
-->
|
||||
`)
|
||||
}
|
||||
`);
|
||||
};
|
||||
|
||||
export const safeLog = (message: string, ...args: (string | number | string[])[]): void => {
|
||||
const clean = (val: any) => ('' + val).replace(/:|#/g, '');
|
||||
console.log(clean(message), ...args.map(clean));
|
||||
};
|
||||
|
||||
Generated
+5746
-941
File diff suppressed because it is too large
Load Diff
@@ -10,15 +10,36 @@
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/github": "^2.1.1",
|
||||
"axios": "^0.21.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"follow-redirects": "1.14.7"
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/github": "^6.0.0",
|
||||
"@octokit/rest": "^21.1.1",
|
||||
"@slack/web-api": "^6.9.1",
|
||||
"applicationinsights": "^2.5.1",
|
||||
"axios": "^1.12.1",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.1.0",
|
||||
"typescript": "^3.8.3"
|
||||
"@azure/storage-blob": "^12.13.0",
|
||||
"@types/chai": "^4.3.3",
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@types/yargs": "^17.0.11",
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
||||
"@typescript-eslint/parser": "^5.33.0",
|
||||
"chai": "^4.3.6",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"husky": "^8.0.1",
|
||||
"mocha": "^10.0.0",
|
||||
"mongodb": "^4.17.0",
|
||||
"nock": "^13.2.9",
|
||||
"prettier": "2.7.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.7.4",
|
||||
"yargs": "^17.5.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"minimatch": "^3.0.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"moduleResolution": "node",
|
||||
"removeComments": false,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"lib": [
|
||||
"es2020"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Bug - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 50 12 * * * # Run at 12:50 PM UTC (4:50 AM PST, 5:50 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Add Comment
|
||||
uses: ./.github/actions/AddComment
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: bug,debugger
|
||||
ignoreLabels: "investigate: costing,investigate,external,by design,question,more info needed,Language Service,internal"
|
||||
createdAfter: "2024-07-22"
|
||||
addComment: "Thank you for reporting this issue. We’ll let you know if we need more information to investigate it. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated."
|
||||
addLabels: help wanted
|
||||
@@ -1,7 +1,7 @@
|
||||
name: By Design closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
- cron: 0 13 * * * # Run at 1:00 PM UTC (5:00 AM PST, 6:00 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,9 +11,11 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -21,6 +23,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: by design,debugger
|
||||
ignoreLabels: language service,internal
|
||||
ignoreLabels: Language Service,internal
|
||||
closeDays: 0
|
||||
closeComment: "This issue has been closed because the described behavior was determined to be by design."
|
||||
|
||||
@@ -11,9 +11,11 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
|
||||
@@ -1,47 +1,14 @@
|
||||
name: CI (Linux)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14.16.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14.16.x
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
working-directory: Extension
|
||||
|
||||
- name: Compile Sources
|
||||
run: yarn run compile
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run Linter
|
||||
run: yarn run lint
|
||||
working-directory: Extension
|
||||
|
||||
- name: Compile Test Sources
|
||||
run: yarn run pretest
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run unit tests
|
||||
uses: GabrielBB/[email protected]
|
||||
with:
|
||||
run: yarn run unitTests
|
||||
working-directory: Extension
|
||||
|
||||
# - name: Run languageServer integration tests
|
||||
# uses: GabrielBB/[email protected]
|
||||
# with:
|
||||
# run: yarn run integrationTests
|
||||
# working-directory: Extension
|
||||
name: CI (Linux)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
job:
|
||||
uses: ./.github/workflows/job-compile-and-test.yml
|
||||
with:
|
||||
runner-env: ubuntu-22.04
|
||||
platform: linux
|
||||
@@ -1,47 +1,15 @@
|
||||
name: CI (Mac)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14.16.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14.16.x
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install --network-timeout 100000
|
||||
working-directory: Extension
|
||||
|
||||
- name: Compile Sources
|
||||
run: yarn run compile
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run Linter
|
||||
run: yarn run lint
|
||||
working-directory: Extension
|
||||
|
||||
- name: Compile Test Sources
|
||||
run: yarn run pretest
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run unit tests
|
||||
uses: GabrielBB/[email protected]
|
||||
with:
|
||||
run: yarn run unitTests
|
||||
working-directory: Extension
|
||||
|
||||
# - name: Run languageServer integration tests
|
||||
# uses: GabrielBB/[email protected]
|
||||
# with:
|
||||
# run: yarn run integrationTests
|
||||
# working-directory: Extension
|
||||
name: CI (Mac)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
job:
|
||||
uses: ./.github/workflows/job-compile-and-test.yml
|
||||
with:
|
||||
runner-env: macos-14
|
||||
platform: mac
|
||||
yarn-args: --network-timeout 100000
|
||||
@@ -1,43 +1,14 @@
|
||||
name: CI (Windows)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14.16.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14.16.x
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
working-directory: Extension
|
||||
|
||||
- name: Compile Sources
|
||||
run: yarn run compile
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run Linter
|
||||
run: yarn run lint
|
||||
working-directory: Extension
|
||||
|
||||
- name: Compile Test Sources
|
||||
run: yarn run pretest
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run unit tests
|
||||
run: yarn run unitTests
|
||||
working-directory: Extension
|
||||
|
||||
# - name: Run languageServer integration tests
|
||||
# run: yarn run integrationTests
|
||||
# working-directory: Extension
|
||||
name: CI (Windows)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
job:
|
||||
uses: ./.github/workflows/job-compile-and-test.yml
|
||||
with:
|
||||
runner-env: windows-2022
|
||||
platform: windows
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "insiders", "release", "vs" ]
|
||||
pull_request:
|
||||
branches: [ "main", "insiders", "release", "vs" ]
|
||||
schedule:
|
||||
- cron: '29 4 * * 3'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# required to fetch internal or private CodeQL packs
|
||||
packages: read
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: javascript-typescript
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Enhancement Closer (no milestone)
|
||||
on:
|
||||
schedule:
|
||||
- cron: 50 11 * * * # Run at 11:50 AM UTC (3:50 AM PST, 4:50 AM PDT)
|
||||
- cron: 40 12 * * * # Run at 12:40 PM UTC (4:40 AM PST, 5:40 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Enhancement Closer (Triage)
|
||||
on:
|
||||
schedule:
|
||||
- cron: 40 11 * * * # Run at 11:40 AM UTC (3:40 AM PST, 4:40 AM PDT)
|
||||
- cron: 30 12 * * * # Run at 12:30 PM UTC (4:30 AM PST, 5:30 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Enhancement Reopener
|
||||
on:
|
||||
schedule:
|
||||
- cron: 20 12 * * * # Run at 12:20 PM UTC (4:20 AM PST, 5:20 AM PDT)
|
||||
- cron: 0 11 * * * # Run at 11:00 AM UTC (3:00 AM PST, 4:00 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: External closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
- cron: 10 13 * * * # Run at 1:10 PM UTC (5:10 AM PST, 6:10 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
@@ -21,6 +23,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: external,debugger
|
||||
ignoreLabels: language service,internal
|
||||
ignoreLabels: Language Service,internal
|
||||
closeDays: 0
|
||||
closeComment: "This issue has been closed because it is external or not applicable to the extension."
|
||||
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Feature Request - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 20 13 * * * # Run at 1:20 PM UTC (5:20 AM PST, 6:20 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Add Comment
|
||||
uses: ./.github/actions/AddComment
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: Feature Request,debugger
|
||||
ignoreLabels: "investigate: costing,investigate,external,by design,question,more info needed,Language Service,internal"
|
||||
createdAfter: "2024-07-22"
|
||||
addComment: "Thank you for your feature request. While we may not be able to implement it immediately, we will monitor community reactions to see how it fits into our backlog. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated."
|
||||
addLabels: help wanted
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Investigate closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
- cron: 30 13 * * * # Run at 1:30 PM UTC (5:30 AM PST, 6:30 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
@@ -21,6 +23,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: investigate,debugger
|
||||
ignoreLabels: language service,internal
|
||||
ignoreLabels: Language Service,internal
|
||||
closeDays: 180
|
||||
closeComment: "This issue has been closed as lower priority. We're sorry if this issue still impacts you but unfortunately we're not able to address this. We will accept a pull request from the community if it's applicable for this issue."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Investigate Costing closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
- cron: 40 13 * * * # Run at 1:40 PM UTC (5:40 AM PST, 6:40 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
@@ -21,6 +23,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: "investigate: costing,debugger"
|
||||
ignoreLabels: language service,internal
|
||||
ignoreLabels: Language Service,internal
|
||||
closeDays: 180
|
||||
closeComment: "This issue has been closed as lower priority. We're sorry if this issue still impacts you but unfortunately we're not able to address this. We will accept a pull request from the community if it's applicable for this issue."
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
# Reuable workflow for compiling and testing extension.
|
||||
name: Compile and test extension
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner-env:
|
||||
required: true
|
||||
type: string
|
||||
platform:
|
||||
# Expects 'mac', 'linux', or 'windows'
|
||||
required: true
|
||||
type: string
|
||||
yarn-args:
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ inputs.runner-env }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js 22
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install ${{ inputs.yarn-args }}
|
||||
working-directory: Extension
|
||||
|
||||
- name: Compile Sources
|
||||
run: yarn run compile
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run Linter
|
||||
run: yarn run lint
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run unit tests
|
||||
run: yarn test
|
||||
working-directory: Extension
|
||||
|
||||
# These tests don't require the binary.
|
||||
# On Linux, it is failing (before the tests actually run) with: Test run terminated with signal SIGSEGV.
|
||||
# But it works on Linux during the E2E test.
|
||||
- name: Run SingleRootProject tests
|
||||
if: ${{ inputs.platform != 'linux' }}
|
||||
run: yarn test --scenario=SingleRootProject --skipCheckBinaries
|
||||
working-directory: Extension
|
||||
|
||||
# NOTE : We can't run the test that require the native binary files
|
||||
# yet -- there will be an update soon that allows the tester to
|
||||
# acquire them on-the-fly
|
||||
# - name: Run languageServer integration tests
|
||||
# if: ${{ inputs.platform == 'windows' }}
|
||||
# run: yarn test --scenario=SingleRootProject
|
||||
# working-directory: Extension
|
||||
|
||||
# - name: Run E2E IntelliSense features tests
|
||||
# if: ${{ inputs.platform == 'windows' }}
|
||||
# run: yarn test --scenario=MultirootDeadlockTest
|
||||
# working-directory: Extension
|
||||
|
||||
# NOTE: For mac/linux run the tests with xvfb-action for UI support.
|
||||
# Another way to start xvfb https://github.com/microsoft/vscode-test/blob/master/sample/azure-pipelines.yml
|
||||
|
||||
# - name: Run languageServer integration tests (xvfb)
|
||||
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
||||
# uses: coactions/setup-xvfb@v1
|
||||
# with:
|
||||
# run: yarn test --scenario=SingleRootProject
|
||||
# working-directory: Extension
|
||||
|
||||
# - name: Run E2E IntelliSense features tests (xvfb)
|
||||
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
||||
# uses: coactions/setup-xvfb@v1
|
||||
# with:
|
||||
# run: yarn test --scenario=MultirootDeadlockTest
|
||||
# working-directory: Extension
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: More Info Needed Closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
- cron: 50 13 * * * # Run at 1:50 PM UTC (5:50 AM PST, 6:50 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
@@ -21,7 +23,7 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: more info needed,debugger
|
||||
ignoreLabels: language service,internal
|
||||
ignoreLabels: Language Service,internal
|
||||
involves: wardengnaw,pieandcakes,calgagi
|
||||
closeDays: 14
|
||||
closeComment: "This issue has been closed because it needs more information and has not had recent activity."
|
||||
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
@@ -22,7 +24,7 @@ jobs:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: more info needed
|
||||
ignoreLabels: debugger,internal
|
||||
closeDays: 60
|
||||
closeDays: 30
|
||||
closeComment: "This issue has been closed because it needs more information and has not had recent activity."
|
||||
pingDays: 80
|
||||
pingDays: 14
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Question Closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
|
||||
- cron: 0 14 * * * # Run at 2:00 PM UTC (6:00 AM PST, 7:00 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
@@ -21,7 +23,7 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: question,debugger
|
||||
ignoreLabels: language service,internal
|
||||
ignoreLabels: Language Service,internal
|
||||
involves: wardengnaw,pieandcakes,calgagi
|
||||
closeDays: 14
|
||||
closeComment: "This issue has been closed because it is a question and has not had recent activity."
|
||||
|
||||
@@ -11,6 +11,8 @@ on:
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
name: $(date:yyyyMMdd)$(rev:.r)
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- release
|
||||
- insiders
|
||||
|
||||
schedules:
|
||||
- cron: 30 5 * * 0
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
always: true
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
variables:
|
||||
- name: Codeql.Enabled
|
||||
value: true
|
||||
- name: Codeql.Language
|
||||
value: javascript
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
binskim:
|
||||
preReleaseVersion: '4.3.1'
|
||||
tsa:
|
||||
enabled: true
|
||||
config:
|
||||
tsaVersion: TsaV2
|
||||
codebase: NewOrUpdate
|
||||
codebaseName: vscode-cpptools
|
||||
tsaStamp: $(TsaProjectName)
|
||||
tsaEnvironment: PROD
|
||||
notificationAliases: $(TsaNotificationAlias)
|
||||
codebaseAdmins: $(TsaCodebaseAdmins)
|
||||
instanceUrl: $(TsaInstanceUrl)
|
||||
projectName: $(TsaProjectName)
|
||||
areaPath: $(TsaAreaPath)
|
||||
iterationPath: $(TsaIterationPath)
|
||||
alltools: true
|
||||
repositoryName: vscode-cpptools
|
||||
policheck:
|
||||
enabled: true
|
||||
featureFlags:
|
||||
autoBaseline: false
|
||||
|
||||
stages:
|
||||
- stage: build
|
||||
jobs:
|
||||
- job: Phase_1
|
||||
displayName: Build cpptools.vsix
|
||||
timeoutInMinutes: 60
|
||||
cancelTimeoutInMinutes: 1
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
displayName: 'cpptools.vsix'
|
||||
condition: succeeded()
|
||||
targetPath: $(Build.ArtifactStagingDirectory)\Extension
|
||||
artifactName: cpptools.vsix
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
|
||||
displayName: Use Yarn 1.x
|
||||
|
||||
- task: UseNode@1
|
||||
displayName: Use Node 22.x
|
||||
inputs:
|
||||
version: 22.x
|
||||
|
||||
- script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc
|
||||
displayName: Delete .npmrc if it exists
|
||||
|
||||
- task: Npm@0
|
||||
displayName: Install vsce
|
||||
inputs:
|
||||
arguments: --global @vscode/vsce
|
||||
|
||||
- script: mkdir $(Build.ArtifactStagingDirectory)\Extension
|
||||
displayName: Create Extension Staging Directory
|
||||
|
||||
- script: yarn run vsix-prepublish
|
||||
displayName: Build files
|
||||
workingDirectory: $(Build.SourcesDirectory)\Extension
|
||||
|
||||
- script: |
|
||||
cd $(Build.SourcesDirectory)\Extension
|
||||
vsce package --yarn -o $(Build.ArtifactStagingDirectory)\Extension\cpptools.vsix
|
||||
name: ProcessRunner_12
|
||||
displayName: Run VSCE to package vsix
|
||||
|
||||
- task: Npm@0
|
||||
displayName: Uninstall vsce
|
||||
inputs:
|
||||
command: uninstall
|
||||
arguments: --global @vscode/vsce
|
||||
@@ -2,11 +2,14 @@
|
||||
# Pipeline for VsCodeExtension-Localization build definition
|
||||
# Runs OneLocBuild task to localize xlf file
|
||||
# ==================================================================================
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: self
|
||||
clean: true
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
trigger: none
|
||||
pr: none
|
||||
@@ -18,40 +21,72 @@ schedules:
|
||||
- main
|
||||
always: true
|
||||
|
||||
pool:
|
||||
name: 'AzurePipelines-EO'
|
||||
demands:
|
||||
- ImageOverride -equals AzurePipelinesWindows2022compliant
|
||||
variables:
|
||||
TeamName: cpptools
|
||||
Codeql.Language: javascript
|
||||
|
||||
steps:
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && yarn install'
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
stages:
|
||||
- stage: stage
|
||||
jobs:
|
||||
- job: job
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
artifactName: 'drop'
|
||||
publishLocation: 'Container'
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '22.x'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd ./Extension && yarn run translations-export && cd ..'
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && yarn install'
|
||||
|
||||
- task: OneLocBuild@2
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
locProj: 'Build/loc/LocProject.json'
|
||||
outDir: '$(Build.ArtifactStagingDirectory)'
|
||||
isCreatePrSelected: false
|
||||
prSourceBranchPrefix: 'locfiles'
|
||||
packageSourceAuth: 'patAuth'
|
||||
patVariable: '$(OneLocBuildPat)'
|
||||
LclSource: lclFilesfromPackage
|
||||
LclPackageId: 'LCL-JUNO-PROD-VCPP'
|
||||
lsBuildXLocPackageVersion: '7.0.30510'
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd ./Extension && yarn run translations-export && cd ..'
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && node ./translations_auto_pr.js microsoft vscode-cpptools csigs $(csigsPat) csigs [email protected] "$(Build.ArtifactStagingDirectory)/loc" vscode-extensions-localization-export/vscode-extensions && cd ..'
|
||||
# Requires Azure client 2.x
|
||||
- task: AzureCLI@2
|
||||
displayName: 'Set OneLocBuildToken'
|
||||
enabled: true
|
||||
inputs:
|
||||
azureSubscription: '$(AzureSubscription)' # Azure DevOps service connection
|
||||
scriptType: 'pscore'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
$token = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv
|
||||
Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: 'drop'
|
||||
publishLocation: 'Container'
|
||||
- task: OneLocBuild@2
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
locProj: 'Build/loc/LocProject.json'
|
||||
outDir: '$(Build.ArtifactStagingDirectory)'
|
||||
isCreatePrSelected: false
|
||||
prSourceBranchPrefix: 'locfiles'
|
||||
packageSourceAuth: 'patAuth'
|
||||
patVariable: '$(AzDO.OneLocBuildToken)'
|
||||
LclSource: lclFilesfromPackage
|
||||
LclPackageId: 'LCL-JUNO-PROD-VCPP'
|
||||
lsBuildXLocPackageVersion: '7.0.30510'
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && node ./translations_auto_pr.js microsoft vscode-cpptools csigs $(csigsPat) csigs [email protected] "$(Build.ArtifactStagingDirectory)/loc" vscode-extensions-localization-export/vscode-extensions && cd ..'
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
name: $(date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
parameters:
|
||||
- name: verifyVersion
|
||||
displayName: Attest version in package.json is correct
|
||||
type: boolean
|
||||
default: false
|
||||
- name: verifyReadme
|
||||
displayName: Attest README.md is updated
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
|
||||
stages:
|
||||
- stage: package
|
||||
jobs:
|
||||
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
|
||||
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
|
||||
- 'The version in package.json should be updated before scheduling the pipeline.'
|
||||
|
||||
- ${{ if not(eq(parameters.verifyReadme, true)) }}:
|
||||
- 'README.md should be updated before scheduling the pipeline.'
|
||||
|
||||
- template: /Build/package/jobs_package_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-extension-pack.vsix
|
||||
srcDir: ExtensionPack
|
||||
@@ -0,0 +1,48 @@
|
||||
name: $(date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
parameters:
|
||||
- name: verifyVersion
|
||||
displayName: Attest version in package.json is correct
|
||||
type: boolean
|
||||
default: false
|
||||
- name: verifyReadme
|
||||
displayName: Attest README.md is updated
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
|
||||
stages:
|
||||
- stage: package
|
||||
jobs:
|
||||
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
|
||||
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
|
||||
- 'The version in package.json should be updated before scheduling the pipeline.'
|
||||
|
||||
- ${{ if not(eq(parameters.verifyReadme, true)) }}:
|
||||
- 'README.md should be updated before scheduling the pipeline.'
|
||||
|
||||
- template: /Build/package/jobs_package_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-themes.vsix
|
||||
srcDir: Themes
|
||||
@@ -0,0 +1,49 @@
|
||||
parameters:
|
||||
- name: vsixName
|
||||
type: string
|
||||
default: ''
|
||||
- name: srcDir
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
jobs:
|
||||
- job: package
|
||||
displayName: Build ${{ parameters.vsixName }}
|
||||
timeoutInMinutes: 30
|
||||
cancelTimeoutInMinutes: 1
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
displayName: '${{ parameters.vsixName }}'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)\vsix
|
||||
artifactName: vsix
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- task: UseNode@1
|
||||
displayName: Use Node 22.x
|
||||
inputs:
|
||||
version: 22.x
|
||||
|
||||
- task: Npm@0
|
||||
displayName: Install vsce
|
||||
inputs:
|
||||
arguments: --global @vscode/vsce
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
|
||||
displayName: Use Yarn 1.x
|
||||
|
||||
- script: mkdir $(Build.ArtifactStagingDirectory)\vsix
|
||||
displayName: Create Staging Directory
|
||||
|
||||
- script: |
|
||||
cd $(Build.SourcesDirectory)\${{ parameters.srcDir }}
|
||||
vsce package -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}
|
||||
displayName: Run VSCE to package vsix
|
||||
|
||||
- task: Npm@0
|
||||
displayName: Uninstall vsce
|
||||
inputs:
|
||||
command: uninstall
|
||||
arguments: --global @vscode/vsce
|
||||
@@ -0,0 +1,43 @@
|
||||
name: $(Date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
pipelines:
|
||||
- pipeline: vsixBuild
|
||||
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-extension-pack'
|
||||
trigger: true
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
|
||||
stages:
|
||||
- stage: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_manual_validation.yml@self
|
||||
parameters:
|
||||
notifyUsers: $(NotifyUsers)
|
||||
releaseBuildUrl: $(ReleaseBuildUrl)
|
||||
|
||||
- stage: Release
|
||||
dependsOn: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_publish_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-extension-pack.vsix
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
name: $(Date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
pipelines:
|
||||
- pipeline: vsixBuild
|
||||
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-themes'
|
||||
trigger: true
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2022
|
||||
os: windows
|
||||
|
||||
stages:
|
||||
- stage: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_manual_validation.yml@self
|
||||
parameters:
|
||||
notifyUsers: $(NotifyUsers)
|
||||
releaseBuildUrl: $(ReleaseBuildUrl)
|
||||
|
||||
- stage: Release
|
||||
dependsOn: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_publish_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-themes.vsix
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
parameters:
|
||||
- name: notifyUsers
|
||||
type: string
|
||||
default: ''
|
||||
- name: releaseBuildUrl
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
jobs:
|
||||
- job: WaitForValidation
|
||||
displayName: Wait for VSIX validation
|
||||
pool: server
|
||||
steps:
|
||||
- task: ManualValidation@0
|
||||
displayName: "Manual Validation"
|
||||
inputs:
|
||||
notifyUsers: $(notifyUsers)
|
||||
instructions: |
|
||||
Download and test the vsix from the latest release build: $(releaseBuildUrl)
|
||||
@@ -0,0 +1,44 @@
|
||||
parameters:
|
||||
- name: vsixName
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
jobs:
|
||||
- job: Publish
|
||||
displayName: Publish to Marketplace
|
||||
templateContext:
|
||||
type: releaseJob
|
||||
isProduction: true
|
||||
inputs:
|
||||
- input: pipelineArtifact
|
||||
pipeline: vsixBuild
|
||||
artifactName: vsix
|
||||
targetPath: $(Build.StagingDirectory)\vsix
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
displayName: Use Node 22.x
|
||||
inputs:
|
||||
versionSpec: 22.x
|
||||
|
||||
- task: Npm@0
|
||||
displayName: Install vsce
|
||||
inputs:
|
||||
arguments: --global @vscode/vsce
|
||||
|
||||
- task: AzureCLI@2
|
||||
displayName: Generate AAD_TOKEN
|
||||
inputs:
|
||||
azureSubscription: $(AzureSubscription)
|
||||
scriptType: ps
|
||||
scriptLocation: inlineScript
|
||||
inlineScript: |
|
||||
$aadToken = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv
|
||||
Write-Host "##vso[task.setvariable variable=AAD_TOKEN;issecret=true]$aadToken"
|
||||
|
||||
- script: |
|
||||
vsce publish --packagePath $(Build.StagingDirectory)\vsix\${{ parameters.vsixName }}
|
||||
displayName: Publish to Marketplace
|
||||
env:
|
||||
VSCE_PAT: $(AAD_TOKEN)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<BaseOutputDirectory>$(BUILD_STAGINGDIRECTORY)/Extension</BaseOutputDirectory>
|
||||
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
|
||||
<IntermediateOutputPath>$(BaseOutputDirectory)</IntermediateOutputPath>
|
||||
<OutDir>$(BaseOutputDirectory)</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Because of Webpack bundling, these are the only shipping Javascript files.
|
||||
There are no third-party files to sign because they've all been bundled. -->
|
||||
<FilesToSign Include="$(OutDir)\dist\src\main.js;$(OutDir)\dist\ui\settings.js">
|
||||
<Authenticode>Microsoft400</Authenticode>
|
||||
</FilesToSign>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<BaseOutputDirectory>$(BUILD_STAGINGDIRECTORY)</BaseOutputDirectory>
|
||||
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
|
||||
<IntermediateOutputPath>$(BaseOutputDirectory)</IntermediateOutputPath>
|
||||
<OutDir>$(BaseOutputDirectory)</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToSign Include="$(OutDir)\vsix\cpptools-*.signature.p7s">
|
||||
<Authenticode>VSCodePublisher</Authenticode>
|
||||
</FilesToSign>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.VisualStudioEng.MicroBuild.Core" version="0.4.1" developmentDependency="true" />
|
||||
</packages>
|
||||
@@ -0,0 +1,8 @@
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence,
|
||||
# @microsoft/cpptools-maintainers will be requested for
|
||||
# review when someone opens a pull request.
|
||||
|
||||
* @microsoft/cpptools-maintainers
|
||||
+2
-1
@@ -6,4 +6,5 @@ Resources:
|
||||
|
||||
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
||||
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
||||
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
|
||||
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
|
||||
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)
|
||||
+22
-1
@@ -5,7 +5,7 @@
|
||||
* [Build and debug the extension](Documentation/Building%20the%20Extension.md).
|
||||
* File an [issue](https://github.com/Microsoft/vscode-cpptools/issues) and a [pull request](https://github.com/Microsoft/vscode-cpptools/pulls) with the change and we will review it.
|
||||
* If the change affects functionality, add a line describing the change to [**CHANGELOG.md**](Extension/CHANGELOG.md).
|
||||
* Try and add a test in [**test/extension.test.ts**](Extension/test/unitTests/extension.test.ts).
|
||||
* Try and add a test in [**test/extension.test.ts**](Extension/test/scenarios/SingleRootProject/tests/extension.test.ts).
|
||||
* Run tests via opening the [**Extension**](https://github.com/Microsoft/vscode-cpptools/tree/main/Extension) folder in Visual Studio Code, selecting the "Launch Tests" configuration in the Debug pane, and choosing "Start Debugging".
|
||||
|
||||
## About the Code
|
||||
@@ -33,3 +33,24 @@ const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
const readmeMessage: string = localize("refer.read.me", "Please refer to {0} for troubleshooting information. Issues can be created at {1}", readmePath, "https://github.com/Microsoft/vscode-cpptools/issues");
|
||||
```
|
||||
* The first parameter to localize should be a unique key for that string, not used by any other call to localize() in the file unless representing the same string. The second parameter is the string to localize. Both of these parameters must be string literals. Tokens such as {0} and {1} are supported in the localizable string, with replacement values passed as additional parameters to localize().
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to
|
||||
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
|
||||
and actually do, grant us the rights to use your contribution. For details, visit
|
||||
https://cla.microsoft.com.
|
||||
|
||||
When you submit a pull request, a CLA-bot will automatically determine whether you need
|
||||
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
|
||||
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
||||
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
|
||||
|
||||
### Adding/Updating package.json dependencies
|
||||
|
||||
We maintain a public Azure Artifacts feed that we point the package manager to in .npmrc files. If you want to add a dependency or update a version in package.json, you may need to contact us so we can add it to our feed. Please ping our team in a PR or new issue if you experience this issue.
|
||||
|
||||
For local development, you can delete the .npmrc file and the matching `yarn.lock` file while you wait for us to update the feed. However, these changes will need to be reverted in your branch before we will accept a PR.
|
||||
@@ -1 +1 @@
|
||||
The documentation for c_cpp_properties.json has moved to https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference.
|
||||
The documentation for c_cpp_properties.json has moved to https://code.visualstudio.com/docs/cpp/customize-cpp-settings.
|
||||
@@ -1,4 +1,4 @@
|
||||
*.js
|
||||
test/**/index.ts
|
||||
test/**/runTest.ts
|
||||
tools/prepublish.js
|
||||
|
||||
dist/
|
||||
vscode*.d.ts
|
||||
|
||||
+51
-51
@@ -1,4 +1,9 @@
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/strict",
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
@@ -6,19 +11,22 @@ module.exports = {
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "tsconfig.json",
|
||||
"sourceType": "module"
|
||||
"project": ["tsconfig.json", ".scripts/tsconfig.json"],
|
||||
"ecmaVersion": 2022,
|
||||
"sourceType": "module",
|
||||
"warnOnUnsupportedTypeScriptVersion": false,
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"@typescript-eslint/tslint",
|
||||
"eslint-plugin-jsdoc",
|
||||
"@typescript-eslint/eslint-plugin-tslint",
|
||||
"@typescript-eslint/eslint-plugin",
|
||||
"eslint-plugin-import",
|
||||
"eslint-plugin-header"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/adjacent-overload-signatures": "error",
|
||||
"@typescript-eslint/array-type": "error",
|
||||
"@typescript-eslint/await-thenable": "error",
|
||||
"camelcase": "off",
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"error",
|
||||
@@ -27,7 +35,6 @@ module.exports = {
|
||||
"format": ["PascalCase"]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/indent": "error",
|
||||
"@typescript-eslint/member-delimiter-style": [
|
||||
"error",
|
||||
{
|
||||
@@ -41,8 +48,20 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extraneous-class": "off",
|
||||
"no-case-declarations": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-floating-decimal": "error",
|
||||
"keyword-spacing": ["error", { "before": true, "overrides": { "this": { "before": false } } }],
|
||||
"arrow-spacing": ["error", { "before": true, "after": true }],
|
||||
"semi-spacing": ["error", { "before": false, "after": true }],
|
||||
"no-extra-parens": ["error", "all", { "nestedBinaryExpressions": false, "ternaryOperandBinaryExpressions": false }],
|
||||
"@typescript-eslint/no-array-constructor": "error",
|
||||
"@typescript-eslint/no-useless-constructor": "error",
|
||||
"@typescript-eslint/no-for-in-array": "error",
|
||||
"@typescript-eslint/no-misused-new": "error",
|
||||
"@typescript-eslint/no-misused-promises": "error",
|
||||
"@typescript-eslint/no-namespace": "error",
|
||||
"@typescript-eslint/no-non-null-assertion": "error",
|
||||
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
||||
@@ -56,8 +75,16 @@ module.exports = {
|
||||
"@typescript-eslint/triple-slash-reference": "error",
|
||||
"@typescript-eslint/type-annotation-spacing": "error",
|
||||
"@typescript-eslint/unified-signatures": "error",
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/method-signature-style": ["error", "method"],
|
||||
"@typescript-eslint/space-infix-ops": "error",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
||||
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
||||
"arrow-body-style": "error",
|
||||
"comma-dangle": "error",
|
||||
"comma-spacing": "off",
|
||||
"@typescript-eslint/comma-spacing": "error",
|
||||
"constructor-super": "error",
|
||||
"curly": "error",
|
||||
"eol-last": "error",
|
||||
@@ -79,17 +106,19 @@ module.exports = {
|
||||
"no-fallthrough": "error",
|
||||
"no-invalid-this": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"rest-spread-spacing": ["error", "never"],
|
||||
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1, "maxBOF": 0 }],
|
||||
"no-new-wrappers": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-return-await": "error",
|
||||
"no-sequences": "error",
|
||||
"no-sparse-arrays": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"no-multi-spaces": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-unused-labels": "error",
|
||||
"space-before-blocks": "error",
|
||||
"no-var": "error",
|
||||
"one-var": [
|
||||
"error",
|
||||
@@ -102,54 +131,25 @@ module.exports = {
|
||||
"never"
|
||||
],
|
||||
"spaced-comment": [
|
||||
"error",
|
||||
"always"
|
||||
"off",
|
||||
"always",
|
||||
{ "line": { "exceptions": ["/"] } } // triple slash directives
|
||||
],
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "error",
|
||||
"yoda": "error",
|
||||
"@typescript-eslint/tslint/config": [
|
||||
"error",
|
||||
{
|
||||
"rules": {
|
||||
"encoding": true,
|
||||
"file-header": [
|
||||
true,
|
||||
".*"
|
||||
],
|
||||
"import-spacing": true,
|
||||
"match-default-export-name": true,
|
||||
"no-boolean-literal-compare": true,
|
||||
"no-mergeable-namespace": true,
|
||||
"no-reference-import": true,
|
||||
"no-unnecessary-callback-wrapper": true,
|
||||
"number-literal-format": true,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-catch",
|
||||
"check-finally",
|
||||
"check-else",
|
||||
"check-open-brace",
|
||||
"check-whitespace"
|
||||
],
|
||||
"prefer-method-signature": true,
|
||||
"prefer-while": true,
|
||||
"typedef": [
|
||||
true,
|
||||
"variable-declaration",
|
||||
"call-signature",
|
||||
"variable-declaration-ignore-function"
|
||||
],
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-preblock",
|
||||
"check-type"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
"space-infix-ops": "error",
|
||||
"header/header": [
|
||||
"warn",
|
||||
"block",
|
||||
[
|
||||
" --------------------------------------------------------------------------------------------",
|
||||
" * Copyright (c) Microsoft Corporation. All Rights Reserved.",
|
||||
" * See 'LICENSE' in the project root for license information.",
|
||||
" * ------------------------------------------------------------------------------------------ "
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# ignore dependency packages
|
||||
node_modules
|
||||
|
||||
# ignore compliled typescript
|
||||
# ignore compiled typescript
|
||||
out
|
||||
dist
|
||||
|
||||
@@ -10,6 +10,7 @@ server
|
||||
debugAdapters
|
||||
LLVM
|
||||
bin/cpptools*
|
||||
bin/libc.so
|
||||
bin/*.dll
|
||||
bin/.vs
|
||||
bin/LICENSE.txt
|
||||
@@ -34,3 +35,4 @@ localized_string_ids.h
|
||||
src/nativeStrings.ts
|
||||
|
||||
vscode*.d.ts
|
||||
.scripts/_*
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
|
||||
always-auth=true
|
||||
@@ -0,0 +1,64 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { error } from 'node:console';
|
||||
import { resolve, sep } from 'node:path';
|
||||
import { filepath } from '../src/Utility/Filesystem/filepath';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { $root, Git, brightGreen, cyan, getModifiedIgnoredFiles, rimraf } from './common';
|
||||
|
||||
// notes:
|
||||
// list all gitignore'd files that are modified: `git clean -Xd -n`
|
||||
// list all untracked and ignored files that are modified/created: `git clean -Xd -n`
|
||||
|
||||
export async function main() {
|
||||
await rimraf(resolve($root, 'dist'));
|
||||
}
|
||||
|
||||
export async function all() {
|
||||
await rimraf(...(await getModifiedIgnoredFiles()).filter(each => !each.includes('node_modules')));
|
||||
}
|
||||
|
||||
export async function reset() {
|
||||
verbose(`Resetting all .gitignored files in extension`);
|
||||
await rimraf(...await getModifiedIgnoredFiles());
|
||||
}
|
||||
|
||||
async function details(files: string[]) {
|
||||
let all = await Promise.all(files.filter(each => each).map(async (each) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [filename, stats ] = await filepath.stats(each);
|
||||
return {
|
||||
filename: stats.isDirectory() ? cyan(`${each}${sep}**`) : brightGreen(`${each}`),
|
||||
date: stats.mtime.toLocaleDateString().replace(/\b(\d)\//g, '0$1\/'),
|
||||
time: stats.mtime.toLocaleTimeString().replace(/^(\d)\:/g, '0$1:'),
|
||||
modified: stats.mtime
|
||||
};
|
||||
}));
|
||||
all = all.sort((a, b) => a.modified.getTime() - b.modified.getTime());
|
||||
// print a formatted table so the date and time are aligned
|
||||
const max = all.reduce((max, each) => Math.max(max, each.filename.length), 0);
|
||||
all.forEach(each => console.log(` ${each.filename.padEnd(max)} [${each.date} ${each.time}]`));
|
||||
console.log('');
|
||||
}
|
||||
|
||||
export async function show(opt?: string) {
|
||||
switch (opt?.toLowerCase()) {
|
||||
case 'new':
|
||||
console.log(cyan('\n\nNew files:'));
|
||||
const r = await Git('ls-files', '--others', '--exclude-standard', '-z');
|
||||
return details(r.stdio.all().map(each => resolve(each.trim().replace(/\0/g, ''))));
|
||||
|
||||
case undefined:
|
||||
case '':
|
||||
case 'ignored':
|
||||
case 'untracked':
|
||||
console.log(cyan('\n\nUntracked+Ignored files:'));
|
||||
return details(await getModifiedIgnoredFiles());
|
||||
|
||||
default:
|
||||
return error(`Unknown option '${opt}'`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { spawnSync } from 'child_process';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { $args, $root, $scenario, assertAnyFile, brightGreen, gray, green, pwd } from './common';
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { getTestInfo } from '../test/common/selectTests';
|
||||
import { install, options } from "./vscode";
|
||||
|
||||
export { install, reset } from './vscode';
|
||||
|
||||
export async function main() {
|
||||
let ti = await getTestInfo($scenario);
|
||||
if (!ti) {
|
||||
// try using the first arg as a scenario name or location
|
||||
ti = await getTestInfo($args[0], $args[0] ? resolve(pwd, $args[0]) : undefined);
|
||||
if (ti) {
|
||||
$args[0] = ti.workspace;
|
||||
}
|
||||
} else {
|
||||
// we found it
|
||||
$args.unshift(ti.workspace);
|
||||
}
|
||||
await assertAnyFile('dist/src/main.js', `The extension entry point '${$root}/dist/src/main.js is missing. You should run ${brightGreen("yarn compile")}\n\n`);
|
||||
|
||||
const { cli, args } = await install();
|
||||
|
||||
// example of installing an extension into code
|
||||
//verbose(`Installing release version of 'ms-vscode.cpptools'`);
|
||||
//spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cpptools'], { encoding: 'utf-8', stdio: 'ignore' })
|
||||
verbose(green('Launch VSCode'));
|
||||
const ARGS = [...args, ...options.launchArgs.filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir=')), `--extensionDevelopmentPath=${$root}`, ...$args ].map(each => (each.indexOf(' ') > -1) && (each.indexOf('"') === -1) ? `"${each}"` : each);
|
||||
const CLI = cli.indexOf(' ') > -1 && cli.indexOf('"') === -1 ? `"${cli}"` : cli;
|
||||
|
||||
verbose(gray(`${CLI}\n ${ [...ARGS ].join('\n ')}`));
|
||||
|
||||
spawnSync(CLI, ARGS, { encoding: 'utf-8', stdio: 'ignore', env: { ...process.env, DONT_PROMPT_WSL_INSTALL:"1" }, shell: true });
|
||||
}
|
||||
@@ -0,0 +1,359 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { Command, CommandFunction } from '../src/Utility/Process/program';
|
||||
|
||||
import { ok } from 'assert';
|
||||
import { CommentJSONValue, parse, stringify } from 'comment-json';
|
||||
import { mkdir as md, readFile, rm, writeFile } from 'fs/promises';
|
||||
import { IOptions, glob as globSync } from 'glob';
|
||||
import { dirname, resolve } from 'path';
|
||||
import { chdir, cwd, env } from 'process';
|
||||
import { setImmediate } from 'timers/promises';
|
||||
import { promisify } from 'util';
|
||||
import { filepath } from '../src/Utility/Filesystem/filepath';
|
||||
import { is } from '../src/Utility/System/guards';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
|
||||
export const $root = resolve(`${__dirname}/..`);
|
||||
export let $cmd = 'main';
|
||||
export let $scenario = '';
|
||||
|
||||
// loop through the args and pick out --scenario=... and remove it from the $args and set $scenario
|
||||
process.argv.slice(2).filter(each => !(each.startsWith('--scenario=') && ($scenario = each.substring('--scenario='.length))));
|
||||
export const $args = process.argv.slice(2).filter(each => !each.startsWith('--'));
|
||||
export const $switches = process.argv.slice(2).filter(each => each.startsWith('--'));
|
||||
|
||||
/** enqueue the call to the callback function to happen on the next available tick, and return a promise to the result */
|
||||
export function then<T>(callback: () => Promise<T> | T): Promise<T> {
|
||||
return setImmediate().then(callback);
|
||||
}
|
||||
|
||||
export const pwd = env.INIT_CWD ?? cwd();
|
||||
verbose(yellow(`pwd: ${pwd}`));
|
||||
|
||||
// ensure we're in the extension folder.
|
||||
chdir($root);
|
||||
|
||||
// dump unhandled async errors to the console and exit.
|
||||
process.on('unhandledRejection', (reason: any, _promise) => {
|
||||
error(`${reason?.stack?.split(/\r?\n/).filter(l => !l.includes('node:internal') && !l.includes('node_modules')).join('\n')}`);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
const git = new Command('git');
|
||||
export const Git = async (...args: Parameters<Awaited<CommandFunction>>) => (await git)(...args);
|
||||
export const GitClean = async (...args: Parameters<Awaited<CommandFunction>>) => (await new Command(await git, 'clean'))(...args);
|
||||
|
||||
export async function getModifiedIgnoredFiles() {
|
||||
const { code, error, stdio } = await GitClean('-Xd', '-n');
|
||||
if (code) {
|
||||
throw new Error(`\n${error.all().join('\n')}`);
|
||||
}
|
||||
|
||||
// return the full path of files that would be removed.
|
||||
return Promise.all(stdio.filter("Would remove").map((s) => filepath.exists(s.replace(/^Would remove /, ''), $root)).filter(p => p));
|
||||
}
|
||||
|
||||
export async function rimraf(...paths: string[]) {
|
||||
const all = [];
|
||||
for (const each of paths) {
|
||||
if (!each) {
|
||||
continue;
|
||||
}
|
||||
if (await filepath.isFolder(each)) {
|
||||
verbose(`Removing folder ${red(each)}`);
|
||||
all.push(rm(each, { recursive: true, force: true }));
|
||||
continue;
|
||||
}
|
||||
verbose(`Removing file ${red(each)}`);
|
||||
all.push(rm(each, { force: true }));
|
||||
}
|
||||
await Promise.all(all);
|
||||
}
|
||||
|
||||
export async function mkdir(filePath: string) {
|
||||
const [fullPath, info] = await filepath.stats(filePath, $root);
|
||||
if (info) {
|
||||
if (info.isDirectory()) {
|
||||
return fullPath;
|
||||
}
|
||||
throw new Error(`Cannot create directory '${filePath}' because there is a file there.`);
|
||||
}
|
||||
|
||||
await md(fullPath, { recursive: true });
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
export const glob: (pattern: string, options?: IOptions) => Promise<string[]> = promisify(globSync);
|
||||
|
||||
export async function write(filePath: string, data: Buffer | string) {
|
||||
await mkdir(dirname(filePath));
|
||||
|
||||
if (await filepath.isFile(filePath)) {
|
||||
const content = await readFile(filePath);
|
||||
if (is.string(data)) {
|
||||
// if we're passed a text file, we should match the line endings of the existing file.
|
||||
const textContent = content.toString();
|
||||
|
||||
// normalize the line endings to the same as the current file.
|
||||
data = textContent.indexOf('\r\n') > -1 ? data.replace(/\r\n|\n/g, '\r\n') : data.replace(/\r\n|\n/g, '\n');
|
||||
|
||||
// if the text content is a match, we don't have to change anything
|
||||
if (textContent === data) {
|
||||
verbose(`Text file at '${filePath}' is up to date.`);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// if the binary content is a match, we don't have to change anything
|
||||
if (content.equals(data)) {
|
||||
verbose(`File at '${filePath}' is up to date.`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
verbose(`Writing file '${filePath}'`);
|
||||
await writeFile(filePath, data);
|
||||
}
|
||||
|
||||
export async function updateFiles(files: string[], dest: string | Promise<string>) {
|
||||
const target = is.promise(dest) ? await dest : dest;
|
||||
await Promise.all(files.map(async (each) => {
|
||||
const sourceFile = await filepath.isFile(each, $root);
|
||||
if (sourceFile) {
|
||||
const targetFile = resolve(target, each);
|
||||
await write(targetFile, await readFile(sourceFile));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
export async function go() {
|
||||
if (require.main) {
|
||||
// loop through the args and pick out the first non --arg and remove it from the $args and set $cmd
|
||||
for (let i = 0; i < $args.length; i++) {
|
||||
const each = $args[i];
|
||||
if (!each.startsWith('--') && require.main.exports[each]) {
|
||||
$cmd = each;
|
||||
$args.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
verbose(`${yellow("Running task:")} ${green($cmd)} ${green($args.join(' '))}`);
|
||||
require.main.exports[$cmd](...$args);
|
||||
}
|
||||
}
|
||||
void then(go);
|
||||
|
||||
export async function read(filename: string) {
|
||||
const content = await readFile(filename);
|
||||
ok(content, `File '${filename}' has no content`);
|
||||
return content.toString();
|
||||
}
|
||||
|
||||
export async function readJson(filename: string, fallback = {}): Promise<CommentJSONValue> {
|
||||
try {
|
||||
return parse(await read(filename));
|
||||
} catch {
|
||||
return fallback as CommentJSONValue;
|
||||
}
|
||||
}
|
||||
|
||||
export async function writeJson(filename: string, object: CommentJSONValue) {
|
||||
await write(filename, stringify(object, null, 4));
|
||||
}
|
||||
|
||||
export function error(text: string) {
|
||||
console.error(`\n${red('ERROR')}: ${text}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
export function warn(text: string) {
|
||||
console.error(`\n${yellow('WARNING')}: ${text}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
export function note(text: string) {
|
||||
console.error(`\n${cyan('NOTE')}: ${text}`);
|
||||
}
|
||||
|
||||
export function underline(text: string) {
|
||||
return `\u001b[4m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function bold(text: string) {
|
||||
return `\u001b[1m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function dim(text: string) {
|
||||
return `\u001b[2m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function brightGreen(text: string) {
|
||||
return `\u001b[38;2;19;161;14m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function green(text: string) {
|
||||
return `\u001b[38;2;78;154;6m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function brightWhite(text: string) {
|
||||
return `\u001b[38;2;238;238;236m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function gray(text: string) {
|
||||
return `\u001b[38;2;117;113;94m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function yellow(text: string) {
|
||||
return `\u001b[38;2;252;233;79m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function red(text: string) {
|
||||
return `\u001b[38;2;197;15;31m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export function cyan(text: string) {
|
||||
return `\u001b[38;2;0;174;239m${text}\u001b[0m`;
|
||||
}
|
||||
|
||||
export const hr = "===============================================================================";
|
||||
|
||||
export function heading(text: string, level = 1) {
|
||||
switch (level) {
|
||||
case 1:
|
||||
return `${underline(bold(text))}`;
|
||||
case 2:
|
||||
return `${brightGreen(text)}`;
|
||||
case 3:
|
||||
return `${green(text)}`;
|
||||
}
|
||||
return `${bold(text)}\n`;
|
||||
}
|
||||
|
||||
export function optional(text: string) {
|
||||
return gray(text);
|
||||
}
|
||||
|
||||
export function cmdSwitch(text: string) {
|
||||
return optional(`--${text}`);
|
||||
}
|
||||
|
||||
export function command(text: string) {
|
||||
return brightWhite(bold(text));
|
||||
}
|
||||
|
||||
export function hint(text: string) {
|
||||
return green(dim(text));
|
||||
}
|
||||
|
||||
export function count(num: number) {
|
||||
return gray(`${num}`);
|
||||
}
|
||||
|
||||
export function position(text: string) {
|
||||
return gray(`${text}`);
|
||||
}
|
||||
|
||||
export async function assertAnyFolder(oneOrMoreFolders: string | string[], errorMessage?: string): Promise<string> {
|
||||
oneOrMoreFolders = is.array(oneOrMoreFolders) ? oneOrMoreFolders : [oneOrMoreFolders];
|
||||
for (const each of oneOrMoreFolders) {
|
||||
const result = await filepath.isFolder(each, $root);
|
||||
if (result) {
|
||||
verbose(`Folder ${brightGreen(each)} exists.`);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (errorMessage) {
|
||||
if (!$switches.includes('--quiet')) {
|
||||
error(errorMessage);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export async function assertAnyFile(oneOrMoreFiles: string | string[], errorMessage?: string): Promise<string> {
|
||||
oneOrMoreFiles = is.array(oneOrMoreFiles) ? oneOrMoreFiles : [oneOrMoreFiles];
|
||||
for (const each of oneOrMoreFiles) {
|
||||
const result = await filepath.isFile(each, $root);
|
||||
if (result) {
|
||||
verbose(`Folder ${brightGreen(each)} exists.`);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (errorMessage) {
|
||||
if (!$switches.includes('--quiet')) {
|
||||
error(errorMessage);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const quiet = process.argv.includes('--quiet');
|
||||
|
||||
export async function checkPrep() {
|
||||
let failing = false;
|
||||
|
||||
failing = !await assertAnyFolder('dist/test') && (quiet || warn(`The compiled test files are not in place.`)) || failing;
|
||||
failing = !await assertAnyFolder('dist/walkthrough') && (quiet || warn(`The walkthrough files are not in place.`)) || failing;
|
||||
failing = !await assertAnyFolder('dist/html') && (quiet || warn(`The html files are not in place.`)) || failing;
|
||||
failing = !await assertAnyFolder('dist/schema') && (quiet || warn(`The schema files are not in place.`)) || failing;
|
||||
failing = !await assertAnyFile('dist/nls.metadata.json') && (quiet || warn(`The extension translation file '${$root}/dist/nls.metadata.json is missing.`)) || failing;
|
||||
failing = await checkDTS() || failing;
|
||||
|
||||
if (!failing) {
|
||||
verbose('Prep files appear to be in place.');
|
||||
}
|
||||
return failing;
|
||||
}
|
||||
|
||||
export async function checkCompiled() {
|
||||
let failing = false;
|
||||
failing = await checkDTS() || failing;
|
||||
failing = !await assertAnyFile('dist/src/main.js') && (quiet || warn(`The extension entry point '${$root}/dist/src/main.js is missing.`)) || failing;
|
||||
|
||||
if (!failing) {
|
||||
verbose('Compiled files appear to be in place.');
|
||||
}
|
||||
return failing;
|
||||
}
|
||||
|
||||
export async function checkDTS() {
|
||||
let failing = false;
|
||||
failing = !await assertAnyFile('vscode.d.ts') && (quiet || warn(`The VSCode import file '${$root}/dist/src/vscode.d.ts is missing.`)) || failing;
|
||||
failing = !await assertAnyFile('vscode.proposed.terminalDataWriteEvent.d.ts') && (quiet || warn(`The VSCode import file '${$root}/dist/src/vscode.proposed.terminalDataWriteEvent.d.ts is missing.`)) || failing;
|
||||
failing = !await assertAnyFile('vscode.proposed.lmTools.d.ts') && (quiet || warn(`The VSCode import file '${$root}/dist/src/vscode.proposed.lmTools.d.ts is missing.`)) || failing;
|
||||
|
||||
if (!failing) {
|
||||
verbose('VSCode d.ts files appear to be in place.');
|
||||
}
|
||||
return failing;
|
||||
}
|
||||
|
||||
export async function checkBinaries() {
|
||||
if ($switches.includes('--skipCheckBinaries')) {
|
||||
return false;
|
||||
}
|
||||
let failing = false;
|
||||
failing = !await assertAnyFile(['bin/cpptools.exe', 'bin/cpptools']) && (quiet || warn(`The native binary files are not present. You should either build or install the native binaries\n\n.`)) || failing;
|
||||
|
||||
if (!failing) {
|
||||
verbose('Native binary files appear to be in place.');
|
||||
}
|
||||
return failing;
|
||||
}
|
||||
|
||||
export async function checkProposals() {
|
||||
let failing = false;
|
||||
|
||||
await rm(`${$root}/vscode.proposed.chatParticipantAdditions.d.ts`);
|
||||
failing = await assertAnyFile('vscode.proposed.chatParticipantAdditions.d.ts') && (quiet || warn(`The VSCode import file '${$root}/vscode.proposed.chatParticipantAdditions.d.ts' should not be present.`)) || failing;
|
||||
|
||||
if (!failing) {
|
||||
verbose('VSCode proposals appear to be in place.');
|
||||
}
|
||||
return failing;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { watch as watchFiles } from 'fs/promises';
|
||||
import { filepath } from '../src/Utility/Filesystem/filepath';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { $root, glob, mkdir, updateFiles } from './common';
|
||||
|
||||
export async function main() {
|
||||
verbose(`Copying walkthrough media to extension/dist folder`);
|
||||
await updateFiles(await glob('walkthrough/images/**/*'), mkdir('dist'));
|
||||
}
|
||||
|
||||
export async function watch() {
|
||||
const source = await filepath.isFolder('walkthrough/images', $root);
|
||||
if (source) {
|
||||
verbose(`Watching ${source} folder for changes.`);
|
||||
console.log('Press Ctrl+C to exit.');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
for await (const event of watchFiles(source, {recursive: true })) {
|
||||
await main();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { parse } from 'comment-json';
|
||||
import { resolve } from 'path';
|
||||
import { read, write } from './common';
|
||||
|
||||
// ****************************
|
||||
// Command: generate-native-strings
|
||||
// The following is used to generate nativeStrings.ts and localized_string_ids.h from ./src/nativeStrings.json
|
||||
// If adding localized strings to the native side, start by adding it to nativeStrings.json and use this to generate the others.
|
||||
// ****************************
|
||||
export async function main() {
|
||||
const $root = resolve(`${__dirname}/..`);
|
||||
const stringTable = parse(await read(`${$root}/src/nativeStrings.json`)) as any;
|
||||
|
||||
let nativeEnumContent = "";
|
||||
let nativeStringTableContent = "";
|
||||
let typeScriptSwitchContent = "";
|
||||
|
||||
let stringIndex = 1;
|
||||
for (const property in stringTable) {
|
||||
let stringValue = stringTable[property];
|
||||
let hintValue;
|
||||
if (typeof stringValue !== "string") {
|
||||
hintValue = stringValue.hint;
|
||||
stringValue = stringValue.text;
|
||||
}
|
||||
|
||||
// Add to native enum
|
||||
nativeEnumContent += ` ${property} = ${stringIndex},\n`;
|
||||
|
||||
// Add to native string table
|
||||
nativeStringTableContent += ` ${JSON.stringify(stringValue)},\n`;
|
||||
|
||||
// Add to TypeScript switch
|
||||
// Skip empty strings, which can be used to prevent enum/index reordering
|
||||
if (stringValue !== "") {
|
||||
// It's possible that a translation may skip "{#}" entries, so check for up to 50 of them.
|
||||
let numArgs = 0;
|
||||
for (let i = 0; i < 50; i++) {
|
||||
if (stringValue.includes(`{${i}}`)) {
|
||||
numArgs = i + 1;
|
||||
}
|
||||
}
|
||||
typeScriptSwitchContent += ` case ${stringIndex}:\n`;
|
||||
if (numArgs !== 0) {
|
||||
typeScriptSwitchContent += ` if (stringArgs) {\n`;
|
||||
if (hintValue) {
|
||||
typeScriptSwitchContent += ` message = localize({ key: ${JSON.stringify(property)}, comment: [${JSON.stringify(hintValue)}] }, ${JSON.stringify(stringValue)}`;
|
||||
} else {
|
||||
typeScriptSwitchContent += ` message = localize(${JSON.stringify(property)}, ${JSON.stringify(stringValue)}`;
|
||||
}
|
||||
for (let i = 0; i < numArgs; i++) {
|
||||
typeScriptSwitchContent += `, stringArgs[${i}]`;
|
||||
}
|
||||
typeScriptSwitchContent += `);\n break;\n }\n`;
|
||||
}
|
||||
if (hintValue) {
|
||||
typeScriptSwitchContent += ` message = localize({ key: ${JSON.stringify(property)}, comment: [${JSON.stringify(hintValue)}] }, ${JSON.stringify(stringValue)}`;
|
||||
} else {
|
||||
typeScriptSwitchContent += ` message = localize(${JSON.stringify(property)}, ${JSON.stringify(stringValue)}`;
|
||||
}
|
||||
typeScriptSwitchContent += `);\n break;\n`;
|
||||
}
|
||||
++stringIndex;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
// Generate the TypeScript file
|
||||
// --------------------------------------------------------------------------------------------
|
||||
|
||||
const typeScriptContent = `/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
// ****** This file is generated from nativeStrings.json. Do not edit this file directly. ******
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
export const localizedStringCount: number = ${stringIndex};
|
||||
|
||||
export function lookupString(stringId: number, stringArgs?: string[]): string {
|
||||
let message: string = "";
|
||||
switch (stringId) {
|
||||
case 0:
|
||||
// Special case for blank string
|
||||
break;
|
||||
${typeScriptSwitchContent}
|
||||
default:
|
||||
console.assert(\"Unrecognized string ID\");
|
||||
break;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
`;
|
||||
|
||||
// If the file isn't there, or the contents are different, write it out
|
||||
await write(`${$root}/src/nativeStrings.ts`, typeScriptContent);
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
// Generate the native string header file
|
||||
// --------------------------------------------------------------------------------------------
|
||||
const nativeContents = `/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
// ****** This file is generated from nativeStrings.json. Do not edit this file directly. ******
|
||||
|
||||
#pragma once
|
||||
// NOLINTBEGIN(modernize-raw-string-literal)
|
||||
enum class localized_string_id : unsigned int
|
||||
{
|
||||
blank = 0,
|
||||
${nativeEnumContent}};
|
||||
|
||||
inline static const char *localizable_strings[] = {
|
||||
"",
|
||||
${nativeStringTableContent}};
|
||||
// NOLINTEND(modernize-raw-string-literal)
|
||||
`;
|
||||
|
||||
// If the file isn't there, or the contents are different, write it out
|
||||
await write(`${$root}/localized_string_ids.h`, nativeContents);
|
||||
}
|
||||
+15
-18
@@ -1,10 +1,12 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
/* eslint-disable no-prototype-builtins */
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { $root, read, write } from './common';
|
||||
|
||||
function appendFieldsToObject(reference: any, obj: any): any {
|
||||
// Make sure it is an object type
|
||||
@@ -54,7 +56,7 @@ function updateDefaults(object: any, defaults: any): any {
|
||||
|
||||
function refReplace(definitions: any, ref: any): any {
|
||||
// $ref is formatted as "#/definitions/ObjectName"
|
||||
const referenceStringArray: string[] = ref['$ref'].split('/');
|
||||
const referenceStringArray: string[] = ref.$ref.split('/');
|
||||
|
||||
// Getting "ObjectName"
|
||||
const referenceName: string = referenceStringArray[referenceStringArray.length - 1];
|
||||
@@ -69,7 +71,7 @@ function refReplace(definitions: any, ref: any): any {
|
||||
ref = appendFieldsToObject(reference, ref);
|
||||
|
||||
// Remove $ref field
|
||||
delete ref['$ref'];
|
||||
delete ref.$ref;
|
||||
|
||||
return ref;
|
||||
}
|
||||
@@ -114,10 +116,10 @@ function mergeReferences(baseDefinitions: any, additionalDefinitions: any): void
|
||||
}
|
||||
}
|
||||
|
||||
function generateOptionsSchema(): void {
|
||||
const packageJSON: any = JSON.parse(fs.readFileSync('package.json').toString());
|
||||
const schemaJSON: any = JSON.parse(fs.readFileSync('tools/OptionsSchema.json').toString());
|
||||
const symbolSettingsJSON: any = JSON.parse(fs.readFileSync('tools/VSSymbolSettings.json').toString());
|
||||
export async function main() {
|
||||
const packageJSON: any = JSON.parse(await read(resolve($root, 'package.json')));
|
||||
const schemaJSON: any = JSON.parse(await read(resolve($root, 'tools/OptionsSchema.json')));
|
||||
const symbolSettingsJSON: any = JSON.parse(await read(resolve($root, 'tools/VSSymbolSettings.json')));
|
||||
|
||||
mergeReferences(schemaJSON.definitions, symbolSettingsJSON.definitions);
|
||||
|
||||
@@ -132,16 +134,11 @@ function generateOptionsSchema(): void {
|
||||
packageJSON.contributes.debuggers[1].configurationAttributes.launch = schemaJSON.definitions.CppvsdbgLaunchOptions;
|
||||
packageJSON.contributes.debuggers[1].configurationAttributes.attach = schemaJSON.definitions.CppvsdbgAttachOptions;
|
||||
|
||||
let content: string = JSON.stringify(packageJSON, null, 2);
|
||||
if (os.platform() === 'win32') {
|
||||
content = content.replace(/\n/gm, "\r\n");
|
||||
}
|
||||
let content: string = JSON.stringify(packageJSON, null, 4);
|
||||
|
||||
// We use '\u200b' (unicode zero-length space character) to break VS Code's URL detection regex for URLs that are examples. This process will
|
||||
// convert that from the readable espace sequence, to just an invisible character. Convert it back to the visible espace sequence.
|
||||
content = content.replace(/\u200b/gm, "\\u200b");
|
||||
content = content.replace(/\u200b/gm, "\\u200b") + "\n";
|
||||
|
||||
fs.writeFileSync('package.json', content);
|
||||
await write('package.json', content);
|
||||
}
|
||||
|
||||
generateOptionsSchema();
|
||||
@@ -0,0 +1,95 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
import * as fs from "fs";
|
||||
import * as path from 'path';
|
||||
import { parseString } from 'xml2js';
|
||||
import { mkdir, write } from './common';
|
||||
|
||||
export async function main() {
|
||||
|
||||
const localizeRepoPath = process.argv[2];
|
||||
const cpptoolsRepoPath = process.argv[3];
|
||||
|
||||
if (!localizeRepoPath || !cpptoolsRepoPath) {
|
||||
console.error(`ERROR: Usage: ${path.parse(process.argv[0]).base} ${path.parse(process.argv[1]).base} <Localize repo path> <vscode-cpptools repo path>`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("Importing EDGE strings from Localize repo: " + localizeRepoPath);
|
||||
console.log("Writing to cpptools repo: " + cpptoolsRepoPath);
|
||||
|
||||
if (!fs.existsSync(path.join(localizeRepoPath, ".git"))) {
|
||||
console.error("ERROR: Localize repo submodule is not initialized in Localize repo");
|
||||
return;
|
||||
}
|
||||
|
||||
const languages = [
|
||||
{ id: "zh-tw", folderName: "cht", transifexId: "zh-hant" },
|
||||
{ id: "zh-cn", folderName: "chs", transifexId: "zh-hans" },
|
||||
{ id: "fr", folderName: "fra" },
|
||||
{ id: "de", folderName: "deu" },
|
||||
{ id: "it", folderName: "ita" },
|
||||
{ id: "es", folderName: "esn" },
|
||||
{ id: "ja", folderName: "jpn" },
|
||||
{ id: "ko", folderName: "kor" },
|
||||
{ id: "ru", folderName: "rus" },
|
||||
{ id: "bg", folderName: "bul" }, // VS Code supports Bulgarian, but VS is not currently localized for those languages.
|
||||
{ id: "hu", folderName: "hun" }, // VS Code supports Hungarian, but VS is not currently localized for those languages.
|
||||
{ id: "pt-br", folderName: "ptb", transifexId: "pt-BR" },
|
||||
{ id: "tr", folderName: "trk" },
|
||||
{ id: "cs", folderName: "csy" },
|
||||
{ id: "pl", folderName: "plk" }
|
||||
];
|
||||
|
||||
const locFolderNames = fs.readdirSync(localizeRepoPath).filter(f => fs.lstatSync(path.join(localizeRepoPath, f)).isDirectory());
|
||||
for (const locFolderName of locFolderNames) {
|
||||
const lclPath = path.join(localizeRepoPath, locFolderName, "vc/vc/cpfeui.dll.lcl");
|
||||
const languageInfo = languages.find(l => l.folderName === locFolderName);
|
||||
if (!languageInfo) {
|
||||
return;
|
||||
}
|
||||
const languageId = languageInfo.id;
|
||||
const outputLanguageFolder = path.join(cpptoolsRepoPath, "Extension/bin/messages", languageId);
|
||||
const outputPath = path.join(outputLanguageFolder, "messages.json");
|
||||
const sourceContent = fs.readFileSync(lclPath, 'utf-8');
|
||||
|
||||
// Scan once, just to determine how many there are the size of the array we need
|
||||
let highestValue = 0;
|
||||
parseString(sourceContent, function (err, result) {
|
||||
result.LCX.Item.forEach((item) => {
|
||||
if (item.$.ItemId === ";String Table") {
|
||||
item.Item.forEach((subItem) => {
|
||||
const itemId = parseInt(subItem.$.ItemId, 10);
|
||||
if (subItem.Str[0].Tgt) {
|
||||
if (highestValue < itemId) {
|
||||
highestValue = itemId;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const resultArray = new Array(highestValue);
|
||||
parseString(sourceContent, function (err, result) {
|
||||
result.LCX.Item.forEach((item) => {
|
||||
if (item.$.ItemId === ";String Table") {
|
||||
item.Item.forEach((subItem) => {
|
||||
const itemId = parseInt(subItem.$.ItemId, 10);
|
||||
if (subItem.Str[0].Tgt) {
|
||||
resultArray[itemId] = subItem.Str[0].Tgt[0].Val[0].replace(/\]5D;/g, "]");
|
||||
if (highestValue < itemId) {
|
||||
highestValue = itemId;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
await mkdir(outputLanguageFolder);
|
||||
await write(outputPath, JSON.stringify(resultArray, null, 4) + "\n");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { gray, green, readJson } from './common';
|
||||
|
||||
export async function main() {
|
||||
const pkg = await readJson('package.json') as Record<string, any>;
|
||||
if (pkg.scripts) {
|
||||
console.log(green('\n\nAvailable script commands:\n'));
|
||||
for (const key of Object.keys(pkg.scripts)) {
|
||||
console.log(green(`yarn ${key} - ${gray(pkg.scripts[key])}`));
|
||||
}
|
||||
console.log('');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { runTests } from '@vscode/test-electron';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { CommentArray, CommentObject } from 'comment-json';
|
||||
import { readdir } from 'fs/promises';
|
||||
import { resolve } from 'path';
|
||||
import { env } from 'process';
|
||||
import { returns } from '../src/Utility/Async/returns';
|
||||
import { filepath } from '../src/Utility/Filesystem/filepath';
|
||||
import { is } from '../src/Utility/System/guards';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { getTestInfo } from '../test/common/selectTests';
|
||||
import { $args, $root, $scenario, assertAnyFile, assertAnyFolder, brightGreen, checkBinaries, cmdSwitch, cyan, error, gray, green, readJson, red, writeJson } from './common';
|
||||
import { install, isolated, options } from './vscode';
|
||||
|
||||
export { install, reset } from './vscode';
|
||||
|
||||
const sowrite = process.stdout.write.bind(process.stdout) as (...args: unknown[]) => boolean;
|
||||
const sewrite = process.stderr.write.bind(process.stderr) as (...args: unknown[]) => boolean;
|
||||
|
||||
const filters = [
|
||||
/^\[(.*)\].*/,
|
||||
/^Unexpected token A/,
|
||||
/Cannot register 'cmake.cmakePath'/,
|
||||
/\[DEP0005\] DeprecationWarning/,
|
||||
/--trace-deprecation/,
|
||||
/Iconv-lite warning/,
|
||||
/^Extension '/,
|
||||
/^Found existing install/
|
||||
];
|
||||
|
||||
// remove unwanted messages from stdio
|
||||
function filterStdio() {
|
||||
process.stdout.write = function (...args: unknown[]) {
|
||||
if (typeof args[0] === 'string') {
|
||||
const text = args[0];
|
||||
|
||||
if (filters.some(each => text.match(each))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (args[0] instanceof Buffer) {
|
||||
const text = args[0].toString();
|
||||
if (filters.some(each => text.match(each))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return sowrite(...args);
|
||||
};
|
||||
|
||||
process.stderr.write = function (...args: unknown[]) {
|
||||
if (typeof args[0] === 'string') {
|
||||
const text = args[0];
|
||||
|
||||
if (filters.some(each => text.match(each))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (args[0] instanceof Buffer) {
|
||||
const text = args[0].toString();
|
||||
if (filters.some(each => text.match(each))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return sewrite(...args);
|
||||
};
|
||||
}
|
||||
|
||||
filterStdio();
|
||||
|
||||
async function unitTests() {
|
||||
await assertAnyFolder('dist/test/unit', `The folder '${$root}/dist/test/unit is missing. You should run ${brightGreen("yarn compile")}\n\n`);
|
||||
const mocha = await assertAnyFile(["node_modules/.bin/mocha.cmd", "node_modules/.bin/mocha"], `Can't find the mocha testrunner. You might need to run ${brightGreen("yarn install")}\n\n`);
|
||||
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio:'inherit', shell: true });
|
||||
verbose(`\n${green("NOTE:")} If you want to run a scenario test (end-to-end) use ${cmdSwitch('scenario=<NAME>')} \n\n`);
|
||||
return result.status;
|
||||
}
|
||||
|
||||
async function scenarioTests(assets: string, name: string, workspace: string) {
|
||||
if (await checkBinaries()) {
|
||||
process.exit(1);
|
||||
}
|
||||
return runTests({
|
||||
...options,
|
||||
extensionDevelopmentPath: $root,
|
||||
extensionTestsPath: resolve($root, 'dist/test/common/selectTests'),
|
||||
launchArgs: workspace ? [...options.launchArgs, workspace] : options.launchArgs,
|
||||
extensionTestsEnv: {
|
||||
SCENARIO: assets
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function main() {
|
||||
await assertAnyFolder('dist/test/', `The folder '${$root}/dist/test is missing. You should run ${brightGreen("yarn compile")}\n\n`);
|
||||
const arg = $args.find(each => !each.startsWith("--"));
|
||||
const specifiedScenario = $scenario || env.SCENARIO || await getScenarioFolder(arg);
|
||||
const testInfo = await getTestInfo(specifiedScenario);
|
||||
|
||||
if (!testInfo) {
|
||||
if (arg) {
|
||||
return error(`Could not find scenario ${arg}`);
|
||||
}
|
||||
// lets just run the unit tests
|
||||
process.exit(await unitTests());
|
||||
}
|
||||
|
||||
// at this point, we're going to run some vscode tests
|
||||
if (!await filepath.isFolder(isolated)) {
|
||||
await install();
|
||||
}
|
||||
process.exit(await scenarioTests(testInfo.assets, testInfo.name, testInfo.workspace));
|
||||
}
|
||||
|
||||
export async function all() {
|
||||
if (await checkBinaries()) {
|
||||
process.exit(1);
|
||||
}
|
||||
const finished: string[] = [];
|
||||
|
||||
if (await unitTests() !== 0) {
|
||||
console.log(`${cyan(" UNIT TESTS: ")}${red("failed")}`);
|
||||
process.exit(1);
|
||||
}
|
||||
finished.push(`${cyan(" UNIT TESTS: ")}${green("success")}`);
|
||||
|
||||
// at this point, we're going to run some vscode tests
|
||||
if (!await filepath.isFolder(isolated)) {
|
||||
await install();
|
||||
}
|
||||
try {
|
||||
const scenarios = await getScenarioNames();
|
||||
for (const each of scenarios) {
|
||||
if (await filepath.isFolder(`${$root}/test/scenarios/${each}/tests`)) {
|
||||
const ti = await getTestInfo(each);
|
||||
|
||||
if (ti) {
|
||||
console.log(`\n\nRunning scenario ${each}`);
|
||||
const result = await scenarioTests(ti.assets, ti.name, ti.workspace);
|
||||
if (result) {
|
||||
console.log(finished.join('\n'));
|
||||
console.log(` ${cyan(`${ti.name} Tests:`)}${red("failed")}`);
|
||||
process.exit(result);
|
||||
}
|
||||
finished.push(` ${cyan(`${ti.name} Tests:`)}${green("success")}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
error(e);
|
||||
} finally {
|
||||
console.log(finished.join('\n'));
|
||||
}
|
||||
}
|
||||
|
||||
interface Input {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
options: CommentArray<{label: string; value: string}>;
|
||||
}
|
||||
|
||||
export async function getScenarioNames() {
|
||||
return (await readdir(`${$root}/test/scenarios`).catch(returns.none)).filter(each => each !== 'Debugger');
|
||||
}
|
||||
|
||||
export async function getScenarioFolder(scenarioName: string) {
|
||||
return scenarioName ? resolve(`${$root}/test/scenarios/${(await getScenarioNames()).find(each => each.toLowerCase() === scenarioName.toLowerCase())}`) : undefined;
|
||||
}
|
||||
|
||||
export async function list() {
|
||||
console.log(`\n${cyan("Scenarios: ")}\n`);
|
||||
const names = await getScenarioNames();
|
||||
const max = names.reduce((max, each) => Math.max(max, each), 0);
|
||||
for (const each of names) {
|
||||
console.log(` ${green(each.padEnd(max))}: ${gray(await getScenarioFolder(each))}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function regen() {
|
||||
// update the .vscode/launch.json file with the scenarios
|
||||
const scenarios = await getScenarioNames();
|
||||
const launch = await readJson(`${$root}/.vscode/launch.json`) as CommentObject;
|
||||
if (!is.object(launch)) {
|
||||
return error(`The file ${$root}/.vscode/launch.json is not valid json`);
|
||||
}
|
||||
if (!is.array(launch.inputs)) {
|
||||
return error(`The file ${$root}/.vscode/launch.json is missing the 'inputs' array`);
|
||||
}
|
||||
|
||||
const inputs = launch.inputs as unknown as CommentArray<Input>;
|
||||
const pickScenario = inputs.find(each => each.id === 'pickScenario');
|
||||
if (!pickScenario) {
|
||||
return error(`The file ${$root}/.vscode/launch.json is missing the 'pickScenario' input`);
|
||||
}
|
||||
const pickWorkspace = inputs.find(each => each.id === 'pickWorkspace');
|
||||
if (!pickWorkspace) {
|
||||
return error(`The file ${$root}/.vscode/launch.json is missing the 'pickWorkspace' input`);
|
||||
}
|
||||
|
||||
for (const scenarioFolder of scenarios) {
|
||||
|
||||
const prefix = $root.replace(/\\/g, '/');
|
||||
|
||||
if (await filepath.isFolder(`${$root}/test/scenarios/${scenarioFolder}/tests`)) {
|
||||
const testInfo = await getTestInfo(scenarioFolder);
|
||||
if (testInfo) {
|
||||
const label = `${scenarioFolder} `;
|
||||
const value = testInfo.workspace.replace(/\\/g, '/').replace(prefix, '${workspaceFolder}');
|
||||
|
||||
const scenario = pickScenario.options.find(s => s.label === label);
|
||||
if (!scenario) {
|
||||
console.log(`Adding scenario ${green(scenarioFolder)} to pickScenario`);
|
||||
pickScenario.options.push({ label, value });
|
||||
} else {
|
||||
verbose(`Skipping scenario ${scenarioFolder} because it already exists`);
|
||||
}
|
||||
|
||||
const wrkspace = pickWorkspace.options.find(s => s.label === label);
|
||||
if (!wrkspace) {
|
||||
console.log(`Adding workspace ${green(scenarioFolder)} to pickWorkspace`);
|
||||
pickWorkspace.options.push({ label, value });
|
||||
} else {
|
||||
verbose(`Skipping workspace ${scenarioFolder} because it already exists`);
|
||||
}
|
||||
} else {
|
||||
verbose(`Skipping scenario ${scenarioFolder} because it doesn't look like there are any tests. (maybe try and run ${brightGreen("yarn compile")})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
await writeJson(`${$root}/.vscode/launch.json`, launch);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { checkBinaries, checkCompiled, checkDTS, checkPrep, checkProposals, error, green } from './common';
|
||||
const quiet = process.argv.includes('--quiet');
|
||||
|
||||
export async function main() {
|
||||
let failing = await checkPrep() && (quiet || error(`Files are not up to date. Run ${green('yarn prep')} to fix it.`));
|
||||
failing = (await checkCompiled() && (quiet || error(`Compiled files are not present. Run ${green('yarn compile')} to fix it.`))) || failing;
|
||||
failing = (await checkBinaries() && (quiet || error(`The native binary files are not present. You should either build or install the native binaries\n\n.`))) || failing;
|
||||
if (failing) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export async function compiled() {
|
||||
let failing = false;
|
||||
failing = (await checkCompiled() && (quiet || error(`Compiled files are not present. Run ${green('yarn compile')} to fix it.`))) || failing;
|
||||
|
||||
if (failing) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export async function binaries() {
|
||||
let failing = false;
|
||||
failing = (await checkBinaries() && (quiet || error(`The native binary files are not present. You should either build or install the native binaries\n\n.`))) || failing;
|
||||
|
||||
if (failing) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export async function prep() {
|
||||
let failing = false;
|
||||
failing = (await checkPrep() && (quiet || error(`Files are not up to date. Run ${green('yarn prep')} to fix it.`))) || failing;
|
||||
|
||||
if (failing) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export async function dts() {
|
||||
let failing = false;
|
||||
failing = (await checkDTS() && (quiet || error(`VSCode import files are not present. Run ${green('yarn prep')} to fix it.`))) || failing;
|
||||
|
||||
if (failing) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export async function proposals() {
|
||||
let failing = false;
|
||||
failing = (await checkProposals() && (quiet || error(`Issue with VSCode proposals. Run ${green('yarn prep')} to fix it.`))) || failing;
|
||||
|
||||
if (failing) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath } from '@vscode/test-electron';
|
||||
import { createHash } from 'crypto';
|
||||
import { tmpdir } from 'os';
|
||||
import { resolve } from 'path';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { mkdir, readJson, rimraf, write } from './common';
|
||||
|
||||
export const isolated = resolve(tmpdir(), '.vscode-test', createHash('sha256').update(__dirname).digest('hex').substring(0, 6));
|
||||
export const extensionsDir = resolve(isolated, 'extensions');
|
||||
export const userDir = resolve(isolated, 'user-data');
|
||||
export const settings = resolve(userDir, "User", 'settings.json');
|
||||
|
||||
export const options = {
|
||||
cachePath: `${isolated}/cache`,
|
||||
launchArgs: ['--no-sandbox', '--disable-updates', '--skip-welcome', '--skip-release-notes', `--extensions-dir=${extensionsDir}`, `--user-data-dir=${userDir}`, '--disable-workspace-trust']
|
||||
};
|
||||
|
||||
export async function install() {
|
||||
try {
|
||||
// Create a new isolated directory for VS Code instance in the test folder, and make it specific to the extension folder so we can avoid collisions.
|
||||
// keeping this out of the Extension folder means we're not worried about VS Code getting weird with locking files and such.
|
||||
|
||||
verbose(`Isolated VSCode test folder: ${isolated}`);
|
||||
await mkdir(isolated);
|
||||
|
||||
const vscodeExecutablePath = await downloadAndUnzipVSCode(options);
|
||||
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath).filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir='));
|
||||
|
||||
args.push(`--extensions-dir=${extensionsDir}`, `--user-data-dir=${userDir}`);
|
||||
|
||||
// install the appropriate extensions
|
||||
// spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cpptools'], { encoding: 'utf-8', stdio: 'ignore' });
|
||||
// spawnSync(cli, [...args, '--install-extension', 'twxs.cmake'], { encoding: 'utf-8', stdio: 'ignore' });
|
||||
// spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cmake-tools'], { encoding: 'utf-8', stdio: 'ignore' });
|
||||
const settingsJson = await readJson(settings, {});
|
||||
if (!settingsJson["workbench.colorTheme"]) {
|
||||
settingsJson["workbench.colorTheme"] = "Tomorrow Night Blue";
|
||||
}
|
||||
|
||||
settingsJson["git.openRepositoryInParentFolders"] = "never";
|
||||
await write(settings, JSON.stringify(settingsJson, null, 4));
|
||||
|
||||
return {
|
||||
cli, args
|
||||
};
|
||||
|
||||
} catch (err: unknown) {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export async function reset() {
|
||||
verbose(`Removing VSCode test folder: ${isolated}`);
|
||||
await rimraf(isolated);
|
||||
}
|
||||
Vendored
+141
-134
@@ -1,136 +1,143 @@
|
||||
// A launch configuration that compiles the extension and then opens it inside a new window
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Extension (development)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "Compile Dev",
|
||||
},
|
||||
{
|
||||
"name": "Launch Extension (production)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "TypeScript Compile",
|
||||
},
|
||||
{
|
||||
"name": "Launch Extension (do not build)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Launch Extension (watch, development)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "Compile Dev Watch",
|
||||
},
|
||||
{
|
||||
"name": "Launch Extension (watch, production)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "TypeScript Compile Watch",
|
||||
},
|
||||
{
|
||||
"name": "Launch Unit Tests",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--extensionTestsPath=${workspaceFolder}/out/test/unitTests/index"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/test/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "Pretest"
|
||||
},
|
||||
{
|
||||
"name": "Launch Integration Tests",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"${workspaceFolder}/test/integrationTests/testAssets/SimpleCppProject/simpleCppProject.code-workspace",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/languageServer/index"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/test/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "Pretest",
|
||||
},
|
||||
{
|
||||
"name": "Launch E2E IntelliSense features tests",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"C:/git/Vcls-vscode-test/SingleRootProject",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/IntelliSenseFeatures/index"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/test/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "Pretest"
|
||||
},
|
||||
{
|
||||
"name": "Node Attach",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 5858
|
||||
},
|
||||
]
|
||||
}
|
||||
"version": "0.1.0",
|
||||
"configurations": [
|
||||
{
|
||||
// debugs the extension
|
||||
"name": "Run Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--no-sandbox",
|
||||
"--disable-updates",
|
||||
"--skip-welcome",
|
||||
"--skip-release-notes",
|
||||
"--disable-workspace-trust",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
],
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**"
|
||||
],
|
||||
// you can use a watch task as a prelaunch task and it works like you'd want it to.
|
||||
"preLaunchTask": "watch"
|
||||
},
|
||||
{
|
||||
// debugs the extension (selecting the workspace)
|
||||
"name": "Run Extension-Select Workspace",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--no-sandbox",
|
||||
"--disable-updates",
|
||||
"--skip-welcome",
|
||||
"--skip-release-notes",
|
||||
"--disable-workspace-trust",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"${input:pickWorkspace}"
|
||||
],
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**"
|
||||
],
|
||||
// you can use a watch task as a prelaunch task and it works like you'd want it to.
|
||||
"preLaunchTask": "watch"
|
||||
},
|
||||
{
|
||||
// debug scenario tests (selecting the workspace)
|
||||
"name": "VSCode Tests",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"env": {
|
||||
"SCENARIO": "${input:pickScenario}"
|
||||
},
|
||||
"args": [
|
||||
"--no-sandbox",
|
||||
"--disable-updates",
|
||||
"--skip-welcome",
|
||||
"--skip-release-notes",
|
||||
"--disable-extensions",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--extensionTestsPath=${workspaceFolder}/dist/test/common/selectTests",
|
||||
"--scenario=${input:pickScenario}",
|
||||
"${input:pickScenario}"
|
||||
],
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**"
|
||||
],
|
||||
// you can use a watch task as a prelaunch task and it works like you'd want it to.
|
||||
"preLaunchTask": "watch"
|
||||
},
|
||||
{
|
||||
// used for debugging unit tests
|
||||
"name": "MochaTest",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 9229,
|
||||
"continueOnAttach": true,
|
||||
"autoAttachChildProcesses": false,
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**",
|
||||
"!**/node_modules/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"type": "pickString",
|
||||
"id": "pickScenario",
|
||||
"description": "Select which scenario to debug VSCode tests.",
|
||||
"options": [
|
||||
{
|
||||
"label": "MultirootDeadlockTest ",
|
||||
"value": "${workspaceFolder}/test/scenarios/MultirootDeadlockTest/assets/test.code-workspace"
|
||||
},
|
||||
{
|
||||
"label": "SimpleCppProject ",
|
||||
"value": "${workspaceFolder}/test/scenarios/SimpleCppProject/assets/simpleCppProject.code-workspace"
|
||||
},
|
||||
{
|
||||
"label": "SingleRootProject ",
|
||||
"value": "${workspaceFolder}/test/scenarios/SingleRootProject/assets/"
|
||||
},
|
||||
{
|
||||
"label": "CompilerDetection ",
|
||||
"value": "${workspaceFolder}/test/scenarios/CompilerDetection/assets"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "pickString",
|
||||
"id": "pickWorkspace",
|
||||
"description": "Select which workspace scenario to debug VSCode.",
|
||||
"default": "-n",
|
||||
"options": [
|
||||
{
|
||||
"label": "(Debug with new window) ",
|
||||
"value": "-n"
|
||||
},
|
||||
{
|
||||
"label": "MultirootDeadlockTest ",
|
||||
"value": "${workspaceFolder}/test/scenarios/MultirootDeadlockTest/assets/test.code-workspace"
|
||||
},
|
||||
{
|
||||
"label": "SimpleCppProject ",
|
||||
"value": "${workspaceFolder}/test/scenarios/SimpleCppProject/assets/simpleCppProject.code-workspace"
|
||||
},
|
||||
{
|
||||
"label": "SingleRootProject ",
|
||||
"value": "${workspaceFolder}/test/scenarios/SingleRootProject/assets/"
|
||||
},
|
||||
{
|
||||
"label": "CompilerDetection ",
|
||||
"value": "${workspaceFolder}/test/scenarios/CompilerDetection/assets"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+65
-8
@@ -1,10 +1,67 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"files.exclude": {
|
||||
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||
},
|
||||
"search.exclude": {
|
||||
"out": true // set this to false to include "out" folder in search results
|
||||
},
|
||||
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
|
||||
}
|
||||
"files.exclude": {
|
||||
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||
},
|
||||
"search.exclude": {
|
||||
"out": true // set this to false to include "out" folder in search results
|
||||
},
|
||||
"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
|
||||
// if you install the mocha test explorer extension, you can run the unit tests from the test explorer UI
|
||||
"testExplorer.useNativeTesting": true,
|
||||
"mochaExplorer.files": "./**/unit/**/*.test.js",
|
||||
"mochaExplorer.watch": "./**/unit/**/*.test.js",
|
||||
"mochaExplorer.ignore": [
|
||||
"**/*skip*",
|
||||
"**/dist/test/**/*.d.ts",
|
||||
"**/node_modules/**"
|
||||
],
|
||||
"mochaExplorer.debuggerConfig": "MochaTest",
|
||||
"mochaExplorer.logpanel": true,
|
||||
"mochaExplorer.timeout": 500000,
|
||||
"mochaExplorer.require": [
|
||||
"source-map-support/register"
|
||||
],
|
||||
"mochaExplorer.monkeyPatch": true,
|
||||
"[json]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "vscode.json-language-features",
|
||||
"editor.tabSize": 4,
|
||||
"files.insertFinalNewline": false
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "vscode.json-language-features",
|
||||
"editor.tabSize": 4,
|
||||
"files.insertFinalNewline": true
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.tabSize": 4,
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
"editor.formatOnSave": true,
|
||||
"files.insertFinalNewline": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit",
|
||||
"source.organizeImports": "explicit"
|
||||
},
|
||||
},
|
||||
"eslint.format.enable": true,
|
||||
"[javascript]": {
|
||||
"editor.tabSize": 4,
|
||||
},
|
||||
"markdown.extension.list.indentationSize": "inherit",
|
||||
"markdown.extension.toc.levels": "2..6",
|
||||
"[markdown]": {
|
||||
"editor.tabSize": 4,
|
||||
},
|
||||
"eslint.workingDirectories": [
|
||||
{
|
||||
"changeProcessCWD": true,
|
||||
"directory": "./",
|
||||
},
|
||||
{
|
||||
"changeProcessCWD": true,
|
||||
"directory": "./.scripts",
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
Vendored
+10
-153
@@ -4,168 +4,25 @@
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "TypeScript Compile",
|
||||
"label": "compile",
|
||||
"type": "npm",
|
||||
"script": "compile",
|
||||
"problemMatcher": "$tsc",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"isBackground": false,
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "silent",
|
||||
"focus": false,
|
||||
"panel": "shared"
|
||||
},
|
||||
"command": "yarn",
|
||||
"args": [
|
||||
"run",
|
||||
"compile"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "TypeScript Lint",
|
||||
"group": "build",
|
||||
"isBackground": false,
|
||||
"type": "shell",
|
||||
"command": "yarn",
|
||||
"args": [
|
||||
"run",
|
||||
"lint"
|
||||
],
|
||||
"problemMatcher": {
|
||||
"fileLocation": "absolute",
|
||||
"source": "lint",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "(ERROR:) ([a-zA-Z/:\\-\\.]*)\\[(\\d+), (\\d+)\\]: (.*)",
|
||||
"severity": 1,
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"column": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
"dependsOn": [
|
||||
"Compile Dev"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Compile Dev",
|
||||
"group": "build",
|
||||
"isBackground": false,
|
||||
"type": "shell",
|
||||
"command": "yarn",
|
||||
"args": [
|
||||
"run",
|
||||
"compile-dev"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Pretest",
|
||||
"group": "build",
|
||||
"isBackground": false,
|
||||
"type": "shell",
|
||||
"command": "yarn",
|
||||
"args": [
|
||||
"run",
|
||||
"pretest"
|
||||
],
|
||||
"dependsOn": [
|
||||
"Compile Dev"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "TypeScript Compile Watch",
|
||||
"label": "watch",
|
||||
"type": "npm",
|
||||
"script": "watch",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"isBackground": true,
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "silent",
|
||||
"focus": false,
|
||||
"panel": "shared"
|
||||
},
|
||||
"command": "yarn",
|
||||
"args": [
|
||||
"run",
|
||||
"compile-watch"
|
||||
],
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "typescript",
|
||||
"source": "ts",
|
||||
"applyTo": "closedDocuments",
|
||||
"fileLocation": "absolute",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "\\[tsl\\] ERROR in (.*)?\\((\\d+),(\\d+)\\)",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3
|
||||
},
|
||||
{
|
||||
"regexp": "\\s*TS\\d+:\\s*(.*)",
|
||||
"message": 1
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": {
|
||||
"regexp": "asset"
|
||||
},
|
||||
"endsPattern": {
|
||||
"regexp": "webpack (.*?) compiled (.*?) ms"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Compile Dev Watch",
|
||||
"group": "build",
|
||||
"isBackground": true,
|
||||
"type": "shell",
|
||||
"command": "yarn",
|
||||
"args": [
|
||||
"run",
|
||||
"compile-dev-watch"
|
||||
],
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "typescript",
|
||||
"source": "ts",
|
||||
"applyTo": "closedDocuments",
|
||||
"fileLocation": "absolute",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "\\[tsl\\] ERROR in (.*)?\\((\\d+),(\\d+)\\)",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3
|
||||
},
|
||||
{
|
||||
"regexp": "\\s*TS\\d+:\\s*(.*)",
|
||||
"message": 1
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": {
|
||||
"regexp": "asset"
|
||||
},
|
||||
"endsPattern": {
|
||||
"regexp": "webpack (.*?) compiled (.*?) ms"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
"problemMatcher": "$tsc-watch",
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+57
-47
@@ -1,47 +1,57 @@
|
||||
|
||||
# ignore vscode settings for extension development
|
||||
.vscode/**
|
||||
|
||||
# ignore binaries
|
||||
obj/**
|
||||
|
||||
# ignore source files
|
||||
tools/**
|
||||
notices/**
|
||||
test/**
|
||||
src/**
|
||||
|
||||
# ignore .js files that are webpacked or only used for development
|
||||
out/src/**
|
||||
out/tools/**
|
||||
|
||||
# ignore ts files in ui
|
||||
ui/*.ts
|
||||
|
||||
# ignore Azure-Pipelines files
|
||||
jobs/**
|
||||
cgmanifest.json
|
||||
|
||||
# ignore development files
|
||||
tsconfig.json
|
||||
test.tsconfig.json
|
||||
tslint.json
|
||||
.eslintrc.js
|
||||
webpack.config.js
|
||||
tscCompileList.txt
|
||||
gulpfile.js
|
||||
.gitattributes
|
||||
.gitignore
|
||||
CMakeLists.txt
|
||||
debugAdapters/install.lock*
|
||||
typings/**
|
||||
**/*.map
|
||||
import_edge_strings.js
|
||||
localized_string_ids.h
|
||||
translations_auto_pr.js
|
||||
|
||||
# ignore i18n language files
|
||||
i18n/**
|
||||
|
||||
# ignore node_modules
|
||||
node_modules/
|
||||
|
||||
# ignore vscode settings for extension development
|
||||
.vscode/**
|
||||
|
||||
# ignore binaries
|
||||
obj/**
|
||||
|
||||
# ignore source files
|
||||
tools/**
|
||||
notices/**
|
||||
test/**
|
||||
src/**
|
||||
|
||||
# ignore .js files that are webpacked or only used for development
|
||||
out/src/**
|
||||
out/tools/**
|
||||
|
||||
# don't include the local code and tests compiled files
|
||||
dist/test/**
|
||||
|
||||
# no project scripts
|
||||
.scripts/**
|
||||
|
||||
# ignore ts files in ui
|
||||
ui/*.ts
|
||||
|
||||
# ignore Azure-Pipelines files
|
||||
jobs/**
|
||||
cgmanifest.json
|
||||
|
||||
# ignore development files
|
||||
tsconfig.json
|
||||
test.tsconfig.json
|
||||
ui.tsconfig.json
|
||||
tslint.json
|
||||
.eslintrc.js
|
||||
webpack.config.js
|
||||
tscCompileList.txt
|
||||
gulpfile.js
|
||||
.gitattributes
|
||||
.gitignore
|
||||
CMakeLists.txt
|
||||
debugAdapters/install.lock*
|
||||
typings/**
|
||||
**/*.map
|
||||
import_edge_strings.js
|
||||
localized_string_ids.h
|
||||
translations_auto_pr.js
|
||||
readme.developer.md
|
||||
Reinstalling the Extension.md
|
||||
*.d.ts
|
||||
|
||||
# ignore i18n language files
|
||||
i18n/**
|
||||
|
||||
# ignore node_modules
|
||||
node_modules/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user