Merged
Conversation
This preliminary commit move build-related variables from :build task out to :book namespace. Such variables will be referenced by each generating tasks. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
For each formats, including currently unsupported Mobi format, extract from :build task. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
This file task is required to build books. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
The default task is now empty, so we can simply list its dependency tasks. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Clean all generated artifacts (contributors list and book formats). Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
As suggested by @jnavila. Check only HTML and epub books. As before this refactor, default book:build task also check them. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Instead of invoking :check as dependency, explicitly invoke it inside the body of :build. As suggested by @jnavila, any errors raised from :check should not cause FTBFS, thus ignore them. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
As suggested by @jnavila. Similar to :build, but don't ignore any errors. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Contributor
HonkingGoose
left a comment
There was a problem hiding this comment.
What do you think of these changes?
Apply suggestions from @HonkingGoose: - README rewording - FIXME line fitting on Rakefile Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Contributor
Author
|
review ping |
Contributor
jnavila
requested changes
Feb 6, 2021
Member
jnavila
left a comment
There was a problem hiding this comment.
Thank you for proposing. These are mostly style comments.
As per code review, @jnavila reported an error that requires begin/end block for multiline rescue body. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
As per code review by @jnavila Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
As requested by @jnavila in code review. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
In order to check contributors list by commit hash, the hash have to be added to the list. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
…it hash As requested by @jnavila in code review. Compare current HEAD commit hash against the hash stored in the header of contributors list. If these match, go on. If not, refresh (rm and generate contributors list again). Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
As to be consistent with other non-interpolated strings. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
…sk-refactor Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Contributor
Author
|
review ping |
Comment on lines
18
to
37
| # Check contributors list | ||
| # This checks commit hash stored in the header of list against current HEAD | ||
| def check_contrib | ||
| if File.exist?('book/contributors.txt') | ||
| current_head_hash = `git rev-parse --short HEAD`.strip | ||
| header = `head -n 1 book/contributors.txt`.strip | ||
| # Match regex, then coerce resulting array to string by join | ||
| header_hash = header.scan(/[a-f0-9]{7,}/).join | ||
|
|
||
| if header_hash == current_head_hash | ||
| puts "Hash on header of contributors list (#{header_hash}) matches the current HEAD (#{current_head_hash})" | ||
| else | ||
| puts "Hash on header of contributors list (#{header_hash}) does not match the current HEAD (#{current_head_hash}), refreshing" | ||
| `rm book/contributors.txt` | ||
| # Reenable and invoke task again | ||
| Rake::Task['book/contributors.txt'].reenable | ||
| Rake::Task['book/contributors.txt'].invoke | ||
| end | ||
| end | ||
| end |
Contributor
There was a problem hiding this comment.
Suggested change
| # Check contributors list | |
| # This checks commit hash stored in the header of list against current HEAD | |
| def check_contrib | |
| if File.exist?('book/contributors.txt') | |
| current_head_hash = `git rev-parse --short HEAD`.strip | |
| header = `head -n 1 book/contributors.txt`.strip | |
| # Match regex, then coerce resulting array to string by join | |
| header_hash = header.scan(/[a-f0-9]{7,}/).join | |
| if header_hash == current_head_hash | |
| puts "Hash on header of contributors list (#{header_hash}) matches the current HEAD (#{current_head_hash})" | |
| else | |
| puts "Hash on header of contributors list (#{header_hash}) does not match the current HEAD (#{current_head_hash}), refreshing" | |
| `rm book/contributors.txt` | |
| # Reenable and invoke task again | |
| Rake::Task['book/contributors.txt'].reenable | |
| Rake::Task['book/contributors.txt'].invoke | |
| end | |
| end | |
| end | |
| # Check contributors list | |
| # This checks the commit hash stored in the header of the list against the current HEAD | |
| def check_contrib | |
| if File.exist?('book/contributors.txt') | |
| current_head_hash = `git rev-parse --short HEAD`.strip | |
| header = `head -n 1 book/contributors.txt`.strip | |
| # Match regex, then coerce resulting array to string by join | |
| header_hash = header.scan(/[a-f0-9]{7,}/).join | |
| if header_hash == current_head_hash | |
| puts "Hash on header of contributors list (#{header_hash}) matches the current HEAD (#{current_head_hash})" | |
| else | |
| puts "Hash on header of contributors list (#{header_hash}) does not match the current HEAD (#{current_head_hash}), refreshing" | |
| `rm book/contributors.txt` | |
| # Re-enable and invoke task again | |
| Rake::Task['book/contributors.txt'].reenable | |
| Rake::Task['book/contributors.txt'].invoke | |
| end | |
| end | |
| end |
Some small comment fixes.
Member
|
The build is failing with syntax error. |
That line cause FTBFS on CI. It was forgotten to be deleted on previous commit, due to hurry. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Contributor
Author
|
review ping |
Member
|
It looks good to me. Thank you very much! |
shi1647ra
reviewed
Feb 16, 2021
srgizh
added a commit
to srgizh/progit2-ru
that referenced
this pull request
Feb 28, 2021
progit/progit2#1598 Co-authored-by: Bagas Sanjaya <bagasdotme@gmail.com>
srgizh
added a commit
to srgizh/progit2-ru
that referenced
this pull request
Feb 28, 2021
progit/progit2#1598 Co-authored-by: Bagas Sanjaya <bagasdotme@gmail.com>
2 tasks
This file contains hidden or 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
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
This PR refactors monolithic
book:buildtask into several smaller tasks:book/contributors.txtfile task: generates contributors list required to build book formatsbook:build_html- build HTML formatbook:build_epub- build Epub formatbook:build_pdf- build PDF formatbook:check- check HTML and EpubThis also add convenience tasks:
book:clean- clean artifacts (contributors list and books)book:ci- build books with checking enforced (not ignored), targeted for CI.Note: The CI doesn't execute
book:ci, but still runningbook:buildinstead. Discussions are welcome whether the CI should switch tobook:cior not.Context
Fixes #1595