Skip to content

API docs fixes#431

Merged
Lorak-mmk merged 17 commits intoscylladb:masterfrom
Lorak-mmk:docs-members
Mar 2, 2026
Merged

API docs fixes#431
Lorak-mmk merged 17 commits intoscylladb:masterfrom
Lorak-mmk:docs-members

Conversation

@Lorak-mmk
Copy link
Contributor

I wanted to fix #392 , and that's what the first commit does.
When working on that, I noticed a lot of other issues with our API docs: bugs in doc comments, many types not rendered in documentation, warnings when building docs...
Other commits fix all of such issues that I found. Now, each driver type should be present in docs, and clickable in function signatures.

For reviewers: I advise building the docs, and looking at rendered API docs pages yourself.

Fixes: #392

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have implemented Rust unit tests for the features/changes introduced.
  • I have enabled appropriate tests in Makefile in {SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER.
  • I added appropriate Fixes: annotations to PR description.

@Lorak-mmk Lorak-mmk requested a review from wprzytula February 27, 2026 12:14
@Lorak-mmk Lorak-mmk self-assigned this Feb 27, 2026
@Lorak-mmk Lorak-mmk added this to the 1.0.0 - Post release items milestone Feb 27, 2026
@wprzytula
Copy link
Contributor

My `make preview` output:

❯ make preview
uv sync
Resolved 67 packages in 5ms
Audited 62 packages in 4ms
cd .. && doxygen Doxyfile.in
warning: ignoring unsupported tag 'PROJECT_ICON' at line 70, file Doxyfile.in
warning: ignoring unsupported tag 'AUTOLINK_IGNORE_WORDS' at line 389, file Doxyfile.in
warning: ignoring unsupported tag 'HIDE_UNDOC_NAMESPACES' at line 608, file Doxyfile.in
warning: ignoring unsupported tag 'EXTERNAL_TOOL_PATH' at line 858, file Doxyfile.in
warning: ignoring unsupported tag 'WARN_LAYOUT_FILE' at line 926, file Doxyfile.in
warning: ignoring unsupported tag 'IMPLICIT_DIR_DOCS' at line 1166, file Doxyfile.in
warning: ignoring unsupported tag 'HTML_COPY_CLIPBOARD' at line 1456, file Doxyfile.in
warning: ignoring unsupported tag 'HTML_PROJECT_COOKIE' at line 1465, file Doxyfile.in
warning: ignoring unsupported tag 'SHOW_ENUM_VALUES' at line 1745, file Doxyfile.in
warning: ignoring unsupported tag 'RTF_EXTRA_FILES' at line 2201, file Doxyfile.in
warning: ignoring unsupported tag 'PLANTUMLFILE_DIRS' at line 2809, file Doxyfile.in
uv run --frozen sphinx-autobuild -b dirhtml -d _build/doctrees  -j auto source _build/dirhtml --port 5500 --ignore "*/source/api/*"
[sphinx-autobuild] Starting initial build
[sphinx-autobuild] > python -m sphinx build -b dirhtml -d _build/doctrees -j auto source _build/dirhtml
Running Sphinx v8.2.3
loading translations [en]... done
/home/wojciech/Scylla/cpp-rs-driver/docs/.venv/lib/python3.13/site-packages/breathe/project.py:116: RemovedInSphinx90Warning: Sphinx 9 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
  self._default_build_dir = os.path.dirname(app.doctreedir.rstrip(os.sep))
loading pickled environment... The configuration has changed (3 options: 'html_static_path', 'smv_latest_version', 'smv_tag_whitelist')
done
myst v4.0.1: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions={'colon_fence'}, disable_syntax=[], all_links_external=False, links_external_new_tab=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, fence_as_directive=set(), number_code_blocks=[], title_to_header=False, heading_anchors=6, heading_slug_func=None, html_meta={}, footnote_sort=True, footnote_transition=True, words_per_minute=200, substitutions={}, linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area', enable_checkboxes=False, suppress_warnings=[], highlight_code_blocks=True)
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: build_info mismatch, copying .buildinfo to .buildinfo.bak
building [dirhtml]: targets for 78 source files that are out of date
updating environment: 7 added, 44 changed, 0 removed
reading sources... [100%] topics/security/index .. topics/using/index
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/group.Logging.rst:4: WARNING: Duplicate C++ declaration, also defined at api/struct.CassLogMessage:4.
Declaration is '.. cpp:struct:: CassLogMessage'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/group.Logging.rst:4: WARNING: Duplicate C++ declaration, also defined at api/struct.CassLogMessage:4.
Declaration is '.. cpp:member:: cass_uint64_t time_ms'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/group.Logging.rst:4: WARNING: Duplicate C++ declaration, also defined at api/struct.CassLogMessage:4.
Declaration is '.. cpp:member:: CassLogLevel severity'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/group.Logging.rst:4: WARNING: Duplicate C++ declaration, also defined at api/struct.CassLogMessage:4.
Declaration is '.. cpp:member:: const char * file'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/group.Logging.rst:4: WARNING: Duplicate C++ declaration, also defined at api/struct.CassLogMessage:4.
Declaration is '.. cpp:member:: int line'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/group.Logging.rst:4: WARNING: Duplicate C++ declaration, also defined at api/struct.CassLogMessage:4.
Declaration is '.. cpp:member:: const char * function'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/group.Logging.rst:4: WARNING: Duplicate C++ declaration, also defined at api/struct.CassLogMessage:4.
Declaration is '.. cpp:member:: char message [1024]'. [duplicate_declaration.cpp]
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... 
copying static files... 
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/language_data.js
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/documentation_options.js
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/basic.css
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/copybutton.js
copying static files: done
copying extra files... 
copying extra files: done
copying assets: done
writing output... [100%] topics/using/index .. topics/using/schema-metadata
generating indices... genindex done
writing additional pages... search done
dumping search index in English (code: en)... done
dumping object inventory... done
sphinx-sitemap: sitemap.xml was generated for URL https://cpp-rs-driver.docs.scylladb.com in /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/sitemap.xml
build succeeded, 7 warnings.

The HTML pages are in _build/dirhtml.
[sphinx-autobuild] Serving on http://127.0.0.1:5500
[sphinx-autobuild] Waiting to detect changes...

So there are some Duplicate C++ declaration errors and some warnings.

Comment on lines +129 to +143
def _generate_groups(outdir, groups, project):
"""Write structs docs in the designated outdir folder"""
for obj in groups:
with open(outdir / f"group.{obj}.rst", "w") as t_file:
t_file.write(
obj
+ "\n"
+ "=" * len(obj)
+ "\n\n"
+ ".. doxygengroup:: "
+ obj
+ "\n :project: "
+ breathe_default_project
+ "\n :content-only:"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ How did you know how to do that?

  • similar to something else in the code?
  • documentation?
  • AI?

Please explain this in a comment.

Copy link
Contributor Author

@Lorak-mmk Lorak-mmk Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI. I ofc read the code to see if it looks reasonable + tested that it works.
I don't think its useful to describe in the comments "how I found some informations". Comments should explain how something works, and sometimes why it works that way.

@wprzytula
Copy link
Contributor

wprzytula commented Feb 27, 2026

Additionally, make preview caused me OOM already twice.

But it no longer reproduces after I did make clean.

@wprzytula
Copy link
Contributor

Rendered documentation looks bad (visually).
The division you introduced is good - 👍

@Lorak-mmk
Copy link
Contributor Author

Additionally, make preview caused me OOM already twice.

I did have similar issues on the day when I was working on this PR!
At some point I stopped being able to ssh into my work machine. @swasik has to restart it, and he said there were some OOM messages printed to the screen.
I didn't know it was caused by this work. I wonder if I broke something in my PR, of if its a bug somewhere in our docs stack.

@Lorak-mmk
Copy link
Contributor Author

So there are some Duplicate C++ declaration errors and some warnings.

One warning about sphinx 9 is expected - it comes from a dependency.
Warnings about duplicate declarations should go away after make clean.

Doxygen config warnings are surprising. I also experienced such warnings, so I updated the config to get rid of them (there is a commit with that in this PR).
Do you still experience those warnings? What version of doxygen do you have installed?

@Lorak-mmk
Copy link
Contributor Author

Rendered documentation looks bad (visually).

Did it regress due to my PR? Or is it just a general observation?

@Lorak-mmk
Copy link
Contributor Author

Rebased on master.

@wprzytula
Copy link
Contributor

So there are some Duplicate C++ declaration errors and some warnings.

One warning about sphinx 9 is expected - it comes from a dependency. Warnings about duplicate declarations should go away after make clean.

Doxygen config warnings are surprising. I also experienced such warnings, so I updated the config to get rid of them (there is a commit with that in this PR). Do you still experience those warnings?

On your PR, straight after running make clean, I run make preview and get those warnings.

What version of doxygen do you have installed?

❯ doxygen --version
1.9.8

@wprzytula
Copy link
Contributor

Rendered documentation looks bad (visually).

Did it regress due to my PR? Or is it just a general observation?

It was such before, too. No regression in this regard.

@Lorak-mmk
Copy link
Contributor Author

In CI I also see Doxygen warnings:

cd .. && doxygen Doxyfile.in
warning: ignoring unsupported tag 'PROJECT_ICON' at line 70, file Doxyfile.in
warning: ignoring unsupported tag 'AUTOLINK_IGNORE_WORDS' at line 389, file Doxyfile.in
warning: ignoring unsupported tag 'HIDE_UNDOC_NAMESPACES' at line 608, file Doxyfile.in
warning: ignoring unsupported tag 'EXTERNAL_TOOL_PATH' at line 858, file Doxyfile.in
warning: ignoring unsupported tag 'WARN_LAYOUT_FILE' at line 926, file Doxyfile.in
warning: ignoring unsupported tag 'IMPLICIT_DIR_DOCS' at line 1166, file Doxyfile.in
warning: ignoring unsupported tag 'HTML_COPY_CLIPBOARD' at line 1456, file Doxyfile.in
warning: ignoring unsupported tag 'HTML_PROJECT_COOKIE' at line 1465, file Doxyfile.in
warning: ignoring unsupported tag 'SHOW_ENUM_VALUES' at line 1745, file Doxyfile.in
warning: ignoring unsupported tag 'RTF_EXTRA_FILES' at line 2201, file Doxyfile.in
warning: ignoring unsupported tag 'PLANTUMLFILE_DIRS' at line 2809, file Doxyfile.in

So I guess I updated config to a too-new format. I'll try to adjust that.

Lorak-mmk added 12 commits March 2, 2026 16:54
There were some errors in the documentation: missing parameters docs,
wrong parameter name, @return docs for functions returning void.
All of this was resulting in Doxygen warnings. This commit fixes all
those issues.
This resulted in a warning, but would become a hard error in Sphinx v9.
This commit fixes the warning by using python paths as they were
intended, instead of string concatenation.
After this commit there is only 1 warning left when building docs, and
it is not in our code (Breathe extension will need to fix it).
We want to add all items from cassandra.h that are missing from rendered
docs. For many, we can't use `@memberof`, because they don't really fit
any struct. A good tool for this are Doxygen groups, but right now our
documentation won't render them. This commit adds support for rendering
them.
Some of them don't really belong to any struct, and so have not been
exported. The solution is to introduce new groups for them.
For now, I introduced two: one for logging-related stuff, one for
everything else.
It contains stuff like int aliases, that were missing from docs until
now.
It contains CassError enum and related types: CassWriteType,
CassErrorSource, and functions that operate on them.
It contains types used in cass_alloc_set_functions function, and the
function itself.
Fields of CassAuthenticatorCallbacks used type aliases that were not
documented. This commit adds them to docs of this struct.
I don't see a better place for them.
CassConsistency appears in many functions, operating on various types.
Because of that I think it deserves its own section.
CassValueTypes appears in functions belonging to more than one type, and
quite many of them, so I think it deserves its own section.
Some enums were not present in docs. I added them to relevant section.
This commit adds missing logging-related types to the logging section.
A struct can't be duplicated in docs, and CassLogMessage is a struct so
it had its own section. To fix that, I adjusted logic in conf.py: now,
if a struct is present in some group, it will not get its own section.
@Lorak-mmk
Copy link
Contributor Author

  • Dropped commit that updated Doxygen config, because it caused other warnings in CI
  • Split commit that introduced initial groups into two: first adds support in conf.py, second adds the two initial groups

@Lorak-mmk Lorak-mmk requested a review from wprzytula March 2, 2026 16:01
@wprzytula
Copy link
Contributor

This is what I get now:

rm -rf _build/*
❯ make preview
uv sync
Resolved 67 packages in 0.64ms
Audited 62 packages in 0.57ms
cd .. && doxygen Doxyfile.in
warning: Tag 'TCL_SUBST' at line 205 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 866 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'HTML_TIMESTAMP' at line 972 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'FORMULA_TRANSPARENT' at line 1194 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'LATEX_SOURCE_CODE' at line 1375 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'PERL_PATH' at line 1640 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'CLASS_DIAGRAMS' at line 1652 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'MSCGEN_PATH' at line 1661 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'DOT_FONTNAME' at line 1691 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'DOT_FONTSIZE' at line 1696 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'DOT_TRANSPARENT' at line 1845 of file 'Doxyfile.in' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
uv run --frozen sphinx-autobuild -b dirhtml -d _build/doctrees  -j auto source _build/dirhtml --port 5500 --ignore "*/source/api/*"
[sphinx-autobuild] Starting initial build
[sphinx-autobuild] > python -m sphinx build -b dirhtml -d _build/doctrees -j auto source _build/dirhtml
Running Sphinx v8.2.3
loading translations [en]... done
/home/wojciech/Scylla/cpp-rs-driver/docs/.venv/lib/python3.13/site-packages/breathe/project.py:116: RemovedInSphinx90Warning: Sphinx 9 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
  self._default_build_dir = os.path.dirname(app.doctreedir.rstrip(os.sep))
myst v4.0.1: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions={'colon_fence'}, disable_syntax=[], all_links_external=False, links_external_new_tab=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, fence_as_directive=set(), number_code_blocks=[], title_to_header=False, heading_anchors=6, heading_slug_func=None, html_meta={}, footnote_sort=True, footnote_transition=True, words_per_minute=200, substitutions={}, linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area', enable_checkboxes=False, suppress_warnings=[], highlight_code_blocks=True)
building [mo]: targets for 0 po files that are out of date
writing output... 
building [dirhtml]: targets for 85 source files that are out of date
updating environment: [new config] 85 added, 0 changed, 0 removed
reading sources... [100%] topics/using/handling-results .. topics/using/schema-metadata
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/struct.CassLogMessage.rst:4: WARNING: Duplicate C++ declaration, also defined at api/group.Logging:4.
Declaration is '.. cpp:struct:: CassLogMessage'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/struct.CassLogMessage.rst:4: WARNING: Duplicate C++ declaration, also defined at api/group.Logging:4.
Declaration is '.. cpp:var:: cass_uint64_t time_ms'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/struct.CassLogMessage.rst:4: WARNING: Duplicate C++ declaration, also defined at api/group.Logging:4.
Declaration is '.. cpp:var:: CassLogLevel severity'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/struct.CassLogMessage.rst:4: WARNING: Duplicate C++ declaration, also defined at api/group.Logging:4.
Declaration is '.. cpp:var:: const char *file'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/struct.CassLogMessage.rst:4: WARNING: Duplicate C++ declaration, also defined at api/group.Logging:4.
Declaration is '.. cpp:var:: int line'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/struct.CassLogMessage.rst:4: WARNING: Duplicate C++ declaration, also defined at api/group.Logging:4.
Declaration is '.. cpp:var:: const char *function'. [duplicate_declaration.cpp]
/home/wojciech/Scylla/cpp-rs-driver/docs/source/api/struct.CassLogMessage.rst:4: WARNING: Duplicate C++ declaration, also defined at api/group.Logging:4.
Declaration is '.. cpp:var:: char message[1024]'. [duplicate_declaration.cpp]
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... 
copying static files... 
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/language_data.js
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/documentation_options.js
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/basic.css
Writing evaluated template result to /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/_static/copybutton.js
copying static files: done
copying extra files... 
copying extra files: done
copying assets: done
writing output... [100%] topics/using/index .. topics/using/schema-metadata
generating indices... genindex done
writing additional pages... search done
dumping search index in English (code: en)... done
dumping object inventory... done
sphinx-sitemap: sitemap.xml was generated for URL https://cpp-rs-driver.docs.scylladb.com in /home/wojciech/Scylla/cpp-rs-driver/docs/_build/dirhtml/sitemap.xml
build succeeded, 7 warnings.

The HTML pages are in _build/dirhtml.
[sphinx-autobuild] Serving on http://127.0.0.1:5500
[sphinx-autobuild] Waiting to detect changes...

@Lorak-mmk
Copy link
Contributor Author

Doxygen config warnings are harmless, and depend on the version, We can sort it out some other time.
Duplicate declarations are caused by you only deleting the docs/_build folder.
You also need to delete doxygen and docs/source/api.

@wprzytula
Copy link
Contributor

Doxygen config warnings are harmless, and depend on the version, We can sort it out some other time. Duplicate declarations are caused by you only deleting the docs/_build folder. You also need to delete doxygen and docs/source/api.

I'm running make clean. Can you fix the Makefile to run proper cleanup as you suggest?

Before that `make clean` didn't clean all files produced while building
docs. This commit fixes that.
@Lorak-mmk
Copy link
Contributor Author

I added a commit that fixes make clean in docs directory.

@Lorak-mmk Lorak-mmk merged commit aede4e1 into scylladb:master Mar 2, 2026
9 checks passed
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.

Doxygen fails to discover some methods of given struct

2 participants