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

[AWS] [S3] Remove url.QueryUnescape() from aws-s3 input in polling mode #38125

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

zmoog
Copy link
Contributor

@zmoog zmoog commented Feb 23, 2024

Proposed commit message

Remove url.QueryUnescape() from aws-s3 input in polling mode because it is not required.

We introduced the url.QueryUnescape() function to unescape object keys from S3 notifications in SQS messages when the input runs in SQS. We also used it for object keys from the S3 list objects when the input runs in polling mode. However, the object keys in the S3 list object responses (polling mode) do not require unescape.

We must remove the unescape to avoid unintended changes to the S3 object key.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

go test -v ./x-pack/filebeat/input/awss3/... -run TestS3Poller

Related issues

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 23, 2024
@zmoog zmoog changed the title [AWS] [S3] Remove url.QueryUnescape() from aws-s3 input (polling mode) [AWS] [S3] Remove url.QueryUnescape() from aws-s3 input in polling mode Feb 23, 2024
@mergify mergify bot assigned zmoog Feb 23, 2024
Copy link
Contributor

mergify bot commented Feb 23, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @zmoog? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@zmoog zmoog added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Feb 23, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 23, 2024
@zmoog zmoog added bug needs_team Indicates that the issue/PR needs a Team:* label labels Feb 23, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 23, 2024
@zmoog zmoog force-pushed the zmoog/remove-unescape-from-aws-s3 branch from a4323ab to a11ed6e Compare February 23, 2024 15:49
@zmoog zmoog closed this Feb 23, 2024
@zmoog zmoog force-pushed the zmoog/remove-unescape-from-aws-s3 branch from b5146ca to a27e439 Compare February 23, 2024 16:25
@zmoog
Copy link
Contributor Author

zmoog commented Feb 23, 2024

Reopening (closed accidentally)

@zmoog zmoog reopened this Feb 23, 2024
Copy link
Contributor

mergify bot commented Feb 23, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @zmoog? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@zmoog
Copy link
Contributor Author

zmoog commented Feb 23, 2024

The "x-pack/libbeat: Load dynamic pipeline's steps" is failing, but I don't think it's related to the changes in this PR.

@zmoog zmoog marked this pull request as ready for review February 23, 2024 16:46
@zmoog zmoog requested a review from a team as a code owner February 23, 2024 16:46
Copy link
Contributor

mergify bot commented Feb 23, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b zmoog/remove-unescape-from-aws-s3 upstream/zmoog/remove-unescape-from-aws-s3
git merge upstream/main
git push upstream zmoog/remove-unescape-from-aws-s3

We introduced [^1] the `url.QueryUnescape()` function to unescape
object keys from S3 notification in SQS messages.

However, the object keys in the S3 list object responses do not
require [^2] unescape.

We must remove the unescape to avoid unintended changes to the S3
object key.

[^1]: elastic#18370
[^2]: elastic#38012 (comment)
@zmoog zmoog force-pushed the zmoog/remove-unescape-from-aws-s3 branch from 62e9992 to f303b7a Compare March 4, 2024 10:01
@zmoog zmoog added the backport-v8.13.0 Automated backport with mergify label Mar 4, 2024
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @zmoog

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @zmoog

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @zmoog

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @zmoog

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 4, 2024

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-03-04T10:30:42.687+0000

  • Duration: 134 min 29 sec

Test stats 🧪

Test Results
Failed 0
Passed 3320
Skipped 180
Total 3500

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @zmoog

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @zmoog

@zmoog zmoog enabled auto-merge (squash) March 4, 2024 11:24
@zmoog zmoog merged commit 5f1e656 into elastic:main Mar 4, 2024
38 of 39 checks passed
mergify bot pushed a commit that referenced this pull request Mar 4, 2024
…de (#38125)

* Remove url.QueryUnescape()

We introduced [^1] the `url.QueryUnescape()` function to unescape
object keys from S3 notification in SQS messages.

However, the object keys in the S3 list object responses do not
require [^2] unescape.

We must remove the unescape to avoid unintended changes to the S3
object key.

[^1]: #18370
[^2]: #38012 (comment)

---------

Co-authored-by: Andrea Spacca <andrea.spacca@elastic.co>
(cherry picked from commit 5f1e656)
@zmoog zmoog deleted the zmoog/remove-unescape-from-aws-s3 branch March 4, 2024 15:15
zmoog pushed a commit that referenced this pull request Mar 4, 2024
…s-s3 input in polling mode (#38165)

* [AWS] [S3] Remove url.QueryUnescape() from aws-s3 input in polling mode (#38125)

We introduced [^1] the `url.QueryUnescape()` function to unescape
object keys from S3 notification in SQS messages.

However, the object keys in the S3 list object responses do not
require [^2] unescape.

We must remove the unescape to avoid unintended changes to the S3
object key.

[^1]: #18370
[^2]: #38012 (comment)

---------

Co-authored-by: Andrea Spacca <andrea.spacca@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.13.0 Automated backport with mergify bug Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[awss3 input] unescape characters in s3 file names
3 participants