-
Notifications
You must be signed in to change notification settings - Fork 53
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: Extract Defra specific logic from ACPLocal type #2656
refactor: Extract Defra specific logic from ACPLocal type #2656
Conversation
47decef
to
82f7148
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we are over abstracting things by having both the ACP
and sourcehubClient
interfaces. This introduces a complexity which I am not sure we need.
From what I understand so far (correct me if missing something):
-
The
ACP
interface was combining the "wrapping of sourcehub" + "defra specific acp logic" -
But rather than re-implementing the wrapping of sourcehub logic for remote acp and the defra specific acp logic you thought perhaps you can separate the sourcehub client to re-use those parts? Hence the current bridge and new interface?
-
The
sourcehubClient
just seems like a lean wrapper extracting the functions we need from sourcehub. Couldn't this just be a struct? What other thing would implement it other than thesourceHubBridge
Not just the ACP interface, the localACP implementation of that interface was. The ACP interface should/can/continues-to do that.
If by
I think you are confused. |
Thanks for the clarification, so to understand the full picture:
Is that correct? |
Yes. We shouldn't expose the internals (client vs defra logic spit) outside of the acp package. You can see the source hub implementation of the client in the PR linked in this PR's description |
Thanks for the explanation here and on Discord. I think ACP interface should be a struct rather than an interface with the new changes, I don't like abstractions at this stage when we only have sourcehub acp that we need to worry about now, mostly for the sake of simplicity. But the preference isn't a hard blocker however. So will give an approval, would be nice to hear from others too. |
I do strongly disagree with that. |
I'm very happy to continue this discussion post-merge, changing that after this goes in will probably cause far less problems than delaying this merge. I would like to merge this before I start my weekend too (I don't want to have this PR in my head next week). |
Want to briefly chime in and say I agree with @AndrewSisley regarding the interface vs struct approach. I'm not a huge fan of the internals of some of this PR regarding the client approach, but it's fine and wouldn't have caused me to block the merge anyway. |
Relevant issue(s)
Resolves #2655
Description
Extracts Defra specific logic from the ACPLocal type so that it may be re-used for SourceHub ACP.
None of the code has changed, it's just moved around.
I'm opening a PR now, as a lot of us (including Bruno) are working in this space, and merging refactors like this asap tends to minimise conflicts.
The (WIP) source hub implementation can be found here: #2657