-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Re-add non-English ProGit downloads #1964
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We indent with spaces here, not using tabs. Signed-off-by: Johannes Schindelin <[email protected]>
Some books have downloadable PDF/ebook versions. In the `remote_genbook2` function, this information is discovered dynamically by looking at the corresponding repository's latest release. This functionality is useful even in the GitHub workflow that keeps https://git-scm.com/book/ up to date, so let's refactor it into a reusable function. Signed-off-by: Johannes Schindelin <[email protected]>
There used to be convenient download links for some of the ProGit book translations. In the transition to a Hugo-generated site, these links were lost for all except the original English version, where the downloads were hard-coded. The reason is that in the Hugo world, we want to avoid network-heavy roundtrips that would be necessary when using the `remote_genbook2` function, and we use `local_genbook2` instead, where the information about what downloadable assets there are (if any) is simply not there. Let's add a way to discover the downloadable assets, by using Octokit, but still use the local clone for the rest of the generation. The way to enable this is by providing a `GITHUB_API_TOKEN` environment variable. If that environment variable is not set, no dynamic discovery will be performed. Signed-off-by: Johannes Schindelin <[email protected]>
This is needed whenever calling Octokit. So far, this has not been necessary in the GitHub workflows, but in the next commit we will switch to discover the ProGit downloads dynamically, which requires Octokit. Signed-off-by: Johannes Schindelin <[email protected]>
…ions In the transition to the Hugo world, these download links were lost. By using the just-introduced feature where `script/update-book2.rb` can work on a clone of the (potentially translated) ProGit book but also discover dynamically in what format the book can be downloaded (if any), we can add those back. This closes git#1963. Signed-off-by: Johannes Schindelin <[email protected]>
When forcing a full rebuild, it is possible that some translations do not result in any change. Allow for that _specifically_ when force-rebuilding, but not otherwise (where it would be a bug if there was no change, as at least the head commit will be changed). Signed-off-by: Johannes Schindelin <[email protected]>
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
Updated via the `update-book.yml` GitHub workflow.
…nglish-progit-downloads
…nglish-progit-downloads
I'll just go ahead and merge before there will be any merge conflicts. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Example:
Context
As reported in #1963, the download links for the non-English versions of the ProGit book were lost. The reason was that during the transition to the Hugo world, we switched from generating the ProGit HTML pages from dynamically-fetched Git objects (via Octokit) to using a local clone instead, and that local clone lacks the information which downloadable versions of the respective ProGit translation exists (if any).
This PR introduces changes so that the download links are once again discovered dynamically, without the need to switch away from using clones to generate the HTML pages.
This PR also needed to fix the
update-book
workflow so that it handles gracefully when forcing a complete re-generation might not result in any committable changes in some of the translations.The actual
book/
updates were performed by this manualupdate-book
workflow run where I setforce-rebuild
totrue
.This closes #1963