Fix run-pass telemetry decorator placement - #2649
Open
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
Open
Fix run-pass telemetry decorator placement#2649Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Sylvester Kaczmarek (sylvesterkaczmarek)
September 3, 2026 18:34
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change aligns run-pass with existing CLI telemetry patterns and includes a focused regression test validating the intended decorator placement.
Pull request overview
This PR fixes Olive CLI telemetry for the run-pass command by moving the @action decorator from the RunPassCommand class (which unintentionally wraps the class into a function) onto the run() method, aligning it with the established pattern used by other CLI commands.
Changes:
- Removed
@actionfromRunPassCommand’s class definition so the argparse binding remains a class (not a wrapper function). - Added
@actiontoRunPassCommand.run()so telemetry records actual command execution. - Added a regression test to ensure
RunPassCommandremains a class and thatrun()is wrapped (viafunctools.wraps/__wrapped__).
File summaries
| File | Description |
|---|---|
olive/cli/run_pass.py |
Moves @action from the command class to the run() method to correctly capture execution telemetry and preserve class binding. |
test/cli/test_run_pass_action.py |
Adds regression coverage asserting the command is still a class and the run() method is telemetry-wrapped. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Addresses the
run-passdecorator issue identified in #2516.RunPassCommandcurrently applies@actionto the class itself, while the other CLI commands apply it to theirrun()methods. Theactiondecorator wraps callables and therefore replaces the class binding with a wrapper function, recording construction rather than the actual command execution.This change keeps
RunPassCommandas a class and applies@actiontorun()consistently with the rest of the CLI.Tests
Adds regression coverage verifying that
RunPassCommandremains a class and that itsrun()method is wrapped by the telemetry decorator.