Skip to content

Conversation

@wprzytula
Copy link
Collaborator

This patch fixes the unmet requirements for doctests wrt features:

  1. The doctest for SessionBuilder::tls_context() is compiled conditionally, only when the required openssl-010 feature is turned on;
  2. scylla-macros, scylla-cql, and scylla-proxy now have set all-features flag for docs.rs, which will make optional entities appear in those crates' respective docs. Before, #[cfg(feature)]'d entities would not show up in, e.g., scylla-cql crate docs on docs.rs.

Fixes: #1369

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • [ ] I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • [ ] I have provided docstrings for the public items that I want to introduce.
  • [ ] I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

wprzytula added 4 commits June 4, 2025 09:26
This is needed for docs.rs to include all features in the generated
documentation. It seems that `scylla` crate has already been configured
correctly, but `scylla-cql`, `scylla-macros`, and `scylla-proxy` were
missing the needed setting. Also, I added quotes around the `docs.rs`
metadata key to disambiguate it from the period that is used for
nesting metadata keys.
The doc test for the `tls_context` method in `SessionBuilder` would fail
when the `openssl-010` feature was disabled, because the feature
was required to use the `openssl` crate required by the example.
The changes are introduces as suggested here:
https://users.rust-lang.org/t/doctests-that-require-a-non-default-feature-is-it-possible/29529/3
This makes all doc tests pass both when the `openssl-010` feature is
enabled or disabled.

Fixes: scylladb#1369
The test uses entities which may be unobvious to the reader.
Their imports are made visible to aid understanding.
@wprzytula wprzytula requested a review from Lorak-mmk June 4, 2025 08:12
@wprzytula wprzytula self-assigned this Jun 4, 2025
@wprzytula wprzytula added this to the 1.3.0 milestone Jun 4, 2025
@github-actions
Copy link

github-actions bot commented Jun 4, 2025

cargo semver-checks found no API-breaking changes in this PR.
Checked commit: 8aacdd6

Copy link
Collaborator

@Lorak-mmk Lorak-mmk left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix!

@wprzytula wprzytula merged commit 2895d7e into scylladb:main Jun 4, 2025
12 checks passed
@wprzytula wprzytula deleted the set-features-for-docs branch June 4, 2025 08:36
@wprzytula wprzytula mentioned this pull request Jul 6, 2025
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.

"use of unresolved module or unlinked crate openssl" when running tests for scylla package

2 participants