hexpm / hex

Package manager for the Erlang ecosystem.
https://hex.pm
974 stars 187 forks source link

Add checks before publishing docs #591

Closed ericmj closed 6 years ago

ericmj commented 6 years ago

These checks are performed by hexpm right now, but the upload process will move to a separate service making the process sync. This makes it harder to give users feedback on these issues which means we should try and detect them in the client.

ericmj commented 6 years ago

@supersimple Thanks for the semver version check. If you would like to contribute the last part; we need to check the size of the docs tarball. The compressed size is currently limited to 8 * 1024 * 1024 [1] and 64 * 1024 * 1024 [2] uncompressed on the server side. We need to add these checks on the client side as well. The checks should be added to https://github.com/hexpm/hex_erl in a new function :hex_tarball.create_docs(...) that wraps this function [3].

Let us know if you wish to work on this, otherwise I will grab it in a few days.

[1] https://github.com/hexpm/hexpm/blob/emj/hexdocs/lib/hexpm/web/docs_tar.ex#L3 [2] https://github.com/hexpm/hexpm/blob/emj/hexdocs/lib/hexpm/web/docs_tar.ex#L4 [3] https://github.com/hexpm/hex/blob/master/lib/mix/tasks/hex.publish.ex#L282

supersimple commented 6 years ago

@ericmj I have been looking at it for a few days and trying to decipher the Erlang code. Sorry it is taking so long, but I have never worked in Erlang (past the occasional :timer call in Elixir. I am leaving for holiday tomorrow, for a few days, so if you or @wojtekmach feels like working on it in this week I will not be offended. Otherwise I will plan to keep working on it.

ericmj commented 6 years ago

No worries, there is no rush. Just wondering if you were planning to grab it so there was no duplicate work. If you need any pointers feel free to ping me or wojtekmach.

Have a nice holiday! 😎

zacck-zz commented 6 years ago

Can we close this? I think it's done?

ericmj commented 6 years ago

@zacck It is implemented in hex_core but we don't seem to be calling the appropriate function. Here https://github.com/hexpm/hex/blob/master/lib/mix/tasks/hex.publish.ex#L291 we should be calling :mix_hex_erl_tarball.create_docs/1.

zacck-zz commented 6 years ago

@ericmj sweet, let me get that one done