Check out, review, and merge locally
Step 1. Fetch and check out the branch for this merge request
git fetch origin git checkout -b feature/plugin-workflow-report origin/feature/plugin-workflow-report
Step 2. Review the changes locally
Step 3. Merge the branch and fix any conflicts that come up
git checkout master git merge --no-ff feature/plugin-workflow-report
Step 4. Push the result of the merge to GitLab
git push origin master
Note that pushing to GitLab requires write access to this repository.
Tip: You can also checkout merge requests locally by following these guidelines.
-
Tấn Trần Thanh @tantt
added 1 commit
- 0dc84db9 - cover case data column equal nil and refactor code
added 1 commit
- 0dc84db9 - cover case data column equal nil and refactor code
added 1 commit * 0dc84db9 - cover case data column equal nil and refactor code [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5559&start_sha=63e50323f146af4fb2c4b573b1eccf20f7a41523)Toggle commit list -
Tấn Trần Thanh @tantt
changed the description
changed the description
changed the descriptionToggle commit list -
plugins/workflow_report/README.rdoc 0 → 100755
1 = workflow_report 2 3 Description goes here -
Hoang Phuc Do @phucdh commentedDeveloper
I recommend adding a short description or screenshot here to give an overview of this plugin.
I recommend adding a short description or screenshot here to give an overview of this plugin. -
Tấn Trần Thanh @tantt
changed this line in version 3 of the diff
changed this line in version 3 of the diff
changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94#e9bf6690e582b5269ce2c6972249e5e900bcfd2f_3_3)Toggle commit list
Please register or sign in to reply -
-
1 class WorkflowReportController < ApplicationController 2 3 def index 4 @thead = ['root_id', 'project', 'subject', 'target_version', ' created_on ', ' closed_on ', ' due_date ', ' status ', ' Estimated_hours (*final version) ', 'Actual time', 'Diff', 'Estimated_hours (*Initial version)', 5 'Number of estimation changes', 'Note of estimation changes', '1. Requirement', '2. Design', '3. Coding', '4. Testing', '5. Bug fixing', '6. Release', 'Others', '1. Requirement', '2. Design', '3. Coding', 6 '4. Testing', '5. Bug fixing', '6. Release', 'Others', 'testcases', 'vn STG bug', 'Jp STG bug', 'Production', 'Issue', 'Issue comment', 'PR comment', 'Review comment', 'Commits', 'File changed', 'Addtion', 'Deletetion'] 7 github = Github.new oauth_token: "your github token" -
Hoang Phuc Do @phucdh commentedDeveloperEdited
Is
oauth_tokenneccessary ? If oauth_token is neccessary, put this config in settings fileIs `oauth_token` neccessary ? If oauth_token is neccessary, put this config in settings file -
Tấn Trần Thanh @tantt
changed this line in version 3 of the diff
changed this line in version 3 of the diff
changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94#df43b4da575656405b65d37dd6d947c32c2fa424_7_5)Toggle commit list
-
-
1 class WorkflowReportController < ApplicationController 2 3 def index 4 @thead = ['root_id', 'project', 'subject', 'target_version', ' created_on ', ' closed_on ', ' due_date ', ' status ', ' Estimated_hours (*final version) ', 'Actual time', 'Diff', 'Estimated_hours (*Initial version)', -
Hoang Phuc Do @phucdh commentedDeveloperEdited
Since these are business logic, it is recommended to write them in the
libfolder. Controller is mainly used to handle requests.You can refer the structure of
redmine/plugins/redmine_agilepluginSince these are business logic, it is recommended to write them in the `lib` folder. Controller is mainly used to handle requests. You can refer the structure of `redmine/plugins/redmine_agile` plugin -
Tấn Trần Thanh @tantt
changed this line in version 3 of the diff
changed this line in version 3 of the diff
changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94#df43b4da575656405b65d37dd6d947c32c2fa424_4_5)Toggle commit list
-
-
1 class WorkflowReportController < ApplicationController 2 3 def index 4 @thead = ['root_id', 'project', 'subject', 'target_version', ' created_on ', ' closed_on ', ' due_date ', ' status ', ' Estimated_hours (*final version) ', 'Actual time', 'Diff', 'Estimated_hours (*Initial version)', 5 'Number of estimation changes', 'Note of estimation changes', '1. Requirement', '2. Design', '3. Coding', '4. Testing', '5. Bug fixing', '6. Release', 'Others', '1. Requirement', '2. Design', '3. Coding', 6 '4. Testing', '5. Bug fixing', '6. Release', 'Others', 'testcases', 'vn STG bug', 'Jp STG bug', 'Production', 'Issue', 'Issue comment', 'PR comment', 'Review comment', 'Commits', 'File changed', 'Addtion', 'Deletetion'] 7 github = Github.new oauth_token: "your github token" 8 kuruma_project_ids = [139, 138, 94, 90, 93, 120, 128, 147, 121, 116] 9 @result = Array.new(@thead.length) 10 root_ids = Issue.select('issues.root_id') -
Hoang Phuc Do @phucdh commentedDeveloperEdited
Can we use ActiveRecord methods instead of raw SQL here?
Can we use ActiveRecord methods instead of raw SQL here? -
Tấn Trần Thanh @tantt
changed this line in version 3 of the diff
changed this line in version 3 of the diff
changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94#df43b4da575656405b65d37dd6d947c32c2fa424_10_5)Toggle commit list
-
-
21 DateTime.new(2023, 3).beginning_of_day, 22 DateTime.new(2023, 3, -1).end_of_day]) 23 .distinct.pluck(:root_id) 24 return unless root_ids.length.positive? 25 26 sum_hours_records = Issue.select('issues.root_id, sum(time_entries.hours) as hours, max(IFNULL(c1.value,-1)) as testcases, max(IFNULL(c2.value,-1)) as bugs,max(IFNULL(stg.value,-1)) as stg_bugs, max(IFNULL(prod.value,-1)) as prod_bugs') 27 .joins('INNER JOIN time_entries ON issues.id = time_entries.issue_id') 28 .joins('LEFT OUTER JOIN custom_values c1 ON c1.customized_id = issues.id and c1.custom_field_id=22') 29 .joins('LEFT OUTER JOIN custom_values c2 ON c2.customized_id = issues.id and c2.custom_field_id=23') 30 .joins('LEFT OUTER JOIN custom_values stg ON stg.customized_id = issues.id and stg.custom_field_id=27') 31 .joins('LEFT OUTER JOIN custom_values prod ON prod.customized_id = issues.id and prod.custom_field_id=28') 32 .where("issues.root_id IN (#{root_ids.join(',')})") 33 .where('issues.tracker_id <> 1') 34 .group('issues.root_id') 35 36 raw_tasks_records = Issue.select('issues.root_id, issues.id, tracker_id, issues.subject, issues.due_date, issues.created_on, issues.closed_on, estimated_hours, issue_statuses.name as status, versions.name as target_version, projects.name as project, pr.value as pr, jr.value as jp_request') -
Hoang Phuc Do @phucdh commentedDeveloperEdited
Can we use ActiveRecord methods instead of raw SQL here?
Can we use ActiveRecord methods instead of raw SQL here? -
Tấn Trần Thanh @tantt
changed this line in version 3 of the diff
changed this line in version 3 of the diff
changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94#df43b4da575656405b65d37dd6d947c32c2fa424_36_5)Toggle commit list
-
-
25 26 sum_hours_records = Issue.select('issues.root_id, sum(time_entries.hours) as hours, max(IFNULL(c1.value,-1)) as testcases, max(IFNULL(c2.value,-1)) as bugs,max(IFNULL(stg.value,-1)) as stg_bugs, max(IFNULL(prod.value,-1)) as prod_bugs') 27 .joins('INNER JOIN time_entries ON issues.id = time_entries.issue_id') 28 .joins('LEFT OUTER JOIN custom_values c1 ON c1.customized_id = issues.id and c1.custom_field_id=22') 29 .joins('LEFT OUTER JOIN custom_values c2 ON c2.customized_id = issues.id and c2.custom_field_id=23') 30 .joins('LEFT OUTER JOIN custom_values stg ON stg.customized_id = issues.id and stg.custom_field_id=27') 31 .joins('LEFT OUTER JOIN custom_values prod ON prod.customized_id = issues.id and prod.custom_field_id=28') 32 .where("issues.root_id IN (#{root_ids.join(',')})") 33 .where('issues.tracker_id <> 1') 34 .group('issues.root_id') 35 36 raw_tasks_records = Issue.select('issues.root_id, issues.id, tracker_id, issues.subject, issues.due_date, issues.created_on, issues.closed_on, estimated_hours, issue_statuses.name as status, versions.name as target_version, projects.name as project, pr.value as pr, jr.value as jp_request') 37 .joins('INNER JOIN projects ON projects.id = issues.project_id') 38 .joins('INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id') 39 .joins('LEFT JOIN versions ON issues.fixed_version_id = versions.id') 40 .joins('LEFT OUTER JOIN custom_values jr ON jr.customized_id = issues.id and jr.custom_field_id=16') -
Hoang Phuc Do @phucdh commentedDeveloperEdited
There are magic numbers here, please resolve it https://refactoring.guru/replace-magic-number-with-symbolic-constant
There are magic numbers here, please resolve it https://refactoring.guru/replace-magic-number-with-symbolic-constant -
Tấn Trần Thanh @tantt
changed this line in version 3 of the diff
changed this line in version 3 of the diff
changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94#df43b4da575656405b65d37dd6d947c32c2fa424_40_5)Toggle commit list
-
-
30 .joins('LEFT OUTER JOIN custom_values stg ON stg.customized_id = issues.id and stg.custom_field_id=27') 31 .joins('LEFT OUTER JOIN custom_values prod ON prod.customized_id = issues.id and prod.custom_field_id=28') 32 .where("issues.root_id IN (#{root_ids.join(',')})") 33 .where('issues.tracker_id <> 1') 34 .group('issues.root_id') 35 36 raw_tasks_records = Issue.select('issues.root_id, issues.id, tracker_id, issues.subject, issues.due_date, issues.created_on, issues.closed_on, estimated_hours, issue_statuses.name as status, versions.name as target_version, projects.name as project, pr.value as pr, jr.value as jp_request') 37 .joins('INNER JOIN projects ON projects.id = issues.project_id') 38 .joins('INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id') 39 .joins('LEFT JOIN versions ON issues.fixed_version_id = versions.id') 40 .joins('LEFT OUTER JOIN custom_values jr ON jr.customized_id = issues.id and jr.custom_field_id=16') 41 .joins('LEFT OUTER JOIN custom_values pr ON pr.customized_id = issues.id and pr.custom_field_id=18') 42 .where("issues.root_id IN (#{root_ids.join(',')})") 43 .where('issues.tracker_id <> 1') 44 .order('issues.root_id') 45 @result.map! { |item| item = [] } -
Hoang Phuc Do @phucdh commentedDeveloperEdited
@result = Array.new(@thead.length) @result.map! { |item| item = [] }Two above lines can be shorten as following:
@result = Array.new(@thead.length, [])```ruby @result = Array.new(@thead.length) @result.map! { |item| item = [] } ``` Two above lines can be shorten as following: ```ruby @result = Array.new(@thead.length, []) ``` -
Tấn Trần Thanh @tantt
changed this line in version 3 of the diff
changed this line in version 3 of the diff
changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94#df43b4da575656405b65d37dd6d947c32c2fa424_45_5)Toggle commit list
-
-
Tấn Trần Thanh @tantt
added 2 commits
added 2 commits * 4e639d71 - refactor code * 4ba9727d - refactor code [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5567&start_sha=0dc84db96ea2a956d3819c9df3fd95e06de05b94)Toggle commit list -
Hoang Phuc Do @phucdh
resolved all discussions
resolved all discussions
resolved all discussionsToggle commit list -
4 'Number of estimation changes', 'Note of estimation changes', '1. Requirement', '2. Design', '3. Coding', '4. Testing', '5. Bug fixing', '6. Release', 'Others', '1. Requirement', '2. Design', '3. Coding', 5 '4. Testing', '5. Bug fixing', '6. Release', 'Others', 'testcases', 'vn STG bug', 'Jp STG bug', 'Production', 'Issue', 'Issue comment', 'PR comment', 'Review comment', 'Commits', 'File changed', 'Addtion', 'Deletetion'] 6 KURUMA_PROJECT_IDS = [139, 138, 94, 90, 93, 120, 128, 147, 121, 116] 7 TESTCASE_FIELD_ID = 22 8 BUGS_FIELD_ID = 23 9 STG_BUGS_FIELD_ID = 27 10 PROD_BUGS_FIELD_ID = 28 11 PR_FIELD_ID = 18 12 JP_REQUEST_FIELD_ID = 16 13 EST_DETAIL_FIRST_COL = 14 14 ACTUAL_TIME_DETAIL_FIRST_COL = 21 15 16 class << self 17 def build_report(year, month, project_ids) 18 github = Github.new oauth_token: $workflow_report_config['github_token'] 19 result = TABLE_HEADER.length.times.map{[]} -
Hoang Phuc Do @phucdh commentedDeveloperEdited
Follow the system syntax:
.map { [] }Follow the system syntax: ```ruby .map { [] } ``` -
Tấn Trần Thanh @tantt
changed this line in version 5 of the diff
changed this line in version 5 of the diff
changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5571&start_sha=97fc407926ceb77c6e4ad4a9a413aa43234b9f58#6ba37397caa16cbccf75e776496345d327b7c512_19_12)Toggle commit list
-
-
205 end 206 name.strip 207 end 208 209 def find_root_ids(year: 2023, month: 3, project_ids: []) 210 Issue.joins(:project, project: :enabled_modules) 211 .joins('LEFT OUTER JOIN time_entries ON issues.id = time_entries.issue_id') 212 .where.not(projects: { status: 9 }) 213 .where(projects: { id: project_ids }, enabled_modules: { name: 'time_tracking' }) 214 .where(['((time_entries.spent_on IS NOT NULL AND time_entries.tyear = ? AND time_entries.tmonth = ?) OR (issues.closed_on BETWEEN ? AND ?))', 215 year, month, DateTime.new(year, month).beginning_of_day, DateTime.new(year, month, -1).end_of_day]) 216 .distinct.pluck(:root_id) 217 end 218 219 def find_sum_hours_records(root_ids) 220 Issue.select(:root_id, 'sum(time_entries.hours) as hours', 'max(IFNULL(c1.value,-1)) as testcases', 'max(IFNULL(c2.value,-1)) as bugs', 'max(IFNULL(stg.value,-1)) as stg_bugs', 'max(IFNULL(prod.value,-1)) as prod_bugs') -
Hoang Phuc Do @phucdh commentedDeveloperEdited by Hoang Phuc Do
It will take time to rewrite this query to object, hence we will keep this style for the time being.
However, please move all the query to the
modelsfolderEx:
#workflow_report/app/models/workflow_report_issue.rb class WorkflowReportIssue < Issue # logic here endIt will take time to rewrite this query to object, hence we will keep this style for the time being. However, please move all the query to the `models` folder Ex: ```ruby #workflow_report/app/models/workflow_report_issue.rb class WorkflowReportIssue < Issue # logic here end ``` -
Tấn Trần Thanh @tantt
changed this line in version 5 of the diff
changed this line in version 5 of the diff
changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5571&start_sha=97fc407926ceb77c6e4ad4a9a413aa43234b9f58#6ba37397caa16cbccf75e776496345d327b7c512_220_201)Toggle commit list
-
-
Tấn Trần Thanh @tantt
added 1 commit
- 97fc4079 - gemfile, gemfile.lock and unloadable
added 1 commit * 97fc4079 - gemfile, gemfile.lock and unloadable [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5570&start_sha=4ba9727dacbaf4186ce50d0ef500864ff3a5defb)Toggle commit list -
Tấn Trần Thanh @tantt
added 1 commit
- 83251359 - refactor code
added 1 commit * 83251359 - refactor code [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5571&start_sha=97fc407926ceb77c6e4ad4a9a413aa43234b9f58)Toggle commit list -
Tấn Trần Thanh @tantt
added 1 commit
- 6786d5a8 - refactor code
added 1 commit * 6786d5a8 - refactor code [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5572&start_sha=8325135930fb9684baad57249f5d9e47a6380c95)Toggle commit list -
Tấn Trần Thanh @tantt
added 1 commit
- 9f5054ce - refactor code
added 1 commit * 9f5054ce - refactor code [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5574&start_sha=6786d5a8a836510401577d80901093d55c422df4)Toggle commit list -
Tấn Trần Thanh @tantt
resolved all discussions
resolved all discussions
resolved all discussionsToggle commit list -
Tấn Trần Thanh @tantt
added 1 commit
- d654a045 - change github token
added 1 commit * d654a045 - change github token [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5584&start_sha=9f5054ce4ba35f1b9dd4d58bfb6d3db2fb765ab2)Toggle commit list -
Tấn Trần Thanh @tantt
added 8 commits
- 3f67f34d - done for search month, year, team and export data to csv
- e8a1223a - case for button download csv
- e8650e1f - permission, gemfile.lock for github_api
- e4270585 - set up gem for github_api
- 55e9704c - change logic ajax
- aa117c95 - merge plugin workflow report
- b5eef676 - REDMINE cover case github token did not access to repo
- b4f35d92 - Merge branch 'feature/search-for-date-and-team-in-plugin-workflow-report' into…
added 8 commits
- 3f67f34d - done for search month, year, team and export data to csv
- e8a1223a - case for button download csv
- e8650e1f - permission, gemfile.lock for github_api
- e4270585 - set up gem for github_api
- 55e9704c - change logic ajax
- aa117c95 - merge plugin workflow report
- b5eef676 - REDMINE cover case github token did not access to repo
- b4f35d92 - Merge branch 'feature/search-for-date-and-team-in-plugin-workflow-report' into…
added 8 commits * 3f67f34d - done for search month, year, team and export data to csv * e8a1223a - case for button download csv * e8650e1f - permission, gemfile.lock for github_api * e4270585 - set up gem for github_api * 55e9704c - change logic ajax * aa117c95 - merge plugin workflow report * b5eef676 - REDMINE cover case github token did not access to repo * b4f35d92 - Merge branch 'feature/search-for-date-and-team-in-plugin-workflow-report' into… [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5585&start_sha=d654a045dd2aeb1b94ad24affe8f0953724b394b)Toggle commit list -
Tấn Trần Thanh @tantt
added 7 commits
added 7 commits
added 7 commits * 1cbaf3c8 - done daily report * b571dfef - fix magic number * b041836a - fix comment and add input select date * 45a5d5c6 - merge plugin workflow report * 01ef1b86 - fix comment * 94fcc54e - fix comment * 34333349 - Merge branch 'feature/daily-report' into feature/plugin-workflow-report [Compare with previous version](https://gitlab.zigexn.vn/ventura/redmine_v2/merge_requests/8/diffs?diff_id=5586&start_sha=b4f35d92851bb064eab49ec3264a306c515eb1fe)Toggle commit list -
Hoang Phuc Do @phucdh
merged
merged
mergedToggle commit list -
Hoang Phuc Do @phucdh
mentioned in commit 94a13e5c
mentioned in commit 94a13e5c
mentioned in commit 94a13e5c0d97327956581325335240c78b40bd7aToggle commit list


