Skip to content

Docs: 209 README and guide code examples don't compile against the current API #48

Closed

Description

@CodingAnarchy

Part of #7. I pulled README.md and every docs/*.md into rustdoc as doctests (#[cfg(doctest)] #[doc = include_str!(...)] struct …; in src/lib.rs), then ran cargo test --doc -p hammerwork --all-features. 209 of the Rust code blocks fail.

File Failing examples
docs/encryption.md 27
docs/archiving.md 24
docs/workflows.md 22
docs/worker-configuration.md 22
docs/batch-operations.md 22
docs/tracing.md 17
docs/cron-scheduling.md 17
docs/priority-system.md 15
docs/job-spawning.md 10
docs/job-types.md 8
README.md 6
docs/quick-start.md 5
docs/monitoring.md 5
docs/migrations.md 3
docs/webhooks.md, docs/integration-testing.md 2 each
docs/testing.md, docs/streaming.md 1 each

Fix

  • Keep the #[cfg(doctest)] includes, so the README and every guide are compiled by cargo test --doc and CI from now on.
  • Make every example compile against the real API:
    • Use hidden # lines for imports and setup.
    • Use no_run for examples that need a database, network or cloud service. They must still compile; CI runs with --include-ignored, so ignore doesn't skip anything.
    • Use text / toml / sql fences for blocks that aren't Rust.
  • Fix examples that show APIs that don't exist, or behaviour that changed this cycle. Notable changes: with_spawn_config returns Result; EncryptionEngine isn't generic; AlertTarget::Email has smtp; with_max_retries is a cap; retries use the job's max_attempts; RetryStrategy::Custom holds an Arc; the [encryption] config section exists.
  • Also review the README feature list for accuracy:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions