-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minor: fix documentation of new features #823
Conversation
//! | `in-use-encryption-unstable` | Enable support for client-side field level encryption and queryable encryption. This API is unstable and may be subject to breaking changes in minor releases. | no | | ||
//! | `tracing-unstable` | Enable support for emitting [`tracing`](https://docs.rs/tracing/latest/tracing/) events. This API is unstable and may be subject to breaking changes in minor releases. | no | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the two new additions to the table; I realized they were missing. I also removed the "Extra dependencies" column as a lot of the information was outdated/incorrect. If we think this information is valuable then I can go through and fix it, but I'm not sure how useful it is given that users can just look at our Cargo.toml
. There's also a risk that it will become out-of-date again in the future if we add/change dependencies and forget to update here. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed this doesn't need to be in the table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
src/lib.rs
Outdated
@@ -343,7 +345,8 @@ mod test; | |||
#[cfg(feature = "tracing-unstable")] | |||
mod trace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's anything here that needs to be exported publicly/documented but let me know if that's wrong, @kmahar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only thing explicitly in the API around tracing is the tracing_max_document_length_bytes
option in ClientOptions
. that already has the docsrs annotations and appears to show up correctly in the docs: https://docs.rs/mongodb/2.4.0-beta.1/mongodb/options/struct.ClientOptions.html#structfield.tracing_max_document_length_bytes
//! | `in-use-encryption-unstable` | Enable support for client-side field level encryption and queryable encryption. This API is unstable and may be subject to breaking changes in minor releases. | no | | ||
//! | `tracing-unstable` | Enable support for emitting [`tracing`](https://docs.rs/tracing/latest/tracing/) events. This API is unstable and may be subject to breaking changes in minor releases. | no | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed this doesn't need to be in the table.
src/lib.rs
Outdated
@@ -343,7 +345,8 @@ mod test; | |||
#[cfg(feature = "tracing-unstable")] | |||
mod trace; | |||
|
|||
#[cfg(feature = "in-use-encryption-unstable")] | |||
#[cfg(any(feature = "in-use-encryption-unstable", docsrs))] | |||
#[cfg_attr(docsrs, doc(cfg(any(feature = "sync", feature = "tokio-sync"))))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the second line should be
#[cfg_attr(docsrs, doc(cfg(feature = "in-use-encryption-unstable")))]
(and below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, bad copy/paste - fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM mod Abraham's comment.
# The In Use Encryption API is unstable and may have backwards-incompatible changes in minor version updates. | ||
in-use-encryption-unstable = ["mongocrypt", "rayon", "num_cpus"] | ||
|
||
# DO NOT USE; see https://jira.mongodb.org/browse/RUST-580 for the status of tracing/logging support in the Rust driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for removing this! I forgot :)
//! | `in-use-encryption-unstable` | Enable support for client-side field level encryption and queryable encryption. This API is unstable and may be subject to breaking changes in minor releases. | no | | ||
//! | `tracing-unstable` | Enable support for emitting [`tracing`](https://docs.rs/tracing/latest/tracing/) events. This API is unstable and may be subject to breaking changes in minor releases. | no | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
src/lib.rs
Outdated
@@ -343,7 +345,8 @@ mod test; | |||
#[cfg(feature = "tracing-unstable")] | |||
mod trace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only thing explicitly in the API around tracing is the tracing_max_document_length_bytes
option in ClientOptions
. that already has the docsrs annotations and appears to show up correctly in the docs: https://docs.rs/mongodb/2.4.0-beta.1/mongodb/options/struct.ClientOptions.html#structfield.tracing_max_document_length_bytes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
The new changes update our docs.rs build approach to use feature flags rather than the
The first line includes the code in our docs build and the second line adds a note in the docs that the item is gated behind a feature flag. We also have the following in our Cargo.toml:
This approach was necessary in part because the The new approach is to build our documentation with all of the non-default-conflicting features (i.e. everything but |
"aws-auth", | ||
"tracing-unstable", | ||
"in-use-encryption-unstable" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main drawback of this new approach is that we need to keep a manual list of all of our features and be sure to append here as new ones are added. I do think this is still a slight improvement to the current situation, though, as this is an easier change than adding #[cfg(docsrs)]
to any public API behind a feature flag.
This becomes much easier if we choose to remove our async-std-related features in the future, as we can just specify to use all features 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, agreed, definitely prefer this way.
// `missing_crate_level_docs` was renamed with a `rustdoc::` prefix in rustc 1.55, but isn't | ||
// supported in the MSRV. | ||
// TODO: remove the wrapping cfg_attr if/when the MSRV is 1.55+. | ||
#![cfg_attr(docsrs, warn(rustdoc::missing_crate_level_docs))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slightly unrelated but I noticed that we can remove this now that our MSRV is higher than 1.55.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much better than how it was set up before - thank you!
"aws-auth", | ||
"tracing-unstable", | ||
"in-use-encryption-unstable" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, agreed, definitely prefer this way.
As far as I can tell there's not a great way to test what this is going to look like on docs.rs short of doing a release, but the FLE docs should show up in the same way that the sync docs currently do.