kiegroup / github-action-build-chain

86 stars 24 forks source link

enable multiple platforms #441

Closed shubhbapna closed 1 year ago

shubhbapna commented 1 year ago

fixes #320

This PR redesigns the entire git service to enable easy plug and play for different git clients like github, gitlab, gerrit etc. Changes made:

  1. Added a new git token service that enables us to handle tokens for github and gitlab. Removed the previous method in which we simply loaded a token as a constant on initialization.
  2. Defined a git client that internally loads the correct platform's client based on for which project we are trying to make an api call.
  3. Added methods to detect default platforms to be used if none are defined in configuration services. This was super important to break circular dependency injection: cli-configuration uses git api to load pull requets/merge request details -> git api uses configuration service -> configuration services uses cli configuration to load definition files and get the platforms. By adding default platforms, we are able to break this cycle.

I did not touch the e2e and regression tests so hopefully there are no regressions.