-
Notifications
You must be signed in to change notification settings - Fork 18
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
Consolidate onBuild tests + verify imagesPath for multiple operating systems #101
Consolidate onBuild tests + verify imagesPath for multiple operating systems #101
Conversation
✅ Deploy Preview for netlify-plugin-cloudinary ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
hey @gshel changes generally look good! looks like it's running into a little issue though are you able to see the logs? https://github.com/cloudinary-community/netlify-plugin-cloudinary/actions/runs/6885078686/job/18751733492?pr=101 |
I can, thanks @colbyfayock! I see that there is a posix test failing when |
definitely not expected! that may be a regression then? as it did work at one point. i dont currently have a test for that it seems |
I crack myself up. I wrote tests to catch issues caused by using |
…string or list, if undefined default to `/images` * Fixes issue wherein, if input imagesPath was a string, it would always use `/images`. This prevented users from specifying `/notimages` and `images/specificsubfolder` as their input imagesPath
… imagesPath is undefined
Okey doke I think it should be ready to pass all the tests now 🤞 I fixed the issue where I also added tests to make sure that imagesPath will:
There's quite a bit in this one PR; if you'd prefer I'd be happy to split it into separate PRs. Thanks @colbyfayock ! |
imagesPath = CLOUDINARY_ASSET_DIRECTORIES.find( | ||
({ inputKey }) => inputKey === 'imagesPath', | ||
)?.path, | ||
imagesPath = inputs.imagesPath || '/images', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at this again - the intent for using CLOUDINARY_ASSET_DIRECTORIES
was so that i could define the different configurations for different asset types in one location
for instance, in the future there could be a second object in CLOUDINARY_ASSET_DIRECTORIES
with a name of videos
im kind of surprised the default wasn't working properly as the code seems to run fine
can we keep the default value but use the inputs
first if available like you have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya!
im kind of surprised the default wasn't working properly as the code seems to run fine
I was surprised also, but I noticed the bug when testing locally and wrote two tests to confirm it.
To reproduce on the main branch:
- ✅ Run all tests successfully
pnpm -r test
- ✏️ Change line 129 of
on-build.test.js
to a string that is not/images
const imagesPath = '/notimages'
- ❌ Run all tests again; the test
should create redirects with defaut fetch-based configuration in deploy preview context
will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep the default value but use the inputs first if available like you have?
I'll look into this now~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
just one more question on the default value update! |
* CLOUDINARY_ASSET_DIRECTORIES is meant to contain configurations for various asset types in one location
thanks @gshel! |
Description
Consolidated and added new tests to demonstrate bug where Windows imagesPath contains url-encoded
\
, caused by path.join() using os specific separator which is escaped\
for windowsIssue Ticket Number
#100
Fixes #100
Type of change
Checklist