Giter VIP home page Giter VIP logo

trac-code-comments-plugin's People

Contributors

bart2016 avatar codebykat avatar danielbachhuber avatar jkudish avatar mjangda avatar nb avatar pepegar avatar rjollos avatar schwuk avatar sebdiebln avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trac-code-comments-plugin's Issues

Comment timestamps don't respect users time zone

The timestamps shown for each comment should be in the timezone the current user has selected in the preferences, as are all other timestamps in Trac. However, timestamps for comments at the moment are always shown as UTC (or the timezone the server running Trac is configured for?).

Exception when browsing git repository

With both 1.1.1 and the current master, I get the following exception on a git repository, while for svn it works fine:

2014-04-02 10:05:46,511 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 497, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 214, in dispatch
resp = chosen_handler.process_request(req)
File "/var/lib/trac/plugins/TracCodeComments-1.1.1-py2.7.egg/code_comments/web.py", line 277, in process_request
self.return_json(req, Comments(req, self.env).search(req.args))
File "/var/lib/trac/plugins/TracCodeComments-1.1.1-py2.7.egg/code_comments/comments.py", line 75, in search
return self.select('SELECT * FROM code_comments ' + where + ' ORDER BY ' + order_by + ' ' + order + limit, values)
File "/var/lib/trac/plugins/TracCodeComments-1.1.1-py2.7.egg/code_comments/comments.py", line 32, in select
@self.env.with_transaction()
File "/usr/lib/python2.7/dist-packages/trac/db/api.py", line 97, in transaction_wrapper
fn(ldb)
File "/var/lib/trac/plugins/TracCodeComments-1.1.1-py2.7.egg/code_comments/comments.py", line 35, in get_comments
cursor.execute(*query)
File "/usr/lib/python2.7/dist-packages/trac/db/util.py", line 65, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
DataError: invalid input syntax for integer: "HEAD"
LINE 1: ...ts WHERE path = '/' AND line = '0' AND revision = 'HEAD' ORD...
^
DataError: invalid input syntax for integer: "HEAD"
LINE 1: ...ts WHERE path = '/' AND line = '0' AND revision = 'HEAD' ORD...

Query argument for showing all comments

Now that there's pagination on the code comments table, it would be nice to have a URL query argument to change the number of results listed (with "all" as an option)

Notifications

Use case: I leave some comments, then somebody replies, but I have no idea that it happened.

It would be great if I can subscribe for comments on certain lines, files, directories, or projects.

Any interest in joining the trac-hacks organization?

Hi,

I'm an administrator for trac-hacks.org. We've created an organization on GitHub and are inviting authors of trac-hacks plugins to join the organization. Your repository could be transferred into the organization as described in the GitHub docs. You'd retain full control over the repository, but the hope is that it will be easier for users on GitHub to fine trac-hacks plugins, including yours, by viewing the trac-hacks organization.

In the future, if you choose to no longer maintain the plugin, the organization would be able to provide commit access to new developers. This would only be done with your permission, as has been the policy for plugins hosted on trac-hacks.org. If you've already decided to no longer maintain the plugin, we would particularly appreciate you transferring the plugin to the trac-hacks organization so that we can help find new maintainers for it.

Finally, creating the trac-hacks organization is a work in progress. I appreciate if you have any suggestions on how to best support the community of trac plugin developers on GitHub. I'll be writing a blog post soon with more information and will follow-up here with a link to that post.

Kind regards,

  • Ryan

How to install?

Your readme says to get the appropriate egg from the Downloads page. However, GitHub downloads are deprecated, and you haven't updated yours is two years. What's the best way to add this to my trac installation with a minimum of fuss?

Unicode error when attach a non-english file.

If I attach a file named: 抽獎系統工時預估.xlsx
I got this error:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\trac\web\main.py", line 551, in _dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python27\lib\site-packages\trac\web\main.py", line 244, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\Python27\lib\site-packages\trac\attachment.py", line 529, in process_request
    data = self._do_save(req, attachment)
  File "C:\Python27\lib\site-packages\trac\attachment.py", line 782, in _do_save
    attachment.insert(filename, upload.file, size)
  File "C:\Python27\lib\site-packages\trac\attachment.py", line 345, in insert
    listener.attachment_added(self)
  File "build\bdist.win-amd64\egg\code_comments\subscription.py", line 413, in attachment_added
    Subscription.from_attachment(self.env, attachment)
  File "build\bdist.win-amd64\egg\code_comments\subscription.py", line 198, in from_attachment
    attachment.filename)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128)

expander icon in Browse Source not work.

Hello,

First Congrats for you work with this plugin for trac :) very thanks.

The icon with class ''expander'' not work in my tree view of Browse Source. (this is an ajax button)

Create macro to show actual comments

The existing macro only handles links to comments.

It would be beneficial if the macro could actually render the comments, for e.g. bringing an attachment's comments into the ticket.

Inline code comments should ideally display some context of the code it is replying to, even if it just one line. Clicking it should either expand that context or open up the attachment to that context.

Doesn't work at all for git repos

I'm doing some basic testing, and apparently you're not allowing for revision ids with more than 3 characters (actually, just saw that you're using int as a revision type in the database - that won't work at all).

There might be more issues, but I've hit upon that one right away.

Removing the "int" specifier from the revision field in db.py appears to fix that across the board, in the sense that I now get a listing of the comments I made.

They still don't display, though, but I think the reason for that is #14.

Uncaught Reference error in changeset

Hi, just installed the plugin into Trac 1.0.1., and the comments I add doesn't show. They are visible on Code comments tab, but not at all in the browser or changeset.

In the console is this error:

Uncaught ReferenceError: id is not defined VM2628:3

with trace pointing on the code-comments.js

(anonymous function) VM2628:3
(anonymous function) underscore-min.js:29
window.CommentView.Backbone.View.extend.render code-comments.js:48
window.CommentView.Backbone.View.extend.appendTo code-comments.js:56
window.CommentsForALineView.Backbone.View.extend.addOne code-comments.js:148
window.LineCommentsView.Backbone.View.extend.addOne code-comments.js:118
(anonymous function) code-comments.js:123
b.each.b.forEach underscore-min.js:11
e.Collection.(anonymous function) backbone-min.js:28
window.LineCommentsView.Backbone.View.extend.addAll code-comments.js:122
e.Events.trigger backbone-min.js:14
f.extend.reset backbone-min.js:24
a.success backbone-min.js:24
f.resolveWith jquery-1.5.min.js:16
w jquery-1.5.min.js:16
c jquery-1.5.min.js:16

If a new comment is written to line, the dialog doesn't close on submit, and the only thing that appears by the line is a reply button and the same error in console.

Is it just some incompatibility of versions (jquery, backbone, or trac in general)?

Code comments don't work when changing the number of lines

When changing the number of lines shown in a diff the code comments fail to work correctly unless they are viewed at the same line.

Steps:

  1. Choose a commit
  2. Change the "number of lines around each change"
  3. Leave a comment
  4. Change the "number of lines around each change" back to 2
  5. See that the comment will either be displayed in the wrong position, or not at all.

Allow non-admins to see the comments list

TRAC_ADMIN privileges are required to perform this operation. You don't have the required permissions.

I think that TICKET_CREATE and/or TICKET_VIEW should be enought to see code comments list... Or even better - additional permission type: CODE_COMMENTS_LIST

Release?

I'm particularly interested in the in-line comments on changesets, which has now landed in master.

When do you think there will be an "official" release including #32?

The last official release is from 2012!

implement a "check all" checkbox in Code Comments table

Here's a scenario:

  • I filter the comments to only those that I want to add to add to a ticket (or maybe there's only one or two that I don't want)
  • I have to check all of them one at a time
  • It would be much easier to have a check all checkbox in the header of that column!

checkboxes

Have a single place for sorting defaults

Currently we have defaults for sorting field and sorting direction both in the ListComments route and in the Comments model.

We should choose one place for them, because now it's confusing which values take precedence. Since we want to have default values when querying comments, it makes more sense for these defaults to live in Comments.

trac-code-comments-plugin doesn't work in Trac 1.4.1

This plugin doesn't work in latest Trac 1.4.1

2020-03-09 10:16:56,094 Trac[web_ui] INFO: Installing plugin TracCodeComments-1.1.0-py2.7.egg
2020-03-09 10:16:56,095 Trac[web_ui] INFO: Plugin TracCodeComments-1.1.0-py2.7.egg installed to /home/TRAC/plugins/TracCodeComments-1.1.0-py2.7.egg
2020-03-09 10:16:56,337 Trac[env] INFO: Reloading environment due to configuration change
2020-03-09 10:16:56,364 Trac[env] INFO: -------------------------------- environment startup [Trac 1.4.1] --------------------------------
2020-03-09 10:16:56,467 Trac[loader] ERROR: Skipping "ckintegration = ckintegration": ImportError: cannot import name Context
2020-03-09 10:16:56,470 Trac[loader] ERROR: Skipping "code_comments = code_comments": ImportError: cannot import name Context
2020-03-09 10:16:56,758 Trac[chrome] WARNING: Component TotalHoursFilter relies on deprecated Genshi stream filtering

Database error when using plugin

So I have built the egg from source and included it in the trac plugins folder.

When I load a changeset I get the following errors in the Chrome console log (as well as an alert to tell me to look there):

GET https://trac12-dmz.lshift.net/test/trac/code-comments/comments?line=0&revision=79f06da7332fe7837dc10e7b894b416e3960d0b4&type=changeset 500 (Internal Server Error) jquery-1.11.1.min.js:4
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 497, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 214, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.win-amd64/egg/code_comments/web.py", line 276, in process_request
  self.return_json(req, Comments(req, self.env).search(req.args))
File "build/bdist.win-amd64/egg/code_comments/comments.py", line 76, in search
  return self.select('SELECT * FROM code_comments ' + where + ' ORDER BY ' + order_by + ' ' + order + limit, values)
File "build/bdist.win-amd64/egg/code_comments/comments.py", line 33, in select
  @self.env.with_transaction()
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/db/api.py", line 97, in transaction_wrapper
  fn(ldb)
File "build/bdist.win-amd64/egg/code_comments/comments.py", line 36, in get_comments
  cursor.execute(*query)
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/db/util.py", line 65, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)
 code-comments.js:14

GET https://trac12-dmz.lshift.net/test/trac/code-comments/comments?line__gt=0&revision=79f06da7332fe7837dc10e7b894b416e3960d0b4&type=changeset 500 (Internal Server Error) jquery-1.11.1.min.js:4
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 497, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 214, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.win-amd64/egg/code_comments/web.py", line 276, in process_request
  self.return_json(req, Comments(req, self.env).search(req.args))
File "build/bdist.win-amd64/egg/code_comments/comments.py", line 76, in search
  return self.select('SELECT * FROM code_comments ' + where + ' ORDER BY ' + order_by + ' ' + order + limit, values)
File "build/bdist.win-amd64/egg/code_comments/comments.py", line 33, in select
  @self.env.with_transaction()
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/db/api.py", line 97, in transaction_wrapper
  fn(ldb)
File "build/bdist.win-amd64/egg/code_comments/comments.py", line 36, in get_comments
  cursor.execute(*query)
File "/usr/local/share/trac-testing-virtualenv/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/db/util.py", line 65, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)

It look to me like the database tables don't exist. What do I need to do to get them into the database?

No handler matched request to /code-comments

Hi there,

Sometimes we get the following error when trying to browse the comments added to a Trac env:

No handler matched request to /code-comments

When this happens the "Code Comments" tab in the navigation is also not visible.

Version: 1.1.0 (Trac: 0.12.3)

Problem when doing comments for revision diffs

In a revision diff page, with a customised 'from' and 'to' revisions (as we normally batch review a range of changesets), I could still make comments there. However, there are two problems:

  1. the link in the comments page does not get me back to the diff page, instead, it bring me to the latest changeset regarding to the 'to' revision.

  2. the comments in the page have wrong positions.

It seems to be related with the following code in web.py

    def changeset_js_data(self, req, data):
        return {
            'page': 'changeset',
            'revision': data['new_rev'],
            'path': data['reponame'],
            'selectorToInsertAfter': 'div.diff div.diff:last'
        }

Apparently, only the reponame, and last revision is stored, instead of the actual diff. I wonder if it would be possible if the full browser URL is stored inside the 'path' column instead?

Doesn't work for multiple repos

I've been testing this a bit further and realized that there's also no support for multiple repos (even though I get the "Code Comments" top level menu, and a comment listing, source browser links are not generated with the repo name in them).

I'm still trying to pin this down, since it may well be the reason why I can't see any comments (all the Trac instances I'm running have multiple repos).

No comments on changeset

While there is a comment button at the top of a changeset when clicked it says the comment is for only one of the revisions. There is no inline commenting on the changesets.

Cannot add comments to a directory

The value of'selectorToInsertBefore': 'table#info' in browser_js_data prevents comments being added to directories.

Using table#dirlist works, but (obviously) breaks top-level comments for files.

Include LICENSE file?

Hi - I'm packaging this for Fedora and EPEL, (see the review request here).

I've been asked as a minor/non-blocker issue, to see if you would mind putting a LICENSE file in the repo. Would you consider it? ;-)

Thanks.

Issue with MySQL

I can add the comment successfully but not able to view it, using mysql database. But no issue with sqlite.

I am getting the following errors while viewing a file.

Error: ReferenceError: id is not defined
Source File: *********/chrome/code-comments/underscore-min.js
Line: 29

Timestamp: 09/25/2012 01:05:42 PM
Error: TypeError: $("a", $th).attr("href") is undefined
Source File: *****/chrome/code-comments/code-comments.js
Line: 185

Trac 1.0
TracCodeComments 1.1.0 for Python 2.7

issue exists with "master" branch too.

pop up error informantion

Hello,

It always popup error dialog: "Not Found: Environment not found".
and comments's URL is not correct miss root path( such as, URL should be is "/project_1/file_c", but miss "/project_1/"
Thanks!

Ability to have non-priviledged view of all comments

This would allow developers without TRAC_ADMIN permissions to see comment activity in a central location and perhaps delete permissions on their own comments.

I could not determine if the current code base has this capability, please correct me if I am wrong.

thanks.

Better default sort

When I go to the /code-comments view, I'm always looking for my own comments that I just posted. I think it would be better if the comments in the main list were filtered for the current user and sorted reverse chronologically to start.

append comments to existing ticket

It would be useful to append comments to an existing ticket. Most of the time we have a ticket like: fix something. Now we implement the code changes and they needs to be reviewed. But it is not useful to create a new ticket and add a reference to the new ticket. It would be nice to have the possibility to add only a ticket comment with the code comments.

Pagination should respect filter arguments

I did:

  • Filtered to a subset of comments by path
  • Clicked the link at the bottom to the next page of comments by that path

I saw:

  • My previous filter had been dropped from the query string of arguments

I expected:

  • My previously applied filter to be respected

Allow comments to be turned off for specific pages

Comments can occur on changesets, attachments, and files. They can also be inline, or made against the page generally. There should be some trac.ini configuration options to turn each of these six possibilities off.

For example, on core.trac, we would only like inline comments against attachments. We don't want general comments as those belong on the ticket. But we would probably want both inline and regular comments on commits if we enabled them there (which we won't do at first), and we wouldn't want comments on files at all.

IntegrityError: null value in column "id" violates not-null constraint

getting a db error:

2012-02-25 16:05:05,987 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/code_comments/web.py", line 222, in process_request
    id = comments.create(json.loads(req.read()))
  File "build/bdist.linux-i686/egg/code_comments/comments.py", line 87, in create
    @self.env.with_transaction()
  File "build/bdist.linux-i686/egg/trac/db/api.py", line 77, in transaction_wrapper
    fn(ldb)
  File "build/bdist.linux-i686/egg/code_comments/comments.py", line 91, in insert_comment
    cursor.execute(sql, values)
  File "build/bdist.linux-i686/egg/trac/db/util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
IntegrityError: null value in column "id" violates not-null constraint

fresh install on 12.2 with postgres

Sorting for Code Comments table

Users need to be able to sort the code comments by any of the fields, except Tickets and Actions.

The headers of the columns should be links. By default they are sorted by ID, descending.

The action when we click on a column, depends on the state:

  • If the table is currently sorted by this column, clicking on it reverts the sorting direction. If it was ascending, it's changed to descending, and vice versa.
  • If the table currently isn't sorted by this column, we sort the table by this column, descending.

There should be an icon, denoting which is the current sort column, and what is the direction.

Include revision when copying a link

Problem: when I post comments to the latest version of a single file and then I send the link to somebody, the link doesn't include the file revision. That's why often when the person comes and click on the link they don't see any comments – there were commits in between and the latest version of the file isn't the one with the comments.

I am not sure what the solution should be here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.