Skip to content

Conversation

y1yang0
Copy link
Contributor

@y1yang0 y1yang0 commented Aug 5, 2025

Subtask of #29

This patch checks which rules match the package being compiled by the current build command. In the next step, we will perform the actual instrumentation!

@y1yang0 y1yang0 requested a review from a team as a code owner August 5, 2025 03:07
@github-actions github-actions bot added the conventional-commit/feat A new feature being added label Aug 5, 2025
@y1yang0
Copy link
Contributor Author

y1yang0 commented Aug 14, 2025

Can I have a review? Thanks

@ralf0131 ralf0131 requested a review from Copilot August 19, 2025 06:59
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 implements rule matching functionality in the instrumentation phase, allowing the tool to identify which rules apply to the package being compiled by the current build command. The changes refactor compile command detection and rule matching logic to be more modular and reusable across the codebase.

Key changes:

  • Moved compile command utilities from setup package to util package for better reusability
  • Implemented rule matching logic that compares compile command package paths with instrumentation rules
  • Enhanced logging configuration to remove redundant time/level information and add phase context

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tool/util/go.go New file containing extracted compile command detection and parsing utilities
tool/util/util_test.go Updated test file with correct package name and function references
tool/internal/setup/find.go Refactored to use moved utility functions from util package
tool/internal/instrument/toolexec.go Enhanced to check compile commands and match rules before instrumentation
tool/internal/instrument/match.go Implemented rule matching logic comparing package import paths
tool/internal/instrument/load.go Changed logging level from Info to Debug for rule loading
tool/internal/ast/ast_test.go New test file with proper package structure
tool/cmd/main.go Simplified logger configuration removing time formatting and adding phase context

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

if err != nil {
return err
}
// return nil
Copy link
Preview

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

This commented-out return statement should be removed as it creates confusion about the intended control flow.

Suggested change
// return nil

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

This line is commented out because it is not implemented yet.

@ralf0131 ralf0131 merged commit 93e342d into open-telemetry:main Aug 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conventional-commit/feat A new feature being added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants