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

feat: add parameter to disable path encoding #124

Merged
merged 2 commits into from
Oct 18, 2022

Conversation

pypas
Copy link
Contributor

@pypas pypas commented Oct 6, 2022

Description

Adds a disable_path_encoding parameter to allow user to opt-out of path encoding (issue: #117)

Checklist

  • Read the contributing guidelines.
  • Each commit follows the Conventional Commit spec format.
  • Update the readme (if applicable).
  • Update or add any necessary API documentation (if applicable)
  • All existing unit tests are still passing (if applicable).
  • Add new passing unit tests to cover the code introduced by your PR (if applicable).

@pypas pypas requested a review from a team as a code owner October 6, 2022 07:46
@commit-lint
Copy link

commit-lint bot commented Oct 6, 2022

Features

  • add parameter to disable path encoding (ede1d53)

Contributors

pypas

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

@pypas pypas force-pushed the feat/optionally-disable-path-encoding branch from 5be58cd to a140441 Compare October 6, 2022 07:48
Copy link
Contributor

@atlawrie atlawrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pypas,
While this looks good at first, there's one or two things we want to double check. Nonetheless, thank you for your hard work!

Copy link
Contributor

@atlawrie atlawrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pypas - looking into it a little deeper, it looks like your changes broke some of our preexisting tests as is. While your revised tests do pass as intended, there's a concern that this might serve as a breaking change for current users. In this instance, it'd be ideal for a solution to this issue to be able to pass our current tests as is, in addition to any new ones you've written testing the new functionality.

@pypas pypas force-pushed the feat/optionally-disable-path-encoding branch 2 times, most recently from 581c6bc to 68816c8 Compare October 7, 2022 08:16
@pypas
Copy link
Contributor Author

pypas commented Oct 7, 2022

Hey @atlawrie , I've updated the code as not to break the preexisting test, let me know what you think!

@luqven luqven added hacktoberfest Good first issue for hacktoberfest contributors enhancement labels Oct 13, 2022
Copy link
Contributor

@luqven luqven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @pypas,

This is looking great, awesome work.

I do think we need to enable this functionality for the srcsets as well. Do you think you could update this PR to include the disable_path_encoding option when to_url in invoked in build_srcset_pairs and build_dpr_srcset?

edit: I forgot to mention, we'll need tests for disable_path_encoding in the to_srcset specs as well.

@pypas pypas force-pushed the feat/optionally-disable-path-encoding branch from 68816c8 to ede1d53 Compare October 17, 2022 06:41
@pypas pypas requested review from luqven and atlawrie and removed request for luqven October 17, 2022 06:41
README.md Outdated
#=> https://your-subdomain.imgix.net/%5Bimages%5D/demo.png?s=270832685733a36ba02bd8ab9fd72df5
client.path('/[images]/demo.png').to_url({},{disable_path_encoding: true})
#=> https://your-subdomain.imgix.net/[images]/demo.png?s=ed6eb07e9eff3f6c8bbcc83fc4f63198

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up that you're missing a closing ``` here

Copy link
Contributor

@luqven luqven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼 great work, let's just add that closing "```" to the README. I've also left two small non-blocking comments, but feel free to ignore them.

Once that README change is done we should be ready to merge.

lib/imgix/path.rb Outdated Show resolved Hide resolved
test/units/srcset_test.rb Outdated Show resolved Hide resolved
Co-authored-by: Luis H. Ball Jr. <[email protected]>
@pypas pypas force-pushed the feat/optionally-disable-path-encoding branch from 1003de8 to c93c409 Compare October 18, 2022 12:02
@pypas
Copy link
Contributor Author

pypas commented Oct 18, 2022

Thanks for the suggestions @luqven and @sherwinski!

Copy link
Contributor

@luqven luqven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼 , great work on this 👏🏼

yes-nice-gif

@luqven luqven merged commit b9405d1 into imgix:main Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement hacktoberfest Good first issue for hacktoberfest contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants