Open
Conversation
Reviewer's Guide by SourceryThis pull request refactors the reporter classes to introduce a Sequence diagram for reporter command executionsequenceDiagram
participant User
participant Approvals
participant NamedReporter
participant Launcher
participant DiffTool
User->>Approvals: Verify(data, reporter)
Approvals->>NamedReporter: report(received, approved)
NamedReporter->>NamedReporter: default_launcher()
NamedReporter->>Launcher: send(launcher_name)
Launcher->>NamedReporter: command(received, approved)
NamedReporter->>DiffTool: Execute command
DiffTool-->>User: Show diff
Updated class diagram for Reporter hierarchyclassDiagram
class Reporter
class NamedReporter
class DiffmergeReporter
class FilelauncherReporter
class OpendiffReporter
class TortoisediffReporter
class VimdiffReporter
Reporter <|-- NamedReporter : Inherits from
NamedReporter <|-- DiffmergeReporter : Inherits from
NamedReporter <|-- FilelauncherReporter : Inherits from
NamedReporter <|-- OpendiffReporter : Inherits from
NamedReporter <|-- TortoisediffReporter : Inherits from
NamedReporter <|-- VimdiffReporter : Inherits from
NamedReporter : +default_launcher()
DiffmergeReporter : +command(received, approved)
FilelauncherReporter : +command(received, _)
OpendiffReporter : +command(received, approved)
TortoisediffReporter : +command(received, approved)
VimdiffReporter : +command(received, approved)
note for NamedReporter "Introduced NamedReporter class"
note for DiffmergeReporter "Added command method"
note for FilelauncherReporter "Added command method"
note for OpendiffReporter "Added command method"
note for TortoisediffReporter "Added command method"
note for VimdiffReporter "Added command method"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Hi, Llewellyn! This is a followup from yesterday's pairing session. You didn't push your branch, but it was useful for me to engage with the code anyway. 😜
This moves us closer to being able to remove
Launcher.The solution
Similar to pairing session: creates a
commandmethod on [some] reporter classes that builds the actual command for that reporter. If we ignore all of the fancy metaprogramming, the only actual knowledge thatLauncherstill has at this point is the names of five reporter classes. (These are the ones that used to be singletons; I removed the Singleton implementation and gave them a temporary superclass ofNamedReporter.)First commit in branch adds characterization tests around the
default_launchermethods for those five reporter classes; those tests can be removed when that method goes away.There are still two distinct sets of reporters: those that inherit from
Reporterand look like proper classes, and the five I've touched in this branch, which still look suspiciously like a glorified data structure (in that they only have one useful static method, and one inherited public instance method that only exists to satisfy the characterization tests that should go away. That's probably for a future pairing session.Notation
Arlo's git notation
Summary by Sourcery
Refactor the Launcher module and reporter classes to simplify the implementation and move towards removing the Launcher module
Enhancements:
Tests:
Chores: