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

Commenting of issues. #742

Merged
merged 1 commit into from
Jul 20, 2017
Merged

Conversation

csordasmarton
Copy link
Contributor

This commit resolves #685 issue.

Copy link
Contributor

@whisperity whisperity left a comment

Choose a reason for hiding this comment

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

I didn't have the ability to test manually.
Travis is failing on pep8 stuff.

Code and feature looks good! 🙂

@@ -267,6 +267,21 @@ def __init__(self, run_id, path, comment):
self.run_id = run_id
self.comment = comment

class Comment(Base):
__tablename__ = 'comment'
Copy link
Contributor

Choose a reason for hiding this comment

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

Original object relations follow a convention of singular type name and plural table name. (Though skip_path above already violates this convention. 🙁 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

__tablename__ = 'comment'

id = Column(Integer, autoincrement=True, primary_key=True)
hash = Column(String, nullable=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering that the bugHash (hash) is used for primarily querying the comments for a bug(group), I think this field should definitely be made an index=True to speed up the database.

Copy link
Contributor

Choose a reason for hiding this comment

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

And maybe for greater clarity we could rename this field to be bug_hash or bugHash, according to how other such fields are named.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

from libtest import env


class TestSkeleton(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

class TestSkeleton?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

self.assertEqual(num_comment, 0)

# Try to add a new comment for the first bug
comment1 = CommentData(author = 'Anonymous', message = 'First msg')
Copy link
Contributor

Choose a reason for hiding this comment

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

pep8: No spaces between kwargs keys and values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -7,6 +7,8 @@ define([
'dojo/store/Memory',
'dojo/store/Observable',
'dojo/topic',
'dojo/fx',
Copy link
Contributor

Choose a reason for hiding this comment

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

Imports should be sorted in JS files too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@csordasmarton csordasmarton force-pushed the comments branch 4 times, most recently from fcc2d08 to 13351a6 Compare July 20, 2017 11:34
"""
session = self.__session
comment = Comment(bug_hash,
comment_data.author,
Copy link
Member

Choose a reason for hiding this comment

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

Security leak!

Author must not be given by the client! It must be queried from the authenticated session. Wire in comment_data.author="Anonymous" for now and add a FIXME and a followup issue in GITHUB to query the proper user name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also add a # TODO: to this line, not just a GitHub issue.

Copy link
Contributor

@whisperity whisperity left a comment

Choose a reason for hiding this comment

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

Very small changes. The feature looks nice.

One small detail: if the BugPath is changed (because I'm jumping back and forth in it), the comments are reloaded. This creates an unneccessary load on the connection, and "blinking" in the window. As long as the user is viewing the same bug, the comment loading should be prevented. But of course, jumping into a different bug while viewing the same source file must work.

// add new comment for a bug
bool addComment(1: string bugHash,
2: CommentData comment)
throws(1: shared.RequestFailed requestError),
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation.

this.hide = false;
} else {
toggler.show();
this.hide = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing ;

//--- Remove comment confirmation dialog ---//

this._removeDialog = new ConfirmDialog({
title : 'CodeChecker - Remove comment',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think putting CodeChecker here is rendundant. The message is really short which already makes the box small.

var fuzzy;

if (delta < 30) {
fuzzy = 'just then.';
Copy link
Contributor

Choose a reason for hiding this comment

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

just then? When? just now works better. (Also, that's how GitHub and other such sites show it.)

@whisperity whisperity merged commit 9fdc354 into Ericsson:version6 Jul 20, 2017
@csordasmarton csordasmarton deleted the comments branch July 21, 2017 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants