@@ -25,7 +25,7 @@ const str2 = `commit b6475b9a9d0da0971eec7eb5559dff4d18a0e721
2525Author: Evan Lucas <evanlucas@me.com>
2626Date: Tue Mar 29 08:09:37 2016 -0500
2727
28- Revert "tty: don't read from console stream upon creation"
28+ Revert "tty: do not read from the console stream upon creation"
2929
3030 This reverts commit 461138929498f31bd35bea61aa4375a2f56cceb7.
3131
@@ -127,6 +127,42 @@ Date: Thu Mar 3 10:10:46 2016 -0600
127127 test: Check memoryUsage properties.
128128`
129129
130+ const str10 = `commit b04fe688d5859f707cf1a5e0206967268118bf7a
131+ Author: Darshan Sen <raisinten@gmail.com>
132+ Date: Sun May 1 21:10:21 2022 +0530
133+
134+ Revert "bootstrap: delay the instantiation of maps in per-context scripts"
135+
136+ The linked issue, https://bugs.chromium.org/p/v8/issues/detail?id=6593,
137+ is marked as "Fixed", so I think we can revert this now.
138+
139+ This reverts commit 08a9c4a996964aca909cd75fa8ecafd652c54885.
140+
141+ Signed-off-by: Darshan Sen <raisinten@gmail.com>
142+ PR-URL: https://github.com/nodejs/node/pull/42934
143+ Refs: https://bugs.chromium.org/p/v8/issues/detail?id=9187
144+ Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
145+ Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
146+ `
147+
148+ const str11 = `commit b04fe688d5859f707cf1a5e0206967268118bf7a
149+ Author: Darshan Sen <raisinten@gmail.com>
150+ Date: Sun May 1 21:10:21 2022 +0530
151+
152+ Revert "bootstrap: delay the instantiation of all maps in the per-context scripts"
153+
154+ The linked issue, https://bugs.chromium.org/p/v8/issues/detail?id=6593,
155+ is marked as "Fixed", so I think we can revert this now.
156+
157+ This reverts commit 08a9c4a996964aca909cd75fa8ecafd652c54885.
158+
159+ Signed-off-by: Darshan Sen <raisinten@gmail.com>
160+ PR-URL: https://github.com/nodejs/node/pull/42934
161+ Refs: https://bugs.chromium.org/p/v8/issues/detail?id=9187
162+ Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
163+ Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
164+ `
165+
130166test ( 'Validator - misc' , ( t ) => {
131167 const v = new Validator ( )
132168
@@ -215,6 +251,49 @@ test('Validator - real commits', (t) => {
215251 } )
216252 } )
217253
254+ t . test ( 'accept revert commit titles that are elongated by git' , ( tt ) => {
255+ const v = new Validator ( )
256+ v . lint ( str10 )
257+ v . on ( 'commit' , ( data ) => {
258+ const c = data . commit . toJSON ( )
259+ tt . equal ( c . sha , 'b04fe688d5859f707cf1a5e0206967268118bf7a' , 'sha' )
260+ tt . equal ( c . date , 'Sun May 1 21:10:21 2022 +0530' , 'date' )
261+ tt . deepEqual ( c . subsystems , [ 'bootstrap' ] , 'subsystems' )
262+ tt . equal ( c . prUrl , 'https://github.com/nodejs/node/pull/42934' , 'pr' )
263+ tt . equal ( c . revert , true , 'revert' )
264+ const msgs = data . messages
265+ const filtered = msgs . filter ( ( item ) => {
266+ return item . level === 'fail'
267+ } )
268+ tt . equal ( filtered . length , 0 , 'messages.length' )
269+ tt . end ( )
270+ } )
271+ } )
272+
273+ t . test ( 'reject revert commit titles whose original titles are really long' , ( tt ) => {
274+ const v = new Validator ( )
275+ v . lint ( str11 )
276+ v . on ( 'commit' , ( data ) => {
277+ const c = data . commit . toJSON ( )
278+ tt . equal ( c . sha , 'b04fe688d5859f707cf1a5e0206967268118bf7a' , 'sha' )
279+ tt . equal ( c . date , 'Sun May 1 21:10:21 2022 +0530' , 'date' )
280+ tt . deepEqual ( c . subsystems , [ 'bootstrap' ] , 'subsystems' )
281+ tt . equal ( c . prUrl , 'https://github.com/nodejs/node/pull/42934' , 'pr' )
282+ tt . equal ( c . revert , true , 'revert' )
283+ const msgs = data . messages
284+ const filtered = msgs . filter ( ( item ) => {
285+ return item . level === 'fail'
286+ } )
287+ tt . equal ( filtered . length , 1 , 'messages.length' )
288+ const ids = filtered . map ( ( item ) => {
289+ return item . id
290+ } )
291+ const exp = [ 'title-length' ]
292+ tt . deepEqual ( ids . sort ( ) , exp . sort ( ) , 'message ids' )
293+ tt . end ( )
294+ } )
295+ } )
296+
218297 t . test ( 'invalid pr-url, missing subsystem' , ( tt ) => {
219298 const v = new Validator ( )
220299 v . lint ( str4 )
0 commit comments