Skip to content

Migrate to new cli hosting framework for the cli app - #21

Merged
darthsharp merged 7 commits into
mainfrom
feature/migratetoclihosting
Jan 31, 2026
Merged

darthsharp merged 7 commits into
mainfrom
feature/migratetoclihosting

Conversation

@darthsharp

Copy link
Copy Markdown
Contributor

No description provided.

- Add `CreativeCoders.GitTool.Cli.App` project for GitTool's CLI application.
- Add `CreativeCoders.GitTool.Cli.Commands` project to host commands.
- Implement `ShowConfigCommand` to display repository configuration.
- Integrate GitHub and GitLab tools into the CLI.
- Update solution and build configuration to include new CLI projects.
- Upgrade dependencies to `CreativeCoders.Core 6.2.0`.
- Implement `ListBranchesCommand` to list branches by location (all, local, or remote).
- Implement `InfoBranchesCommand` to display details of the current branch and recent commits.
- Implement `PullBranchCommand` to pull the current branch from remote.
- Implement `PushBranchCommand` with options to create a remote branch if it doesn’t exist.
- Add shared infrastructure and options for branch-related commands.
- Update CLI projects and dependency configurations for new commands.
- Move CLI commands to `GitTool/CreativeCoders.GitTool.Cli.Commands`.
- Relocate CLI app to `GitTool/CreativeCoders.GitTool.Cli.GtApp`.
- Update solution and build configurations to match new structure.
- Implement `UpdateBranchesCommand` to pull updates for permanent local branches (e.g., production, main, develop) from remote.
- Add `UpdateBranchesOptions` to include options like `SkipFetchPrune`.
- Update project configuration to include the new command.
- Delete all CLI command classes, options, and implementations for branches, features, and releases.
- Remove shared infrastructure (e.g., `GitToolCommandExecutor`, `GitToolPullCommand`, `GitToolPushCommand`, and `AnsiConsoleExtensions`).
- Delete project files and references for `CreativeCoders.GitTool.Commands.*`.
- Update solution and build configurations to reflect the removal.
- Implement `CreateReleaseCommand` to create versioned releases with tags and optional push to remote.
- Add `CreateReleaseOptions` to handle version and tag-push options.
- Introduce `ReleaseCommandGroup` for organizing release-related commands.
- Refactor existing `Branches` and `Features` command namespaces to `BranchGroup` and `FeatureGroup`.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request migrates the CLI application from an older CLI framework (CreativeCoders.SysConsole.Cli.Actions v6.1.0) to a new hosting framework (CreativeCoders.Cli.Hosting v6.2.0). The migration involves significant restructuring of the command architecture and removal of several legacy projects.

Changes:

  • Replaced the old CLI framework with a new CLI hosting framework (CreativeCoders.Cli.Hosting v6.2.0)
  • Restructured command organization from controller-based to direct command implementations with attributes
  • Removed legacy command controller projects and consolidated commands into a single project (CreativeCoders.GitTool.Cli.Commands)
  • Updated package versions across the solution (CreativeCoders.Core 6.1.0 → 6.2.0, FakeItEasy 9.0.0 → 9.0.1)
  • Consolidated the CLI application entry point into a new project (CreativeCoders.GitTool.Cli.GtApp)

Reviewed changes

Copilot reviewed 70 out of 71 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
GitTools.sln Removed old command projects, added new CLI structure under "Cli" solution folder
build/BuildContext.cs Updated CLI project paths to reflect new structure
build/Build.csproj Updated CreativeCoders.CakeBuild package to 6.2.0
source/Directory.Build.props Set target framework to net10.0
source/GitTool/CreativeCoders.GitTool.Cli.GtApp/* New CLI application entry point with hosting configuration
source/GitTool/CreativeCoders.GitTool.Cli.Commands/* New unified commands project with all command implementations
source/GitTool/CreativeCoders.GitTool.Cli/* (deleted) Old CLI project removed
source/GitTool/Commands/* (deleted) Old controller-based command projects removed
source/GitTool/CreativeCoders.GitTool.Base/CreativeCoders.GitTool.Base.csproj Updated CreativeCoders.Core to 6.2.0
source/GitTool/CreativeCoders.GitTool.GitHub/CreativeCoders.GitTool.GitHub.csproj Updated CreativeCoders.Core to 6.2.0
source/Git/CreativeCoders.Git/CreativeCoders.Git.csproj Updated CreativeCoders.Core to 6.2.0
source/Git/CreativeCoders.Git.Abstractions/* Updated CreativeCoders.Core to 6.2.0
tests/* Updated FakeItEasy to 9.0.1, standardized formatting
Comments suppressed due to low confidence (10)

source/GitTool/CreativeCoders.GitTool.Cli.Commands/ReleaseGroup/Create/CreateReleaseOptions.cs:11

  • Inconsistent spacing style. The property declaration has inconsistent spacing compared to other property declarations in the same file. While this is a minor style issue, it would be better to keep the formatting consistent with the rest of the codebase (property on its own line).
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/FeatureGroup/Start/StartFeatureOptions.cs:11
  • Inconsistent spacing style. The property declaration has inconsistent spacing compared to the rest of the codebase. While this is a minor style issue, it would be better to keep the formatting consistent (property on its own line).
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/FeatureGroup/Finish/FinishFeatureOptions.cs:11
  • Inconsistent spacing style. The property declaration has inconsistent spacing compared to the rest of the codebase. While this is a minor style issue, it would be better to keep the formatting consistent (property on its own line).
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/FeatureGroup/Start/StartFeatureCommand.cs:76
  • Incomplete error handling. When branch creation or checkout fails, the method simply returns without providing any error code or throwing an exception. The command will appear to succeed even though it failed. This should either throw an exception or return an appropriate error CommandResult.
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/FeatureGroup/Start/StartFeatureCommand.cs:137
  • The ExecuteAsync method returns ReturnCodes.Success (an integer) at line 147, but the method signature expects Task<CommandResult>. This is inconsistent with all other commands in the new framework which return CommandResult.Success. This will cause a compilation error.
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/BranchGroup/Push/PushBranchOptions.cs:17
  • Inconsistent spacing style. The property declaration has inconsistent spacing compared to the rest of the codebase. While this is a minor style issue, it would be better to keep the formatting consistent (property on its own line).
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/Shared/GitToolPushCommand.cs:27
  • Parameter order changed in method signature. The parameters for ExecuteAsync were reordered from (gitRepository, createRemoteIsNotExists, verbose, confirmPush) in the old code to (gitRepository, createRemoteIsNotExists, confirmPush, verbose) in the new code. While the call sites appear to have been updated correctly, this is a potential source of subtle bugs if any call sites were missed. Consider whether this reordering was necessary.
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/FeatureGroup/Start/StartFeatureCommand.cs:45
  • Commented-out code that should either be completed or removed. This appears to be incomplete logic for checking remote branches. Either implement this functionality or remove the commented code.
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/FeatureGroup/Start/StartFeatureCommand.cs:43
  • Incomplete implementation. This method checks if a feature branch exists but doesn't actually do anything meaningful when it does exist - it just writes an empty line. In the old code, this logic was more complete. This should either throw an error, warn the user, or handle the case appropriately.
    source/GitTool/CreativeCoders.GitTool.Cli.Commands/FeatureGroup/Start/StartFeatureCommand.cs:97
  • Incomplete error handling. When the base branch name is empty, the method returns early without propagating an error status. The command will continue execution and appear to succeed even though a critical step failed. This should either throw an exception or the calling method should check for this error condition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/GitTool/CreativeCoders.GitTool.Cli.GtApp/Program.cs Outdated
Comment thread source/GitTool/CreativeCoders.GitTool.Cli.GtApp/Program.cs
…figCommand`

- Introduce `SetupCommand` to configure repository settings and service providers.
- Refactor `ShowConfigCommand` namespace for consistency.
- Update dependency injection to handle repository configurations and certificate validation.
@darthsharp
darthsharp merged commit b816cef into main Jan 31, 2026
6 checks passed
@darthsharp
darthsharp deleted the feature/migratetoclihosting branch January 31, 2026 17:28
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.

2 participants