Skip to content

docs: document core public API and guard it with deny(missing_docs) - #586

Open
sshaplygin wants to merge 1 commit into
ydb-platform:masterfrom
sshaplygin:docs/core-public-api-rustdoc
Open

docs: document core public API and guard it with deny(missing_docs)#586
sshaplygin wants to merge 1 commit into
ydb-platform:masterfrom
sshaplygin:docs/core-public-api-rustdoc

Conversation

@sshaplygin

Copy link
Copy Markdown
Contributor

Problem

Building with -W missing_docs reports roughly 470 undocumented public items, spread across most modules. docs.rs therefore shows bare signatures for types users touch on their first query.

Change

Start with the core surface and make it non-regressable:

  • errors.rsYdbOrCustomerError::to_ydb_error, the five YdbIssueSeverity variants, the YdbIssue issue_code/message fields.
  • result.rsResultSet and its rows/is_truncated, Row and both remove_field* methods, ResultSetRowsIter.
  • pub_traits.rsTokenInfo, Credentials and both trait methods. The existing implementation notes on create_token (caching, background renewal, behaviour while renewal fails) were plain // comments invisible on docs.rs; they are now rustdoc, with the originals kept in place.
  • waiter.rsWaiter and Waiter::wait.

Then #[deny(missing_docs)] on those four module declarations in lib.rs, so the documented surface cannot regress.

The other modules stay unguarded and can be converted one at a time by the same pattern — the largest remaining are client_topic/list_types.rs (72 items), client_topic/client.rs (46) and table_requests.rs (41).

Verification

  • -W missing_docs reports 0 remaining warnings in the four modules.
  • Confirmed the guard bites: deleting one doc comment turns the build red with error: missing documentation for a method.
  • All new intra-doc links resolve. cargo doc reports 17 broken links crate-wide, all pre-existing and all in other modules (10 in client_query/builders.rs).
  • cargo fmt --check, clippy -D warnings, cargo test --workspace and cargo test --doc all pass.

🤖 Generated with Claude Code

Around 470 public items in the crate have no rustdoc. Start with the
types every user of the SDK touches - errors, result sets and rows, the
`Credentials` and `Waiter` traits - and add `#[deny(missing_docs)]` to
those four modules so the documented surface cannot regress.

Documented: `YdbOrCustomerError::to_ydb_error`, the `YdbIssueSeverity`
variants, the `YdbIssue` code/message fields, `ResultSet` and its
`rows`/`is_truncated`, `Row` and both `remove_field*` methods,
`ResultSetRowsIter`, `TokenInfo`, `Credentials` with both trait methods,
and `Waiter::wait`.

The remaining modules stay unguarded; they can be converted one at a
time by the same pattern.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.85%. Comparing base (a6d7911) to head (78cf418).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #586      +/-   ##
==========================================
- Coverage   86.91%   86.85%   -0.06%     
==========================================
  Files         198      198              
  Lines       19492    19492              
==========================================
- Hits        16941    16930      -11     
- Misses       2551     2562      +11     
Flag Coverage Δ
rust-1.88.0 86.85% <ø> (-0.06%) ⬇️
rust-1.96.1 87.15% <ø> (-0.01%) ⬇️
tests 86.85% <ø> (-0.06%) ⬇️
ubuntu 86.85% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread ydb/src/errors.rs
#[default]
Fatal,

/// The operation failed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Тут непонятно различие между этими двумя ошибками. И в fatal и в error - операция дальше не продолжается.

Comment thread ydb/src/errors.rs
pub struct YdbIssue {
/// Server-defined issue code
///
/// More stable than the message - prefer it for programmatic checks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

На эти коды тоже нельзя полагаться в общем случаи. Они более стабильны, чем текст. Но гарантии их стабильности и неизменности на конкретных сценариях нет. Это низкоуровневые штуки, больше для диагностики. И общая рекомендация - не завязываться на них.

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.

2 participants