-
Notifications
You must be signed in to change notification settings - Fork 451
docs: chunky overhaul #3129
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
docs: chunky overhaul #3129
Changes from 36 commits
8a19729
92f8568
e3103eb
226e0a0
fa01035
c26dfe4
25c4160
d7037fc
fd4f374
1142be2
e581a8e
9cba7a1
9b6f0d5
5684487
af69110
3a27b27
4e4f1b7
ffa34f4
955e3be
a49fb1c
6c43b4f
a83d4a9
6da9e6c
09ce4a5
91f091f
78de27f
69cacd0
8d4b792
0bc6e3c
c04d5ef
10e4fc9
29df31d
c02b8a1
c6f4375
367a31a
d710e18
09e5c12
6a3ce15
1b205aa
acd1e5f
37bdece
ddffcce
9b9a1a8
8bcb352
38cc864
0b38b8b
3f1f82e
d6c5548
94105b2
efc269a
132d262
de13522
ada66bb
c177f83
bb6157d
029a4a9
e4ea55a
9d2b441
597ca71
b4dd930
631b841
521ee3f
474101b
54528e3
e8a1715
b8cfd1a
7a358b2
d1c2cb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| description: How to edit guide code examples and regenerate snippets | ||
| globs: sdks/guides/**/*,frontend/docs/pages/guides/**/*.mdx,examples/*/guides/**/* | ||
| alwaysApply: false | ||
| --- | ||
|
|
||
| # Guide Snippet Workflow | ||
|
|
||
| ## Source of truth | ||
|
|
||
| All guide code lives in `sdks/guides/{lang}/`. The files under `examples/{lang}/guides/` are **generated** mirrors. Never edit the `examples/` copies directly. | ||
|
|
||
| ## Snippet markers | ||
|
|
||
| Use `# > Step Title` (or `// >` for TS/Go) to open a snippet and `# !!` (or `// !!`) to close it. The generator converts the title to snake_case for the snippet key (e.g. `# > Step 04 Rate Limited Scrape` → `step_04_rate_limited_scrape`). | ||
|
|
||
| ## Referencing snippets in MDX | ||
|
|
||
| ``` | ||
| snippets.{lang}.guides.{guide_dir}.{file_stem}.{snippet_key} | ||
| ``` | ||
|
|
||
| Example: `snippets.python.guides.web_scraping.worker.step_01_define_scrape_task` | ||
|
|
||
| ## Regenerating | ||
|
|
||
| After editing any file in `sdks/guides/`, run: | ||
|
|
||
| ``` | ||
| cd frontend/snippets && python3 generate.py | ||
| ``` | ||
|
|
||
| This regenerates both `examples/*/guides/` mirror files and `frontend/docs/lib/generated/snippets/index.ts`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| description: Writing style conventions for Hatchet documentation | ||
| globs: frontend/docs/**/*.mdx | ||
| alwaysApply: false | ||
| --- | ||
|
|
||
| # Docs Writing Style | ||
|
|
||
| ## Punctuation | ||
|
|
||
| - Do NOT use em dashes (—). Use commas, parentheses, or separate sentences instead. | ||
| - Prefer short, direct sentences over long compound ones. | ||
|
|
||
| ## Phrases to Avoid | ||
|
|
||
| - Do not use "under the hood." Just state the fact directly. | ||
|
|
||
| ## Terminology | ||
|
|
||
| - Do not use the word "cycle" to describe agent loops. Use "child spawning" or "self-spawning child task" instead. | ||
| - Use "durable task" (not "durable function" or "durable workflow step") for the core execution primitive. | ||
| - Link concept terms to their concept pages on first use (e.g. `[durable task](/concepts/durable-workflows/durable-task-execution)`). |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,5 +17,27 @@ repos: | |||||
| rev: v2.7.2 | ||||||
| hooks: | ||||||
| - id: golangci-lint | ||||||
| args: ["--config=.golangci.yml"] | ||||||
| exclude: ^examples/ | ||||||
| args: ["--config=.golangci.yml", "--allow-parallel-runners"] | ||||||
| exclude: ^(examples/|sdks/guides/go/) | ||||||
| - repo: local | ||||||
| hooks: | ||||||
| - id: golangci-lint-guides | ||||||
| name: golangci-lint (sdks/guides/go) | ||||||
| entry: bash -c 'cd sdks/guides/go && golangci-lint run ./... --config .golangci.yml --allow-parallel-runners' | ||||||
| language: system | ||||||
| files: ^sdks/guides/go/ | ||||||
| - id: ruff-python-guides | ||||||
| name: ruff (sdks/guides/python) | ||||||
| entry: bash -c 'cd sdks/guides/python && poetry run ruff check .' | ||||||
| language: system | ||||||
| files: ^sdks/guides/python/ | ||||||
| - id: eslint-typescript-guides | ||||||
| name: eslint (sdks/guides/typescript) | ||||||
| entry: bash -c 'cd sdks/guides/typescript && pnpm run lint:check' | ||||||
| language: system | ||||||
| files: ^sdks/guides/typescript/ | ||||||
| - id: rubocop-ruby-guides | ||||||
| name: rubocop (sdks/guides/ruby) | ||||||
| entry: bash -c 'cd sdks/guides/ruby && bundle install && bundle exec rubocop' | ||||||
|
||||||
| entry: bash -c 'cd sdks/guides/ruby && bundle install && bundle exec rubocop' | |
| entry: bash -c 'cd sdks/guides/ruby && (bundle check || bundle install) && bundle exec rubocop' |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -61,9 +61,21 @@ tasks: | |||||||||||||||||||||||||||
| fmt-docs: | ||||||||||||||||||||||||||||
| dir: frontend/docs | ||||||||||||||||||||||||||||
| cmd: pnpm run prettier:fix && pnpm run prettier:check | ||||||||||||||||||||||||||||
| sync-agent-instructions: | ||||||||||||||||||||||||||||
| desc: Sync agent-instructions MDX files into hatchet-cli skill-assets references | ||||||||||||||||||||||||||||
| cmds: | ||||||||||||||||||||||||||||
| - | | ||||||||||||||||||||||||||||
| src="frontend/docs/pages/agent-instructions" | ||||||||||||||||||||||||||||
| dest="cmd/hatchet-cli/cli/skill-assets/hatchet-cli/references" | ||||||||||||||||||||||||||||
| for f in "$src"/*.mdx; do | ||||||||||||||||||||||||||||
|
Comment on lines
+69
to
+70
|
||||||||||||||||||||||||||||
| dest="cmd/hatchet-cli/cli/skill-assets/hatchet-cli/references" | |
| for f in "$src"/*.mdx; do | |
| dest="cmd/hatchet-cli/cli/skill-assets/hatchet-cli/references" | |
| # Ensure destination directory exists | |
| mkdir -p "$dest" | |
| # Remove previously generated reference docs to avoid stale files | |
| rm -f "$dest"/*.md | |
| # Re-sync current MDX files as .md references | |
| for f in "$src"/*.mdx; do | |
| [ -e "$f" ] || continue |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,11 @@ func ToCronWorkflowsFromSQLC(cron *sqlcv1.ListCronWorkflowsRow) *gen.CronWorkflo | |
| } | ||
| } | ||
|
|
||
| input := make(map[string]interface{}) | ||
| if cron.Input != nil { | ||
| json.Unmarshal(cron.Input, &input) //nolint:errcheck | ||
| } | ||
|
Comment on lines
+69
to
+72
|
||
|
|
||
| res := &gen.CronWorkflows{ | ||
| Metadata: *toAPIMetadata(cron.ID_2, cron.CreatedAt_2.Time, cron.UpdatedAt_2.Time), | ||
| WorkflowVersionId: cron.WorkflowVersionId.String(), | ||
|
|
@@ -78,6 +83,7 @@ func ToCronWorkflowsFromSQLC(cron *sqlcv1.ListCronWorkflowsRow) *gen.CronWorkflo | |
| Enabled: cron.Enabled, | ||
| Method: gen.CronWorkflowsMethod(cron.Method), | ||
| Priority: &cron.Priority, | ||
| Input: &input, | ||
|
Comment on lines
85
to
+86
|
||
| } | ||
|
|
||
| return res | ||
|
|
||
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.
On Ubuntu runners, apt-get install can intermittently fail without an apt-get update first (stale package index). Add a preceding 'sudo apt-get update' (or combine into one step) to make the workflow more reliable.