Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Change the max files that can be bulk deleted. #160716

Merged
merged 7 commits into from
Jun 28, 2023

Conversation

adcoelho
Copy link
Contributor

Connected with #146945

Summary

Description Limit Done? Documented?
Total number of files that can be deleted 10 No

Checklist

@adcoelho adcoelho added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.10.0 labels Jun 28, 2023
@adcoelho adcoelho requested a review from a team as a code owner June 28, 2023 10:37
@adcoelho adcoelho self-assigned this Jun 28, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

Copy link
Contributor

@jonathan-buttner jonathan-buttner left a comment

Choose a reason for hiding this comment

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

await expect(
bulkDeleteFileAttachments({ caseId: 'mock-id-4', fileIds }, clientArgs, casesClient)
).rejects.toThrowError(
'Failed to delete file attachments for case: mock-id-4: Error: array must be of length <= 10'
Copy link
Member

Choose a reason for hiding this comment

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

Same here about the message. It should be a bit more explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not really sure if that can be done.

The schema/type has a message for when it fails but it has no knowledge of the variable name that is failing. So I cannot really say FileIds error: array must be etc etc.

One solution would be something like creating limitedFileIdsArray just so it could have a specific error message but it kind of defeats the purpose of having a generic limitedArray type.

Copy link
Member

Choose a reason for hiding this comment

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

You can pass a message variable to the limitedArray function to customize the message. I am talking about the 'array must be of length >= ${min}' which seems is being set in the limitedArray function.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also pass a field name to schema and include in message. I am currently doing like this The length of the ${field} is too long. The maximum length is ${max}.

Copy link
Member

Choose a reason for hiding this comment

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

oh even better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the PR with this logic 🙌

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cases 143.1KB 143.2KB +161.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 413 417 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 492 496 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @adcoelho

@adcoelho adcoelho merged commit 11f63f2 into elastic:main Jun 28, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants