caioq commented on PR #8136:
URL: 
https://github.com/apache/incubator-devlake/pull/8136#issuecomment-2420425733

   > The current implementation assumes all repositories belong to GitHub, 
which is incorrect. We need to decouple `GitExtractor` plugin from specific 
data source platforms like GitHub and GitLab.
   > 
   > Here's a suggested approach:
   > 
   > Define an interface: Create an interface named `DynamicGitUrl` (or a more 
descriptive name) within the `gitextractor` plugin. This interface should 
define a method to retrieve the latest Git URL based on a given connection ID 
and scope ID.
   > 
   > Implement `PrepareTaskData`: In the gitextractor.PrepareTaskData function, 
if a plugin, connection ID, and scope ID are provided, use `core.GetPlugin` to 
fetch the plugin instance and dynamically cast it to the DynamicGitUrl 
interface. Then, call the interface's method with the connection ID and scope 
ID to retrieve the latest Git URL.
   > 
   > Implement DynamicGitUrl in Data Source plugins: Each data source plugin 
(like GitHub) should implement the DynamicGitUrl interface, providing its own 
logic for determining the Git URL based on connection and scope information.
   > 
   > This approach allows for a more flexible and extensible design. The 
GitExtractor plugin remains agnostic to specific data sources, while each data 
source plugin is responsible for providing the appropriate Git URL retrieval 
logic.
   
   Hi @klesh, thanks for the review!
   I agree with you and liked your suggestion. I implemented it 
[here](https://github.com/apache/incubator-devlake/pull/8136/commits/26b716f9880aff1ff58c1730f1c4260112cef110)
 for the Github plugin, let me know if this is what you had in mind.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to