Skip to content

Commit 08a785b

Browse files
Update to sphinx documentation (#3078)
This updates our website to use sphinx for its documentation site. This includes some new content around the SQL API, as well as our API Javadoc, which we will be publishing ourselves for the first time in a while. Publishing happens at the end of the release process (which I've been able to test by first applying these changes to a test repo of mine). --------- Co-authored-by: FDB Relational Layer Authors <[email protected]>
1 parent 565a6da commit 08a785b

File tree

91 files changed

+3263
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3263
-77
lines changed

Diff for: .github/workflows/mixed_mode_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Checkout Main
4141
run: git checkout main
4242
- name: Update release notes
43-
run: python build/publish-mixed-mode-results.py ${{ inputs.tag }} --release-notes docs/ReleaseNotes.md --commit --run-link ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
43+
run: python build/publish-mixed-mode-results.py ${{ inputs.tag }} --release-notes docs/sphinx/source/ReleaseNotes.md --commit --run-link ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
4444
- name: Push release notes update
4545
run: git push
4646

Diff for: .github/workflows/release.yml

+29-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
checks: write
1111
contents: write
1212
packages: write
13-
pages: write
1413
pull-requests: write
1514
steps:
1615
- name: Checkout sources
1716
uses: actions/[email protected]
1817
with:
1918
ssh-key: ${{ secrets.DEPLOY_KEY }}
2019
- name: Setup Base Environment
20+
id: setup-base
2121
uses: ./actions/setup-base-env
2222
- name: Setup FDB
2323
uses: ./actions/setup-fdb
@@ -44,4 +44,31 @@ jobs:
4444
MAVEN_USER: ${{ secrets.MAVEN_USER }}
4545
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
4646

47-
# TODO: Publish documentation updates
47+
# Build documentation.
48+
- name: Cache Python Environment
49+
uses: actions/cache@v4
50+
with:
51+
path: docs/sphinx/.venv
52+
key: ${{ runner.os }}-sphinx-python-${{ steps.setup-base.outputs.python-version }}-${{ hashFiles('docs/sphinx/requirements.txt') }}
53+
- name: Build Documentation Site
54+
uses: ./actions/run-gradle
55+
with:
56+
gradle_command: documentationSite -PreleaseBuild=true
57+
- name: Upload Documentation
58+
id: doc_upload
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
path: docs/sphinx/.out/html/
62+
63+
deploy_docs:
64+
runs-on: ubuntu-latest
65+
needs: gradle
66+
permissions:
67+
pages: write
68+
id-token: write
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.doc_upload.outputs.page_url }}
72+
steps:
73+
- name: Deploy Documentation
74+
uses: actions/deploy-pages@v4

Diff for: .gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ atlassian-ide-plugin.xml
4444
.idea/scala_settings.xml
4545
.idea/shelf
4646

47+
# Built during documentation
48+
/docs/sphinx/.venv
49+
/docs/sphinx/source/api/**/index.md
50+
*.diagram.svg
51+
4752
# VSCode specific files/directories
4853
.vscode
4954
**/bin

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ it is addressing and, upon merging of the PR into the main code line, will
8383
automatically mark the issue as resolved.
8484

8585
If your pull request results in a user-visible change to the Record Layer, you should
86-
also update the [release notes](docs/ReleaseNotes.md). For most changes, it
86+
also update the [release notes](docs/sphinx/source/ReleaseNotes.md). For most changes, it
8787
is sufficient to fill in one of the bullets in the "next release" section of that
8888
document. You should include a short description of the change as well as filling in
8989
the issue number. The "next release" section is commented out, so the change won't

Diff for: actions/release-build-publish/action.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ runs:
5151
id: push_updates
5252
shell: bash
5353
run: git push origin
54+
# Continue the build (including downstream steps). If the push fails, we'll create a PR
55+
continue-on-error: true
5456
- name: Create Merge PR if conflict
55-
if: failure() && steps.push_updates.conclusion == 'failure'
57+
# Only create the PR if we've otherwise been successful, but the push failed. Note that
58+
# we're checking the .outcome of the push step, which is applied before continue-on-error.
59+
if: success() && steps.push_updates.outcome == 'failure'
5660
uses: peter-evans/create-pull-request@bb88e27d3f9cc69c8bc689eba126096c6fe3dded
5761
id: pr_on_conflict
5862
with:
@@ -62,3 +66,8 @@ runs:
6266
sign-commits: true
6367
body: |
6468
Updates from release for version ${{ steps.get_version.outputs.version }}. Conflicts during the build prevented automatic updating. Please resolve conflicts by checking out the current branch, merging, and then deleting this branch.
69+
70+
# Creating the PR can change the current branch. Explicitly check out the tag here for downstream builds
71+
- name: Revert to tag
72+
shell: bash
73+
run: git checkout "${{ steps.get_version.outputs.version }}"

Diff for: actions/setup-base-env/action.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Setup Base Environment
22

3+
outputs:
4+
python-version:
5+
value: ${{ steps.setup-python.outputs.python-version }}
6+
37
runs:
48
using: "composite"
59
steps:
@@ -11,6 +15,7 @@ runs:
1115
- name: Setup Gradle
1216
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6
1317
- name: Setup Python
18+
id: setup-python
1419
uses: actions/setup-python@v5
1520
with:
1621
python-version: '3.13'

Diff for: build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ subprojects {
240240
linksOffline "https://developers.google.com/protocol-buffers/docs/reference/java/", "${packageListDir}/protobuf/"
241241

242242
// This is for dependent sub-projects so that their links to things in the Record Layer work
243-
linksOffline "https://static.javadoc.io/org.foundationdb/fdb-extensions/${project.version}/", "${packageListDir}/fdb-extensions/"
244-
linksOffline "https://static.javadoc.io/org.foundationdb/fdb-record-layer-core/${project.version}/", "${packageListDir}/fdb-record-layer-core/"
243+
linksOffline "https://foundationdb.github.io/fdb-record-layer/api/fdb-extensions/", "${packageListDir}/fdb-extensions/"
244+
linksOffline "https://foundationdb.github.io/fdb-record-layer/api/fdb-record-layer-core/", "${packageListDir}/fdb-record-layer-core/"
245245
}
246246
}
247247
compileJava {
@@ -333,6 +333,8 @@ clean.doLast {
333333
}
334334
}
335335

336+
apply from: 'gradle/sphinx.gradle'
337+
336338
if (!JavaVersion.current().isJava8Compatible()) {
337339
throw new Exception("Java 8 is required to build fdb-record-layer")
338340
}

Diff for: build/update_release_notes.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
script_dir="$( dirname $0 )"
3232
success=0
3333

34-
release_notes_file="${script_dir}/../docs/ReleaseNotes.md"
34+
release_notes_file="${script_dir}/../docs/sphinx/source/ReleaseNotes.md"
3535

3636
if [[ -n "${GIT_BRANCH:-}" ]] ; then
3737
branch="${GIT_BRANCH#*/}"

Diff for: docs/_config.yml

-7
This file was deleted.

Diff for: docs/_includes/footer.html

-5
This file was deleted.

Diff for: docs/_layouts/default.html

-14
This file was deleted.

Diff for: docs/_layouts/page.html

-11
This file was deleted.

Diff for: docs/sphinx/generate_railroad_svg.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/python
2+
#
3+
# generate_railroad_svg.py
4+
#
5+
# This source file is part of the FoundationDB open source project
6+
#
7+
# Copyright 2015-2025 Apple Inc. and the FoundationDB project authors
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
#
21+
22+
from os import walk, path
23+
from railroad import Diagram, Choice, Terminal, NonTerminal, OneOrMore, Sequence, Optional, Stack
24+
import railroad
25+
26+
# Vertical space
27+
railroad.VS = 15
28+
29+
# Arc radius
30+
railroad.AR = 12
31+
32+
# Find all diagram files and generate svgs
33+
base_dir = path.dirname(path.abspath(__file__))
34+
for root, dirs, files in walk('.'):
35+
for file in files:
36+
if file.endswith('.diagram'):
37+
with open(path.join(root, file), 'r') as diagram_file:
38+
diagram = eval(diagram_file.read())
39+
with open(path.join(root, file + ".svg"), 'w') as svg_file:
40+
diagram.writeStandalone(svg_file.write)
41+

Diff for: docs/sphinx/requirements.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
alabaster==1.0.0
2+
babel==2.16.0
3+
beautifulsoup4==4.12.3
4+
certifi==2024.7.4
5+
charset-normalizer==3.3.2
6+
docutils==0.21.2
7+
furo==2024.8.6
8+
idna==3.7
9+
imagesize==1.4.1
10+
Jinja2==3.1.4
11+
MarkupSafe==2.1.5
12+
myst-parser==4.0.0
13+
packaging==24.1
14+
Pygments==2.18.0
15+
railroad-diagrams==3.0.1
16+
requests==2.32.3
17+
snowballstemmer==2.2.0
18+
soupsieve==2.5
19+
sphinx==8.1.3
20+
sphinx-basic-ng==1.0.0b2
21+
sphinxcontrib-devhelp==2.0.0
22+
sphinxcontrib-htmlhelp==2.1.0
23+
sphinxcontrib-jsmath==1.0.1
24+
sphinxcontrib-qthelp==2.0.0
25+
sphinxcontrib-serializinghtml==2.0.0
26+
tomli==2.0.1
27+
urllib3==2.2.2
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: docs/FAQ.md renamed to docs/sphinx/source/FAQ.md

File renamed without changes.
File renamed without changes.

Diff for: docs/GettingStarted.md renamed to docs/sphinx/source/GettingStarted.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To keep the guide simple, we will not cover:
1414
* Modifying a schema
1515
* Using advanced [index](Overview.md#secondary-indexes) and [query](Overview.md#querying-for-records) functionality
1616

17-
### Setup
17+
## Setup
1818

1919
Install Java JDK for version 8 or above; for this demo we are using JDK `1.8.0_181`.
2020

@@ -52,7 +52,7 @@ Now we should add the Record Layer as a dependency of our project. The Record La
5252
are published to Maven Central, so we can declare the dependency by adding the following to our
5353
project's `build.gradle` file:
5454

55-
```gradle
55+
```groovy
5656
repositories {
5757
mavenCentral()
5858
maven {
@@ -64,11 +64,12 @@ dependencies {
6464
implementation 'org.foundationdb:fdb-record-layer-core-pb3:VERSION_NUMBER'
6565
}
6666
```
67+
6768
Replace `VERSION_NUMBER` with a recent version of the artifact from Maven Central (See
6869
[mvnrepository](https://mvnrepository.com/artifact/org.foundationdb/fdb-record-layer-core-pb3)
6970
for a listing of published versions).
7071

71-
### ProtoBuf Configuration
72+
## Protobuf Configuration
7273

7374
Our sample project will use [Protocol Buffers](https://developers.google.com/protocol-buffers/) (protobuf)
7475
to define our record meta-data. First, since we are using Gradle, let's include the
@@ -77,7 +78,7 @@ which will allow us to add protobuf compilation as a step in our build process.
7778
Add this to the top of your `build.gradle`, ahead of the above `repositories` and
7879
`dependencies` added above:
7980

80-
```gradle
81+
```groovy
8182
plugins {
8283
id 'java'
8384
id 'com.google.protobuf' version "0.8.19"
@@ -88,7 +89,7 @@ include `id'java'`.
8889

8990
Additionally, add the following:
9091

91-
```gradle
92+
```groovy
9293
protobuf {
9394
generatedFilesBaseDir = "${projectDir}/src/main/generated"
9495
protoc {
@@ -119,7 +120,7 @@ One last step might be necessary to configure your IDE of choice to discover the
119120
offer auto-complete suggestions. The additional generated source directory can be added to the list of Java sources
120121
by adding the following to the project's `build.gradle` file:
121122

122-
```gradle
123+
```groovy
123124
sourceSets {
124125
main {
125126
java {
@@ -180,7 +181,7 @@ Finally, the Record Layer requires we have a `UnionDescriptor` message which con
180181
record types to be stored in our record store (here only `Order`). We must either set the `usage = UNION`
181182
option for this message or we can omit the option and instead name the message `RecordTypeUnion`.
182183

183-
### Creating an Application
184+
## Creating an Application
184185

185186
Run `./gradlew generateProto` to see that the above configuration is correct.
186187
You should see the generated code put into `src/main/generated/main/java/RecordLayerDemoProto.java`.
@@ -411,7 +412,7 @@ flower {
411412
price: 34
412413
```
413414

414-
### Summary
415+
## Summary
415416

416417
We've covered creating a very simple demo app from scratch using the FDB Record Layer.
417418
We downloaded and started up an FDB server, created a new Java project, brought in the Record Layer dependency,
File renamed without changes.

Diff for: docs/ReleaseNotes.md renamed to docs/sphinx/source/ReleaseNotes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The Apache Commons library has been removed as a dependency. There were a few lo
132132

133133
### Breaking Changes
134134

135-
Support for the Protobuf 2 runtime has been removed as of this version. All artifacts now use Protobuf version 3. Note that the choice of Protobuf runtime version is distinct from the choice of Protobuf message syntax, and that users wishing to retain Protobuf 2 behavior can still achieve the same semantics (including [optional field behavior]()) as long as they specify the syntax on their Protobuf file as `proto2`. Note that the Maven artifacts using Protobuf version 3 used to be suffixed with `-pb3`. Existing Protobuf 3 users must remove that suffix from their dependency declarations (e.g., `fdb-record-layer-core-pb3` should now be `fdb-record-layer-core`).
135+
Support for the Protobuf 2 runtime has been removed as of this version. All artifacts now use Protobuf version 3. Note that the choice of Protobuf runtime version is distinct from the choice of Protobuf message syntax, and that users wishing to retain Protobuf 2 behavior can still achieve the same semantics (including [optional field behavior](Overview.md#indexing-and-querying-of-missing--null-values)) as long as they specify the syntax on their Protobuf file as `proto2`. Note that the Maven artifacts using Protobuf version 3 used to be suffixed with `-pb3`. Existing Protobuf 3 users must remove that suffix from their dependency declarations (e.g., `fdb-record-layer-core-pb3` should now be `fdb-record-layer-core`).
136136

137137
Starting with version [3.4.455.0](#344550), the semantics of `UnnestedRecordType` were changed in response to [Issue #2512](https://github.com/FoundationDB/fdb-record-layer/issues/2512). It was identified that extraneous synthetic records were being produced when one of the children was empty. This did not match the semantics of `FanOut` expressions, and so the unnesting calculation was changed. This means that any index on an existing `UnnestedRecordType` requires rebuilding to clear out any such entries from older indexes.
138138

@@ -2168,7 +2168,7 @@ The `FDBDatabase::getReadVersion()` method has been replaced with the `FDBRecord
21682168

21692169
### Breaking Changes
21702170

2171-
The Guava version has been updated to version 27. Users of the [shaded variants](Shaded.html#Variants) of the Record Layer dependencies should not be affected by this change. Users of the unshaded variant using an older version of Guava as part of their own project may find that their own Guava dependency is updated automatically by their dependency manager.
2171+
The Guava version has been updated to version 27. Users of the [shaded variants](Versioning.md#variants) of the Record Layer dependencies should not be affected by this change. Users of the unshaded variant using an older version of Guava as part of their own project may find that their own Guava dependency is updated automatically by their dependency manager.
21722172

21732173
### 2.7.79.0
21742174

Diff for: docs/sphinx/source/SQL_Reference.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SQL Reference
2+
3+
The FDB relational subproject provides a SQL API for interacting with Record Layer databases. This SQL API is currently under active development and is expected
4+
to change frequently. This reference is currently also a work in progress to be updated as the SQL engine develops.
5+
6+
7+
```{toctree}
8+
:caption: SQL
9+
:maxdepth: 2
10+
11+
reference/sql_types
12+
reference/sql_commands
13+
reference/Functions
14+
```
15+
16+
```{toctree}
17+
:caption: Data Model
18+
:maxdepth: 2
19+
20+
reference/Databases_Schemas_SchemaTemplates
21+
reference/Tables
22+
reference/Indexes
23+
```
24+
25+
```{toctree}
26+
:caption: Miscellaneous
27+
:maxdepth: 2
28+
29+
reference/Direct_Access_Api
30+
reference/understanding_bitmap
31+
```
File renamed without changes.

0 commit comments

Comments
 (0)