Skip to content

feat: setup attest for type benchmarking#142

Merged
luxass merged 5 commits intomainfrom
feat_setup_attest_for_type_benchmarking
Apr 25, 2025
Merged

feat: setup attest for type benchmarking#142
luxass merged 5 commits intomainfrom
feat_setup_attest_for_type_benchmarking

Conversation

@luxass
Copy link
Copy Markdown
Member

@luxass luxass commented Apr 24, 2025

This PR is setting @ark/attest up for us to improve our typechecking performance.

Summary by CodeRabbit

  • New Features
    • Introduced type benchmarking capabilities, allowing performance measurement of type-related operations.
  • Chores
    • Added new scripts and configuration for running type benchmarks in development and CI workflows.
    • Expanded development dependencies and updated project configuration to support benchmarking.
  • Tests
    • Added benchmark tests to evaluate the performance of source adapter instantiation and transform chaining.
  • Style
    • Updated test setup file path in the testing configuration.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 24, 2025

⚠️ No Changeset found

Latest commit: 431242e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a type-level benchmarking workflow into the project. It adds new scripts and configuration for running TypeScript benchmarks, integrates these benchmarks into the continuous integration (CI) pipeline, and updates package management files to include necessary dependencies. Benchmark test files are added to measure the instantiation and transform chaining performance of a source adapter builder. TypeScript configuration is extended to include benchmark files, and workspace and build tool configurations are updated to support the new benchmarking tasks. Additionally, a minor change is made to the Vitest test setup file path.

Changes

File(s) Change Summary
.github/workflows/ci.yaml Added a "run benchmarks" step to CI, running pnpm bench:types with threshold flags after typecheck and before test.
package.json, pnpm-workspace.yaml Added bench:types script, included @ark/attest and tsx as dev dependencies and workspace catalog entries.
packages/adapters/package.json Added bench:types script using tsx to run benchmarks; minor JSON syntax fix in "typecheck" script.
packages/adapters/.ts-benchmarks/builders/source-builder.ts-bench.ts New benchmark test file for createSourceAdapter and its transform API, measuring instantiation performance.
packages/adapters/.ts-benchmarks/index.ts Imported the new benchmark test file to the benchmarks entry point.
packages/adapters/tsconfig.json Included .ts-benchmarks/**/* in TypeScript compilation scope.
turbo.json Added a bench:types task with dependency on ^topo and disabled caching.
vitest.config.ts Updated test setup file path from ./test/setup/msw.ts to ./test/global-setup/msw.ts.

Sequence Diagram(s)

sequenceDiagram
    participant CI
    participant Turbo
    participant Benchmarks
    participant TypeScript

    CI->>Turbo: Run bench:types (via pnpm script)
    Turbo->>Benchmarks: Execute .ts-benchmarks/index.ts
    Benchmarks->>TypeScript: Compile and run benchmark tests
    TypeScript-->>Benchmarks: Benchmark results
    Benchmarks-->>Turbo: Report threshold status
    Turbo-->>CI: Continue workflow based on benchmark outcome
Loading

Poem

In the warren, code hops at speed,
Benchmarks now planted—a gardener’s deed!
Type and transform, adapters in tow,
Through scripts and configs, the numbers will show.
CI runs swiftly, with rabbits in mind,
🥕 May your types be fast, and your bugs left behind!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

vitest.config.ts

Oops! Something went wrong! :(

ESLint: 9.23.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/adapters/.ts-benchmarks/index.ts

Oops! Something went wrong! :(

ESLint: 9.23.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/adapters/.ts-benchmarks/builders/source-builder.ts-bench.ts

Oops! Something went wrong! :(

ESLint: 9.23.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 216bbf6 and 431242e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .github/workflows/ci.yaml (1 hunks)
  • package.json (2 hunks)
  • packages/adapters/.ts-benchmarks/builders/source-builder.ts-bench.ts (1 hunks)
  • packages/adapters/.ts-benchmarks/index.ts (1 hunks)
  • packages/adapters/package.json (1 hunks)
  • packages/adapters/tsconfig.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • turbo.json (1 hunks)
  • vitest.config.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Member Author

luxass commented Apr 24, 2025

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 24, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​ark/​attest@​0.46.08310010096100

View full report

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the pkg: adapters changes related to the adapters pkg label Apr 24, 2025
@luxass luxass marked this pull request as ready for review April 24, 2025 17:20
@luxass luxass requested a review from Copilot April 24, 2025 17:20
Copy link
Copy Markdown

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 sets up @ark/attest for benchmarking typechecking performance. Key changes include updating configuration files to point to new setup files, adding the required dependencies for attest and tsx, introducing TypeScript benchmarks for the source adapter builder, and updating the CI workflow to run benchmarks.

Reviewed Changes

Copilot reviewed 6 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vitest.config.ts Updated msw file path from ./test/setup/msw.ts to ./test/global-setup/msw.ts
pnpm-workspace.yaml Added new dependencies (@ark/attest and tsx)
packages/adapters/.ts-benchmarks/index.ts Imported the new benchmark builder
packages/adapters/.ts-benchmarks/builders/source-builder.ts-bench.ts Introduced benchmarking tests using @ark/attest and defined multiple transforms
.github/workflows/ci.yaml Added a CI step to run benchmarks
Files not reviewed (5)
  • package.json: Language not supported
  • packages/adapters/package.json: Language not supported
  • packages/adapters/tsconfig.json: Language not supported
  • pnpm-lock.yaml: Language not supported
  • turbo.json: Language not supported
Comments suppressed due to low confidence (1)

packages/adapters/.ts-benchmarks/builders/source-builder.ts-bench.ts:83

  • [nitpick] Multiple withTransform blocks in this bench use identical configuration logic (e.g. hardcoded 'v14' URL and 'generic' parser). Consider extracting this common logic into a reusable helper to improve readability and maintainability.
  .withTransform(

Copy link
Copy Markdown
Member Author

luxass commented Apr 25, 2025

Merge activity

  • Apr 25, 9:42 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 25, 9:44 AM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 25, 9:44 AM EDT: @luxass merged this pull request with Graphite.

@luxass luxass changed the base branch from refactor_remove_typecheck_configurations_and_related_tsconfig_files to graphite-base/142 April 25, 2025 13:42
@luxass luxass changed the base branch from graphite-base/142 to main April 25, 2025 13:42
@luxass luxass force-pushed the feat_setup_attest_for_type_benchmarking branch from 03868c1 to 431242e Compare April 25, 2025 13:43
@luxass luxass merged commit da90074 into main Apr 25, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: adapters changes related to the adapters pkg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants