Git Product home page Git Product logo

Comments (19)

allenwyma avatar allenwyma commented on July 21, 2024 1

I'm more than happy to help out on this cause I'd hate to see such a useful package stalled out due to someone being busy. :)

from ecto_commons.

allenwyma avatar allenwyma commented on July 21, 2024 1

replaced with URI.parse/1 and seems to work fine, at least for the tests.

from ecto_commons.

aparod avatar aparod commented on July 21, 2024

You're probably running different versions of Erlang between your dev and prod environments. I'm on Erlang/OTP 24 and it gives me a warning that :http_uri.parse/1 is deprecated and will be removed in OTP 25.

from ecto_commons.

achedeuzot avatar achedeuzot commented on July 21, 2024

Hm indeed, it looks like a difference in OTP versions. Thanks @aparod ❤️
We'll have to look for a replacement of the :http_uri.parse function for this validator for OTP > 25.

from ecto_commons.

allenwyma avatar allenwyma commented on July 21, 2024

What about URI.new/1 in Elixir?

from ecto_commons.

allenwyma avatar allenwyma commented on July 21, 2024

hi @achedeuzot its' been quite some time and this issue still isn't resolved. I've also noticed you have quite a few dependabot PRs waiting to be updated.

Did you need some help with this project?

from ecto_commons.

achedeuzot avatar achedeuzot commented on July 21, 2024

@allenwyma I'd be happy to have a hand on it indeed, I've been quite busy lately so I've struggled to find time to maintain this even tough I still use it in production.

from ecto_commons.

allenwyma avatar allenwyma commented on July 21, 2024

@achedeuzot as a workaround, erlang uses to use :uri_string, so I was looking at :uri_string.parse/1 but these URIs are failing in the test to be marked as false:

rdar://1234
h:/test
ftps://foo.bar/

from ecto_commons.

achedeuzot avatar achedeuzot commented on July 21, 2024

They do look false though, don't they ? Well we can set them as truthy but it might provide a less strict validation which could have unintended consequences on end-users of the lib :/ This option would probably require a lib major version bump so users are aware of the breaking change.

What about using URI.parse/1 ?

from ecto_commons.

allenwyma avatar allenwyma commented on July 21, 2024

URI.parse/1 will parse anything:

iex> URI.parse("foo/bar")
%URI{
  fragment: nil,
  host: nil,
  path: "foo/bar",
  port: nil,
  query: nil,
  scheme: nil,
  userinfo: nil
}

from ecto_commons.

allenwyma avatar allenwyma commented on July 21, 2024

@achedeuzot let me know what you think of #88

I went back and looked at the code for http_uri and looks like they hard checked for certain ports if they are there or not, which is what i tried to emulate.

from ecto_commons.

achedeuzot avatar achedeuzot commented on July 21, 2024

#88 looks good :)

I'm just a bit unsure of using uri_string vs URI.parse, WDYT is more future proof ?

from ecto_commons.

achedeuzot avatar achedeuzot commented on July 21, 2024

Looks good with URI.parse/1 :)
It seems the CI script will need a bit of a refresher too for erlang / elixir compatibility matrix.

from ecto_commons.

allenwyma avatar allenwyma commented on July 21, 2024

@achedeuzot no idea how this stuff works, can you take a moment to try to fix that?

from ecto_commons.

joeyates avatar joeyates commented on July 21, 2024

Hi @achedeuzot (pinging also @allenwyma and @esacteksab)

I'd be willing to sort out the URI stuff and the CI matrix, but I think it would be a good idea to clarify a couple of things first...

URI Parsing

Firstly, uri_string is not available in all OTP versions: "Module uri_string was introduced in OTP 21.0"

Secondly, it is not possible to specify a minimum OTP version in mix.exs - it's an explicit policy.

But, URI.parse/1 has been around since well before Elixir 1.9.0. And this library declares 1.9 as it's minimal supported version.

So, I think the best way forward with URI parsing is to switch to using Elixir's URI.parse/1.

Build Matrix

The current CI configuration runs 3*4 - 5 = 7 builds.

In comparison, Ecto runs 3.

I propose reducing down to 3. I would keep the same minimum versions as now (Elixir 1.9.4 and OTP 20.3), plus the latest releases of both (currently Elixir 1.16.0 and OTP 26.2.1) plus one more in the middle (Elixir 1.13, OTP 23).

from ecto_commons.

joeyates avatar joeyates commented on July 21, 2024

Additional note: it would be necessary to implement the failure cases of http_uri.parse/1 as URI.parse/1 accepts any String.

from ecto_commons.

achedeuzot avatar achedeuzot commented on July 21, 2024

Hi @joeyates 👋

I haven't had the time lately to give this lib the love it deserves. I'm happy to merge PRs that fix or improve the CI as well as the compatibility matrix and support :)

from ecto_commons.

joeyates avatar joeyates commented on July 21, 2024

I've made a PR (#90) with the introduction of URI.new/1 to replace calls to the OTP function :http_uri.parse/1.

from ecto_commons.

achedeuzot avatar achedeuzot commented on July 21, 2024

All the pending pull requests have been merged and/or the corresponding issue fixed.
There's a new release: 0.3.5 🎉

Thank you all for your contributions ❤️🤗

from ecto_commons.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.