feat: implement optimization #2 - automated tag pushing control
Added --push/--no-push flag to release tag command for explicit control over tag pushing behavior. **Implementation**: - Added --push/--no-push flag to CLI tag command (default: --push) - Updated ReleaseManager.create_tag to accept push parameter - Updated GitManager.create_tag to conditionally push based on flag - Maintains backward compatibility (defaults to pushing) **Usage**: ```bash # Default behavior - creates and pushes tag release tag --version 0.11.0 # Explicit push (same as default) release tag --version 0.11.0 --push # Create tag but don't push (manual push later) release tag --version 0.11.0 --no-push ``` **Output when --no-push used**: ``` ✅ Tag v0.11.0 created 💡 Push tag with: git push origin v0.11.0 ``` **Benefits**: - Makes push behavior explicit and controllable - Prevents accidental pushes in some workflows - Defaults to safe behavior (automatic push) - Helpful reminder shown when --no-push used **Files Modified**: - capabilities/release-management/src/release_management/cli/main.py - capabilities/release-management/src/release_management/core/manager.py - capabilities/release-management/src/release_management/git/manager.py Optimizations completed: 2/9 (High Priority)
This commit is contained in:
@@ -75,12 +75,13 @@ class ReleaseManager:
|
||||
"""
|
||||
return self.validator.validate_release_state(force=self.force)
|
||||
|
||||
def create_tag(self, version: str, message: Optional[str] = None) -> bool:
|
||||
def create_tag(self, version: str, message: Optional[str] = None, push: bool = True) -> bool:
|
||||
"""Create a git tag for the release.
|
||||
|
||||
Args:
|
||||
version: Version to tag (e.g., "1.0.0")
|
||||
message: Optional tag message
|
||||
push: Whether to push the tag to origin (default: True)
|
||||
|
||||
Returns:
|
||||
True if tag created successfully, False otherwise
|
||||
@@ -93,7 +94,7 @@ class ReleaseManager:
|
||||
print(f" - {issue}")
|
||||
return False
|
||||
|
||||
return self.git_manager.create_tag(version, message)
|
||||
return self.git_manager.create_tag(version, message, push=push)
|
||||
|
||||
def build_packages(self) -> bool:
|
||||
"""Build release packages.
|
||||
|
||||
Reference in New Issue
Block a user