This repository was archived by the owner on Feb 26, 2026. It is now read-only.
chore: remove ServiceContextModule dependency#200
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes the ServiceContextModule dependency in favor of an explicit Logger dependency injection for improved decoupling.
- Removed unnecessary ServiceContextModule imports in test files.
- Updated XCFrameworkMetadataProvider to accept an optional Logger via its constructor while eliminating ServiceContextModule usage.
- Removed the LoggerServiceContextKey and updated Package.swift accordingly.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/XcodeMetadataTests/XCFrameworkMetadataProviderTests.swift | Removed unused ServiceContextModule import |
| Tests/XcodeMetadataTests/AssertionsTesting.swift | Removed unused ServiceContextModule import |
| Tests/XcodeGraphMapperTests/Mocks/AssertionsTesting.swift | Removed unused ServiceContextModule import |
| Sources/XcodeMetadata/Providers/XCFrameworkMetadataProvider.swift | Replaced ServiceContextModule logger with an optional Logger injection |
| Sources/XcodeMetadata/LoggerServiceContextKey.swift | Removed the file as the dependency is no longer used |
| Package.swift | Removed dependency on swift-service-context package |
Comments suppressed due to low confidence (1)
Sources/XcodeMetadata/Providers/XCFrameworkMetadataProvider.swift:190
- Consider adding a comment to clarify that the logger parameter is optional and that warnings won't be logged if no Logger is provided. This could help future maintainers understand the design decision.
logger?.warning(
fortmarek
approved these changes
May 20, 2025
Member
fortmarek
left a comment
There was a problem hiding this comment.
Let's not forget to pass the logger from tuist/tuist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed this package depends on the service-context-module. I don't think a dependency should have an opinion about how its dependencies, like
loggerin this case, are passed. I believe this is a pattern that leaked from one of the main consumers of the package,tuist/tuist. This PR removes that dependency and passesLoggerthrough the constructor of the utility that expects it.