Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 1, 2025

This PR refactors the AsyncOperation base class to improve encapsulation and provide more descriptive operation names by implementing the requirements outlined in the issue.

Changes Made

Base Class Refactoring

  • Renamed abstract property: Changed name to _name in the AsyncOperation base class
  • Implemented public name property: Returns git/{foldername}/{_name} format where foldername is the root git repository directory name
  • Improved encapsulation: The _name property is now the internal implementation detail that subclasses override

Subclass Updates

Updated all 14 subclasses to use _name instead of name:

  • File operations: CreateDirOperation, EditFileOperation, MoveDirOperation, RemoveFileOperation, RenameOperation
  • Git operations: GitAddOperation, GitCheckoutOperation, GitCommitOperation, GitCreateBranchOperation, GitDiffOperation, GitPullOperation, GitPushOperation, GitStatusOperation
  • Command operations: ExecMakeTarget, PredefinedCommands

Test Updates

  • Modified tests to work with the new name format using pattern matching (e.g., tool.name.endswith("/git_status"))
  • Maintained full backward compatibility for functionality while updating name expectations

Example

Before:

op = GitStatusOperation(root_dir="/path/to/my-project")
print(op.name)  # "git_status"

After:

op = GitStatusOperation(root_dir="/path/to/my-project") 
print(op._name)  # "git_status"
print(op.name)   # "git/my-project/git_status"

Benefits

  1. Better organization: Operation names now include the project context
  2. Improved encapsulation: Clear distinction between internal (_name) and public (name) interfaces
  3. Unique naming: Different projects will have distinct operation names
  4. Backward compatibility: All existing functionality preserved

Testing

  • ✅ All 127 tests passing
  • ✅ Linting and formatting checks pass
  • ✅ Validated with real repository scenarios
  • ✅ No breaking changes to existing functionality

Fixes #14.


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

@Copilot Copilot AI changed the title [WIP] Refactor meta operation class to use _name property and update name logic Refactor AsyncOperation to use _name property and implement git/foldername prefix Jun 1, 2025
@Copilot Copilot AI requested a review from eh-main-bot June 1, 2025 20:53
Copilot finished work on behalf of eh-main-bot June 1, 2025 20:53
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.69%. Comparing base (70689a7) to head (2626057).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   94.65%   94.69%   +0.03%     
==========================================
  Files          29       29              
  Lines         599      603       +4     
==========================================
+ Hits          567      571       +4     
  Misses         32       32              

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

@eh-main-bot
Copy link
Collaborator

@copilot update branch

Copy link
Contributor Author

Copilot AI commented Jun 5, 2025

@copilot update branch

Branch has been successfully updated with the latest changes from main (commit 0aba26c). The merge included documentation theme updates, new exploration tools, and pre-commit hook updates. All tests are passing (157 passed, 6 skipped) and linting checks pass.

Copilot finished work on behalf of eh-main-bot June 5, 2025 19: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.

Refactor meta operation class to use _name property and update name logic

2 participants