Skip to content

fix(docs): scope vitest run to target dir in js-libs-update workflow - #44943

Merged
mandarini merged 1 commit into
masterfrom
fix/docs-workflow-vitest4-filter
Apr 16, 2026
Merged

mandarini merged 1 commit into
masterfrom
fix/docs-workflow-vitest4-filter

Conversation

@mandarini

@mandarini mandarini commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Vitest 4 no longer restricts test execution when a file path is passed as a positional filter, causing all docs tests to run and fail on unrelated tests. Use --dir to scope to the target directory. PR #44833 made the update which broke the behaviour.

Summary by CodeRabbit

  • Chores
    • Updated the test snapshot generation workflow to cover the expanded set of tests in the documentation features directory, broadening the scope of automated snapshot updates.

@supabase

supabase Bot commented Apr 16, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Apr 16, 2026 2:07pm
docs Ready Ready Preview, Comment, Open in v0 Apr 16, 2026 2:07pm
learn Ready Ready Preview, Comment Apr 16, 2026 2:07pm
studio-self-hosted Ready Ready Preview, Comment Apr 16, 2026 2:07pm
studio-staging Ready Ready Preview, Comment Apr 16, 2026 2:07pm
ui-library Ready Ready Preview, Comment Apr 16, 2026 2:07pm
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Apr 16, 2026 2:07pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Apr 16, 2026 2:07pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: a3b7ba94-5aa2-4e98-9ceb-f9d96be99925

📥 Commits

Reviewing files that changed from the base of the PR and between ae4f155 and c7a0a07.

📒 Files selected for processing (1)
  • .github/workflows/docs-js-libs-update.yml

📝 Walkthrough

Walkthrough

A GitHub Actions workflow step was updated to run Vitest with a directory-based selection (--dir features/docs) instead of a single test file, broadening the snapshot update scope across all tests in the features/docs directory.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/docs-js-libs-update.yml
Updated the "Generate new typespec snapshot" step to use --dir features/docs instead of targeting ./features/docs/Reference.typeSpec.test.ts, expanding snapshot generation scope to all tests in the directory.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hoppy hopping through the workflow so fine,
One file's no match for the whole directory line,
Snapshots now bloom across features/docs wide,
More tests, more checks—we've multiplied our pride! 📸✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provided is minimal but covers the core issue (Vitest 4 regression) and solution (using --dir flag). However, it does not follow the repository's template structure with required sections like 'What kind of change' and 'Additional context'. Restructure the description to follow the template: include explicit sections for change type, current behavior, new behavior, and add context about the Vitest version change.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: updating the vitest command to use --dir flag instead of a file path to properly scope test execution in the js-libs-update workflow.
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 fix/docs-workflow-vitest4-filter

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.

@mandarini
mandarini enabled auto-merge (squash) April 16, 2026 14:03
@mandarini
mandarini merged commit 28ef62c into master Apr 16, 2026
23 checks passed
@mandarini
mandarini deleted the fix/docs-workflow-vitest4-filter branch April 16, 2026 14:07
@github-actions

github-actions Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1776348547)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 30.4% (+1pp) 6 🟢 4 🔴
Correctness 100% (+4pp) 1 🟢 -
Docs Faithfulness 78.8% (+5pp) 3 🟢 2 🔴
Goal Completion 94.1% (+1pp) 2 🟢 1 🔴
Tool Usage 71.4% (-2pp) - 1 🔴
Knowledge Usage 96.3% (-4pp) - 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
URL Validity 100% (+0pp) - -
Time_to_first_token 0.01tok (+0tok) 6 🟢 11 🔴
Llm_calls 12.18 (-0.06) 9 🟢 4 🔴
Tool_calls 3.14 (+0.06) 9 🟢 6 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 25993.61tok (+2265.92tok) 8 🟢 9 🔴
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 564.75tok (-2.06tok) 8 🟢 9 🔴
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 26558.35tok (+2263.86tok) 8 🟢 9 🔴
Estimated_cost 0.01$ (+0$) 7 🟢 7 🔴
Duration 17.13s (+2.15s) 6 🟢 11 🔴
Llm_duration 44.12s (+6.12s) 6 🟢 11 🔴

mandarini added a commit that referenced this pull request Jun 8, 2026
…ned (#46737)

The `Update JS Client Libraries Docs` workflow's "Refresh
reference-content snapshot" step fails because `npx vitest run --update
scripts/build-reference-content.test.ts` is treated as a filter, not a
restriction, under Vitest 4, so all docs tests
run. `CodeSample.test.ts` then fails with ENOENT on
`apps/docs/examples/_internal/fixtures/*` because the workflow bypasses
the `pretest` npm hook that runs `codegen:examples`.
  
This is a regression of #44943 (commit 28ef62c), reintroduced by
#46163 when the snapshot step was renamed and rewritten back to the
file-path form.
  
Fixes:
- Workflow: use `--dir scripts` so only the snapshot test runs.
- Tests: add a vitest globalSetup that mirrors `codegen:examples`, so
`npx vitest`, `pnpm test:local`, and IDE single-test runs no longer
depend on the `pretest` lifecycle hook being triggered first.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated test infrastructure configuration and initialization process
for improved test suite management.
* Refined test execution workflow to efficiently manage test discovery
and execution across project directories.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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