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

Refactor application configuration #706

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

dbrumann
Copy link
Collaborator

@dbrumann dbrumann commented Oct 17, 2021

Background

As discussed before, having some kind of extension mechanism for Deptrac would be nice, e.g. to register custom collectors or output formatters. This will require some changes to the application bootstrapping and configuration.

Description

I am moving the current configuration to the parameters section to make it easier to reuse them in services and to be in line with how Symfony configures services.

To Dos

  • Update commands to use --config-file from Application instead of current depfile argument
  • Make Application load new configuration file in advance (allows registering additional services) during container buliding
  • Allow using both file formats in AnalyseCommand
  • Allow using both file formats in DebugLayerCommand
  • Allow using both file formats in DebugTokenCommand
  • Allow using both file formats in DebugUnassignedCommand
  • InitCommand should create new file format (use --config-file as target file location)
  • Update examples for new depfile format
  • Fix file loading issue (see attached screenshot)
  • Fix e2e tests
  • Update documentation
  • Restore tests for ContainerBuilderFactory
  • Ensure imports stay at top level and check imported files for both new and old format
  • Ensure deprecation works with existing parameters section

Follow ups

  • Create separate project for deptrac-plugin-api where we keep interfaces for extension points, e.g. CollectorInterface
  • Register collectors via CompilerPass using tag deptrac.collector (Allows adding new collectors by tagging them)
  • Register output formatters via CompilerPass using tag deptrac.formatter

@dbrumann dbrumann force-pushed the refactor/configuration branch 2 times, most recently from 860735f to d47cd49 Compare October 17, 2021 12:54
@patrickkusebauch
Copy link
Collaborator

@dbrumann if this is meant to be BC break (and thus requiring a new major version if keeping semanting versioning), can other BC breaks like removing deprecated parameters be released alongside this refactor? Not this PR per se, in order not to clutter, but with the new release version?

@dbrumann
Copy link
Collaborator Author

Since we are still in 0.x BC breaks are fine according to semver. That being said, if I can I will make this non BC-breaking once the general implementation is somewhat stable. If that is not possible, then I will try to make it a clean cut and also remove existing deprecations as well.

@dbrumann dbrumann removed the bc-break label Dec 17, 2021
@dbrumann dbrumann force-pushed the refactor/configuration branch 2 times, most recently from 217a28a to 73ec47a Compare December 17, 2021 11:32
@dbrumann
Copy link
Collaborator Author

dbrumann commented Dec 17, 2021

Screen Shot 2021-12-17 at 12 30 27

@dbrumann
Copy link
Collaborator Author

FYI, this is what the command looks like, when we use the current depfile.yaml vs. new deptrac.yaml:
Screen Shot 2021-12-17 at 11 41 10

@dbrumann dbrumann force-pushed the refactor/configuration branch 2 times, most recently from 37aae31 to fb54cf7 Compare December 18, 2021 05:59
docs/depfile.md Outdated Show resolved Hide resolved
docs/depfile.md Outdated Show resolved Hide resolved
@dbrumann dbrumann force-pushed the refactor/configuration branch 2 times, most recently from 5d8616d to 880520a Compare December 19, 2021 10:41
@dbrumann dbrumann marked this pull request as ready for review December 19, 2021 10:43
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
config/parameters.php Outdated Show resolved Hide resolved
UPGRADE.md Show resolved Hide resolved
@dbrumann dbrumann force-pushed the refactor/configuration branch 2 times, most recently from fd9b182 to 206570f Compare December 20, 2021 20:43
@dbrumann dbrumann force-pushed the refactor/configuration branch 5 times, most recently from 9401e82 to 4e284fb Compare December 21, 2021 07:02
 * Default filename changes to "deptrac.yaml"
 * Config now live under parameters-section (except for imports)
 * Docs updated
 * Command issues warning when old file is detected
 * Loader triggers deprecation when old config is encountered
@dbrumann dbrumann merged commit f12b044 into qossmic:main Dec 21, 2021
@dbrumann dbrumann deleted the refactor/configuration branch December 21, 2021 07:14
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.

None yet

2 participants