OSDOCS 8020 modify the build_for_portal.py and makeBuild.py scripts to support second-level books and improve intra-book links#65701
Conversation
| os.makedirs(directory) | ||
|
|
||
| def expand_huge_books(info): | ||
| """ |
There was a problem hiding this comment.
Would something like this work if you wanted to go mad with list comprehensions?
def expand_huge_books(info):
"""
Finds nodes for huge books, creates new nodes for books from their top-level topics,
and then removes the nodes for huge books
"""
huge_book_nodes = [book for book in info["book_nodes"] if book["Name"] in LIST_OF_HUGE_BOOKS]
additional_nodes = [
{
"Dir": f"{book['Dir']}/{topic['Dir']}",
**topic,
}
for book in huge_book_nodes
for topic in book["Topics"]
if "Dir" in topic
]
info["huge_book_dirs"].extend(book["Dir"] for book in huge_book_nodes)
info["book_nodes"] = [node for node in info["book_nodes"] if node not in huge_book_nodes]
info["book_nodes"].extend(additional_nodes)
Could also consider pathlib for all of these changes if you like its ergonomics. 🤷
There was a problem hiding this comment.
I'm not sure about going just this mad with list comprehensions but I will try to use some of this tomorrow Thursday. As for pathlib, I think it should be used everywhere or nowhere and it's to much work to use it everywhere.
aa90adf to
c810289
Compare
…o support second-level books and improve intra-book links
f652536 to
aeb5e85
Compare
|
@maxwelldb, do you see any reason to wait to merge this one? |
|
@kalexand-rh Not really, no. It'd be nice to run Black on any Python code as a matter of neatness, but you're the DPM and can make a call as to whether you want to be strict about formatting or not. 👍 |
|
Then for the sake of orderliness, will one you do that? |
|
@maxwelldb while I don't have a problem with running Black, I suggest this be done separately, just in case Black alters the execution even though it is not designed to do so. There is one more issue to work out anyway: the imp module, which is deprecated and slated to be removed. I can look into this - but again I'd like to separate this from the function enhancement. |
|
Fair enough. I'm going to merge it and CP it to 4.14. |
|
/cherrypick enterprise-4.14 |
|
@kalexand-rh: #65701 failed to apply on top of branch "enterprise-4.14": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@mramendi, will you please manually cherry-pick to 4.14? I reviewed the commit history between |
|
@kalexand-rh done #65981 |
|
This change passes broken AsciiDoc and reports a passed build. IMO it should be reverted, reworked, and tested thoroughly before merging. |
|
@aireilly details please? |
|
All 4.14 portal validation builds that run makeBuild.py and build.py pass the build even when there are errors in the build. Example: https://app.travis-ci.com/github/openshift/openshift-docs/jobs/611584490 This means that the 4.14 production build for the portal OCP docs is now broken. |
|
The sync to the portal uses build_for_portal.py, not build.py, and, at least as of Thursday, all of the 4.14 PV1 jobs were passing. I think we need to investigate switching Travis to use build_for_portal.py. |
Version(s):
4.14+ to validate
Issue:
Link to docs preview:
QE review:
Additional information: