Skip to content

Add GitHub Copilot repository instructions with development workflow guidance #3118

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 5, 2025

This PR adds repository-specific instructions for GitHub Copilot to help it provide better assistance when working with the OpenTelemetry Rust codebase.

The new .github/copilot-instructions.md file includes:

Development Workflow

  • Individual crate development: Use focused cargo build, cargo test, cargo clippy commands within specific crates for efficient development
  • Final validation: Position workspace scripts (./scripts/precommit.sh, ./scripts/lint.sh, ./scripts/test.sh) as final checks before committing rather than per-change requirements
  • Regular tooling: Use clippy, rustfmt, and cargo check regularly as specified in the original issue

Comprehensive Development Guidance

  • Workspace-aware commands for this multi-crate repository structure
  • Feature flag patterns including signals (traces, metrics, logs) and experimental features (otel_unstable)
  • Code standards including MSRV (1.75), error handling patterns, and conventional commit format
  • Build requirements including protoc dependency for OTLP components
  • Testing and validation practices across the entire workspace
  • OpenTelemetry-specific patterns and specification compliance guidelines
  • Configuration priority: compile-time config over environment variables

The instructions follow GitHub's documentation for repository instructions and provide context-specific guidance that will help Copilot understand the unique development practices, tooling, and patterns used in this OpenTelemetry implementation.

Fixes #3117.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

- Create .github/copilot-instructions.md file following GitHub's documentation
- Include required clippy, rustfmt, and cargo check instructions
- Add comprehensive guidance for OpenTelemetry Rust development including:
  - Workspace structure and multi-crate considerations
  - Feature flags and experimental features
  - Code standards and MSRV requirements
  - Build requirements including protoc dependency
  - Testing and validation practices
  - OpenTelemetry-specific patterns and conventions

Co-authored-by: cijothomas <[email protected]>
@Copilot Copilot AI changed the title [WIP] Add repository instructions for copilot Add GitHub Copilot repository instructions Aug 5, 2025
@Copilot Copilot AI requested a review from cijothomas August 5, 2025 05:16
Copilot finished work on behalf of cijothomas August 5, 2025 05:16
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.5%. Comparing base (c7e47de) to head (787d9f6).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3118     +/-   ##
=======================================
- Coverage   80.5%   80.5%   -0.1%     
=======================================
  Files        126     126             
  Lines      22218   22218             
=======================================
- Hits       17890   17889      -1     
- Misses      4328    4329      +1     

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

- Follow the OpenTelemetry specification
- Prioritize functionality over structural compliance with spec
- Use Rust idioms rather than forcing spec API patterns
- Configuration priority: Environment variables > compile-time config
Copy link
Member

Choose a reason for hiding this comment

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

@copilot code should have higher priority than env variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the configuration priority order to prioritize compile-time config over environment variables. Changes committed in commit 8b5a9e2.

@Copilot Copilot AI requested a review from cijothomas August 5, 2025 18:23
Copilot finished work on behalf of cijothomas August 5, 2025 18:23
- Run `cargo fmt --all` to format code consistently
- Run `cargo check --workspace` to verify compilation

2. **Use the provided development scripts:**
Copy link
Member

Choose a reason for hiding this comment

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

@copilot perhaps its easier to just do cargo build/test from the individual crate when working on features for that crate alone. and scripts are anyway run in CI checks, but they can used for a final check, not something to do with each change etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the development workflow guidance to emphasize individual crate commands for focused development and position the scripts as final validation tools. Changes committed in dcdeb96.

@Copilot Copilot AI changed the title Add GitHub Copilot repository instructions Add GitHub Copilot repository instructions with development workflow guidance Aug 5, 2025
@Copilot Copilot AI requested a review from cijothomas August 5, 2025 18:40
Copilot finished work on behalf of cijothomas August 5, 2025 18:40
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.

Add repository instructions for copilot
2 participants