Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comment not found #16

Merged
merged 3 commits into from
Sep 8, 2017
Merged

Conversation

bkeepers
Copy link
Contributor

This fixes #8 by:

  1. Fixing an error I was getting with freezing due calling .calendar() on a plain ol' string, preventing the app from leaving its special comment with the freeze attributes
  2. Skipping unfreeze if no freeze comment is found

@@ -57,7 +51,8 @@ module.exports = class Freeze {
}));

this.github.issues.createComment(context.issue({
body: 'Sure thing. I\'ll close this issue for a bit. I\'ll ping you around ' + props.unfreezeMoment.calendar() + ' :clock1: ' +
body: 'Sure thing. I\'ll close this issue for a bit. I\'ll ping you around ' +
moment(props.unfreezeMoment).calendar() + ' :clock1: ' +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually causing the tests to fail now because moment().calendar() returns the date as mm/dd/yyyy. I actually can't figure out how the tests were even passing before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind. I just came back to this to try to fix it and the tests are actually passing. 😕

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. I'll run all this through again on master once the merges happen to make sure things are clean.

At the end of the day, we are 🔥 much of this to go to metadata anyway, so that should help

index.js Outdated
@@ -49,7 +49,7 @@ module.exports = robot => {
context.github.issues.getComments(githubHelper.parseCommentURL(issue.comments_url)).then(resp => {
return freeze.getLastFreeze(resp.data);
}).then(lastFreezeComment => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this use case should not happen. if you got this far, that means you are in a thread that is frozen, so you should have a last frozen comment. The problem is upstream from this.

@@ -57,7 +51,8 @@ module.exports = class Freeze {
}));

this.github.issues.createComment(context.issue({
body: 'Sure thing. I\'ll close this issue for a bit. I\'ll ping you around ' + props.unfreezeMoment.calendar() + ' :clock1: ' +
body: 'Sure thing. I\'ll close this issue for a bit. I\'ll ping you around ' +
moment(props.unfreezeMoment).calendar() + ' :clock1: ' +
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. I'll run all this through again on master once the merges happen to make sure things are clean.

At the end of the day, we are 🔥 much of this to go to metadata anyway, so that should help

@jbjonesjr
Copy link
Owner

this may no longer fix your comment not found error now, but we can address that separately.

@jbjonesjr jbjonesjr merged commit 69e7510 into jbjonesjr:master Sep 8, 2017
@bkeepers bkeepers deleted the fix-comment-not-found branch October 19, 2017 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read property 'match' of undefined
2 participants