File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ const parse = require('./parse'),
77 labeler = require ( './labeler' ) ,
88 _ = require ( 'lodash' ) ;
99
10+ // We do this outside the event handler to avoid setting up and tearing down this object each time a hook is received
11+ const botStartDate = new Date ( '2018-09-25' ) ;
12+
1013// TODO make this share more with newissue.js?
1114
1215module . exports = function ( robot , alexa ) {
@@ -20,6 +23,12 @@ module.exports = function(robot, alexa) {
2023 return ;
2124 }
2225
26+ const createdAt = new Date ( context . payload . issue . created_at ) ;
27+ if ( createdAt <= botStartDate ) {
28+ robot . log ( 'Ignoring event for a legacy, pre-bot issue.' ) ;
29+ return ;
30+ }
31+
2332 const data = parse ( context . payload . issue . body ) ;
2433
2534 // Check if the data is problematic
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ function resetSpies(context) {
3737}
3838
3939function addLabelsCalledOnce ( err , context ) {
40- assert . ok ( context . github . issues . addLabels . calledOnce ) ;
40+ assert . isTrue ( context . github . issues . addLabels . calledOnce ) ;
4141}
4242
4343function assertWhichLabel ( label ) {
You can’t perform that action at this time.
0 commit comments