-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Move all Git commands behind a PlatformScm interface #19065
Comments
If our platforms were class based it would make this a lot easier. e.g. the base class could default to passing directly through to git if the function is not overridden in the platform. Either way I would prefer not to add 8+ functions to the existing platforms which aren't relevant, so we should try to wrap/centralize it |
Perhaps we could separate the SCM implementation similar to the the current (platform) api implementation (platform/api.ts). Not behind the platform interface it exists besides the platform interface. Then no need to change any existing platform module (i.e. export the util/git module as default scm()). const scm = new Map<string, PlatformScm>();
export default scm;
scm.set('azure', gitScm);
...
scm.set('gerrit', gerrit);
scm.set('mercurial', mercurial); Then the option |
Yes, good idea |
…tebot#19065 this is a proof of concept only...
I've created a proof of concept (commit) and would like to get some feedback about the details. The commit is on-top of the current Gerrit-PR only to show(validate) the usage of partial overriding the (default) PlatformSCM interface. Currently it's allowed to partially override functions. |
This looks ok to me. @viceice @JamieMagee what do you think about this approach vs putting everything behind |
the general idea looks ok, but i've some annotations. So best is to create a draft PR where we can add those. |
Yeah, I like this idea (and going towards interfaces + classes for all other modules like datasources). It would also help any implementation of #18094 |
…tebot#19065 current state: six "util/git" functions are "moved" behind the PlatformSCM interface. more to follow...
I've added the Draft-PR now without the Gerrit-part (stripped off) and six functions already moved behind the interface. It looks like on Github there is currently no option to create (or move) a pull-request on-top of another. |
🎉 This issue has been resolved in version 34.150.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Describe the proposed change(s).
To allow to support new platforms (like Gerrit #4109) which are not based on Git or use Git in a different way we need to abstract the current use of Git behind a new Interface
PlatformScm
.All (most?) current exported functions from the util/git module defines the size/scope of the Interface (perhaps with some renaming).
The util/git module will be the default implementation for the existing platforms.
The text was updated successfully, but these errors were encountered: