[MM-55726] Create batch report worker, add batch report job for exporting users to CSV (#25832)

* Split out migration logic and create generic BatchWorker

* WIP

* WIP

* POC batch reporting

* Oops

* Job hookup

* Working export to file

* PR feedback

* Merge'd

* Fix error handling

* Add API to start report, translations, couple fixes

* Add DMs to send reports to users

* Merge'd

* Update types

* A bit of cleanup

* Some fixes

* Add missing API doc

* PR feedback

* Fix generated

* Fix bug with post creation

* PR feedback

* Add some tests

* PR feedback

* Fix lint

* Some test changes

* Fix tests

* Add comment to explain why we forcibly stop

* Rework of some tests

* Batch report test

* Restrict batch exports to Pro and Enterprise licenses

* Fix erroneous comment

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Devin Binnie
2024-01-19 15:22:17 -05:00
коммит произвёл GitHub
родитель eac9a39677
Коммит f7446d7443
23 изменённых файлов: 1571 добавлений и 361 удалений

Просмотреть файл

@@ -2706,6 +2706,14 @@
"id": "api.restricted_system_admin",
"translation": "This action is forbidden to a restricted system admin."
},
{
"id": "api.retrieveBatchReportFile.invalid_format",
"translation": "Report format is invalid."
},
{
"id": "api.retrieveBatchReportFile.invalid_report_id",
"translation": "Report ID is invalid."
},
{
"id": "api.roles.get_multiple_by_name_too_many.request_error",
"translation": "Unable to get that many roles by name. Only {{.MaxNames}} roles can be requested at once."
@@ -5270,6 +5278,14 @@
"id": "app.command_webhook.try_use.invalid",
"translation": "Invalid webhook."
},
{
"id": "app.compile_csv_chunks.header_error",
"translation": "Failed to write CSV headers."
},
{
"id": "app.compile_report_chunks.unsupported_format",
"translation": "Unsupported report format."
},
{
"id": "app.compliance.get.finding.app_error",
"translation": "We encountered an error retrieving the compliance reports."
@@ -6678,6 +6694,26 @@
"id": "app.report.get_user_report.store_error",
"translation": "Failed to fetch user report."
},
{
"id": "app.report.retrieve_batch_report.license_error",
"translation": "Batch reporting export only available to Pro and Enterprise."
},
{
"id": "app.report.send_report_to_user.export_finished",
"translation": "Report processing is finished. You can download the report [here]({{.Link}})"
},
{
"id": "app.report.start_users_batch_export.job_exists",
"translation": "Job already exists for this user and date range."
},
{
"id": "app.report.start_users_batch_export.license_error",
"translation": "Batch reporting export only available to Pro and Enterprise."
},
{
"id": "app.report.start_users_batch_export.started_export",
"translation": "You have requested the export of user data. A CSV will be delivered to you when the export is complete."
},
{
"id": "app.role.check_roles_exist.role_not_found",
"translation": "The provided role does not exist"
@@ -6718,6 +6754,14 @@
"id": "app.save_config.plugin_hook_error",
"translation": "An error occurred running the plugin hook on configuration save."
},
{
"id": "app.save_csv_chunk.write_error",
"translation": "Failed to write CSV chunk."
},
{
"id": "app.save_report_chunk.unsupported_format",
"translation": "Unsupported report format."
},
{
"id": "app.scheme.delete.app_error",
"translation": "Unable to delete this scheme."