Feature #4138
openAdd spent time comments in search
0%
Description
Files
Related issues
Updated by snow windwaves over 13 years ago
+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
Updated by Jamie Gruener over 13 years ago
+1
We use Redmine time entry comments for invoices, too, and being able to search comments would be a real help.
Updated by Alexander Bagiev over 11 years ago
+1
Since spent hours are associated with comments, we fill this field instead of notes, but cannot search.
Updated by Mischa The Evil about 11 years ago
- Has duplicate Feature #9063: Searchable comments from "Log time" added
Updated by Mischa The Evil about 11 years ago
- File rm4138-make_time_entries_searchable-trunk_12160.diff rm4138-make_time_entries_searchable-trunk_12160.diff added
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
Updated by Karl Fenech about 11 years ago
Hi,
im new to this, can anyone let me know how patch can be installed?
Thanks in advance
Updated by Karl Fenech about 11 years ago
Managed to run the patch but am getting the following:
bitnami@linux:/opt/bitnami/apps/redmine$ patch p0 < rm4138.diff
|Index: lib/redmine.rb
|===================================================================
|--- lib/redmine.rb (revision 12160)
|+++ lib/redmine.rb (working copy)
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:
-------------------------
--------------------------
File to patch:
Am i running the patch in the correct folder? How should i proceed?
Updated by Mischa The Evil about 11 years ago
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 deployments1.
1 according to http://bitnami.com/stack/redmine/README.txt
Updated by Karl Fenech about 11 years ago
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?
Updated by Toshi MARUYAMA about 11 years ago
- Related to Feature #992: Option to search open issues only added
Updated by Toshi MARUYAMA about 11 years ago
- Related to Feature #3082: Repository Search added
Updated by Mischa The Evil about 11 years ago
- Assignee set to Mischa The Evil
- Target version set to Unplanned backlogs
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...
Updated by Mischa The Evil about 11 years ago
- Has duplicate Feature #13693: Possibility to search in time log comments added
Updated by Mischa The Evil about 11 years ago
- File rm4138-make_time_entries_and_their_custom_fields_searchable-trunk_r12406.diff rm4138-make_time_entries_and_their_custom_fields_searchable-trunk_r12406.diff added
- Target version changed from Unplanned backlogs to Candidate for next minor release
- added three tests to search_controller_test1 (including pulling-in the required time_entries fixtures) and one to timelog_controller_test2 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_test3 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.
1 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
.
2 TimelogControllerTest#test_default_search_scope
3 SearchControllerTest#test_search_time_entries_with_searchable_custom_fields
Updated by Marius BĂLTEANU almost 7 years ago
+1
Having the possibility to search in spent time comments will be very useful.
Mischa The Evil, 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.
Updated by Mischa The Evil almost 7 years ago
Marius BALTEANU wrote:
Mischa The Evil, 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).
Updated by Mischa The Evil over 3 years ago
- File 0001-Make-time-entries-searchable-by-their-comments-hours.patch 0001-Make-time-entries-searchable-by-their-comments-hours.patch added
- File 0002-Make-time-entries-searchable-by-their-custom-field-v.patch 0002-Make-time-entries-searchable-by-their-custom-field-v.patch added
- Assignee deleted (
Mischa The Evil)
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.
- 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
andcustom_values
test fixtures for a searchable time entry custom field.
Please review, especially the code implementing the querying of the DB, thoroughly.
Updated by Mischa The Evil over 3 years ago
- Status changed from New to Needs feedback
Updated by Marius BĂLTEANU over 3 years ago
- Target version changed from Candidate for next minor release to Candidate for next major release
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).
Updated by Mischa The Evil about 1 year ago
- Has duplicate Defect #36059: Fulltext search in timelog comments added