プロジェクト

全般

プロフィール

Vote #65946

未完了

Add spent time comments in search

Admin Redmine さんがほぼ4年前に追加. ほぼ4年前に更新.

ステータス:
Needs feedback
優先度:
通常
担当者:
-
カテゴリ:
Search engine_16
開始日:
2009/10/29
期日:
進捗率:

0%

予定工数:
category_id:
16
version_id:
32
issue_org_id:
4138
author_id:
9170
assigned_to_id:
0
comments:
20
status_id:
10
tracker_id:
2
plus1:
4
affected_version:
closed_on:
affected_version_id:
ステータス-->[Needs feedback]

説明

Hello,

we are using the "log time" function extensively for reporting activities related to long running issues. However "spent time" comments are not included in searches. Can they be added?

Thanks in advance

Related issues: #3082 #3936


journals

+1. I log all my time for invoicing and have lots comments to back up my bills. it would be great to be able to search them

--------------------------------------------------------------------------------
+1

We use Redmine time entry comments for invoices, too, and being able to search comments would be a real help.
--------------------------------------------------------------------------------
+1
Since spent hours are associated with comments, we fill this field instead of notes, but cannot search.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I have created a rough patch, against Redmine trunk at r12160, that should provide this feature.

Known issues:
* shown search results display @created_on@ date of time entry comments instead of date from :date
* time entry comments should be ordered by :date instead of :created_on (but can not because it is a date column)
* no tests added yet

--------------------------------------------------------------------------------
Hi,
im new to this, can anyone let me know how patch can be installed?

Thanks in advance
--------------------------------------------------------------------------------
Managed to run the patch but am getting the following:

bitnami@linux:/opt/bitnami/apps/redmine$ patch -p0 < rm4138.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: lib/redmine.rb
|===================================================================
|--- lib/redmine.rb (revision 12160)
|+++ lib/redmine.rb (working copy)
--------------------------
File to patch:

Am i running the patch in the correct folder? How should i proceed?
--------------------------------------------------------------------------------
Karl Fenech wrote:
> bitnami@linux:/opt/bitnami/apps/redmine$ patch p0 < rm4138.diff
> ...
> Am i running the patch in the correct folder? How should i proceed?

No, that is not the correct directory. It should be the top directory where Redmine source files are stored (a.k.a. the RAILS_ROOT or REDMINE_ROOT). It is {BITNAMI_DIR}/apps/redmine/htdocs for BitNami Redmine deployments[1].

fn1. according to http://bitnami.com/stack/redmine/README.txt
--------------------------------------------------------------------------------
Thanks, update worked.
I can now search for comments from the overall time spent under a project and is working fine. only thing that did not work is that comments cannot be searched using the search button top right, is this expected?

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I'll schedule some time to work on this issue to come up with a usable and tested (!) patch.

Karl Fenech wrote:
> Thanks, update worked.
> I can now search for comments from the overall time spent under a project and is working fine. only thing that did not work is that comments cannot be searched using the search button top right, is this expected?

No, it is not. I think the behavior you are experiencing is caused by other search variables. Though, I haven't tested the patch I posted well enough yet to be certain of that. To be continued...

Mischa The Evil wrote:
> * shown search results display @created_on@ date of time entry comments instead of date from :date
> * time entry comments should be ordered by :date instead of :created_on (but can not because it is a date column)

A second look at the core code has left me in doubt if these two issues really are issues because the same @created_on@ is already used/displayed in the activity view (r2877). Any suggestions on this are welcome...
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I continued working on this issue and have come up with a new, extended and thoroughly tested patch against Redmine trunk at r12406. It turns out that the patch I posted earlier in note-6 was already fully functional and bug-free. The changes between that patch and the new patch I'll upload here are:
# added three tests to search_controller_test[1] (including pulling-in the required time_entries fixtures) and one to timelog_controller_test[2] to make sure the new TimeEntry comments searching functionality works correctly in all the cases
# fixed two assertions in @SearchControllerTest#test_search_all_projects@ that broke due to the fact that issue 2 has now been pushed to the second page of the search results
# added additional functionality to also search TimeEntry custom field values (this seems a logic next step now that TimeEntry comments can be searched)
# added yet another test (with accompanying custom field and custom value fixtures) to search_controller_test[3] to make sure that TimeEntry custom field value searching is working correctly

I tried to separate the patch into two dedicated patches, but this wasn't possible because of the test changes that are in the same file.

Please let me know if something else is needed to get these features integrated. Regarding the "issues" with the dates that are used to sort and display the search results that I mentioned earlier in note-6 and note-13: I stick to my previous conclusion that it is not a real issue. Though, it might be something that could be improved in the future (maybe we can change the event title to also include the date of the time entry?), but I don't think that something like that should block the possible integration of these features.

Disclaimer: the patch currently breaks an existing unit test (@ProjectTest#test_destroying_root_projects_should_clear_data@), but this is caused by a defect in the Redmine core instead of a bug in the functionality provided by the patch. See #15709.

fn1. @SearchControllerTest#test_search_time_entries_on_project@, @SearchControllerTest#test_search_time_entries_on_project_with_subprojects_scope@ and @SearchControllerTest#test_search_time_entries_on_all_projects@.

fn2. @TimelogControllerTest#test_default_search_scope@

fn3. @SearchControllerTest#test_search_time_entries_with_searchable_custom_fields@
--------------------------------------------------------------------------------
+1

Having the possibility to search in spent time comments will be very useful.
@Mischa, do you have the time to update your patch in order to apply cleanly on the current trunk? If not, I can take a look in the next period.
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> @Mischa, do you have the time to update your patch in order to apply cleanly on the current trunk? If not, I can take a look in the next period.

I'll see what I can do. Though, feel free to 'take over'. It doesn't seem too much of a work. It is mostly the tests that needs some rewrites (remove the use of @assigns@ and, whenever possible, the fixture additions).
--------------------------------------------------------------------------------
Here's an updated patchset against source:/trunk@21200 as a continuation of the patches provided in note#6 and note#15.

Changes compared to the patch provided in note#15:
* Patch: split-up the patch into atomic commits.
* Feature: added additional support for searching time entries by their 'hours' and 'spent_on' attributes (along with their 'comments' attribute and their custom field values).
* Implementation: added association preloading.
* Implementation: rewritten test coverage using @assert_select@ and added new tests for the added features.

Some notes about the patch transported from note#15:
* It was needed to fix some assertions in @SearchControllerTest#test_search_all_projects@ that broke due to the fact that issue 'Feature !#2' has now been pushed to the second page of the search results.
* The date that is used to sort and display the search results is the '@created_on@' date and not the '@date@' date.
* It adds new @custom_fields@ and @custom_values@ test fixtures for a searchable time entry custom field.

Please review, especially the code implementing the querying of the DB, thoroughly.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Thanks Misha for working on this.

Mischa The Evil wrote:
> * Feature: added additional support for searching time entries by their 'hours' and 'spent_on' attributes (along with their 'comments' attribute and their custom field values).

Searching in 'comments' and 'custom field value' is useful, for sure, but I'm not sure what to say about 'hours' and 'spent_on' because I don't see a real use case. 'spent_on' could be quite confusing because it accepts only the database format (yyyy-mm-dd) and some users are used to use the localization format (for ex: dd-mm-yyyy). I'm in favour of extracting the 'hours' and 'spent_on' to another ticket to get more feedback.

Also, I think it's important to check the impact on the application performance because on some instances, the time entries table can be bigger than the issue table (an issue tends to have more time entries).

--------------------------------------------------------------------------------


related_issues

relates,Closed,992,Option to search open issues only
relates,New,3082,Repository Search
duplicates,Closed,9063,Searchable comments from "Log time"
duplicates,Closed,13693,Possibility to search in time log comments

Admin Redmine さんがほぼ4年前に更新

  • カテゴリSearch engine_16 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0