Skip to content

Commit 6a2209d

Browse files
authored
docs: Stop generating dynamic docs content in build (#3212)
1 parent 5cfca94 commit 6a2209d

File tree

9 files changed

+88
-497
lines changed

9 files changed

+88
-497
lines changed

dev/generate-release-docs.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
# This script generates documentation content for a release branch.
20+
# It should be run once when creating a new release branch to "freeze"
21+
# the generated docs (configs, compatibility matrices) into the branch.
22+
#
23+
# Usage: ./dev/generate-release-docs.sh
24+
#
25+
# This script:
26+
# 1. Compiles the spark module to access CometConf and CometCast
27+
# 2. Runs GenerateDocs to populate the template markers in the docs
28+
# 3. The resulting changes should be committed to the release branch
29+
#
30+
# Example workflow when cutting release 0.13.0:
31+
# git checkout -b branch-0.13 main
32+
# ./dev/generate-release-docs.sh
33+
# git add docs/source/user-guide/latest/
34+
# git commit -m "Generate docs for 0.13.0 release"
35+
# git push origin branch-0.13
36+
37+
set -e
38+
39+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
40+
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
41+
42+
cd "${PROJECT_ROOT}"
43+
44+
echo "Compiling common and spark modules..."
45+
./mvnw -q compile -pl common,spark -DskipTests
46+
47+
echo "Generating documentation content..."
48+
./mvnw -q exec:java -pl spark \
49+
-Dexec.mainClass=org.apache.comet.GenerateDocs \
50+
-Dexec.arguments="${PROJECT_ROOT}/docs/source/user-guide/latest/" \
51+
-Dexec.classpathScope=compile
52+
53+
echo ""
54+
echo "Done! Generated documentation content in docs/source/user-guide/latest/"
55+
echo ""
56+
echo "Next steps:"
57+
echo " git add docs/source/user-guide/latest/"
58+
echo " git commit -m 'Generate docs for release'"
59+
echo " git push"

dev/release/README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,29 @@ origin git@github.com:yourgithubid/datafusion-comet.git (push)
4242
Create a release branch from the latest commit in main and push to the `apache` repo:
4343

4444
```shell
45-
get fetch apache
45+
git fetch apache
4646
git checkout main
4747
git reset --hard apache/main
4848
git checkout -b branch-0.1
4949
git push apache branch-0.1
5050
```
5151

52+
### Generate Release Documentation
53+
54+
Generate the documentation content for this release. The docs on `main` contain only template markers,
55+
so we need to generate the actual content (config tables, compatibility matrices) for the release branch:
56+
57+
```shell
58+
./dev/generate-release-docs.sh
59+
git add docs/source/user-guide/latest/
60+
git commit -m "Generate docs for 0.1.0 release"
61+
git push apache branch-0.1
62+
```
63+
64+
This freezes the documentation to reflect the configs and expressions available in this release.
65+
66+
### Update Maven Version
67+
5268
Update the `pom.xml` files in the release branch to update the Maven version from `0.1.0-SNAPSHOT` to `0.1.0`.
5369

5470
There is no need to update the Rust crate versions because they will already be `0.1.0`.

docs/build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,15 @@ python3 generate-versions.py
3636
rm temp/user-guide/0.9/overview.md 2> /dev/null
3737
rm temp/user-guide/0.8/overview.md 2> /dev/null
3838

39+
# Generate dynamic content (configs, compatibility matrices) for latest docs
40+
# This runs GenerateDocs against the temp copy, not source files
41+
echo "Generating dynamic documentation content..."
42+
cd ..
43+
./mvnw -q compile -pl spark -DskipTests -am
44+
./mvnw -q exec:java -pl spark \
45+
-Dexec.mainClass=org.apache.comet.GenerateDocs \
46+
-Dexec.arguments="$(pwd)/docs/temp/user-guide/latest/" \
47+
-Dexec.classpathScope=compile
48+
cd docs
49+
3950
make SOURCEDIR=`pwd`/temp html

docs/generate-versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ def generate_docs(snapshot_version: str, latest_released_version: str, previous_
105105
print("Generating versioned user guide docs...")
106106
snapshot_version = get_version_from_pom()
107107
latest_released_version = "0.12.0"
108-
previous_versions = ["0.8.0", "0.9.1", "0.10.1", "0.11.0"]
108+
previous_versions = ["0.10.1", "0.11.0"]
109109
generate_docs(snapshot_version, latest_released_version, previous_versions)

docs/source/user-guide/0.8/index.rst

Lines changed: 0 additions & 41 deletions
This file was deleted.

docs/source/user-guide/0.9/index.rst

Lines changed: 0 additions & 41 deletions
This file was deleted.

docs/source/user-guide/latest/compatibility.md

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -84,107 +84,17 @@ Cast operations in Comet fall into three levels of support:
8484

8585
### Legacy Mode
8686

87-
<!-- WARNING! DO NOT MANUALLY MODIFY CONTENT BETWEEN THE BEGIN AND END TAGS -->
88-
8987
<!--BEGIN:CAST_LEGACY_TABLE-->
90-
<!-- prettier-ignore-start -->
91-
| | binary | boolean | byte | date | decimal | double | float | integer | long | short | string | timestamp |
92-
|---|---|---|---|---|---|---|---|---|---|---|---|---|
93-
| binary | - | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | C | N/A |
94-
| boolean | N/A | - | C | N/A | U | C | C | C | C | C | C | U |
95-
| byte | U | C | - | N/A | C | C | C | C | C | C | C | U |
96-
| date | N/A | U | U | - | U | U | U | U | U | U | C | U |
97-
| decimal | N/A | C | C | N/A | - | C | C | C | C | C | C | U |
98-
| double | N/A | C | C | N/A | I | - | C | C | C | C | C | U |
99-
| float | N/A | C | C | N/A | I | C | - | C | C | C | C | U |
100-
| integer | U | C | C | N/A | C | C | C | - | C | C | C | U |
101-
| long | U | C | C | N/A | C | C | C | C | - | C | C | U |
102-
| short | U | C | C | N/A | C | C | C | C | C | - | C | U |
103-
| string | C | C | C | C | I | C | C | C | C | C | - | I |
104-
| timestamp | N/A | U | U | C | U | U | U | U | C | U | C | - |
105-
<!-- prettier-ignore-end -->
106-
107-
**Notes:**
108-
109-
- **decimal -> string**: There can be formatting differences in some case due to Spark using scientific notation where Comet does not
110-
- **double -> decimal**: There can be rounding differences
111-
- **double -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
112-
- **float -> decimal**: There can be rounding differences
113-
- **float -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
114-
- **string -> date**: Only supports years between 262143 BC and 262142 AD
115-
- **string -> decimal**: Does not support fullwidth unicode digits (e.g \\uFF10)
116-
or strings containing null bytes (e.g \\u0000)
117-
- **string -> timestamp**: Not all valid formats are supported
11888
<!--END:CAST_LEGACY_TABLE-->
11989

12090
### Try Mode
12191

122-
<!-- WARNING! DO NOT MANUALLY MODIFY CONTENT BETWEEN THE BEGIN AND END TAGS -->
123-
12492
<!--BEGIN:CAST_TRY_TABLE-->
125-
<!-- prettier-ignore-start -->
126-
| | binary | boolean | byte | date | decimal | double | float | integer | long | short | string | timestamp |
127-
|---|---|---|---|---|---|---|---|---|---|---|---|---|
128-
| binary | - | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | C | N/A |
129-
| boolean | N/A | - | C | N/A | U | C | C | C | C | C | C | U |
130-
| byte | U | C | - | N/A | C | C | C | C | C | C | C | U |
131-
| date | N/A | U | U | - | U | U | U | U | U | U | C | U |
132-
| decimal | N/A | C | C | N/A | - | C | C | C | C | C | C | U |
133-
| double | N/A | C | C | N/A | I | - | C | C | C | C | C | U |
134-
| float | N/A | C | C | N/A | I | C | - | C | C | C | C | U |
135-
| integer | U | C | C | N/A | C | C | C | - | C | C | C | U |
136-
| long | U | C | C | N/A | C | C | C | C | - | C | C | U |
137-
| short | U | C | C | N/A | C | C | C | C | C | - | C | U |
138-
| string | C | C | C | C | I | C | C | C | C | C | - | I |
139-
| timestamp | N/A | U | U | C | U | U | U | U | C | U | C | - |
140-
<!-- prettier-ignore-end -->
141-
142-
**Notes:**
143-
144-
- **decimal -> string**: There can be formatting differences in some case due to Spark using scientific notation where Comet does not
145-
- **double -> decimal**: There can be rounding differences
146-
- **double -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
147-
- **float -> decimal**: There can be rounding differences
148-
- **float -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
149-
- **string -> date**: Only supports years between 262143 BC and 262142 AD
150-
- **string -> decimal**: Does not support fullwidth unicode digits (e.g \\uFF10)
151-
or strings containing null bytes (e.g \\u0000)
152-
- **string -> timestamp**: Not all valid formats are supported
15393
<!--END:CAST_TRY_TABLE-->
15494

15595
### ANSI Mode
15696

157-
<!-- WARNING! DO NOT MANUALLY MODIFY CONTENT BETWEEN THE BEGIN AND END TAGS -->
158-
15997
<!--BEGIN:CAST_ANSI_TABLE-->
160-
<!-- prettier-ignore-start -->
161-
| | binary | boolean | byte | date | decimal | double | float | integer | long | short | string | timestamp |
162-
|---|---|---|---|---|---|---|---|---|---|---|---|---|
163-
| binary | - | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | C | N/A |
164-
| boolean | N/A | - | C | N/A | U | C | C | C | C | C | C | U |
165-
| byte | U | C | - | N/A | C | C | C | C | C | C | C | U |
166-
| date | N/A | U | U | - | U | U | U | U | U | U | C | U |
167-
| decimal | N/A | C | C | N/A | - | C | C | C | C | C | C | U |
168-
| double | N/A | C | C | N/A | I | - | C | C | C | C | C | U |
169-
| float | N/A | C | C | N/A | I | C | - | C | C | C | C | U |
170-
| integer | U | C | C | N/A | C | C | C | - | C | C | C | U |
171-
| long | U | C | C | N/A | C | C | C | C | - | C | C | U |
172-
| short | U | C | C | N/A | C | C | C | C | C | - | C | U |
173-
| string | C | C | C | C | I | C | C | C | C | C | - | I |
174-
| timestamp | N/A | U | U | C | U | U | U | U | C | U | C | - |
175-
<!-- prettier-ignore-end -->
176-
177-
**Notes:**
178-
179-
- **decimal -> string**: There can be formatting differences in some case due to Spark using scientific notation where Comet does not
180-
- **double -> decimal**: There can be rounding differences
181-
- **double -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
182-
- **float -> decimal**: There can be rounding differences
183-
- **float -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
184-
- **string -> date**: Only supports years between 262143 BC and 262142 AD
185-
- **string -> decimal**: Does not support fullwidth unicode digits (e.g \\uFF10)
186-
or strings containing null bytes (e.g \\u0000)
187-
- **string -> timestamp**: ANSI mode not supported
18898
<!--END:CAST_ANSI_TABLE-->
18999

190100
See the [tracking issue](https://github.com/apache/datafusion-comet/issues/286) for more details.

0 commit comments

Comments
 (0)