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

comments: record and prevent duplicates #169

Merged
merged 3 commits into from
Feb 5, 2016
Merged

Conversation

groovecoder
Copy link
Owner

Combines #168 and https://github.com/mdn/discord/compare/master...record-comments-97?expand=1

Testing

  1. Push this branch up to your test webhook
  2. Open a pull request in the repo that uses the test webhook
  3. Wait about 30 seconds, refresh, and note the number of comments
  4. Close the pull request, reopen it, wait a few seconds, refresh, and note the number of comments

The number of comments should not change between step 3 and step 4. No lines should be double-commented.

Todo

  • Add tests
  • Add in-source comments

@darkwing darkwing deployed to mdn-discord-pr-169 January 21, 2016 19:37 Active
@darkwing darkwing deployed to mdn-discord-pr-169 January 21, 2016 20:04 Active
@groovecoder
Copy link
Owner Author

@openjck - I'm not sure what you mean by "in-source" comments?

@groovecoder
Copy link
Owner Author

Did this work to add comments on your PR? I can't get it to post comments to my discord-test repo PR from my discord instance.

I did check the database, and it's storing comments, but the line number is -1 - maybe there's something wrong with the line number logic here?

groovecord2::DATABASE=> select * from "Comments";
 id |           repo           | pr |    filename    | line |          feature          |         createdAt          |         updatedAt
----+--------------------------+----+----------------+------+---------------------------+----------------------------+----------------------------
  1 | groovecoder/discord-test |  4 | transition.css |   -1 | CSS 2.1 selectors         | 2016-01-21 19:44:06.719+00 | 2016-01-21 19:44:06.719+00
  2 | groovecoder/discord-test |  4 | transition.css |   -1 | CSS3 Multiple backgrounds | 2016-01-21 19:44:06.754+00 | 2016-01-21 19:44:06.754+00
  3 | groovecoder/discord-test |  4 | transition.css |   -1 | CSS3 Multiple backgrounds | 2016-01-21 19:44:06.76+00  | 2016-01-21 19:44:06.76+00
  4 | groovecoder/discord-test |  4 | transition.css |   -1 | CSS3 Multiple backgrounds | 2016-01-21 19:44:06.762+00 | 2016-01-21 19:44:06.762+00
(4 rows)

@openjck
Copy link
Contributor

openjck commented Jan 22, 2016

I think Discord reports the wrong line number in very short stylesheets. I'll open a bug about that. In the meantime, do the correct numbers show up when using a bigger file like this one?

@groovecoder
Copy link
Owner Author

Looks like it works with the bigger file. I filed #170 for the 1-line bug. I'm going to remove my comment test from this branch and merge it. Can follow up with the tests in a follow-up branch.

@openjck
Copy link
Contributor

openjck commented Jan 22, 2016

Did we also want to move the INSERT to the worker before merging?

@openjck openjck closed this Jan 22, 2016
@openjck openjck reopened this Jan 22, 2016
@darkwing darkwing had a problem deploying to mdn-discord-pr-169 January 22, 2016 22:08 Failure
@openjck
Copy link
Contributor

openjck commented Jan 22, 2016

If you wanted to remove the test, I can follow up with a commit that moves the INSERT.

@groovecoder
Copy link
Owner Author

The branch has now dropped the commit with the test. If you want to add a commit that moves the INSERT go ahead. I've got commits with the tests on my local branch.

@Faeranne
Copy link
Contributor

I find it very intriguing that the same code can both pass and fail at the same time.

@darkwing darkwing had a problem deploying to mdn-discord-pr-169 January 25, 2016 15:45 Failure
@groovecoder
Copy link
Owner Author

Updated the code to pass jshint. Yeah I'm not sure why the pr and push builds are different. We'll see how this goes ...

@darkwing darkwing had a problem deploying to mdn-discord-pr-169 January 25, 2016 15:57 Failure
groovecoder added a commit that referenced this pull request Feb 5, 2016
comments: record and prevent duplicates
@groovecoder groovecoder merged commit be31c36 into master Feb 5, 2016
@openjck
Copy link
Contributor

openjck commented Feb 8, 2016

Why was this merged and not #172?

@groovecoder
Copy link
Owner Author

I thought this was just the rebased version that combined our commits together? Did I merge the wrong one? 😢

@openjck
Copy link
Contributor

openjck commented Feb 8, 2016

Yeah, #172 was the follow-up that removed the failing tests. I guess I forgot to close this one in the process.

@openjck openjck mentioned this pull request Feb 9, 2016
openjck added a commit to openjck/discord that referenced this pull request Feb 9, 2016
This reverts the merge of groovecoder#169, which was obsolete but accidentally left
open. We should merge groovecoder#172 instead.
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.

4 participants