keon94 opened a new issue, #5539: URL: https://github.com/apache/incubator-devlake/issues/5539
## What and why to refactor We currently rely on the `GetDomainTablesInfo()` and `GetTablesInfo()` to return the list of tables managed by a plugin. This is error prone - it's easy to forget to include a model in the list, and we've seen this happen a few times, which ends up breaking operations elsewhere in the framework (e.g. deleting data). ## Describe the solution you'd like How to refactor? Instead of having the implementations of these methods return a list, define this convention: For every model struct, we define an `init()` function that instantiates it and writes it to a global map (keyed by the plugin name). With that, `GetDomainTablesInfo()` and `GetTablesInfo()` will just return need to look up that map, aggregate all the values into a list, and return them. Note: Need to ensure the package containing all the models is loaded at runtime. Use an empty import statement in `impl.go` if needed. ## Related issues Please link any other ## Additional context Add any other context or screenshots about the feature request here. -- 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]
