Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions utils/issue-format-bot/lib/issueedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const parse = require('./parse'),
labeler = require('./labeler'),
_ = require('lodash');

// We do this outside the event handler to avoid setting up and tearing down this object each time a hook is received
const botStartDate = new Date('2018-09-25');

// TODO make this share more with newissue.js?

module.exports = function(robot, alexa) {
Expand All @@ -20,6 +23,12 @@ module.exports = function(robot, alexa) {
return;
}

const createdAt = new Date(context.payload.issue.created_at);
if (createdAt <= botStartDate) {
robot.log('Ignoring event for a legacy, pre-bot issue.');
return;
}

const data = parse(context.payload.issue.body);

// Check if the data is problematic
Expand Down
2 changes: 1 addition & 1 deletion utils/issue-format-bot/test/labeler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function resetSpies(context) {
}

function addLabelsCalledOnce(err, context) {
assert.ok(context.github.issues.addLabels.calledOnce);
assert.isTrue(context.github.issues.addLabels.calledOnce);
}

function assertWhichLabel(label) {
Expand Down