Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Topic] Move to New Command Line #2202

Merged
merged 13 commits into from
Jul 25, 2024
Merged

[Topic] Move to New Command Line #2202

merged 13 commits into from
Jul 25, 2024

Commits on Jul 23, 2024

  1. build(Directory.Build.props): reset version to 0.0.0.0 and add FileVe…

    …rsion and InformationalVersion for better versioning control
    
    feat(MigrationTools.sln): add NKDAgility.AzureDevOps.Tools.CommandHost project to solution for extended functionality
    chore(test projects): update MSTest.TestAdapter and MSTest.TestFramework to version 3.5.0 for latest features and bug fixes
    chore(MigrationTools.ConsoleDataGenerator.csproj): update YamlDotNet to version 16.0.0 for improved YAML processing
    chore(MigrationTools.Host.csproj): update Serilog.Settings.Configuration to version 8.0.2 for enhanced logging configuration
    
    chore: update MSTest.TestAdapter and MSTest.TestFramework versions from 3.4.3 to 3.5.0 in MigrationTools.Integration.Tests, MigrationTools.Tests, and VstsSyncMigrator.Core.Tests projects for latest features and bug fixes
    feat: add new project NKDAgility.AzureDevOps.Tools.CommandHost with .NET 8.0 and Newtonsoft.Json 13.0.3 package reference for new functionality
    MrHinsh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    a63261f View commit details
    Browse the repository at this point in the history
  2. refactor(MigrationTools.Host): restructure command line options and c…

    …ommands for better organization and clarity
    
    feat(MigrationTools.Host): introduce new command classes for migration execution and initialization
    fix(MigrationTools.Host): update command options to use Spectre.Console.Cli for better command line interface handling
    
    refactor(MigrationTools.Host): remove ExecuteHostedService.cs and InitHostedService.cs, replace with MigrationService.cs for simplified service execution
    feat(MigrationTools.Host): add Spectre.Console.Cli and YamlDotNet packages for enhanced CLI and YAML support
    chore(MigrationTools.Host): remove unused CommandLineParser package reference from MigrationTools.Host.csproj
    style(MigrationTools.Host): remove unused imports in MigrationToolHost.cs for cleaner code
    MrHinsh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    d15c9a3 View commit details
    Browse the repository at this point in the history
  3. feat(launchSettings.json): add empty commandName to support new proje…

    …ct commands
    
    refactor(MigrationExecuteCommand.cs, MigrationInitCommand.cs): change logger type to improve logging context
    refactor(MigrationInitCommand.cs): change ExecuteAsync method to async to improve readability and performance
    refactor(MigrationService.cs): skip first command line argument to avoid application name in arguments
    refactor(MigrationToolHost.cs): refactor host configuration and services setup to improve code readability and maintainability
    style(HostExtensions.cs): remove unused import to improve code cleanliness
    style(MigrationToolHost.cs): remove commented out code to improve code cleanliness
    
    feat(MigrationTools.Host.csproj): add Spectre.Console.Cli.Extensions.DependencyInjection package to support dependency injection
    MrHinsh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    e02601e View commit details
    Browse the repository at this point in the history
  4. feat(CommandSettingsBase.cs): add new base class for command settings…

    … to reduce code duplication
    
    refactor(MigrationExecuteCommandSettings.cs, MigrationInitCommandSettings.cs): change base class to CommandSettingsBase to utilize common settings
    fix(MigrationExecuteCommandSettings.cs): remove DisableTelemetry property as it's now in CommandSettingsBase
    MrHinsh committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    cf63831 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. Simplifying hosted stuff ✨ (MigrationTools.Host): add base command an…

    …d execute migration command
    
    Introduce `CommandBase` class to handle common command logic, including
    startup logic, telemetry, and version checks. Add `ExecuteMigrationCommand`
    to handle the execution of migration tasks, utilizing the `CommandBase`
    class for shared functionality. Also, add `ExecuteMigrationCommandSettings`
    to define the settings required for the migration command.
    
    These changes are made to modularize the command logic, making it easier
    to manage and extend. The `CommandBase` class centralizes common tasks
    like telemetry and version checks, reducing code duplication. The
    `ExecuteMigrationCommand` class focuses on the specific logic needed to
    execute a migration, improving code readability and maintainability.
    
    ✨ (InitMigrationCommand): add InitMigrationCommand to initialize migration configurations
    
    ✨ (InitMigrationCommandSettings): add settings for InitMigrationCommand
    
    🔧 (MigrationToolHost): update command registration for InitMigrationCommand
    
    The InitMigrationCommand is introduced to allow users to initialize migration configurations with various options. This command supports different configuration modes such as Reference, Basic, WorkItemTracking, Fullv2, and WorkItemTrackingv2, making it flexible for different migration scenarios.
    
    The InitMigrationCommandSettings class is added to handle the settings for the InitMigrationCommand, including the output mode which determines the type of configuration to be generated.
    
    The MigrationToolHost is updated to register the new InitMigrationCommand, ensuring it is available for use within the application. This enhances the tool's functionality by providing a straightforward way to set up migration configurations.
    
    ♻️ (StartupService.cs): remove version check and telemetry logging for simplification
    
    Remove the extensive version check and telemetry logging to simplify the startup process. This reduces the complexity and potential overhead during application startup, making the codebase easier to maintain and understand. The removed code includes checks for package manager installation, version updates, and telemetry notes, which are deemed unnecessary for the current scope of the application.
    MrHinsh committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    ae9c366 View commit details
    Browse the repository at this point in the history
  2. 🔧 (launchSettings.json): update launch profiles for better clarity an…

    …d organization
    
    ♻️ (MigrationToolHost.cs): refactor logging configuration for improved log management and filtering
    
    The launch profiles in `launchSettings.json` are updated to rename and reorganize the profiles for better clarity. The "MigrationTools.ConsoleUI" profile is renamed to "execute" to better reflect its purpose.
    
    In `MigrationToolHost.cs`, the logging configuration is refactored to:
    - Introduce a static variable `logs` to manage log file naming.
    - Add filtering to exclude logs from specific sources.
    - Update the Application Insights connection string to include additional endpoints.
    - Use a static `logDate` variable to ensure consistent log directory naming.
    
    These changes improve log management, make the configuration more maintainable, and enhance the clarity of the launch profiles.
    MrHinsh committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    3d40c88 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b90f681 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Configuration menu
    Copy the full SHA
    69f924e View commit details
    Browse the repository at this point in the history
  2. ✨ (CommandSettingsBase.cs, MigrationToolHost.cs): add support for com…

    …mand-line config file option
    
    ⬆️ (MigrationTools.Host.csproj): add System.CommandLine package
    
    Add support for specifying the configuration file via command-line options `--config`, `--configFile`, or `-c`. This enhances flexibility by allowing users to specify a custom configuration file when running the application. The `System.CommandLine` package is added to facilitate this functionality. The `ForceGetConfigFile` method is introduced to parse the command-line arguments and extract the configuration file path. The `CreateDefaultBuilder` method in `MigrationToolHost.cs` is updated to use this configuration file path, ensuring the application loads the correct configuration.
    MrHinsh committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    aa725a0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    59960e1 View commit details
    Browse the repository at this point in the history
  4. 📝 (MigrationTools.xml): update Git metadata to reflect new branch and…

    … commit details
    
    ♻️ (MigrationToolHost.cs): refactor version logging to use GetRunningVersion method
    🔧 (MigrationTools.csproj): add GitVersion property to disable GitVersion during build
    
    The Git metadata in the MigrationTools.xml file is updated to reflect the new branch, commit, and version details. The version logging in MigrationToolHost.cs is refactored to use a new method, GetRunningVersion, which provides a more accurate and detailed version string. Additionally, the GitVersion property is added to the MigrationTools.csproj file to disable GitVersion during the build process, ensuring that the build process does not rely on Git metadata.
    MrHinsh committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    3a2c737 View commit details
    Browse the repository at this point in the history
  5. ♻️ (MigrationTools): refactor version detection and update XML docume…

    …ntation
    
    - Update `MigrationTools.xml` to reflect the latest commit and version info.
    - Replace `GetRunningVersion` with `DetectVersionService2.GetRunningVersion` in `MigrationToolHost.cs`.
    - Remove the `GetRunningVersion` method from `MigrationToolHost.cs`.
    - Enhance `DetectVersionService2` to handle local version detection more robustly.
    
    The changes improve the maintainability and accuracy of version detection by centralizing the logic in `DetectVersionService2`. This also ensures that the XML documentation is up-to-date with the latest commit and version information.
    MrHinsh committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    6b65ba1 View commit details
    Browse the repository at this point in the history
  6. 🔧 (launchSettings.json): add new launch profile 'empty' for Migration…

    …Tools.ConsoleFull
    
    ♻️ (MigrationToolHost.cs): uncomment log filter for StartupService and add null check for configFile
    
    Adding the 'empty' launch profile provides a new configuration option for running the project without any command line arguments, which can be useful for debugging or initial setup. Uncommenting the log filter for `MigrationTools.Host.StartupService` ensures that logs from this source are excluded, improving log readability. Adding a null check for `configFile` before adding it to the configuration builder prevents potential runtime errors if the file does not exist or the path is empty.
    MrHinsh committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    8bb90e3 View commit details
    Browse the repository at this point in the history