Skip to content

Impove export validation#1500

Merged
mzur merged 2 commits into
masterfrom
patch-1
Jun 25, 2026
Merged

Impove export validation#1500
mzur merged 2 commits into
masterfrom
patch-1

Conversation

@mzur

@mzur mzur commented Jun 25, 2026

Copy link
Copy Markdown
Member

Exporting everything does not really make sense. On large instances it is not possible and on small instances "everything" can be selected with "only".

Exporting everything does not really make sense. On large instances
it is not possible and on small instances "everything" can be selected
with "only".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the export API so that exporting “everything” is no longer allowed; callers must provide either an inclusion (only) or exclusion (except) filter, with request validation centralized in a new FormRequest.

Changes:

  • Added ShowExport FormRequest to parse/validate only/except query filters.
  • Updated the shared export controller to use the FormRequest and apply filtered whereIn/whereNotIn queries.
  • Updated export controller tests to reflect the new validation behavior and cover invalid filter inputs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/php/Http/Controllers/Api/Export/VolumeExportControllerTest.php Adjusts tests to require only/except and adds invalid-filter assertions.
tests/php/Http/Controllers/Api/Export/UserExportControllerTest.php Adjusts tests to require only/except, changes expected exported set, adds invalid-filter assertions.
tests/php/Http/Controllers/Api/Export/LabelTreeExportControllerTest.php Adjusts tests to require only/except and adds invalid-filter assertions.
app/Http/Requests/ShowExport.php New FormRequest for parsing/validating export filters.
app/Http/Controllers/Api/Export/VolumeExportController.php Updates API docs to state a filter is required.
app/Http/Controllers/Api/Export/UserExportController.php Updates API docs to state a filter is required.
app/Http/Controllers/Api/Export/LabelTreeExportController.php Updates API docs to state a filter is required.
app/Http/Controllers/Api/Export/Controller.php Switches to ShowExport and applies parsed filter arrays to the query.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/Http/Requests/ShowExport.php
Comment thread app/Http/Requests/ShowExport.php
Comment thread app/Http/Controllers/Api/Export/Controller.php
Comment thread app/Http/Controllers/Api/Export/UserExportController.php
Comment thread app/Http/Controllers/Api/Export/VolumeExportController.php
Comment thread app/Http/Controllers/Api/Export/LabelTreeExportController.php
@mzur mzur merged commit 330d42d into master Jun 25, 2026
4 checks passed
@mzur mzur deleted the patch-1 branch June 25, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants