Patch #31076

Issues CSV / PDF export via ActiveJob

Added by Jens Krämer about 1 month ago. Updated 5 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:4.1.0

Description

Why?
Exporting large amounts of issues and/or issues with a lot of custom fields as CSV or PDF can take a long time, to the point where users run into HTTP timeouts and cannot successfully do their exports.

How?
This patch which has been extracted from Planio allows for such exports to be run in a queueing backend like DelayedJob (that's what we use, but any supported ActiveJob backend should be fine). Exports with less than 1000 issues or exports that take less than 30 seconds to finish will be delivered to the user immediately as a download (just as it is without this patch), but after 30 seconds, the controller gives up waiting and returns the user to the previous issues listing. An email with a download link will be sent to the user once the export is finished.

Without a configured ActiveJob backend everything will be as before and all exports are processed in-request. The background export logic itself is generic and we use the same approach for running time entry exports in the background as well. I'll post that as a separate patch if there's interest in integrating this into Redmine at all.

Patches are against current master. Patch no 1 adds a lazy_issues method to IssueQuery which fetches issues in batches (to avoid high memory usage). Patch no 2 implements the background execution.

0001-introduces-IssueQuery-lazy_issues.patch Magnifier (2.58 KB) Jens Krämer, 2019-03-21 11:27

0002-implements-background-issue-PDF-and-CSV-exports.patch Magnifier (21.4 KB) Jens Krämer, 2019-03-21 11:27


Related issues

Related to Redmine - Feature #24477: CSV export feature for thousand of issues New
Related to Redmine - Defect #24473: CSV Export Very slow for issues with lots of Custom Fields New

History

#1 Updated by Jens Krämer about 1 month ago

related to #24477, #24473

#2 Updated by Go MAEDA about 1 month ago

  • Target version set to Candidate for next major release

#3 Updated by Go MAEDA about 1 month ago

  • Related to Feature #24477: CSV export feature for thousand of issues added

#4 Updated by Go MAEDA about 1 month ago

  • Related to Defect #24473: CSV Export Very slow for issues with lots of Custom Fields added

#5 Updated by Go MAEDA 16 days ago

  • Target version changed from Candidate for next major release to 4.1.0

#6 Updated by Stephane Evr 5 days ago

Awesome!

Also available in: Atom PDF