-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Security Solution][Detection Engine] Avoid creating list items for empty lines in import list API #192681
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marshallmain
added
release_note:skip
Skip the PR/issue when compiling release notes
Team:Detection Engine
Security Solution Detection Engine Area
v8.16.0
labels
Sep 12, 2024
Pinging @elastic/security-detection-engine (Team:Detection Engine) |
dhurley14
approved these changes
Sep 17, 2024
marshallmain
added
the
backport:prev-minor
Backport to (8.x) the previous minor version (i.e. one version back from main)
label
Sep 30, 2024
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Starting backport for target branches: 8.x |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Sep 30, 2024
…mpty lines in import list API (elastic#192681) ## Summary The quickstart tooling introduced in elastic#190634 uses axios under the hood to make requests to Kibana. When attaching file data to the axios request with `FormData`, axios adds an extra empty line after the end content boundary. The logic in `buffer_lines.ts` assumes that there are no more lines after the end content boundary line, so importing a list with the quickstart tooling would create a list with an extra empty item. This empty item fails validation when retrieved through other APIs. This PR prevents lines after the end content boundary from being turned into list items in the import list API. (cherry picked from commit 5f83ac0)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Sep 30, 2024
… for empty lines in import list API (#192681) (#194470) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution][Detection Engine] Avoid creating list items for empty lines in import list API (#192681)](#192681) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marshall Main","email":"55718608+marshallmain@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-30T18:07:39Z","message":"[Security Solution][Detection Engine] Avoid creating list items for empty lines in import list API (#192681)\n\n## Summary\r\n\r\nThe quickstart tooling introduced in\r\nhttps://github.com//pull/190634 uses axios under the hood\r\nto make requests to Kibana. When attaching file data to the axios\r\nrequest with `FormData`, axios adds an extra empty line after the end\r\ncontent boundary. The logic in `buffer_lines.ts` assumes that there are\r\nno more lines after the end content boundary line, so importing a list\r\nwith the quickstart tooling would create a list with an extra empty\r\nitem. This empty item fails validation when retrieved through other\r\nAPIs.\r\n\r\nThis PR prevents lines after the end content boundary from being turned\r\ninto list items in the import list API.","sha":"5f83ac05991cd980ef5b205acd19c997b60045a3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:Detection Engine","v8.16.0"],"title":"[Security Solution][Detection Engine] Avoid creating list items for empty lines in import list API","number":192681,"url":"https://github.com/elastic/kibana/pull/192681","mergeCommit":{"message":"[Security Solution][Detection Engine] Avoid creating list items for empty lines in import list API (#192681)\n\n## Summary\r\n\r\nThe quickstart tooling introduced in\r\nhttps://github.com//pull/190634 uses axios under the hood\r\nto make requests to Kibana. When attaching file data to the axios\r\nrequest with `FormData`, axios adds an extra empty line after the end\r\ncontent boundary. The logic in `buffer_lines.ts` assumes that there are\r\nno more lines after the end content boundary line, so importing a list\r\nwith the quickstart tooling would create a list with an extra empty\r\nitem. This empty item fails validation when retrieved through other\r\nAPIs.\r\n\r\nThis PR prevents lines after the end content boundary from being turned\r\ninto list items in the import list API.","sha":"5f83ac05991cd980ef5b205acd19c997b60045a3"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192681","number":192681,"mergeCommit":{"message":"[Security Solution][Detection Engine] Avoid creating list items for empty lines in import list API (#192681)\n\n## Summary\r\n\r\nThe quickstart tooling introduced in\r\nhttps://github.com//pull/190634 uses axios under the hood\r\nto make requests to Kibana. When attaching file data to the axios\r\nrequest with `FormData`, axios adds an extra empty line after the end\r\ncontent boundary. The logic in `buffer_lines.ts` assumes that there are\r\nno more lines after the end content boundary line, so importing a list\r\nwith the quickstart tooling would create a list with an extra empty\r\nitem. This empty item fails validation when retrieved through other\r\nAPIs.\r\n\r\nThis PR prevents lines after the end content boundary from being turned\r\ninto list items in the import list API.","sha":"5f83ac05991cd980ef5b205acd19c997b60045a3"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Marshall Main <55718608+marshallmain@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport:prev-minor
Backport to (8.x) the previous minor version (i.e. one version back from main)
release_note:skip
Skip the PR/issue when compiling release notes
Team:Detection Engine
Security Solution Detection Engine Area
v8.16.0
v9.0.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The quickstart tooling introduced in #190634 uses axios under the hood to make requests to Kibana. When attaching file data to the axios request with
FormData
, axios adds an extra empty line after the end content boundary. The logic inbuffer_lines.ts
assumes that there are no more lines after the end content boundary line, so importing a list with the quickstart tooling would create a list with an extra empty item. This empty item fails validation when retrieved through other APIs.This PR prevents lines after the end content boundary from being turned into list items in the import list API.