Skip to content

docs: add Workers howto page and Packages.md entry#56

Merged
ankurs merged 4 commits intomainfrom
docs/workers-howto
Apr 5, 2026
Merged

docs: add Workers howto page and Packages.md entry#56
ankurs merged 4 commits intomainfrom
docs/workers-howto

Conversation

@ankurs
Copy link
Copy Markdown
Member

@ankurs ankurs commented Apr 5, 2026

Summary

  • New howto/workers.md page covering the go-coldbrew/workers package
  • Workers section added to Packages.md
  • Playwright navigation test updated

Howto page covers:

  • Overview with supervisor tree architecture
  • Quick start
  • Builder methods (WithRestart, Every, WithFailureBackoff, etc.)
  • WorkerContext (Name, Attempt, Add, Remove, Children)
  • Helpers (EveryInterval, ChannelWorker, BatchChannelWorker)
  • Dynamic workers: config reconciliation, fixed children, per-tenant, nested hierarchy
  • Logging and ColdBrew integration roadmap

Test plan

  • Playwright tests pass
  • Workers howto page renders correctly
  • Packages.md shows Workers section

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Workers library docs covering supervised worker lifecycle, panic recovery, automatic restart with configurable backoff and jitter, OpenTelemetry tracing, coordinated graceful shutdown, WorkerContext APIs, builder options, usage patterns (periodic, channel-driven, batching, dynamic pools, nested hierarchies), and updated package reference links.
  • Tests
    • Added a page-load test for the new Workers How-To page to ensure it serves correctly and displays headings.

- New howto/workers.md: overview, quick start, builder methods,
  WorkerContext, helpers, dynamic workers (config reconciliation,
  fixed children, per-tenant, nested hierarchy), logging
- Add Workers section to Packages.md
- Add /howto/workers/ to Playwright navigation tests
Copilot AI review requested due to automatic review settings April 5, 2026 10:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 5, 2026

Warning

Rate limit exceeded

@ankurs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 47 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 11 minutes and 47 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 494aa6d0-2b62-4836-94e9-782c8284c7a1

📥 Commits

Reviewing files that changed from the base of the PR and between df135df and b33cd08.

📒 Files selected for processing (1)
  • howto/workers.md
📝 Walkthrough

Walkthrough

Adds documentation for a new Workers library (package reference and a detailed how-to) and updates the site test suite to include the new howto page route. No code changes to exported/public APIs.

Changes

Cohort / File(s) Summary
Packages doc
Packages.md
Adds a top-level Workers section describing worker lifecycle features (panic recovery, restart/backoff, tracing, structured shutdown) and adds [Workers] / [workers-docs] reference links.
Howto guide
howto/workers.md
New comprehensive how-to for go-coldbrew/workers: Run semantics, WorkerContext contract (Name, Attempt, Add/Remove/Children), builder/config options (restart, backoff, jitter, Every/EveryInterval, shutdown timeout), usage patterns (ticker, channel, batch, dynamic pools, nested children), tracing/logging notes, and examples.
Tests
tests/navigation.spec.ts
Adds /howto/workers/ to the Playwright page-load checks to ensure the new documentation page loads and displays a heading.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 I hopped through docs to plant a seed of code,
Workers and restarts where busy bunnies strode,
Tracing footprints, children born and spun,
Panic to error, then backoff till done,
Pages load, tests nod — my burrow's in mode.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a Workers howto page and a Packages.md entry, which matches the changeset across all three modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/workers-howto

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@howto/workers.md`:
- Around line 19-27: The fenced architecture block is missing a language tag
causing MD040; update the fenced code block in the workers.md content (the ASCII
diagram block starting with "Root Supervisor" and the triple backticks) to
include a language identifier such as ```text so the block becomes ```text ...
``` and satisfies the markdown lint rule.
- Line 289: The markdown contains an unused reference label "workers-docs" (the
link definition `[workers-docs]:
https://pkg.go.dev/github.com/go-coldbrew/workers`); either remove that link
definition if it's not needed or update the document to reference
`[workers-docs]` where the package docs should be linked (e.g., replace an
inline URL or add the reference-style link). Locate the definition for the
"workers-docs" label and either delete it or insert the `[workers-docs]`
reference into the appropriate anchor text elsewhere in the file so MD053 is
satisfied.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc61b6a9-9b48-458b-94f1-96014c5abcb7

📥 Commits

Reviewing files that changed from the base of the PR and between a0d0583 and 593d41a.

📒 Files selected for processing (3)
  • Packages.md
  • howto/workers.md
  • tests/navigation.spec.ts

Comment thread howto/workers.md Outdated
Comment thread howto/workers.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the documentation set by introducing a new “Workers” How To guide for the go-coldbrew/workers package, linking it from the central package index, and ensuring the new page is covered by the docs site navigation smoke test.

Changes:

  • Add new howto/workers.md documentation page covering worker lifecycle patterns and APIs.
  • Add a “Workers” entry to Packages.md with links to GitHub and pkg.go.dev docs.
  • Update Playwright navigation smoke test to include the new /howto/workers/ route.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/navigation.spec.ts Adds /howto/workers/ to the list of how-to pages that must load successfully.
Packages.md Adds a “Workers” section and link references to the Workers repo and Go docs.
howto/workers.md Introduces the new Workers how-to page with overview, patterns, and examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread howto/workers.md Outdated
Comment thread howto/workers.md Outdated
ankurs added 2 commits April 5, 2026 19:52
- Add text language tag to architecture code fence
- Handle Run error in quick start example
- Simplify log.Info usage to match ColdBrew API pattern
- Remove unused workers-docs reference link
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
howto/workers.md (1)

274-274: Use fully-qualified type name for consistency

Consider changing []*Worker{w} to []*workers.Worker{w} in prose to match the rest of the page and reduce ambiguity for readers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@howto/workers.md` at line 274, Update the prose to use the fully-qualified
type name to match the rest of the document: change the snippet `[]*Worker{w}`
to `[]*workers.Worker{w}` in the sentence describing RunWorker as a convenience
for Run(ctx, []*Worker{w}); keep the rest of the sentence intact and ensure the
referenced symbols RunWorker, Run, and workers.Worker are used exactly as shown.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@howto/workers.md`:
- Around line 38-50: The Quick Start snippet is missing required imports which
prevents copy-paste execution; add the standard imports used (context, log, os,
os/signal, time) and keep the third-party "github.com/go-coldbrew/workers"
import, so the calls to signal.NotifyContext, workers.Run and workers.NewWorker
compile correctly; update the import block to a grouped import including those
standard packages and leave the rest of the example (ctx/cancel, NotifyContext,
NewWorker, Every, WithRestart, Run) unchanged.

---

Nitpick comments:
In `@howto/workers.md`:
- Line 274: Update the prose to use the fully-qualified type name to match the
rest of the document: change the snippet `[]*Worker{w}` to
`[]*workers.Worker{w}` in the sentence describing RunWorker as a convenience for
Run(ctx, []*Worker{w}); keep the rest of the sentence intact and ensure the
referenced symbols RunWorker, Run, and workers.Worker are used exactly as shown.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d177ec9-58fe-4a3f-9456-5ef1af6eb0ec

📥 Commits

Reviewing files that changed from the base of the PR and between 5f967b9 and df135df.

📒 Files selected for processing (1)
  • howto/workers.md

Comment thread howto/workers.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread howto/workers.md
Comment thread howto/workers.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread howto/workers.md
@ankurs ankurs merged commit 0198735 into main Apr 5, 2026
11 checks passed
@ankurs ankurs deleted the docs/workers-howto branch April 5, 2026 13:20
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