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

Cloudinary Test Cloud returns invalid Public IDs #65

Open
1 of 9 tasks
chrissnyder2337 opened this issue Jan 26, 2023 · 8 comments
Open
1 of 9 tasks

Cloudinary Test Cloud returns invalid Public IDs #65

chrissnyder2337 opened this issue Jan 26, 2023 · 8 comments

Comments

@chrissnyder2337
Copy link
Contributor

chrissnyder2337 commented Jan 26, 2023

Bug report for Cloudinary CLI

This is not necessarily an issue with the Cloudinary CLI itself, but with the test cloud it runs against.

Describe the bug in a sentence or two.

I found that the Test cloud returns invalid/inconsistent public ids for assets, especially when compared to running the same commands against a real Cloudinary account/enviroment. This impacts the ability to write accurate tests. I experienced this while trying to write tests for #63 .

Issue Type (Can be multiple)

  • Build - Cannot install or import the SDK
  • Performance - Performance issues
  • Behaviour - Functions are not working as expected (such as generate URL)
  • Documentation - Inconsistency between the docs and behaviour
  • Other (Cloudinary Cloud)

Steps to reproduce

  1. Run the test_cli_upload_dir command using the test Cloudinary environment (provided by running ./tools/get_test_cloud.sh). Note the command's output (by dumping/inspecting output.result).:
Uploading directory '/Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync'
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_10966/test_sync/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_10966/test_sync/Ek_Bremen_P+R Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/NoSpaces/OrdinaryFilename.png as test_upload_dir_10966/test_sync/NoSpaces/OrdinaryFilename
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Philips Lifetime_200x150.jpg as test_upload_dir_10966/test_sync/Philips Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/SomeName/(02)-some-real_File-Name-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_10966/test_sync/SomeName/(02)-some-real_File-Name-Zone-(2.3.2)_378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Speed_Grip 3_05_200x200.jpg as test_upload_dir_10966/test_sync/Speed_Grip 3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/hymer-1-2_)_98x63.jpg as test_upload_dir_10966/test_sync/hymer-1-2_)_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/specialCharactersätstest_1234/Einzelkritiken/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_10966/test_sync/specialCharactersätstest_1234/Einzelkritiken/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test with spaces/test_space 3_05_200x200.jpg as test_upload_dir_10966/test_sync/test with spaces/test_space 3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test-h7/Philips Lifetime_200x150.jpg as test_upload_dir_10966/test_sync/test-h7/Philips Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test_underscores____test/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_10966/test_sync/test_underscores____test/Ek_Bremen_P+R Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/wohnmobil-2010/hymer-1-2_)_98x63.jpg as test_upload_dir_10966/test_sync/wohnmobil-2010/hymer-1-2_)_98x63
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py:265: ResourceWarning: unclosed running multiprocessing pool <multiprocessing.pool.ThreadPool state=RUN pool_size=30>
  _warn(f"unclosed running multiprocessing pool {self!r}",
ResourceWarning: Enable tracemalloc to get the object allocation traceback
12 resources uploaded
  1. Run the same test_cli_upload_dir command using a real Cloudinary environment (from https://cloudinary.com/console). Note the command's output (by dumping/inspecting output.result).:
Uploading directory '/Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync'
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_86886/test_sync/02_-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-_2.3.2__378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_86886/test_sync/Ek_Bremen_P_R_Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/NoSpaces/OrdinaryFilename.png as test_upload_dir_86886/test_sync/NoSpaces/OrdinaryFilename
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Philips Lifetime_200x150.jpg as test_upload_dir_86886/test_sync/Philips_Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/SomeName/(02)-some-real_File-Name-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_86886/test_sync/SomeName/02_-some-real_File-Name-Zone-_2.3.2__378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/Speed_Grip 3_05_200x200.jpg as test_upload_dir_86886/test_sync/Speed_Grip_3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/hymer-1-2_)_98x63.jpg as test_upload_dir_86886/test_sync/hymer-1-2___98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/specialCharactersätstest_1234/Einzelkritiken/(02)-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-(2.3.2)_378x150_98x63.jpg as test_upload_dir_86886/test_sync/specialCharactersätstest_1234/Einzelkritiken/02_-Krummhoern-Upleward_Badetreppe-Kitesurf-Zone-_2.3.2__378x150_98x63
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test with spaces/test_space 3_05_200x200.jpg as test_upload_dir_86886/test_sync/test with spaces/test_space_3_05_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test-h7/Philips Lifetime_200x150.jpg as test_upload_dir_86886/test_sync/test-h7/Philips_Lifetime_200x150
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/test_underscores____test/Ek_Bremen_P+R Syke_200x200.jpg as test_upload_dir_86886/test_sync/test_underscores____test/Ek_Bremen_P_R_Syke_200x200
Successfully uploaded /Users/christophersnyder/Projects/cloudinary-cli/test/resources/test_sync/wohnmobil-2010/hymer-1-2_)_98x63.jpg as test_upload_dir_86886/test_sync/wohnmobil-2010/hymer-1-2___98x63
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py:265: ResourceWarning: unclosed running multiprocessing pool <multiprocessing.pool.ThreadPool state=RUN pool_size=30>
  _warn(f"unclosed running multiprocessing pool {self!r}",
ResourceWarning: Enable tracemalloc to get the object allocation traceback
12 resources uploaded
  1. Compare and note that the test cloud environment returns different Public IDs. Sometimes invalid. For example, note how the characters ), (, +, (spaces) in the file names are treated differently by each environment.

Error screenshots or Stack Trace (if applicable)

Operating System

  • Linux
  • Windows
  • macOS
  • All

Environment and Frameworks (fill in the version numbers)

  • Cloudinary CLI version - 0.0.0
  • Cloudinary Python SDK version - 0.0.0
  • Python Version - 3.9

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

@chrissnyder2337
Copy link
Contributor Author

With some additional testing, I found that the Cloudinary test cloud is also returning invalid Public IDs with the following characters: <, &, #, ?.

@PixelCook
Copy link

Hey Chris,

I don't see any upload failures and I couldn't find any examples of assets with unpermitted characters in your DAM. Are you receiving any error messages from Cloudinary?

@chrissnyder2337
Copy link
Contributor Author

chrissnyder2337 commented Jan 30, 2023

@PixelCook

That is because the issue is with the Test Cloud, not my DAM. The test cloud is used when running python unit tests within the ci runners.

I have added steps to reproduce in the issue description.

@const-cloudinary
Copy link
Contributor

@chrissnyder2337 , there is this support post:
https://support.cloudinary.com/hc/en-us/articles/115001317409--Legal-naming-conventions

Nothing to do with the CLI.

@chrissnyder2337
Copy link
Contributor Author

Yes this is not an issue with the CLI, it is an issue with the test cloud that the CLI uses. That is what I am trying to point out. The "test cloud" is returning illegal public ids, and does not match what a real Cloudinary cloud account would return. This impacts the CLI development because the "test cloud", used by tests in this project, is returning illegal public ids, and does not match what a real Cloudinary cloud account would return. This impacts the ability to write accurate tests.

There may be another project/place that this issue could be moved to.

@Vdeub-cloudinary
Copy link

@chrissnyder2337 Would you mind sharing the cloud name for both your production and test accounts? Thanks

@cloudinary cloudinary deleted a comment from chrissnyder2337 Feb 1, 2023
@Vdeub-cloudinary
Copy link

Vdeub-cloudinary commented Feb 1, 2023

@chrissnyder2337 For security reasons, I had to delete your comment as you added your credentials and especially the API_SECRET. I got the information needed and I'll have a deeper look.

@Vdeub-cloudinary
Copy link

@chrissnyder2337 @const-cloudinary - it seems the test clouds are using custom flags that are not used by classic accounts. Especially, the test clouds were configured to allow specific characters in a public_id. I believe that's why there was a difference

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

No branches or pull requests

4 participants