Skip to content

Add comprehensive GitHub Copilot development instructions #2152

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

Merged
merged 3 commits into from
Aug 6, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 6, 2025

This PR adds a comprehensive .github/copilot-instructions.md file that provides GitHub Copilot coding agents with everything needed to work effectively in the ast-grep codebase.

What's Included

The instructions cover all essential development workflows:

Build and Test Commands

  • Rust toolchain setup and validation
  • Debug and release builds with exact timing expectations (42s debug, 2m 26s release)
  • Complete test suite execution (48s, 94+ tests)
  • Formatting and linting with proper timeout settings

Multi-Language Support

  • Node.js/NAPI bindings setup and testing (36s build, 5s test with 42 tests)
  • Python bindings compilation and installation (21s build)
  • LSP server functionality verification

Critical Timeout Guidelines

  • Explicit "NEVER CANCEL" warnings for long-running operations
  • Proper timeout values: 120s+ for debug builds, 180s+ for release builds
  • Build time expectations to prevent premature cancellation

Validation Scenarios
Complete functional testing workflows that agents should run after making changes:

# Pattern matching test
echo 'console.log("hello")' > test.js
./target/release/ast-grep -p 'console.log($MSG)' -l js test.js

# Rewrite functionality test  
echo 'var x = 5;' > test.js
./target/release/ast-grep -p 'var $VAR = $VALUE' -r 'let $VAR = $VALUE' -l js test.js

Repository Navigation

  • Key directory structure and file locations
  • Pre-commit checklist for quality assurance
  • Common issues and their solutions

Validation

All documented commands have been thoroughly tested and validated to work correctly. The instructions follow the imperative tone requirement and include exhaustive build timing measurements from actual execution.

Fixes #2151.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • plugins.dprint.dev
    • Triggering command: /home/REDACTED/work/ast-grep/ast-grep/crates/napi/node_modules/dprint/dprint check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.07%. Comparing base (31e2c5e) to head (0af0029).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2152   +/-   ##
=======================================
  Coverage   86.07%   86.07%           
=======================================
  Files         107      107           
  Lines       16795    16795           
=======================================
  Hits        14457    14457           
  Misses       2338     2338           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: HerringtonDarkholme <2883231+HerringtonDarkholme@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] ✨Set up Copilot instructions Add comprehensive GitHub Copilot development instructions Aug 6, 2025
@Copilot Copilot AI requested a review from HerringtonDarkholme August 6, 2025 19:57
Copilot finished work on behalf of HerringtonDarkholme August 6, 2025 19:57
@HerringtonDarkholme HerringtonDarkholme marked this pull request as ready for review August 6, 2025 20:02
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

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 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.

@HerringtonDarkholme
Copy link
Member

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@Copilot 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 adds comprehensive development instructions for GitHub Copilot coding agents working with the ast-grep codebase. The instructions provide detailed workflows for building, testing, and validating the multi-language AST search and rewriting tool.

  • Establishes standardized build commands with specific timing expectations and timeout requirements
  • Provides complete setup instructions for Rust core, Node.js NAPI bindings, and Python bindings
  • Includes validation scenarios for functional testing after code changes

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>
@HerringtonDarkholme HerringtonDarkholme added this pull request to the merge queue Aug 6, 2025
@HerringtonDarkholme HerringtonDarkholme removed this pull request from the merge queue due to a manual request Aug 6, 2025
@HerringtonDarkholme HerringtonDarkholme merged commit d541f8f into main Aug 6, 2025
6 checks passed
@HerringtonDarkholme HerringtonDarkholme deleted the copilot/fix-2151 branch August 6, 2025 20:09
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.

✨Set up Copilot instructions
2 participants