Skip to content

Add pre-commit hook for docs sync#784

Open
mendral-app[bot] wants to merge 2 commits intomainfrom
mendral/add-pre-commit-docs-sync
Open

Add pre-commit hook for docs sync#784
mendral-app[bot] wants to merge 2 commits intomainfrom
mendral/add-pre-commit-docs-sync

Conversation

@mendral-app
Copy link
Copy Markdown

@mendral-app mendral-app Bot commented Apr 23, 2026

Summary

  • Add a session-docs-sync pre-commit hook that runs tests/test_docs_generation.py when SDK source files (packages/notte-sdk/src/) or SDK reference docs (docs/src/sdk-reference/) are modified
  • This lets developers catch docs drift (e.g. session.mdx out of sync with SessionStartRequest) locally before pushing, preventing recurring CI failures from test_session_parameters_in_sync and related sync tests

Context

Insight: test_session_parameters_in_sync fails when session.mdx docs drift from SDK

Over the past 14 days, test_session_parameters_in_sync failed on 4 different PRs — each with a different parameter mismatch. The root cause is developers modifying SDK parameters without updating the corresponding .mdx docs. This hook provides immediate local feedback when relevant files are changed.

Changes

  • .pre-commit-config.yaml: Added session-docs-sync local hook at the end of the repo: local section
    • Runs cd docs/src && uv run python -m pytest tests/test_docs_generation.py -x -q
    • Only triggers when files matching ^(packages/notte-sdk/src/|docs/src/sdk-reference/) are staged
    • Uses pass_filenames: false since the test doesn't accept file arguments

Note

Created by Mendral. Tag @mendral-app with feedback or questions.

Greptile Summary

Adds a session-docs-sync local pre-commit hook that runs tests/test_docs_generation.py whenever files under packages/notte-sdk/src/ or docs/src/sdk-reference/ are staged. The hook name was updated from the previous review to accurately reflect that all SDK reference resources (not just session.mdx) are covered.

Confidence Score: 5/5

Safe to merge — single-line YAML addition with no logic changes and all prior review concerns addressed.

The change is a small, isolated pre-commit hook configuration. The previous naming concern was resolved. No P0/P1 issues found.

No files require special attention.

Important Files Changed

Filename Overview
.pre-commit-config.yaml Adds session-docs-sync pre-commit hook to run tests/test_docs_generation.py when SDK source or SDK reference docs are staged; hook name was updated from a prior review to reflect all 8 resources covered.

Reviews (2): Last reviewed commit: "fix: broaden pre-commit hook name to cov..." | Re-trigger Greptile

Add a local pre-commit hook that runs test_docs_generation.py when
SDK source or SDK reference docs are modified. This catches session.mdx
(and other docs) drift from the SDK before pushing, preventing CI
failures from test_session_parameters_in_sync and related tests.
Comment thread .pre-commit-config.yaml Outdated
files: ^docs/src/testers/.*\.py$
pass_filenames: false
- id: session-docs-sync
name: Check session.mdx is in sync with SDK
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Hook name only mentions session.mdx

The name says "Check session.mdx is in sync with SDK", but test_docs_generation.py actually covers 8 resources: agent, session, workflow, vault, persona, file_storage, agent_fallback, and function. A developer seeing this hook fail for a workflow drift would find the name confusing.

Suggested change
name: Check session.mdx is in sync with SDK
name: Check SDK reference docs are in sync with SDK
Prompt To Fix With AI
This is a comment left during a code review.
Path: .pre-commit-config.yaml
Line: 99

Comment:
**Hook name only mentions `session.mdx`**

The `name` says "Check session.mdx is in sync with SDK", but `test_docs_generation.py` actually covers 8 resources: agent, session, workflow, vault, persona, file_storage, agent_fallback, and function. A developer seeing this hook fail for a workflow drift would find the name confusing.

```suggestion
        name: Check SDK reference docs are in sync with SDK
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch — updated the name to "Check SDK reference docs are in sync with SDK" in e648076. The test covers all 8 resources, so the broader name is more accurate.

@2027-evals
Copy link
Copy Markdown

2027-evals Bot commented Apr 23, 2026

⚠️ Couldn't find a preview deployment for commit c990252 after 10 minutes.

2027 auto-runs evals against preview deployments of your docs. To enable this, install one of:

  • Mintlify — if you use Mintlify docs
  • Vercel — for Next.js / static sites
  • Netlify — for most static docs

Once a preview is deployed, open a new PR and we'll run the eval automatically.


Evaluating agent experience using 2027.dev · View dashboard

@mendral-app mendral-app Bot marked this pull request as ready for review April 23, 2026 16:41
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.

0 participants