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

[WIP]refactor: Move command implementations to separate types and clean up application bootstrap #365

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ap0llo
Copy link
Owner

@ap0llo ap0llo commented Jun 6, 2022

  • Move the implementation of sub-commands out of the Program type to a separate class for each command to ease adding new commands in the future.
  • Clean up application bootstrap by introducing a single composition root. To make the application independent of the DI container, remove instances where types are registered conditionally based on the configuration

TODOs

  • Move implementation of the 'generate' command to a separate class
  • Make application composition independent of the configuration
    • Remove conditional registration of templates
    • Remove conditional composition of ChangeLogPipeline
    • Make ChangeLogPipelineBuilder independent of the DI container or remove ChangeLogPipelineBuilder
  • Add Composition root

…t the right implementation in RenderTemplateTask

Remove the need to conditioally configure the DI container by no longer registering a single instance of ITemplate based on the configuration.
Instead, register all implementations and select the right implementation based in the configuraion in RenderTemplateTask.

This (along with future refactorings) will enable composing the application / creating the DI container independently of the configuration
@ap0llo-bot ap0llo-bot added this to the v1.1 milestone Jun 6, 2022
…ridesFromGitNotesTask to the pipeline

Instead of conditionally adding the LoadMessageOverridesFromFileSystemTask and LoadMessageOverridesFromGitNotesTask tasks based on the configuration, always add the tasks but skip the tasks if the corresponding feature is not enabled in the configuration
Instead of conditionally adding the GitHubLinkTask and GitLabLinkTask tasks based on the configuration, always add the tasks but skip the tasks if the corresponding integration is not enabled in the configuration.
Remove ChangeLogPipelineBuilder and directory create ChangeLogPipeline through the DI container (injecting all regsitered implementations of IChangeLogTask)
@ap0llo ap0llo force-pushed the refactor/separate-command-implementations branch from a1544b9 to a9a9b3a Compare June 6, 2022 20:39
Add CompositionRoot which will be responsible for creating all commands and required types.

Currently, the implementation is incomplete and composition is still split between CompositionRoot and GenerateCommand (which uses the Autofac DI container)
@ap0llo ap0llo force-pushed the refactor/separate-command-implementations branch from a9a9b3a to 127dbb4 Compare June 6, 2022 20:52
@ap0llo ap0llo removed this from the v1.1 milestone Oct 10, 2022
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