andygrove commented on code in PR #7112:
URL: https://github.com/apache/datafusion-comet/pull/7112#discussion_r4320645700
##########
docs/generate-versions.py:
##########
@@ -151,9 +171,31 @@ def generate_docs(snapshot_version: str,
latest_released_version: str, previous_
major_minor = get_major_minor_version(version)
insert_warning_after_asf_header(f"temp/user-guide/{major_minor}",
warning)
+def alias_latest(html_root: str):
+ """Serve the newest release's built user guide at user-guide/latest as
well.
+
+ This copies the finished HTML rather than building a second copy of the
sources, so Sphinx
+ sees each document once. It is a copy and not a symlink because the site
is published by
+ rsync into the asf-site branch, and ASF's web server is not known to
follow symlinks. Every
+ link in the pages is relative, so the copy works unchanged one directory
over.
+ """
+ user_guide = Path(html_root) / "user-guide"
+ source = user_guide / get_major_minor_version(LATEST_RELEASED_VERSION)
+ if not source.is_dir():
+ raise FileNotFoundError(f"{source} was not built, so there is nothing
to alias as latest")
+ target = user_guide / "latest"
+ if target.exists():
Review Comment:
Added the check at the top of `generate_docs`, so the build fails before
Sphinx runs if `docs/source/user-guide/latest` exists.
##########
docs/source/conf.py:
##########
@@ -207,13 +207,6 @@
"user-guide/operators.html": "latest/operators.html",
"user-guide/source.html": "latest/source.html",
"user-guide/tuning.html": "latest/tuning.html",
- # The compatibility guide became a directory of pages in #4055.
- "user-guide/latest/compatibility.html": "compatibility/index.html",
Review Comment:
You're right, `compatibility.html` and `parquet-iceberg-known-issues.html`
have no page in 1.1. Corrected the description. Both will 404 under `latest/`
until the next release, which is the policy stated there, so I left the
redirects out rather than change the copy to keep stubs.
##########
docs/generate-versions.py:
##########
@@ -111,16 +127,20 @@ def insert_warning_after_asf_header(root: str, warning:
str):
file.write_text("".join(new_lines), encoding="utf-8")
-def get_user_guide_dir(major_minor: str):
- if major_minor == "0.8" or major_minor == "0.9":
- return "docs/source/user-guide"
- else:
- return "docs/source/user-guide/latest"
+def get_user_guide_dir(clone_dir: str):
+ # Where a release branch keeps its user guide depends on when it was cut:
directly under
+ # user-guide/ before 0.10, under user-guide/latest/ until the 1.1 branch,
and under
+ # user-guide/dev/ after that.
+ for candidate in ("docs/source/user-guide/dev",
"docs/source/user-guide/latest"):
+ if (Path(clone_dir) / candidate).is_dir():
+ return candidate
+ return "docs/source/user-guide"
Review Comment:
Agreed. It now raises `FileNotFoundError` when neither `dev` nor `latest`
exists, and the comment is updated to match.
##########
docs/generate-versions.py:
##########
@@ -132,11 +152,11 @@ def publish_released_version(version: str):
def generate_docs(snapshot_version: str, latest_released_version: str,
previous_versions: list[str]):
# Strip release-only content; keep snapshot-only content for the latest
(snapshot) docs
Review Comment:
Fixed.
##########
.ai/skills/review-comet-expression-pr/SKILL.md:
##########
@@ -240,7 +240,7 @@ merge. Never ask the contributor to hand-edit them. Check
what feeds them:
### Hand-edited, the PR should update these
-- `docs/source/user-guide/latest/expressions.md`, the supported-expressions
list. A new expression
+- `docs/source/user-guide/dev/expressions.md`, the supported-expressions list.
A new expression
belongs here.
- Other `latest/compatibility/` pages such as `floating-point.md`, `regex.md`,
`operators.md`.
Review Comment:
Fixed, it now says `dev/compatibility/`.
##########
spark/src/test/scala/org/apache/spark/sql/benchmark/CometIcebergWriteBenchmark.scala:
##########
@@ -61,7 +61,7 @@ import org.apache.comet.CometSparkSessionExtensions
* pay equally. It dilutes the writer's factor rather than inflating it.
* - The warehouse is a local temporary directory, so no object-store
latency is included.
* - The two writers choose different file roll points (see the accepted
divergences in
- * `docs/source/user-guide/latest/iceberg-writes.md`), so the resulting
file layouts are not
+ * `docs/source/user-guide/dev/iceberg-writes.md`), so the resulting file
layouts are not
Review Comment:
Fixed in both benchmarks. They now point at the Accepted divergences section
of `dev/iceberg.md`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]