Skip to content

docs: add a VitePress documentation site published to GitHub Pages - #143

Merged
CodeLieutenant merged 4 commits into
trunkfrom
docs/vitepress-github-pages
Aug 5, 2026
Merged

docs: add a VitePress documentation site published to GitHub Pages#143
CodeLieutenant merged 4 commits into
trunkfrom
docs/vitepress-github-pages

Conversation

@CodeLieutenant

Copy link
Copy Markdown
Member

What

Adds website/, a VitePress documentation site (24 pages), plus a workflow that publishes it to GitHub Pages at https://he4rt.github.io/scylladb-php-driver/.

The project had no user documentation. docs/ holds generated PHP class stubs and internal audit notes, so it stays untouched.

Contents

Section Pages
Getting started Introduction, installation, quick start
Connecting Clusters and sessions, authentication, TLS and SSL, load balancing and routing, connection pool and timeouts, retry policies
Working with data Queries and statements, results and paging, data types, collections and UDTs, batches, asynchronous queries, schema metadata
Operating Error handling, performance, metrics and logging, troubleshooting
Reference Cluster\Builder, cluster and session, statements, rows and futures, value classes, type factory, constants, exceptions

How it was written

Content comes from the *.stub.php files and the C sources, not from the upstream DataStax documentation. Specifically:

  • Every default in the Cluster\Builder reference table comes from php_scylladb_cluster_builder_new (src/Cluster/BuilderHandlers.c).
  • The CQL to PHP type table comes from the decode switch in src/Database/ResultDecoder.c and the bind switch in src/DefaultSession.c.
  • The execution option keys come from src/ExecutionOptions.c.
  • The metrics keys come from Cassandra_DefaultSession::metrics.
  • The exception tree comes from src/Exception/exceptions.stub.php.

CI

.github/workflows/docs.yml builds on every pull request that touches website/, and deploys trunk to Pages. ignoreDeadLinks is false, so a broken internal link fails the build.

Reviewer notes

Action required before the deploy step works: set Settings → Pages → Build and deployment → Source to GitHub Actions.

The repository root .gitignore has config.* for the autotools build, which also matched website/.vitepress/config.mts. website/.gitignore negates it. Worth a look, since it silently drops any config.* file added anywhere in the tree.

Two source issues found while reading the code for this. Both are documented as the intended behavior, and separate fixes are in progress:

  1. withConnectionHeartbeatInterval() and withTCPKeepalive() convert seconds to milliseconds through php_scylladb_set_timeout(), but cass_cluster_set_connection_heartbeat_interval and cass_cluster_set_tcp_keepalive take seconds. withConnectionHeartbeatInterval(30.0) currently yields 30000 seconds. The constructor defaults are raw seconds, which confirms seconds is the intent. The docs describe these as seconds, so they are correct only once the fix lands.
  2. php_scylladb_cluster_builder_properties exposes password in clear text, so var_dump($builder) prints it. The docs carry a warning about this, which can be removed once it is redacted.

One broken script, left out of the docs: scripts/run-scylladb-ssl.sh runs docker compose -f ./docker/docker-compose.ssl.yml, and that file does not exist.

Local development

cd website
npm ci
npm run dev      # http://localhost:5173/scylladb-php-driver/
npm run build    # fails on a dead internal link

The project had no user documentation. `docs/` holds generated PHP class
stubs and internal audit notes, not something a user can read.

Add `website/`, a VitePress site with 24 pages, written from the `*.stub.php`
files and the C sources rather than from the upstream DataStax docs. Every
default in the `Cluster\Builder` reference comes from
`php_scylladb_cluster_builder_new` in `src/Cluster/BuilderHandlers.c`.

Structure:

- Getting started: introduction, installation, quick start.
- Connecting: clusters and sessions, authentication, TLS, load balancing and
  routing, connection pool and timeouts, retry policies.
- Working with data: queries, results and paging, data types, collections and
  user defined types, batches, asynchronous queries, schema metadata.
- Operating: error handling, performance, metrics and logging, troubleshooting.
- Reference: eight API pages.

`ignoreDeadLinks` is `false`, so a broken internal link fails the build.

Also add `.github/workflows/docs.yml`. It builds on every pull request that
touches `website/`, and deploys `trunk` to GitHub Pages. The repository needs
Settings, Pages, Source set to GitHub Actions before the deploy step works.

The repository root ignores `config.*` for the autotools build, which also
matched `website/.vitepress/config.mts`. `website/.gitignore` negates that.
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

The organization requires every action to be pinned to a full-length commit
SHA. The unpinned tags made the Build job fail before it started.
actions/upload-pages-artifact is a composite action that calls an unpinned
actions/upload-artifact@v4. The org policy checks nested actions, so the job
failed at set-up.

Do the same work directly: tar the built site into artifact.tar and upload it
under the name 'github-pages', which is what actions/deploy-pages expects.
actions/upload-artifact is already pinned elsewhere in this repository.
… deploy

The archive step was gated on trunk, so a mistake in it could only surface
after the merge. Run it on every pull request and keep only the upload gated.

Also stop cancelling an in-flight run on trunk. A cancelled deploy leaves the
Pages API mid-request.
@CodeLieutenant CodeLieutenant self-assigned this Aug 5, 2026
@CodeLieutenant
CodeLieutenant merged commit 18ba375 into trunk Aug 5, 2026
4 checks passed
@CodeLieutenant
CodeLieutenant deleted the docs/vitepress-github-pages branch August 5, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant