Modify

Opened 6 months ago

Last modified 7 weeks ago

#11821 accepted enhancement

Features for next version of plugin

Reported by: rjollos Owned by: rjollos
Priority: normal Component: TracTicketChangelogPlugin
Severity: normal Keywords:
Cc: hasienda Trac Release:

Description (last modified by rjollos)

Here are some thoughts I have on the next version of the plugin, from reviewing the codebase over the weekend:

  1. Create a ticket-changeset relation table. The table would be populated by implementing IRepositoryChangeListener. It looks like the original author had similar ideas: tracticketchangelogplugin/0.12/ticketlog/model.py@13954 is currently unused. This should make the plugin faster, and extraction of the referenced tickets from the changeset message can be made more precise since we won't have to use a LIKE clause in the query (see next item).
  2. The configuration settings of CommitTicketUpdater can be used to determine which tickets are referenced by a changelog message, rather than redefining redundant configuration settings. The CommitTicketUpdater configuration settings can be seen on the TracIni#ticket-section page: commit_ticket_update_commands.close, commit_ticket_update_commands.refs, commit_ticket_update_envelope, ... We might even want to subclass CommitTicketUpdater so that we can reuse the message parsing code, which should be more robust and will allow us to fix #7884 and maybe #8428.
  3. Remove TICKETLOG_VIEW permission (as well as the unused TICKETLOG_EDIT and TICKETLOG_ADMIN). TICKETLOG_VIEW appears to be redundant with LOG_VIEW if the purpose is to control the ability to view a resource. TICKETLOG_VIEW would provide the ability to control whether the log is present for some users, but I'm not sure this is needed. We would probably be better off showing the log to all users with LOG_VIEW, but having it be initially collapsed so it is out of the way. If greater control is needed to tune this to user preferences, we can follow the lead of trac:#9807 by implementing a user preference on the Preferences panel.
  4. Add an HTML template for the changelog section. Currently the HTML is constructed in JavaScript. We can probably use an ITemplateStreamFilter to insert the HTML and avoid the need for JavaScript entirely (provided there are no performance issues with Genshi).

Attachments (0)

Change History (19)

comment:1 Changed 3 months ago by rjollos

  • Description modified (diff)

comment:2 follow-up: Changed 3 months ago by hasienda

A few comments regarding no. 3 (1-2 are indisputable fine): I see a use case for keeping at least one of edit and admin permissions for corrective edits on-top of commit messages, where doing it in the repository would be practically unfeasible (big SVN repo) or impossible (HG). Third opinion is reasonable again and shouldn’t be too hard to implement.

comment:3 in reply to: ↑ 2 ; follow-ups: Changed 3 months ago by rjollos

Replying to hasienda:

A few comments regarding no. 3 (1-2 are indisputable fine): I see a use case for keeping at least one of edit and admin permissions for corrective edits on-top of commit messages, where doing it in the repository would be practically unfeasible (big SVN repo) or impossible (HG).

That is a really nice idea that I never considered. Should we consider just implementing a feature directly in Trac that allows repository messages to be edited through the changeset view and/or log view (I imagine there is a ticket open somewhere in Trac for that feature).

For Subversion this would require that the appropriate hooks be configured (pre-revprop-change and post-revprop-change). Are you saying that large Subversion repositories have performance issues when trying to edit commit messages, or rather that it is just difficult to edit many messages when working with a large Subversion repository and the existing tools? Commit messages can't be edited in Hg?

Allowing edits through Trac would, with changes to the database schema, allow versioning of the commit messages, a feature that has always been lacking from Subversion.

Thanks for the feedback!

comment:4 in reply to: ↑ 3 ; follow-up: Changed 3 months ago by anonymous

Replying to rjollos:

Should we consider just implementing a feature directly in Trac that allows repository messages to be edited through the changeset view and/or log view (I imagine there is a ticket open somewhere in Trac for that feature).

t:ticket:781?

comment:5 in reply to: ↑ 4 Changed 3 months ago by hasienda

Replying to anonymous:

Replying to rjollos:

Should we consider just implementing a feature directly in Trac that allows repository messages to be edited through the changeset view and/or log view (I imagine there is a ticket open somewhere in Trac for that feature).

t:ticket:781?

I think so, especially note comment 24 of that ticket, that among other things answers the question regarding Hg, which has immutable messages indeed.

comment:6 in reply to: ↑ 3 Changed 3 months ago by anonymous

Replying to rjollos:

Commit messages can't be edited in Hg?

Just like in Git, commit messages are part of the changeset hash, so commit messages of public changesets are not supposed to be edited. For private / draft changesets you can use commit --amend to edit history (again just like in Git). (HG changeset evolution will use obsolescence markers to show relations between such amended changesets and their precursors, and help with evolving affected child changesets.)

comment:7 in reply to: ↑ description Changed 3 months ago by rjollos

Replying to rjollos:

  1. Create a ticket-changeset relation table. The table would be populated by implementing IRepositoryChangeListener.

This might also allow us to support repositories that are not cached (comment:16:ticket:8428).

comment:8 Changed 3 months ago by rjollos

  • Owner changed from richard to rjollos
  • Status changed from new to accepted

comment:9 Changed 3 months ago by rjollos

tracticketchangelogplugin/1.0 branch created in [14180] for development of next major version of this plugin.

comment:10 Changed 3 months ago by rjollos

In 14182:

1.0dev: Style Commit History section like the other sections (Attachments, Change History, ...). Refs #11821.

comment:11 Changed 3 months ago by rjollos

Unintended change to 0.12 branch in [14182] reverted in [14183].

comment:12 Changed 3 months ago by rjollos

In 14186:

1.0dev: Append table of revisions in an ITemplateStreamFilter call rather than an AJAX callback.

The Change History is initially collapsed.

Refs #11821.

comment:13 in reply to: ↑ description Changed 3 months ago by rjollos

Replying to rjollos:

  1. Add an HTML template for the changelog section. Currently the HTML is constructed in JavaScript. We can probably use an ITemplateStreamFilter to insert the HTML and avoid the need for JavaScript entirely (provided there are no performance issues with Genshi).

This change is implemented on the tracticketchangelogplugin/1.0 branch. Next I'll work on adding the ticket-changeset relation table.

comment:14 Changed 3 months ago by rjollos

In 14187:

1.0dev/i18n: New extraction. Refs #11821.

comment:15 Changed 3 months ago by rjollos

In 14191:

1.0dev: Show number of entries next to Commit History heading. Refs #11821.

comment:16 Changed 3 months ago by rjollos

In 14194:

1.0dev: Hide table and show (No commits) message when there are no commits associated with the ticket..Refs #11821.

comment:17 Changed 3 months ago by rjollos

In 14195:

1.0dev: Added license headers to template files. Refs #11821.

comment:18 Changed 7 weeks ago by rjollos

In 14227:

1.0dev: Require LOG_VIEW permission to view the ticket log and remove definition of TICKETLOG_* permssions..Refs #11821.

comment:19 Changed 7 weeks ago by rjollos

In 14228:

1.0dev: Implement fine-grained permission checks..Refs #11821.

Granting LOG_VIEW for the ticket realm is equivalent to granting the TICKETLOG_VIEW permission that existed in previous versions of the plugin.

Add Comment

Modify Ticket

Action
as accepted The owner will remain rjollos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.