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

Value of S3_FOLDER_OUTPUT_PATH is sometimes wrong due to url encoding #94

Closed
felginep opened this issue Jan 29, 2021 · 0 comments · Fixed by #95
Closed

Value of S3_FOLDER_OUTPUT_PATH is sometimes wrong due to url encoding #94

felginep opened this issue Jan 29, 2021 · 0 comments · Fixed by #95

Comments

@felginep
Copy link
Contributor

I want to upload a folder in which I have several files named with the following form:

iOSProject.xcresult/0~pvlGU5pGizhBI1k74zczqoDoy_lNvIDREFIIhVLL-uXcjIVzXCFwyPnCUgpDCUsFUx5flqAdc06TPZknz7A7iA==

Note the == at the end of the file name.

When using the aws_s3(folder: "iOSProject.xcresult") the file is uploaded correctly to my bucket, and the final url has the following form, which is correct:

https://user.s3.eu-central-1.amazonaws.com/report/iOSProject.xcresult.xcresult/0~pvlGU5pGizhBI1k74zczqoDoy_lNvIDREFIIhVLL-uXcjIVzXCFwyPnCUgpDCUsFUx5flqAdc06TPZknz7A7iA%3D%3D

We can note that the last path component is 0~pvlGU5pGizhBI1k74zczqoDoy_lNvIDREFIIhVLL-uXcjIVzXCFwyPnCUgpDCUsFUx5flqAdc06TPZknz7A7iA%3D%3D with %3D%3D instead of == at the end.

The issue is that the S3_FOLDER_OUTPUT_PATH values contains the full path with the file in it: https://user.s3.eu-central-1.amazonaws.com/report/iOSProject.xcresult.xcresult/0~pvlGU5pGizhBI1k74zczqoDoy_lNvIDREFIIhVLL-uXcjIVzXCFwyPnCUgpDCUsFUx5flqAdc06TPZknz7A7iA%3D%3D instead of https://user.s3.eu-central-1.amazonaws.com/report/

The bug lies here:

Actions.lane_context[SharedValues::S3_FOLDER_OUTPUT_PATH] = file_url.gsub('/' + file_relative_path_to_folder, '')

Indeed we try to do a basic gsub from the url, but in our case there is no match because of the == that is encoded.

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 a pull request may close this issue.

1 participant