Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Heads up: ProGit2 build process is not providing .mobi files for now #1498

Closed
HonkingGoose opened this issue Aug 28, 2020 · 25 comments
Closed

Comments

@HonkingGoose
Copy link
Contributor

HonkingGoose commented Aug 28, 2020

Which download is failing?

The link to the latest .mobi files at https://git-scm.com/book/en/v2 is gone.

Problem

The .mobi files are gone upstream, and so the link to the .mobi files is too.

Context

The ProGit2 project had to disable .mobi builds with progit/progit2#1497 because the kindlegen gem that we use to generate the .mobi files whenever Travis CI makes a build cannot be downloaded anymore. See progit/progit2#1496 for more on this.

Steps to Reproduce

  1. Go to the https://git-scm.com/book/en/v2 once the git-scm site build is refreshed.
  2. Click on the .mobi link.
  3. It will probably break.

Other details

Hi git-scm team, I wanted to provide a heads up for you. I hope I filled the correct issue template! 😄

@pedrorijo91
Copy link
Member

wow :) thanks a lot for the heads-up @HonkingGoose !

is there any ETA for getting the .mobi files working again? If I understood correctly, amazon stopped serving a binary which kindlegen wrapped?

@pedrorijo91
Copy link
Member

I think it's just a matter of removing from the UI until things are solved, in these lines

<div class="ebooks">
<% if @book.ebook_mobi %>
<a href="<%= @book.ebook_mobi %>"><img width="50px" src="/images/mobi.png"/></a>
<% end %>
</div>

@HonkingGoose
Copy link
Contributor Author

HonkingGoose commented Aug 28, 2020

I cannot provide any ETA on when the .mobi files will be available again, because I'm not the one that has the ability or knowledge to fix this.

You can follow the asciidoctor-epub3 issue here: asciidoctor/asciidoctor-epub3#363
and the upstream kindlegen issue here: tdtds/kindlegen#42


EDIT:

If I understood correctly, amazon stopped serving a binary which kindlegen wrapped?

Yes that's right. The replacement that Amazon provides (Kindle Previewer) does not have a Linux binary.

@HonkingGoose
Copy link
Contributor Author

I think it's just a matter of removing from the UI until things are solved, in these lines

<div class="ebooks">
<% if @book.ebook_mobi %>
<a href="<%= @book.ebook_mobi %>"><img width="50px" src="/images/mobi.png"/></a>
<% end %>
</div>

Feel free to propose a pull request to delete the .mobi link. I would recommend putting a comment in, so that it's clear why the link was removed, and maybe link to this issue and the upstream ProGit2 issue.

That way it's documented in your code what happened and why, and people can check if/when the issue is fixed and put the .mobi link back.

@HonkingGoose
Copy link
Contributor Author

I visited the page after the site build refreshed: the .mobi link is gone. The pdf and epub have links to version 2.1.259, which are current as of now.

So maybe this takes no action on your side, and the system will just pick up the .mobi files once they are available again. 😄

@jnavila
Copy link
Contributor

jnavila commented Aug 29, 2020

Calibre has a converter to azw, but I fear the quality of the output is not the same as kindlegen.

@HonkingGoose
Copy link
Contributor Author

Yeah I searched for some alternative tool-chain and stumbled into Calibre as well, it does have a command line interface that we maybe could use. That would probably require another Travis CI build chain to be built.

And we would first need to know if the .epub -> Calibre -> Kindle output is any good. So maybe we can get a Kindle user to do the conversion and report back on the results?

@peff
Copy link
Member

peff commented Sep 1, 2020

So maybe this takes no action on your side, and the system will just pick up the .mobi files once they are available again.

Yeah, I think that's what's supposed to (and will) happen. But thank you very much for letting us know about the situation.

I suppose we could also provide an older version of the .mobi, if somebody feels strongly enough about that format that they'd prefer out-of-date content to using .epub or whatever. But I'd prefer not to get into that unless somebody asks for it.

@HonkingGoose
Copy link
Contributor Author

Yeah, I agree: only provide outdated .mobi files if there is actual demand.

This is also a good way to figure out if those .mobi builds are actually valued at all... I've yet to see a issue report here, or on the ProGit2 repo asking about the .mobi files.

@pedrorijo91
Copy link
Member

not sure if it's possible to find out how many accesses to the mobi file there were before this. The url seems to be something like

https://github.com/progit/progit2/releases/download/2.*.*/progit.pdf

I can try to find out during the weekend perharps

@HonkingGoose
Copy link
Contributor Author

Having some historical data would help with making the judgement call if the .mobi files are even worth the support/maintenance cost.

I've seen no comments/issues on the ProGit2 repo, asking about the .mobi files. So it could be that those .mobi files are not really in high demand.
Maybe people just use the version of the book hosted on the website (.html) or download the .epub and .pdf files for their e-book reader or local workstation.

@HonkingGoose
Copy link
Contributor Author

I've opened a PR upstream at the ProGit2 repository that should re-enable the .mobi files. See progit/progit2#1655, once that's merged I'll close this issue.

@pedrorijo91
Copy link
Member

seems like the PR was already merged right @HonkingGoose ?

@HonkingGoose
Copy link
Contributor Author

Yeah, but it's not working... I'm not sure what I need to do to fix it... 😕

@HonkingGoose

This comment has been minimized.

@HonkingGoose
Copy link
Contributor Author

ProGit2 is publishing .mobi files again! Go to https://github.com/progit/progit2/releases to see the progit.mobi files. 😄

The only thing left to do is to verify that git-scm picks up the new files correctly when your Heroku build process runs?

By the way, the progit/progit2 repository now uses a main branch, instead of a master branch. This shouldn't cause issues as @peff already did some preparatory work with PR #1502.

But you should still verify that things work properly after both those changes. 😉

@HonkingGoose
Copy link
Contributor Author

Having some historical data would help with making the judgement call if the .mobi files are even worth the support/maintenance cost.

I've seen no comments/issues on the ProGit2 repo, asking about the .mobi files. So it could be that those .mobi files are not really in high demand.
Maybe people just use the version of the book hosted on the website (.html) or download the .epub and .pdf files for their e-book reader or local workstation.

The progit2 repository maintainer has said that they consider providing the .mobi files to be very important. So we'll probably continue to provide these files, unless we encounter new issues with the toolchain. 😄

@peff
Copy link
Member

peff commented Jun 29, 2021

Hmm, now we don't seem to be generating links for any books! We find the appropriate assets for each release based on their content_type field. But that has changed recently. Running this ruby snippet:

require "octokit"
o = Octokit::Client.new(access_token: ENV["GITHUB_API_TOKEN"])
o.releases("progit/progit2").each do |rel|
        rel.assets.each do |asset|
                puts "#{rel.tag_name} #{asset.name} #{asset.content_type}"
        end
end

yields:

2.1.313 progit.epub raw
2.1.313 progit.html raw
2.1.313 progit.mobi raw
2.1.313 progit.pdf raw
2.1.312 progit.epub raw
2.1.312 progit.html raw
2.1.312 progit.pdf raw
2.1.311 progit.epub raw
2.1.311 progit.html raw
2.1.311 progit.pdf raw
2.1.310 progit.epub raw
2.1.310 progit.html raw
2.1.310 progit.pdf raw
2.1.309 progit.epub raw
2.1.309 progit.html raw
2.1.309 progit.pdf raw
2.1.308 progit.epub application/epub+zip
2.1.308 progit.html text/html
2.1.308 progit.pdf application/pdf
2.1.307 progit.epub application/epub+zip
2.1.307 progit.html text/html
2.1.307 progit.pdf application/pdf
2.1.306 progit.epub application/epub+zip
2.1.306 progit.html text/html
2.1.306 progit.pdf application/pdf
2.1.305 progit.epub application/epub+zip
2.1.305 progit.html text/html
2.1.305 progit.pdf application/pdf
[...and so on...]

So it looks like something changed recently on the release-generation side, and the content-types were lost. We probably could switch to matching the extension in the filename, but I suspect it would be worth fixing the content-type problem for other reasons (e.g., I imagine it impacts the content-type GitHub sends to users when they click on the releases in a browser).

@HonkingGoose
Copy link
Contributor Author

HonkingGoose commented Jun 29, 2021

We did just migrate ProGit2 from Travis CI -> GitHub Actions. Maybe that's breaking something?

EDIT:

@peff
Copy link
Member

peff commented Jun 29, 2021

So it looks like something changed recently on the release-generation side, and the content-types were lost.

Diffing 2.1.308 and 2.1.309, it looks like the release creation now uses https://github.com/ncipollo/release-action, but doesn't pass artifactContentType, so the default is raw. It's not clear to me if that property can take a comma-separated list like artifacts does.

@peff
Copy link
Member

peff commented Jun 29, 2021

It's not clear to me if that property can take a comma-separated list like artifacts does.

Looks like no. The code seems to apply a single content-type to every artifact. So a fix would probably involve extending that action, and then updating progit2 to make use of the new feature. Yikes.

Even if that happens, it may take a while. I think we should switch to selecting based on the names in the meantime.

peff added a commit that referenced this issue Jun 29, 2021
Since progit2 2.1.309 switched to using a GitHub Action to generate
releases, it no longer sets the content-type field of the release
assets. And thus we fail to find any ebooks to link, since we are
looking for assets with "application/pdf", and so on.

Instead, let's do a suffix match against the name of each asset, looking
for the appropriate file extension. This works fine, since the names are
all obvious ("progit.epub", and so on). And it should be
backwards-compatible with older translations that haven't yet picked up
the new Actions-based workflow, since they used the same sensible names.

We may revert this later if the assets start generating with correct
content-types again. But it looks to be non-trivial (there's some
discussion in #1498), so this seems like a good solution in the
meantime.
@peff
Copy link
Member

peff commented Jun 29, 2021

Should be fixed by #1615. Running it locally restores the epub and pdf links, and now generates a mobi link, too. 😅

@peff
Copy link
Member

peff commented Jun 29, 2021

OK, with #1615 merged, I kicked off a manual book generation job, purged the cloudflare cache, and now things are looking good: the main https://git-scm.com/book page has three links (epub, pdf, and mobi). So I think we're probably good to close this issue now!

@HonkingGoose
Copy link
Contributor Author

Looks good to me on the deployed site as well.

I agree, let's close this issue! 😄

@muhamadhafizy1991

This comment was marked as spam.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants