progit / progit2-bg

Other
3 stars 8 forks source link

Failed to build progit2-bg after integrating upstream changes #7

Closed wencywww closed 4 years ago

wencywww commented 4 years ago

Hi, can you please take a look at: https://travis-ci.org/github/progit/progit2-bg/builds/738896536

The buid is failing and i can't figure out why? Thanks.

jnavila commented 4 years ago

You have to be very careful about cross-chapter references.

With the upcoming shift to asciidoctor 2, this limitation should disappear, but meanwhile, this is still active.

wencywww commented 4 years ago

Yeah, but the log output was not very helpful about that: asciidoctor: WARNING: ch02-git-basics-chapter.asc: invalid reference to unknown local anchor (or valid bibref): _rebase_peril.

Meanwhile - should we accept the automatic PR generated by dependabot or it is too early for this: https://github.com/progit/progit2-bg/pull/6

jnavila commented 4 years ago

The issue with this PR is that it implies migrating the text format to the newer version. Right now, it cannot be fully automated and this means having to dig through the compilation log for errors and fixing them, quite in the same way I fixed this issue. The process being manual, I expect to be involved but I clearly haven't had enough time for this lately.

wencywww commented 4 years ago

To be honest, i'm still confused :( According to your fix today, https://github.com/progit/progit2-bg/commit/40b4f11ae87d87c3f60028f7c7dd4fd289f978ef, the build on the upstream should also fail, it still says: <<_rebase_peril>> instead of: <<ch03-git-branching#_rebase_peril>>

jnavila commented 4 years ago

A few comments:

Difference with progit2

The English version is not compiled with the same scripts as the one I have set up for the translations. For the translations, in order to help translators keep the asciidoc formating correct, I added a check on the epub file, with epubcheck. By doing so, we can catch a lot of missing asciidoc formatting errors. On the main Progit2 repo, there are no checks, so I'm not sure everything is ok. To be honest, I think that the latest version of asciidoctor-epub3 does work with the links defined like in progit2, but for now, it's still necessary to add the first level file of each chapter for the translations, until I make the migration.

Finding the errors

Here is what I did to catch the error:

From the log message that you mentionned, the error comes from some mistake in writing links to _rebase_peril anchor. so

1  $ cd progit2-bg
2  $ grep -r _rebase_peril *
3  book/06-github/sections/2-contributing.asc:Ако други хора вече са го изтеглили и са работили по него, ще се сблъскате с всички проблеми посочени в <<ch03-git-branching#_rebase_peril>>.
4  book/07-git-tools/sections/advanced-merging.asc:Погледнете <<ch03-git-branching#_rebase_peril>> за повече информация какво би могло да се случи. Накратко, би следвало да избягвате `reset` ако други хора вече имат къмитите, които ще преработите.
5  book/03-git-branching/sections/rebasing.asc:[[_rebase_peril]]
6  book/02-git-basics/sections/undoing.asc:За повече информация какво се случва, когато се прави това и как да възстановите пораженията, ако сте от приемащата страна, прочетете <<#_rebase_peril>>. 

on the line 5, you can see that the anchor is define in chapter 3, and on line 6, that the link is in chapter 3 but does not include the chapter part.

wencywww commented 4 years ago

Understood, thank you!