Skip to content

ci: Check-docs for all workspace packages#2158

Open
shinigami-777 wants to merge 2 commits intobitcoindevkit:masterfrom
shinigami-777:check-docs
Open

ci: Check-docs for all workspace packages#2158
shinigami-777 wants to merge 2 commits intobitcoindevkit:masterfrom
shinigami-777:check-docs

Conversation

@shinigami-777
Copy link

@shinigami-777 shinigami-777 commented Mar 15, 2026

Description

Issue: #2152

This PR adds a script (ci/check-docs.sh) that checks documentation builds for all workspace packages. The check-docs job is added to the workflow file cont_integration.yml that calls the check-docs.sh script. A justfile recipe just doc added to execute ci/check-docs.sh .

Notes to the reviewers

Currently the bdk_chain and bdk_core checks are failing due to the following errors:

image image

Changelog notice

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@shinigami-777 shinigami-777 changed the title Check docs ci: Check-docs for all workspace packages Mar 15, 2026
@evanlinjin
Copy link
Member

Thanks for this work.

I think it also makes sense to also include the documentation fixes in this PR (as a separate commit).

@ValuedMammal
Copy link
Collaborator

@shinigami-777 Can you add a commit addressing the check-docs failures? I recommend removing the redundant explicit link targets in keychain_txout.rs for types that are already in scope (i.e. bitcoin::Script). Then in spk_client.rs update the docs with a valid link to the KeychainTxOutIndex type.

@shinigami-777
Copy link
Author

Thanks for this work.

I think it also makes sense to also include the documentation fixes in this PR (as a separate commit).

I have added some doc changes to the CONTRIBUTING.md in this commit.

@shinigami-777
Copy link
Author

Updated keychain_txout.rs and spk_client.rs. Now all doc checks are successful.

@ValuedMammal ValuedMammal added documentation Improvements or additions to documentation tests github_actions Pull requests that update GitHub Actions code labels Mar 16, 2026
@ValuedMammal ValuedMammal moved this to Needs Review in BDK Chain Mar 16, 2026
@ValuedMammal ValuedMammal linked an issue Mar 16, 2026 that may be closed by this pull request
10 tasks
@oleonardolima oleonardolima added this to the Chain 0.24.0 milestone Mar 16, 2026
Copy link
Collaborator

@oleonardolima oleonardolima 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 working on this one!

I left some comments as I don't see use for a new check-docs.sh file we should probably just call the cargo commands directly. Let's see what other thinks about it.

Also, you could probably squash it into two commits, something like this:

  • ci: add new check-docs job and recipe in justfile
  • fix(docs): in keychain_txout.rs and spk_client.rs

@@ -57,3 +58,7 @@ _test-testenv:

# Run pre-push suite: format, check, and test
pre-push: fmt check test
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: it's also a good idea to add the doc to pre-push too.

Copy link
Author

Choose a reason for hiding this comment

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

I added the doc for pre-push in this commit.

ci/check-docs.sh Outdated
Comment on lines +1 to +40
#!/usr/bin/env bash

set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'

echo "Checking documentation for all workspace packages..."

PACKAGES=(
"bdk_chain"
"bdk_core"
"bdk_file_store"
"bdk_electrum"
"bdk_esplora"
"bdk_bitcoind_rpc"
"bdk_testenv"
)

FAILED=0

for package in "${PACKAGES[@]}"; do
echo "Checking for ${package}..."

if RUSTDOCFLAGS='-D warnings' cargo rustdoc -p "${package}" --all-features -- -D warnings; then
echo -e "${GREEN}${package} docs OK${NC}"
else
echo -e "${RED}${package} docs FAILED${NC}"
FAILED=1
fi
echo ""
done

if [ $FAILED -eq 1 ]; then
echo -e "${RED}Documentation check failed for one or more packages${NC}"
exit 1
else
echo -e "${GREEN}All documentation checks passed!${NC}"
exit 0
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

@shinigami-777 What's the benefit for having this instead of just calling RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps ?

Copy link
Author

Choose a reason for hiding this comment

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

Removed ci/check-docs.sh. I did the same using RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps.

/// Sync revealed script pubkeys obtained from a
/// [`KeychainTxOutIndex`](../../bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex.
/// html).
/// [`KeychainTxOutIndex`](https://docs.rs/bdk_chain/0.23.2/bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex.html).
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: it's best to use latest

Suggested change
/// [`KeychainTxOutIndex`](https://docs.rs/bdk_chain/0.23.2/bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex.html).
/// [`KeychainTxOutIndex`](https://docs.rs/bdk_chain/latest/bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex.html).

override: true
cache: true
- name: Check docs
run: ./ci/check-docs.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I mentioned below I don't think we need another file, calling RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps here and in justfile is much better.

Copy link
Author

Choose a reason for hiding this comment

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

Changed to just calling RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps.

@shinigami-777
Copy link
Author

@oleonardolima Thanks for reviewing. I have made the changes and squashed them in 2 commits: c4b8e93 and 1d1e985

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code tests

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

Check cargo rustdoc for all workspace members

4 participants